Merge pull request 'yanyang' (#23) from yanyang into master

Reviewed-on: #23
This commit is contained in:
闫阳 2023-03-16 09:56:31 +08:00
commit eda15da1a9
8 changed files with 61 additions and 25 deletions

View File

@ -55,8 +55,8 @@ public class WoPackagingBoxController {
@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 = "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)
})
@PreAuthorize("@ex.hasAuthority('packing:woPackagingBox:page')")
@ -142,8 +142,8 @@ public class WoPackagingBoxController {
@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 = "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 {

View File

@ -36,6 +36,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@ -286,10 +287,35 @@ public class WoPackagingBoxSubstrateController {
return new Result();
}
@GetMapping("substrateList/{woSubstrateId}")
@ApiOperation("模组信息查询")
public List<WoPackagingBoxSubstrateDTO> substrateList(@PathVariable("woSubstrateId") String woSubstrateId){
return woPackagingBoxSubstrateService.substrateList(woSubstrateId);
@GetMapping("substrateList")
@ApiOperation("装箱单信息查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "model", value = "模式1-手动模式2-自动模式", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "packagingBoxId", value = "包装箱IDBoxId", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "woSubstrateId", value = "基板ID关联T_SUBSTRATE表", paramType = "query", dataTypeClass = String.class)
})
public List<WoPackagingBoxSubstrateDTO> substrateList(@ApiIgnore @RequestParam Map<String, Object> params){
return woPackagingBoxSubstrateService.substrateList(params);
}
@GetMapping("exportPackingInfo")
@ApiOperation("装箱单信息导出")
@LogOperation("装箱单信息导出")
@ApiImplicitParams({
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "model", value = "模式1-手动模式2-自动模式", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "packagingBoxId", value = "包装箱IDBoxId", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "woSubstrateId", value = "基板ID关联T_SUBSTRATE表", paramType = "query", dataTypeClass = String.class)
})
public void exportPackingInfo(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<WoPackagingBoxSubstrateDTO> list = woPackagingBoxSubstrateService.list(params);
if(list.size()>0) {
ExcelUtils.exportExcelToTarget(response, "装箱单信息", list, WoPackagingBoxSubstrateExcel.class);
}
}
}

View File

@ -1,6 +1,7 @@
package com.cnbm.packing.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@ -18,12 +19,12 @@ import java.util.Date;
public class WoPackagingBoxSubstrateExcel {
@Excel(name = "创建时间")
private LocalDateTime createTime;
private LocalDateTime boxCreateTime;
@Excel(name = "模组ID")
private String woSubstrateId;
@Excel(name = "Box_ID")
@Excel(name = "BoxID")
private String packagingBoxId;
@Excel(name = "BOX_SLOT")
@Excel(name = "模组所在包装箱位置")
private Integer slot;
@Excel(name = "档位功率")
private String powerLevel;
@ -37,5 +38,7 @@ public class WoPackagingBoxSubstrateExcel {
private Integer lineBody;
@Excel(name = "SAP物料号")
private String sapMaterial;
@Excel(name = "最近打印时间")
private LocalDateTime printTime;
}

View File

@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* 包装箱基板关联表
@ -27,5 +28,5 @@ public interface WoPackagingBoxSubstrateMapper extends BaseDao<WoPackagingBoxSub
List<PowerReportDTO> powerReport(@Param("queryParam") PowerReportQueryParam queryParam);
List<String> orderNameList();
List<WoPackagingBoxSubstrateDTO> substrateList(@Param("woSubstrateId") String woSubstrateId);
List<WoPackagingBoxSubstrateDTO> substrateList(Map<String, Object> params);
}

View File

@ -39,7 +39,7 @@ public interface WoPackagingBoxSubstrateServiceBiz extends CrudService<WoPackagi
WoPackagingBoxSubstrate getBySubId(String subId);
List<WoPackagingBoxSubstrateDTO> substrateList (String woSubstrateId);
List<WoPackagingBoxSubstrateDTO> substrateList (Map<String, Object> params);
int updatePackagingBoxIdAndSlotByWoSubstrateId(String packagingBoxId,Integer slot,String woSubstrateId);

View File

@ -61,24 +61,23 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
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());
wrapper.eq(ObjectUtils.isNotNull(lineBody), WoPackagingBox.LINE_BODY, lineBody);
}
if(params.get("printStatus")!=null) {
Integer printStatus = Integer.parseInt(params.get("printStatus").toString());
wrapper.eq(ObjectUtils.isNotNull(printStatus), WoPackagingBox.PRINT_STATUS, printStatus);
}
// if(params.get("lineBody")!=null) {
// Integer lineBody = Integer.parseInt(params.get("lineBody").toString());
// wrapper.eq(ObjectUtils.isNotNull(lineBody), WoPackagingBox.LINE_BODY, lineBody);
// }
// if(params.get("printStatus")!=null) {
// Integer printStatus = Integer.parseInt(params.get("printStatus").toString());
// wrapper.eq(ObjectUtils.isNotNull(printStatus), WoPackagingBox.PRINT_STATUS, printStatus);
// }
if(params.get("model")!=null) {
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){
if(params.get("startTime")==null && params.get("endTime")==null && params.get("boxNo")==null){
wrapper.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 0");
}

View File

@ -207,8 +207,8 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
}
@Override
public List<WoPackagingBoxSubstrateDTO> substrateList(String woSubstrateId) {
return mapper.substrateList(woSubstrateId);
public List<WoPackagingBoxSubstrateDTO> substrateList(Map<String, Object> params) {
return mapper.substrateList(params);
}
@Override

View File

@ -124,9 +124,16 @@
from t_wo_packaging_box_substrate twpbs
left join t_wo_packaging_box twpb on twpbs.PACKAGING_BOX_ID = twpb.BOX_NO
<where>
twpb.model = #{model}
<if test="woSubstrateId != null and woSubstrateId != ''">
and twpbs.WO_SUBSTRATE_ID like CONCAT(CONCAT('%',#{woSubstrateId}),'%')
</if>
<if test="packagingBoxId != null and packagingBoxId != ''">
and twpbs.PACKAGING_BOX_ID like CONCAT(CONCAT('%',#{packagingBoxId}),'%')
</if>
<if test="startTime != null and endTime != null">
and twpb.CREATE_TIME between #{startTime} AND #{endTime}
</if>
AND twpbs.valid = 1
</where>
order by twpb.CREATE_TIME desc