This commit is contained in:
zhouz
2024-04-12 15:54:00 +08:00
51 changed files with 1032 additions and 141 deletions

View File

@@ -22,7 +22,6 @@ import java.util.Map;
**/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/Materialbase")
@Slf4j
public class MaterialbaseController {

View File

@@ -113,6 +113,13 @@ public class MesToLmsController {
return new ResponseEntity<>(mesToLmsService.sendProcessInfo(jo), HttpStatus.OK);
}
@PostMapping("/processFoilStart")
@Log("表处工单推送")
@SaIgnore
public ResponseEntity<Object> processFoilStart(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.processFoilStart(jo), HttpStatus.OK);
}
@PostMapping("/sendTargetHouse")
@Log("MES传递给LMS入线边库或者入成品库")

View File

@@ -63,6 +63,8 @@ public interface MesToLmsService {
JSONObject sendProcessInfo(JSONObject param);
JSONObject processFoilStart(JSONObject param);
/**
* MES传递给LMS入线边库或者入成品库
*/

View File

@@ -1471,7 +1471,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
public JSONObject sendProcessInfo(JSONObject param) {
log.info("sendProcessInfo输入参数为-------------------" + param.toString());
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
// 冷却区点位库存表
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt");
JSONObject resultParam = new JSONObject();
try {
@@ -1500,10 +1501,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
//上料
if ("1".equals(Type)) {
String up_scroll = device_jo.getString("up_scroll");
String up_pcsn = device_jo.getString("up_pcsn");
/*if (StrUtil.isNotEmpty(up_pcsn)) {
throw new BadRequestException("LMS系统上【" + ResourceName + "】表处机上还存在母卷号,不能进行上料!");
}*/
//查询母卷所在点位
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04'").uniqueResult(0);
JSONObject form = new JSONObject();
@@ -1512,7 +1509,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
form.put("point_code1", jsonCoolIvt.getString("full_point_code"));
form.put("point_code2", device_jo.getString("up_point_code"));
form.put("task_type", "010702");
form.put("material_code", jsonCoolIvt.getString("container_name"));
form.put("material_code", containerName);
form.put("vehicle_code", jsonCoolIvt.getString("full_vehicle_code"));
form.put("product_area", device_jo.getString("product_area"));
} else {
@@ -1531,7 +1528,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
form.put("point_code4", jsonIvt.getString("empty_point_code"));
}
form.put("task_type", "010701");
form.put("material_code", jsonCoolIvt.getString("container_name"));
form.put("material_code", containerName);
form.put("vehicle_code", jsonCoolIvt.getString("full_vehicle_code"));
form.put("product_area", device_jo.getString("product_area"));
}
@@ -1549,7 +1546,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
//寻找可用的冷却区满轴点位
form.put("point_code2", jsonIvt.getString("full_point_code"));
form.put("task_type", "010704");
form.put("material_code", device_jo.getString("up_pcsn"));
form.put("material_code", containerName);
form.put("vehicle_code", device_jo.getString("up_scroll"));
form.put("product_area", device_jo.getString("product_area"));
processTask.createTask(form);
@@ -1568,6 +1565,89 @@ public class MesToLmsServiceImpl implements MesToLmsService {
return resultParam;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject processFoilStart(JSONObject param) {
log.info("processFoilStart接口输入参数为-------------------" + param.toString());
String FoilContainerName = param.getString("FoilContainerName");
String TRContainerName = param.getString("TRContainerName");
String ResourceName = param.getString("ResourceName");
String MfgOrderName = param.getString("MfgOrderName");
String ProductName = param.getString("ProductName");
String Description = param.getString("Description");
String UpCoilerDate = param.getString("UpCoilerDate");
WQLObject pointTab = WQLObject.getWQLObject("st_ivt_stpointivt");
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_SurProcessOrder");
JSONObject result = new JSONObject();
try {
// 校验数据
if (ObjectUtil.isEmpty(FoilContainerName)) {
throw new BadRequestException("母卷号不能为空");
}
if (ObjectUtil.isEmpty(TRContainerName)) {
throw new BadRequestException("表处批次号不能为空");
}
if (ObjectUtil.isEmpty(ResourceName)) {
throw new BadRequestException("机台编码不能为空");
}
if (ObjectUtil.isEmpty(MfgOrderName)) {
throw new BadRequestException("生产工单不能为空");
}
if (ObjectUtil.isEmpty(ProductName)) {
throw new BadRequestException("产品编码不能为空");
}
if (ObjectUtil.isEmpty(Description)) {
throw new BadRequestException("产品名称不能为空");
}
if (ObjectUtil.isEmpty(UpCoilerDate)) {
throw new BadRequestException("开始时间不能为空");
}
JSONObject jsonPoint = pointTab.query("ext_code ='" + ResourceName + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) {
jsonPoint = new JSONObject();
}
// 插入生箔工序工单表
JSONObject json = new JSONObject();
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("foil_container_ame", FoilContainerName);
json.put("container_name", TRContainerName);
json.put("resource_name", ResourceName);
json.put("mfg_order_name", MfgOrderName);
json.put("product_name", ProductName);
json.put("description", Description);
json.put("up_coiler_date", UpCoilerDate);
json.put("product_area", jsonPoint.getString("product_area"));
json.put("point_code", jsonPoint.getString("point_code"));
json.put("realstart_time", DateUtil.now());
json.put("status", "01");
json.put("is_delete", "0");
json.put("productin_qty", 0);
json.put("create_id", "1");
json.put("create_name", "管理员");
json.put("create_time", DateUtil.now());
orderTab.insert(json);
// 返回成功
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
} catch (Exception e) {
// 返回失败
result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + e.getMessage());
result.put("RTOAL", 0);
result.put("RTDAT", null);
}
log.info("processFoilStart接口输出参数为-------------------" + result.toString());
return result;
}
@Override
public JSONObject sendTargetHouse(JSONObject param) {
log.info("sendTargetHouse输入参数为-------------------" + param.toString());

View File

@@ -443,6 +443,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
JSONObject jsonObject = new JSONObject();
jsonObject.put("ext_code", result.getString("RTDAT"));
// 单据状态改变 10(生成) -> 20审核
jsonObject.put("bill_status", "20");
mst.update(jsonObject, "scrap_id = '" + whereJson.getString("scrap_id") + "'");

View File

@@ -118,7 +118,7 @@ public class CheckOutBillController {
}
@PostMapping("/allDivOne")
@Log("出库单全部分2")
@Log("出库单自动分")
public ResponseEntity<Object> allDivOne(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {