CommonField

This commit is contained in:
2023-06-25 16:34:35 +08:00
parent 9546ceec03
commit 32647c035c
17 changed files with 57 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.cnbm.admin.utils.BaseSupportUtils;
import com.cnbm.basic.dto.ProductFeaturesDTO;
import com.cnbm.basic.dto.WorkingProcedureDTO;
import com.cnbm.basic.entity.*;
@@ -78,7 +79,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
QueryWrapper<InspectionSheet> wrapper = new QueryWrapper<>();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
if(params.get("startTime")!=null && params.get("endTime")!=null){
if( ObjectUtils.isNotNull(params.get("startTime")) && ObjectUtils.isNotNull(params.get("endTime"))){
LocalDateTime startTime = LocalDate.parse(params.get("startTime").toString(),df).atStartOfDay();
LocalDateTime endTime = LocalDate.parse(params.get("endTime").toString(),df).atStartOfDay();
wrapper.between(startTime!=null && endTime!=null,"create_time", startTime, endTime);
@@ -191,6 +192,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
//InspectionSheet entity = ConvertUtils.sourceToTarget(dto, InspectionSheet.class);
InspectionSheet entity = new InspectionSheet();
BeanUtils.copyProperties(dto, entity);
BaseSupportUtils.setCommonField(entity);
return entity;
}
@@ -198,6 +200,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
@Transactional(rollbackFor = Exception.class)
public void update(InspectionSheetDTO dto) {
InspectionSheet entity = ConvertUtils.sourceToTarget(dto, InspectionSheet.class);
BaseSupportUtils.setUpdateCommonField(entity);
updateById(entity);
}
@@ -393,6 +396,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
updateDto.setId(inspectionSheetId);
updateDto.setNumberOfDefects(numberOfDefects);
updateDto.setDefectiveQuantity(defectiveQuantity);
BaseSupportUtils.setUpdateCommonField(updateDto);
update(updateDto);
}
}