opt:晶棒库库存页面新增 工单、出库状态字段;mes下发入库、工单判断是否存在,已存在更新,不存在新增
This commit is contained in:
@@ -236,7 +236,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String taskId = param.getString("taskId");
|
||||
BaseResponse result = BaseResponse.build(requestNo);
|
||||
try {
|
||||
SchBaseTask schBaseTask=taskService.getById(taskId);
|
||||
SchBaseTask schBaseTask = taskService.getById(taskId);
|
||||
if(ObjectUtil.isEmpty(schBaseTask)){
|
||||
throw new BadRequestException("任务不存在!taskId:"+taskId);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -15,6 +17,7 @@ import org.nl.wms.mes.domain.*;
|
||||
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail;
|
||||
import org.nl.wms.sch.material.service.IMaterialService;
|
||||
import org.nl.wms.sch.material.service.dao.Material;
|
||||
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper;
|
||||
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
|
||||
@@ -46,6 +49,9 @@ public class MesController {
|
||||
@Autowired
|
||||
private MaterialMapper materialMapper;
|
||||
|
||||
@Autowired
|
||||
private IMaterialService materialService;
|
||||
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService pdmBdWorkorderService;
|
||||
|
||||
@@ -74,13 +80,32 @@ public class MesController {
|
||||
head.setSRC_SYSTEM("AGV");
|
||||
qpmes060Response.setHEAD(head);
|
||||
try {
|
||||
Material material = new Material();
|
||||
for(QPMES060RequestBody QPMES060RequestBody:notice.toJavaObject(QPMES060Request.class).getBODY()) {
|
||||
Material material = new Material();
|
||||
//实体类
|
||||
material.copyFrom(QPMES060RequestBody);
|
||||
material.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
|
||||
material.setReturn_status("0");
|
||||
material.setCreate_time(DateUtil.now());
|
||||
materialMapper.insert(material);
|
||||
String lotSN = material.getLotSN();
|
||||
if(ObjectUtil.isNotEmpty(lotSN)){
|
||||
Material entity = materialService.getOne(new LambdaQueryWrapper<Material>()
|
||||
.eq(Material::getLotSN, lotSN));
|
||||
if (ObjectUtil.isEmpty(entity)){
|
||||
//新增
|
||||
material.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
|
||||
material.setReturn_status("0");
|
||||
material.setCreate_time(DateUtil.now());
|
||||
materialMapper.insert(material);
|
||||
}else{
|
||||
LambdaUpdateWrapper<Material> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(Material::getLotSN,lotSN);
|
||||
//更新
|
||||
material.setGroup_bind_material_status(entity.getGroup_bind_material_status());
|
||||
material.setReturn_status(entity.getReturn_status());
|
||||
material.setCreate_time(DateUtil.now());
|
||||
materialService.update(material,updateWrapper);
|
||||
}
|
||||
}else{
|
||||
log.error("原材料入库晶棒号为空,{}", material.toString());
|
||||
}
|
||||
}
|
||||
qpmes060ResponseBody.setMESSAGE("原材料入库成功");
|
||||
qpmes060ResponseBody.setSTATUS("S");
|
||||
@@ -214,7 +239,24 @@ public class MesController {
|
||||
try {
|
||||
Workorder workorder = new Workorder();
|
||||
workorder.copyFrom(temp);
|
||||
workorderService.create(workorder);
|
||||
String lotSN = workorder.getLotSN();
|
||||
if(ObjectUtil.isNotEmpty(lotSN)){
|
||||
Workorder entity = workorderService.getOne(new LambdaQueryWrapper<Workorder>()
|
||||
.eq(Workorder::getLotSN, lotSN));
|
||||
if (ObjectUtil.isEmpty(entity)){
|
||||
//新增
|
||||
workorderService.create(workorder);
|
||||
}else{
|
||||
LambdaUpdateWrapper<Workorder> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(Workorder::getLotSN,lotSN);
|
||||
//更新
|
||||
workorder.setMode(entity.getMode());
|
||||
workorder.setStatus(entity.getStatus());
|
||||
workorderService.update(workorder,updateWrapper);
|
||||
}
|
||||
}else{
|
||||
log.error("工单晶棒号为空,{}", workorder.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("工单已存在导致新增失败,{}{}", e, e.getMessage());
|
||||
}
|
||||
|
||||
@@ -40,40 +40,70 @@
|
||||
|
||||
<select id="queryYlDetail" resultType="org.nl.wms.sch.report.service.dto.YlDto">
|
||||
SELECT
|
||||
m.lotSN,
|
||||
p.point_code as pointCode,
|
||||
p.point_name as pointName,
|
||||
p.region_code as regionCode,
|
||||
p.region_name as regionName,
|
||||
p.vehicle_code2 as subTray,
|
||||
p.vehicle_code as motherTray,
|
||||
p.update_time as updateTime,
|
||||
m.*
|
||||
*
|
||||
FROM
|
||||
sch_base_point p,sch_base_material m
|
||||
WHERE
|
||||
p.vehicle_code2 = m.PalletSN
|
||||
AND vehicle_code2!=''
|
||||
AND vehicle_code2 is not null
|
||||
<if test="query.supplierName != null">
|
||||
and m.supplierName like CONCAT('%', #{query.supplierName}, '%')
|
||||
(
|
||||
SELECT
|
||||
m.*,
|
||||
p.point_code as pointCode,
|
||||
p.point_name as pointName,
|
||||
p.region_code as regionCode,
|
||||
p.region_name as regionName,
|
||||
p.vehicle_code2 as subTray,
|
||||
p.vehicle_code as motherTray,
|
||||
p.update_time as updateTime,
|
||||
( CASE WHEN ( workorder_two.status = '' OR workorder_two.status IS NULL ) THEN 0
|
||||
WHEN workorder_two.status = 2 THEN 1
|
||||
ELSE workorder_two.status END ) AS status,
|
||||
workorder_two.moname
|
||||
FROM
|
||||
sch_base_point p,sch_base_material m
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
two.moname,
|
||||
two.palletSN,
|
||||
two.status
|
||||
FROM
|
||||
pdm_bd_workorder_two two
|
||||
where two.status not in ('3','4')
|
||||
GROUP BY
|
||||
two.palletSN,
|
||||
two.moname,
|
||||
two.status
|
||||
ORDER BY
|
||||
two.moname,
|
||||
two.palletSN,
|
||||
two.status
|
||||
) workorder_two ON workorder_two.palletSN = m.PalletSN
|
||||
WHERE
|
||||
p.vehicle_code2 = m.PalletSN
|
||||
AND vehicle_code2!=''
|
||||
AND vehicle_code2 is not null
|
||||
<if test="query.supplierName != null">
|
||||
and m.supplierName like CONCAT('%', #{query.supplierName}, '%')
|
||||
</if>
|
||||
<if test="query.productDescription != null">
|
||||
and m.productDescription like CONCAT('%', #{query.productDescription}, '%')
|
||||
</if>
|
||||
<if test="query.point_code != null">
|
||||
and p.point_code like CONCAT('%', #{query.point_code}, '%')
|
||||
</if>
|
||||
<if test="query.region_code != null">
|
||||
and p.region_code like CONCAT('%', #{query.region_code}, '%')
|
||||
</if>
|
||||
<if test="query.lotSN != null">
|
||||
and m.lotSN like CONCAT('%', #{query.lotSN}, '%')
|
||||
</if>
|
||||
<if test="query.ingotBatch != null">
|
||||
and m.ingotBatch like CONCAT('%', #{query.ingotBatch}, '%')
|
||||
</if>
|
||||
ORDER BY
|
||||
point_code ASC
|
||||
) pp
|
||||
where 1=1
|
||||
<if test="query.status != null">
|
||||
and pp.status = #{query.status}
|
||||
</if>
|
||||
<if test="query.productDescription != null">
|
||||
and m.productDescription like CONCAT('%', #{query.productDescription}, '%')
|
||||
</if>
|
||||
<if test="query.point_code != null">
|
||||
and p.point_code like CONCAT('%', #{query.point_code}, '%')
|
||||
</if>
|
||||
<if test="query.region_code != null">
|
||||
and p.region_code like CONCAT('%', #{query.region_code}, '%')
|
||||
</if>
|
||||
<if test="query.lotSN != null">
|
||||
and m.lotSN like CONCAT('%', #{query.lotSN}, '%')
|
||||
</if>
|
||||
<if test="query.ingotBatch != null">
|
||||
and m.ingotBatch like CONCAT('%', #{query.ingotBatch}, '%')
|
||||
</if>
|
||||
ORDER BY point_code ASC
|
||||
</select>
|
||||
|
||||
<select id="queryYlOutDetail" resultType="org.nl.wms.sch.report.service.dto.YCLKCDto">
|
||||
|
||||
@@ -95,4 +95,8 @@ public class YlDto implements Serializable {
|
||||
* 线径
|
||||
*/
|
||||
private String lineDiameter;
|
||||
//出库状态
|
||||
private String status;
|
||||
//工单
|
||||
private String moname;
|
||||
}
|
||||
|
||||
@@ -135,6 +135,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
|
||||
mp.put("入库时间",detailDto.getUpdateTime());
|
||||
mp.put("棒源等级",detailDto.getSiliconGrade());
|
||||
mp.put("客户来料批次号",detailDto.getIngotBatch());
|
||||
if("1".equals(detailDto.getStatus())){
|
||||
mp.put("出库状态","出库中");
|
||||
}else{
|
||||
mp.put("出库状态","未出库");
|
||||
}
|
||||
mp.put("工单编号",detailDto.getMoname());
|
||||
mp.put("晶棒号",detailDto.getLotSN());
|
||||
mp.put("来料长度",detailDto.getIncomingLength());
|
||||
mp.put("来料重量",detailDto.getIncomingWeight());
|
||||
|
||||
Reference in New Issue
Block a user