|
@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
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.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
@ -17,10 +16,8 @@ import org.nl.wms.mes.domain.*; |
|
|
import org.nl.wms.pdm.service.IPdmBdWorkorderService; |
|
|
import org.nl.wms.pdm.service.IPdmBdWorkorderService; |
|
|
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; |
|
|
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; |
|
|
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; |
|
|
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; |
|
|
import org.nl.wms.sch.material.service.IMaterialService; |
|
|
import org.nl.wms.sch.material.service.IMaterialServiceProc; |
|
|
import org.nl.wms.sch.material.service.dao.Material; |
|
|
import org.nl.wms.sch.material.service.dao.MaterialProc; |
|
|
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; |
|
|
|
|
|
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
|
|
|
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
|
import org.nl.wms.sch.workorder.service.IWorkorderService; |
|
|
import org.nl.wms.sch.workorder.service.IWorkorderService; |
|
|
import org.nl.wms.sch.workorder.service.dao.Workorder; |
|
|
import org.nl.wms.sch.workorder.service.dao.Workorder; |
|
@ -33,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Collection; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
@Slf4j |
|
|
@Slf4j |
|
@ -47,10 +45,7 @@ public class MesController { |
|
|
private PointMapper pointMapper; |
|
|
private PointMapper pointMapper; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private MaterialMapper materialMapper; |
|
|
private IMaterialServiceProc IMaterialServiceProc; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IMaterialService materialService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private IPdmBdWorkorderService pdmBdWorkorderService; |
|
|
private IPdmBdWorkorderService pdmBdWorkorderService; |
|
@ -79,34 +74,27 @@ public class MesController { |
|
|
head.setSRC_MSGID(IdUtil.simpleUUID()); |
|
|
head.setSRC_MSGID(IdUtil.simpleUUID()); |
|
|
head.setSRC_SYSTEM("AGV"); |
|
|
head.setSRC_SYSTEM("AGV"); |
|
|
qpmes060Response.setHEAD(head); |
|
|
qpmes060Response.setHEAD(head); |
|
|
|
|
|
|
|
|
|
|
|
QPMES060Request qpmes060request = notice.toJavaObject(QPMES060Request.class); |
|
|
|
|
|
log.info(qpmes060request.toString()); |
|
|
|
|
|
|
|
|
|
|
|
Collection<MaterialProc> materlist = new ArrayList(); |
|
|
try { |
|
|
try { |
|
|
for(QPMES060RequestBody QPMES060RequestBody:notice.toJavaObject(QPMES060Request.class).getBODY()) { |
|
|
for(QPMES060RequestBody temp : qpmes060request.getBODY()) { |
|
|
Material material = new Material(); |
|
|
MaterialProc material = new MaterialProc(); |
|
|
//实体类
|
|
|
//实体类
|
|
|
material.copyFrom(QPMES060RequestBody); |
|
|
material.copyFrom(temp); |
|
|
String lotSN = material.getLotSN(); |
|
|
String lotSN = material.getLotSN(); |
|
|
if(ObjectUtil.isNotEmpty(lotSN)){ |
|
|
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()); |
|
|
material.setCreate_time(DateUtil.now()); |
|
|
materialMapper.insert(material); |
|
|
materlist.add(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{ |
|
|
}else{ |
|
|
log.error("原材料入库晶棒号为空,{}", material.toString()); |
|
|
log.error("原材料入库晶棒号为空,{}", material.toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
boolean flag = IMaterialServiceProc.saveOrUpdateBatch(materlist,materlist.size()); |
|
|
|
|
|
log.info("QPMES060服务被调用IMaterialServiceProc.saveOrUpdateBatch:" + flag); |
|
|
|
|
|
|
|
|
qpmes060ResponseBody.setMESSAGE("原材料入库成功"); |
|
|
qpmes060ResponseBody.setMESSAGE("原材料入库成功"); |
|
|
qpmes060ResponseBody.setSTATUS("S"); |
|
|
qpmes060ResponseBody.setSTATUS("S"); |
|
|
qpmes060ResponseBodyArrayList.add(qpmes060ResponseBody); |
|
|
qpmes060ResponseBodyArrayList.add(qpmes060ResponseBody); |
|
|