This commit is contained in:
caixiang 2023-03-07 09:45:01 +08:00
commit a16cd349cc
17 changed files with 199 additions and 149 deletions

View File

@ -58,7 +58,7 @@ public abstract class BaseSupportUtils {
*/
public static <T extends Serializable> T setCommonField(T t, String... ignoreProperties) {
CommonField commonField = CommonField.builder()
.enabled(WhetherEnum.YES.getValue())
// .enabled(WhetherEnum.YES.getValue())
.valid(WhetherEnum.YES.getValue())
.createTime(LocalDateTime.now())
.creatorId(getLoginUser().getId())

View File

@ -11,6 +11,7 @@ import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO;
import com.cnbm.packing.entity.ChangePackagingBoxHistory;
import com.cnbm.packing.excel.ChangePackagingBoxHistoryExcel;
import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz;
import io.swagger.annotations.Api;
@ -117,9 +118,10 @@ public class ChangePackagingBoxHistoryController {
})
@PreAuthorize("@ex.hasAuthority('packing:changePackagingBoxHistory:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ChangePackagingBoxHistoryDTO> list = changePackagingBoxHistoryService.list(params);
ExcelUtils.exportExcelToTarget(response, "包装箱模组操作记录", list, ChangePackagingBoxHistoryExcel.class);
List<ChangePackagingBoxHistory> list = changePackagingBoxHistoryService.historyList(params);
if(list.size()>0) {
ExcelUtils.exportExcelToTarget(response, "包装箱模组操作记录", list, ChangePackagingBoxHistoryExcel.class);
}
}
}

View File

@ -49,7 +49,8 @@ public class PrintModelController {
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
@ApiImplicitParam(name = "name", value = "标签名称", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "类型0模组标签1等级标签", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "lineBody", value = "线体1=F ; 2=S", paramType = "query", dataTypeClass = Integer.class)
@ApiImplicitParam(name = "lineBody", value = "线体1=F ; 2=S", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "enabled", value = "启用状态:0 、停用1、启用", paramType = "query", dataTypeClass = Integer.class)
})
@PreAuthorize("@ex.hasAuthority('packing:printModel:page')")
public Result<PageData<PrintModelDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){

View File

@ -12,7 +12,10 @@ import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.packing.dto.IdVo;
import com.cnbm.packing.dto.WoPackagingBoxDTO;
import com.cnbm.packing.entity.WoPackagingBox;
import com.cnbm.packing.entity.WoPackagingBoxSubstrate;
import com.cnbm.packing.excel.WoPackagingBoxExcel;
import com.cnbm.packing.excel.WoPackagingBoxSubstrateExcel;
import com.cnbm.packing.service.WoPackagingBoxServiceBiz;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -132,4 +135,37 @@ public class WoPackagingBoxController {
return new Result<WoPackagingBoxDTO>().ok(data);
}
@GetMapping("exportSubstrateList")
@ApiOperation("箱单明细导出")
@LogOperation("箱单明细导出")
@ApiImplicitParams({
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "boxNo", value = "boxid", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "lineBody", value = "线体", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "printStatus", value = "打印状态0、未打印1、已打印", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "model", value = "模式1-手动模式2-自动模式", paramType = "query", dataTypeClass = Integer.class)
})
public void exportSubstrateList(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<WoPackagingBoxSubstrate> list = woPackagingBoxService.substrateList(params);
if (list.size() > 0) {
ExcelUtils.exportExcelToTarget(response, "箱单明细", list, WoPackagingBoxSubstrateExcel.class);
}
}
@GetMapping("boxList/{woSubstrateId}")
@ApiOperation("查询模组id所在包装箱")
public List<WoPackagingBox> get(@PathVariable("woSubstrateId") String woSubstrateId){
return woPackagingBoxService.boxList(woSubstrateId);
}
@PostMapping("insertSubstrateManual")
@ApiOperation("手动新增包装箱")
@LogOperation("手动新增包装箱")
public IdVo insertSubstrateManual(@RequestBody WoPackagingBoxDTO dto){
return woPackagingBoxService.insertSubstrateManual(dto);
}
}

View File

@ -205,10 +205,9 @@ public class WoPackagingBoxSubstrateController {
@LogOperation("合箱")
public Result insertSubstrate(@RequestBody ChangePackingBoxDTO dto){
String woSubstrateId = dto.getWoSubstrateId();
//验证模组是否存在
QueryWrapper<WoPackagingBoxSubstrate> substrateQueryWrapper1 = new QueryWrapper<>();
substrateQueryWrapper1.eq(StringUtils.isNotBlank(woSubstrateId), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, woSubstrateId);
substrateQueryWrapper1.eq(WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId());
if(woPackagingBoxSubstrateMapper.selectCount(substrateQueryWrapper1 )== 0){
return new Result().error(1,"该模组不存在,请重新输入");
}
@ -278,4 +277,14 @@ public class WoPackagingBoxSubstrateController {
return new Result();
}
@PostMapping("updateSubstrateManual")
@ApiOperation("手动装箱编辑")
@LogOperation("手动装箱编辑")
public Result updateSubstrateManual(@RequestBody ChangePackingBoxDTO[] dtos){
woPackagingBoxSubstrateService.updateSubstrateManual(dtos);
return new Result();
}
}

View File

@ -14,7 +14,7 @@ import lombok.Data;
* </p>
*
* @author codeGenerator
* @since 2023-02-21
* @since 2023-03-03
*/
@Data
@TableName("t_wo_packaging_box_substrate")
@ -80,10 +80,6 @@ public class WoPackagingBoxSubstrate implements Serializable {
@ApiModelProperty("订单名")
private String orderName;
@ApiModelProperty("真实PMPP")
private Float actualPmpp;
private Long binclassFl1;
private Long binclassFl2;
@ -144,6 +140,9 @@ public class WoPackagingBoxSubstrate implements Serializable {
private Float uocFl2;
@ApiModelProperty("真实PMPP")
private Float actualPmpp;
public static final String ID = "ID";

View File

@ -16,41 +16,20 @@ import java.util.Date;
*/
@Data
public class ChangePackagingBoxHistoryExcel {
@Excel(name = "ID")
private Long id;
@Excel(name = "基板ID")
private String substrateId;
@Excel(name = "源包装箱")
private String sourceBoxNo;
@Excel(name = "源位置")
private Integer sourceSlot;
@Excel(name = "离开时间")
private LocalDateTime leaveTime;
@Excel(name = "目的包装箱")
private String targetBoxNo;
@Excel(name = "目的位置")
private Integer targetSlot;
@Excel(name = "进入时间")
private LocalDateTime inputTime;
@Excel(name = "等级")
private String grade;
@Excel(name = "操作类型")
private Integer type;
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
private Integer valid;
@Excel(name = "创建人")
private Long creatorId;
@Excel(name = "创建人姓名")
private String creatorName;
@Excel(name = "操作时间")
private LocalDateTime createTime;
@Excel(name = "更新人")
private Long updaterId;
@Excel(name = "更新人姓名")
private String updaterName;
@Excel(name = "更新时间")
private LocalDateTime updateTime;
@Excel(name = "版本号")
private Integer version;
}

View File

@ -16,106 +16,26 @@ import java.util.Date;
*/
@Data
public class WoPackagingBoxSubstrateExcel {
@Excel(name = "ID")
private Long id;
@Excel(name = "Box_ID")
private String packagingBoxId;
@Excel(name = "substrate ID")
private String woSubstrateId;
@Excel(name = "创建人")
private Long creatorId;
@Excel(name = "创建人姓名")
private String creatorName;
@Excel(name = "创建时间")
private LocalDateTime createTime;
@Excel(name = "更新人")
private Long updaterId;
@Excel(name = "更新人姓名")
private String updaterName;
@Excel(name = "更新时间")
private LocalDateTime updateTime;
@Excel(name = "版本号")
private Integer version;
@Excel(name = "模组ID")
private String woSubstrateId;
@Excel(name = "Box_ID")
private String packagingBoxId;
@Excel(name = "BOX_SLOT")
private Integer slot;
@Excel(name = "进入时间")
private LocalDateTime inputTime;
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
private Integer valid;
@Excel(name = "SAP MATERIAL,从t_wo_power_level 对应过来的")
private String sapMaterial;
@Excel(name = "线体")
private Integer lineBody;
@Excel(name = "功率等级")
@Excel(name = "档位功率")
private String powerLevel;
@Excel(name = "")
private LocalDateTime lastUpdateTime;
@Excel(name = "补偿后的功率pmpp")
@Excel(name = "补偿功率")
private Float pmpp;
@Excel(name = "实测功率")
private Float actualPmpp;
@Excel(name = "订单")
private String orderName;
@Excel(name = "")
private Long binclassFl1;
@Excel(name = "")
private Long binclassFl2;
@Excel(name = "")
private Float etaFl1;
@Excel(name = "")
private Float etaFl2;
@Excel(name = "")
private Float ffFl1;
@Excel(name = "")
private Float ffFl2;
@Excel(name = "")
private Float imppFl1;
@Excel(name = "")
private Float imppFl2;
@Excel(name = "")
private Float insolflashcontrolFl1;
@Excel(name = "")
private Float insolflashcontrolFl2;
@Excel(name = "")
private Float insolmppFl1;
@Excel(name = "")
private Float insolmppFl2;
@Excel(name = "")
private Float insolvocFl1;
@Excel(name = "")
private Float insolvocFl2;
@Excel(name = "")
private Float insolFl1;
@Excel(name = "")
private Float insolFl2;
@Excel(name = "")
private Float iscFl1;
@Excel(name = "")
private Float iscFl2;
@Excel(name = "")
private LocalDateTime measTimeFl1;
@Excel(name = "")
private LocalDateTime measTimeFl2;
@Excel(name = "")
private Float pmppFl1;
@Excel(name = "")
private Float pmppFl2;
@Excel(name = "")
private Float tcellFl1;
@Excel(name = "")
private Float tcellFl2;
@Excel(name = "")
private Float tmonicellFl1;
@Excel(name = "")
private Float tmonicellFl2;
@Excel(name = "")
private Float umppFl1;
@Excel(name = "")
private Float umppFl2;
@Excel(name = "")
private Float uocFl1;
@Excel(name = "")
private Float uocFl2;
@Excel(name = "真实PMPP")
private Float actualPmpp;
@Excel(name = "线体")
private Integer lineBody;
@Excel(name = "SAP物料号")
private String sapMaterial;
}

View File

@ -28,4 +28,6 @@ public interface ChangePackagingBoxHistoryServiceBiz extends CrudService<ChangeP
List<ChangePackagingBoxHistoryDTO> list(Map<String, Object> params);
List<ChangePackagingBoxHistory> historyList(Map<String, Object> params);
}

View File

@ -6,6 +6,7 @@ import com.cnbm.packing.dto.IdVo;
import com.cnbm.packing.dto.PowerReportDTO;
import com.cnbm.packing.dto.WoPackagingBoxDTO;
import com.cnbm.packing.entity.WoPackagingBox;
import com.cnbm.packing.entity.WoPackagingBoxSubstrate;
import com.cnbm.packing.param.PowerReportQueryParam;
import org.apache.ibatis.annotations.Param;
@ -35,6 +36,12 @@ public interface WoPackagingBoxServiceBiz extends CrudService<WoPackagingBox, Wo
WoPackagingBoxDTO printList(Long id);
List<WoPackagingBoxSubstrate> substrateList (Map<String, Object> params);
List<WoPackagingBox> boxList (String woSubstrateId);
IdVo insertSubstrateManual(WoPackagingBoxDTO dto);
int updateIsArrivedByBoxNo(Integer isArrived, String boxNo);

View File

@ -34,6 +34,8 @@ public interface WoPackagingBoxSubstrateServiceBiz extends CrudService<WoPackagi
void insertSubstrateManual(ChangePackingBoxDTO[] dtos);
void updateSubstrateManual(ChangePackingBoxDTO[] dtos);
WoPackagingBoxSubstrate getBySubId(String subId);

View File

@ -8,7 +8,6 @@ import com.cnbm.common.page.PageData;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.common.utils.ConvertUtils;
import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO;
import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO;
import com.cnbm.packing.entity.ChangePackagingBoxHistory;
import com.cnbm.packing.mapper.ChangePackagingBoxHistoryMapper;
import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz;
@ -17,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -35,16 +35,22 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha
@Override
public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
LocalDateTime endTime = (LocalDateTime) params.get("endTime");
QueryWrapper<ChangePackagingBoxHistory> wrapper = new QueryWrapper<>();
wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.CREATE_TIME, startTime, endTime);
wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.CREATE_TIME, startTime, endTime);
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if(params.get("startTime")!=null && params.get("endTime")!=null){
LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df);
LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df);
wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.CREATE_TIME, startTime, endTime);
}
if(params.get("type")!=null) {
Integer type = Integer.parseInt( params.get("type").toString());
wrapper.eq(ObjectUtils.isNotNull(type), ChangePackagingBoxHistory.TYPE, type);
}
if(params.get("startTime")==null && params.get("endTime")==null && params.get("type")==null){
wrapper.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 0");
}
return wrapper;
}
@ -52,8 +58,8 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha
@Override
public PageData<ChangePackagingBoxHistoryDTO> page (Map<String, Object> params){
IPage<ChangePackagingBoxHistory> page = baseDao.selectPage(
getPage(params, ChangePackagingBoxHistory.CREATE_TIME, true),
getWrapper(params)
getPage(params, ChangePackagingBoxHistory.CREATE_TIME, true),
getWrapper(params)
);
return getPageData(page, ChangePackagingBoxHistoryDTO.class);
}
@ -94,4 +100,12 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha
return list;
}
@Override
@Transactional(rollbackFor = Exception.class)
public List<ChangePackagingBoxHistory> historyList(Map<String, Object> params) {
QueryWrapper<ChangePackagingBoxHistory> wrapper = getWrapper(params);
List<ChangePackagingBoxHistory> historyList = mapper.selectList(wrapper);
return historyList;
}
}

View File

@ -47,6 +47,10 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
Integer lineBody = Integer.parseInt(params.get("lineBody").toString());
wrapper.eq(ObjectUtils.isNotNull(lineBody), PrintModel.LINE_BODY, lineBody);
}
if(params.get("enabled")!=null) {
Integer enabled = Integer.parseInt(params.get("enabled").toString());
wrapper.eq(ObjectUtils.isNotNull(enabled), PrintModel.ENABLED, enabled);
}
return wrapper;
}

View File

@ -16,12 +16,15 @@ import com.cnbm.packing.mapper.WoPackagingBoxMapper;
import com.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper;
import com.cnbm.packing.param.PowerReportQueryParam;
import com.cnbm.packing.service.WoPackagingBoxServiceBiz;
import com.cnbm.packing.service.WoPackagingBoxSubstrateServiceBiz;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -39,17 +42,22 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
private WoPackagingBoxMapper mapper;
@Autowired
private WoPackagingBoxSubstrateMapper substrateMapper;
@Autowired
private WoPackagingBoxSubstrateServiceBiz woPackagingBoxSubstrateServiceBiz;
@Override
public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
LocalDateTime endTime = (LocalDateTime) params.get("endTime");
String boxNo = (String) params.get("boxNo");
QueryWrapper<WoPackagingBox> wrapper = new QueryWrapper<>();
wrapper.between(startTime!=null && endTime!=null,WoPackagingBox.CREATE_TIME, startTime, endTime);
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if(params.get("startTime")!=null && params.get("endTime")!=null){
LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df);
LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df);
wrapper.between(startTime!=null && endTime!=null, WoPackagingBox.CREATE_TIME, startTime, endTime);
}
String boxNo = (String) params.get("boxNo");
wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingBox.BOX_NO, boxNo);
if(params.get("lineBody")!=null) {
Integer lineBody = Integer.parseInt(params.get("lineBody").toString());
@ -63,6 +71,9 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
Integer model = Integer.parseInt(params.get("model").toString());
wrapper.eq(ObjectUtils.isNotNull(model), WoPackagingBox.MODEL, model);
}
if(params.get("startTime")==null && params.get("endTime")==null && params.get("boxNo")==null && params.get("lineBody")==null && params.get("printStatus")==null){
wrapper.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 0");
}
return wrapper;
}
@ -126,6 +137,53 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
return dto;
}
@Override
public List<WoPackagingBoxSubstrate> substrateList(Map<String, Object> params) {
QueryWrapper<WoPackagingBox> boxQueryWrapper = getWrapper(params);
List<WoPackagingBox> boxList = mapper.selectList(boxQueryWrapper);
List<WoPackagingBoxSubstrate> substrateList = new ArrayList<>();
for(WoPackagingBox box: boxList){
QueryWrapper<WoPackagingBoxSubstrate> substrateQueryWrapper = new QueryWrapper<>();
substrateQueryWrapper.eq(StringUtils.isNotBlank(box.getBoxNo()), WoPackagingBoxSubstrate.PACKAGING_BOX_ID, box.getBoxNo());
List<WoPackagingBoxSubstrate> woPackagingBoxSubstrateList = substrateMapper.selectList(substrateQueryWrapper);
substrateList.addAll(woPackagingBoxSubstrateList);
}
return substrateList;
}
@Override
public List<WoPackagingBox> boxList(String woSubstrateId) {
QueryWrapper<WoPackagingBoxSubstrate> substrateQueryWrapper = new QueryWrapper<>();
substrateQueryWrapper.eq(StringUtils.isNotBlank(woSubstrateId), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, woSubstrateId);
List<WoPackagingBoxSubstrate> substrateList = substrateMapper.selectList(substrateQueryWrapper);
List<WoPackagingBox> boxList = new ArrayList<>();
for(WoPackagingBoxSubstrate substrate: substrateList){
QueryWrapper<WoPackagingBox> boxQueryWrapper = new QueryWrapper<>();
boxQueryWrapper.like(StringUtils.isNotBlank(substrate.getPackagingBoxId()), WoPackagingBox.BOX_NO, substrate.getPackagingBoxId());
List<WoPackagingBox> woPackagingBoxList = mapper.selectList(boxQueryWrapper);
boxList.addAll(woPackagingBoxList);
}
return boxList;
}
@Override
@Transactional(rollbackFor = Exception.class)
public IdVo insertSubstrateManual(WoPackagingBoxDTO dto) {
//新增包装箱
WoPackagingBox box = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
BaseSupportUtils.setCommonField(box);
insert(box);
//新增模组
List<WoPackagingBoxSubstrate> substrateList = dto.getSubstrateList();
for(WoPackagingBoxSubstrate substrate : substrateList){
substrate.setPackagingBoxId(box.getBoxNo());
substrate.setPowerLevel(box.getPowerLevel());
BaseSupportUtils.setCommonField(substrate);
woPackagingBoxSubstrateServiceBiz.insert(substrate);
}
return IdVo.builder().id(box.getId()).build();
}
@Override
public int updateIsArrivedByBoxNo(Integer isArrived, String boxNo) {
return mapper.updateIsArrivedByBoxNo(isArrived,boxNo);

View File

@ -14,17 +14,14 @@ import com.cnbm.packing.dto.ChangePackingBoxDTO;
import com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO;
import com.cnbm.packing.entity.ChangePackagingBoxHistory;
import com.cnbm.packing.entity.WoPackagingBoxSubstrate;
import com.cnbm.packing.mapper.WoPackagingBoxMapper;
import com.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper;
import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz;
import com.cnbm.packing.service.WoPackagingBoxSubstrateServiceBiz;
import org.apache.commons.lang3.StringUtils;
import org.omg.CORBA.PRIVATE_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Map;
@ -166,8 +163,12 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
@Transactional(rollbackFor = Exception.class)
public void insertSubstrateManual(ChangePackingBoxDTO[] dtos) {
for(ChangePackingBoxDTO dto : dtos) {
QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId());
// QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
// wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId());
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
BaseSupportUtils.setCommonField(entity);
insert(entity);
/*
if (mapper.selectCount(wrapper) > 0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) {
WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0);
substrate.setPackagingBoxId(dto.getPackagingBoxId());
@ -184,6 +185,17 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
BaseSupportUtils.setCommonField(entity);
insert(entity);
}
*/
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateSubstrateManual(ChangePackingBoxDTO[] dtos) {
for(ChangePackingBoxDTO dto : dtos) {
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
BaseSupportUtils.setUpdateCommonField(entity);
updateById(entity);
}
}

View File

@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -40,12 +41,16 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
@Override
public QueryWrapper<WoPackagingPrintHistory> getWrapper(Map<String, Object> params){
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
LocalDateTime endTime = (LocalDateTime) params.get("endTime");
String boxNo = (String) params.get("boxNo");
QueryWrapper<WoPackagingPrintHistory> wrapper = new QueryWrapper<>();
wrapper.between(startTime!=null && endTime!=null, WoPackagingPrintHistory.PRINT_TIME, startTime, endTime);
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if(params.get("startTime")!=null && params.get("endTime")!=null){
LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df);
LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df);
wrapper.between(startTime!=null && endTime!=null, WoPackagingPrintHistory.PRINT_TIME, startTime, endTime);
}
String boxNo = (String) params.get("boxNo");
wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingPrintHistory.BOX_NO, boxNo);
return wrapper;

View File

@ -32,7 +32,7 @@
and type = #{type}
</if>
</where>
order by id asc
order by CREATE_TIME desc
</select>
</mapper>