yanyang #23

Merged
yanyang merged 2 commits from yanyang into master 2023-03-16 09:56:32 +08:00
8 changed files with 61 additions and 25 deletions
Showing only changes of commit ba30dfe7af - Show all commits

View File

@ -55,8 +55,8 @@ public class WoPackagingBoxController {
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "endTime", 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 = "boxNo", value = "boxid", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "lineBody", value = "线体", 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 = "printStatus", value = "打印状态0、未打印1、已打印", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "model", value = "模式1-手动模式2-自动模式", paramType = "query", dataTypeClass = Integer.class) @ApiImplicitParam(name = "model", value = "模式1-手动模式2-自动模式", paramType = "query", dataTypeClass = Integer.class)
}) })
@PreAuthorize("@ex.hasAuthority('packing:woPackagingBox:page')") @PreAuthorize("@ex.hasAuthority('packing:woPackagingBox:page')")
@ -142,8 +142,8 @@ public class WoPackagingBoxController {
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class),
@ApiImplicitParam(name = "endTime", 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 = "boxNo", value = "boxid", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "lineBody", value = "线体", 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 = "printStatus", value = "打印状态0、未打印1、已打印", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "model", value = "模式1-手动模式2-自动模式", 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 { 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 javax.servlet.http.HttpServletResponse;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -286,10 +287,35 @@ public class WoPackagingBoxSubstrateController {
return new Result(); return new Result();
} }
@GetMapping("substrateList/{woSubstrateId}") @GetMapping("substrateList")
@ApiOperation("模组信息查询") @ApiOperation("装箱单信息查询")
public List<WoPackagingBoxSubstrateDTO> substrateList(@PathVariable("woSubstrateId") String woSubstrateId){ @ApiImplicitParams({
return woPackagingBoxSubstrateService.substrateList(woSubstrateId); @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; package com.cnbm.packing.excel;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -18,12 +19,12 @@ import java.util.Date;
public class WoPackagingBoxSubstrateExcel { public class WoPackagingBoxSubstrateExcel {
@Excel(name = "创建时间") @Excel(name = "创建时间")
private LocalDateTime createTime; private LocalDateTime boxCreateTime;
@Excel(name = "模组ID") @Excel(name = "模组ID")
private String woSubstrateId; private String woSubstrateId;
@Excel(name = "Box_ID") @Excel(name = "BoxID")
private String packagingBoxId; private String packagingBoxId;
@Excel(name = "BOX_SLOT") @Excel(name = "模组所在包装箱位置")
private Integer slot; private Integer slot;
@Excel(name = "档位功率") @Excel(name = "档位功率")
private String powerLevel; private String powerLevel;
@ -37,5 +38,7 @@ public class WoPackagingBoxSubstrateExcel {
private Integer lineBody; private Integer lineBody;
@Excel(name = "SAP物料号") @Excel(name = "SAP物料号")
private String sapMaterial; 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.time.LocalDateTime;
import java.util.List; 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<PowerReportDTO> powerReport(@Param("queryParam") PowerReportQueryParam queryParam);
List<String> orderNameList(); 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); WoPackagingBoxSubstrate getBySubId(String subId);
List<WoPackagingBoxSubstrateDTO> substrateList (String woSubstrateId); List<WoPackagingBoxSubstrateDTO> substrateList (Map<String, Object> params);
int updatePackagingBoxIdAndSlotByWoSubstrateId(String packagingBoxId,Integer slot,String woSubstrateId); 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 startTime = LocalDateTime.parse(params.get("startTime").toString(),df);
LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df); LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df);
wrapper.between(startTime!=null && endTime!=null, WoPackagingBox.CREATE_TIME, startTime, endTime); wrapper.between(startTime!=null && endTime!=null, WoPackagingBox.CREATE_TIME, startTime, endTime);
} }
String boxNo = (String) params.get("boxNo"); String boxNo = (String) params.get("boxNo");
wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingBox.BOX_NO, boxNo); wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingBox.BOX_NO, boxNo);
if(params.get("lineBody")!=null) { // if(params.get("lineBody")!=null) {
Integer lineBody = Integer.parseInt(params.get("lineBody").toString()); // Integer lineBody = Integer.parseInt(params.get("lineBody").toString());
wrapper.eq(ObjectUtils.isNotNull(lineBody), WoPackagingBox.LINE_BODY, lineBody); // wrapper.eq(ObjectUtils.isNotNull(lineBody), WoPackagingBox.LINE_BODY, lineBody);
} // }
if(params.get("printStatus")!=null) { // if(params.get("printStatus")!=null) {
Integer printStatus = Integer.parseInt(params.get("printStatus").toString()); // Integer printStatus = Integer.parseInt(params.get("printStatus").toString());
wrapper.eq(ObjectUtils.isNotNull(printStatus), WoPackagingBox.PRINT_STATUS, printStatus); // wrapper.eq(ObjectUtils.isNotNull(printStatus), WoPackagingBox.PRINT_STATUS, printStatus);
} // }
if(params.get("model")!=null) { if(params.get("model")!=null) {
Integer model = Integer.parseInt(params.get("model").toString()); Integer model = Integer.parseInt(params.get("model").toString());
wrapper.eq(ObjectUtils.isNotNull(model), WoPackagingBox.MODEL, model); 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"); wrapper.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 0");
} }

View File

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

View File

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