|
|
@ -246,7 +246,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
if (list.size() > 0) {
|
|
|
|
if (list.size() > 0) {
|
|
|
|
ProdReadyTask prodReadyTask = list.get(0);
|
|
|
|
ProdReadyTask prodReadyTask = list.get(0);
|
|
|
|
if (prodReadyTask.getStatus().equals(STATUS_CANCEL)) {
|
|
|
|
if (prodReadyTask.getStatus().equals(STATUS_CANCEL)) {
|
|
|
|
throw new BaseException("产前准备任务任务已取消");
|
|
|
|
throw new BaseException("产前准备任务已取消");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
prodReadyTask.setStatus(STATUS_CANCEL);
|
|
|
|
prodReadyTask.setStatus(STATUS_CANCEL);
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
@ -265,7 +265,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
Integer admin = userGroupMapper.getUserGroupByUser(HandleEnum.USER.getHandle(site, user), new UserGroupBOHandle(site, "ADMINISTRATORS").getValue());
|
|
|
|
Integer admin = userGroupMapper.getUserGroupByUser(HandleEnum.USER.getHandle(site, user), new UserGroupBOHandle(site, "ADMINISTRATORS").getValue());
|
|
|
|
return prodReadyTaskMapper.getTaskList(prodReadyTask, LocaleContextHolder.getLocale().getLanguage(),admin,user);
|
|
|
|
return prodReadyTaskMapper.getTaskList(prodReadyTask, LocaleContextHolder.getLocale().getLanguage(), admin, user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -292,6 +292,84 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
return prodReadyTask;
|
|
|
|
return prodReadyTask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Map<String, Object> loadTaskExecute(String taskBo) {
|
|
|
|
|
|
|
|
Map<String, Object> returnMap=new HashMap<>();
|
|
|
|
|
|
|
|
ProdReadyTask prodReadyTask = prodReadyTaskMapper.selectById(taskBo);
|
|
|
|
|
|
|
|
String dispatchNo = StringUtil.trimHandle(prodReadyTask.getSfcDispatchBo());
|
|
|
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
|
|
|
|
if (prodReadyTask.getStatus().equals(STATUS_NEW)) {
|
|
|
|
|
|
|
|
prodReadyTask.setReadyUser(CommonMethods.getUser());
|
|
|
|
|
|
|
|
prodReadyTask.setReadyDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
prodReadyTask.setModifyUser(CommonMethods.getUser());
|
|
|
|
|
|
|
|
prodReadyTask.setModifiedDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
prodReadyTask.setStatus(STATUS_DOING);
|
|
|
|
|
|
|
|
updateById(prodReadyTask);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ProdReadyTaskDetail> lambdaQuery = new LambdaQueryWrapper<>();
|
|
|
|
|
|
|
|
lambdaQuery.eq(ProdReadyTaskDetail::getProdReadyTaskBo, taskBo);
|
|
|
|
|
|
|
|
List<ProdReadyTaskDetail> list = prodReadyTaskDetailService.list(lambdaQuery);
|
|
|
|
|
|
|
|
List<Map<String, Object>> itemList = null;
|
|
|
|
|
|
|
|
List<Map<String, Object>> toolList = null;
|
|
|
|
|
|
|
|
List<Map<String, Object>> processControolList = null;
|
|
|
|
|
|
|
|
//物料接收数据
|
|
|
|
|
|
|
|
if (list.stream().filter(prodReadyTaskDetail -> prodReadyTaskDetail.getInspectionItem().equals(P01)).count()>0){
|
|
|
|
|
|
|
|
itemList = prodReadyTaskMapper.getItemDetail(site, LocaleContextHolder.getLocale().getLanguage(), dispatchNo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//刀具
|
|
|
|
|
|
|
|
if (list.stream().filter(prodReadyTaskDetail -> prodReadyTaskDetail.getInspectionItem().equals(P02)).count()>0){
|
|
|
|
|
|
|
|
toolList = prodReadyTaskMapper.getToolDetail(site, LocaleContextHolder.getLocale().getLanguage(), dispatchNo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//通过加工的零件号、设备类型、设备获取发布状态的工控程序
|
|
|
|
|
|
|
|
if (list.stream().filter(prodReadyTaskDetail -> prodReadyTaskDetail.getInspectionItem().equals(P03)).count()>0){
|
|
|
|
|
|
|
|
processControolList= new ArrayList<>();
|
|
|
|
|
|
|
|
SfcDispatchDto sfcdispatch = new SfcDispatchDto();
|
|
|
|
|
|
|
|
sfcdispatch.setHandle(HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo));
|
|
|
|
|
|
|
|
sfcdispatch = sfcDispatchCommonService.findSfcDispatchBySfc(sfcdispatch);
|
|
|
|
|
|
|
|
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfcdispatch.getSfc()));
|
|
|
|
|
|
|
|
String itemBo = sfcServiceById.getItemBo();
|
|
|
|
|
|
|
|
JSONObject jsonObject = sendToDnc(StringUtil.trimHandle(itemBo), sfcdispatch.getResrce(), sfcdispatch.getResourceType());
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("RESOURCE", sfcdispatch.getResrce());
|
|
|
|
|
|
|
|
map.put("RESOURCE_TYPE", sfcdispatch.getResourceType());
|
|
|
|
|
|
|
|
map.put("RESULT", jsonObject.get("RESULT"));
|
|
|
|
|
|
|
|
map.put("MESSAGE", jsonObject.get("MESSAGE"));
|
|
|
|
|
|
|
|
processControolList.add(map);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
returnMap.put("itemList",itemList);
|
|
|
|
|
|
|
|
returnMap.put("cutterList",toolList);
|
|
|
|
|
|
|
|
returnMap.put("processControlList",processControolList);
|
|
|
|
|
|
|
|
return returnMap;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void savePdaResult(ProdReadyTask prodReadyTask) {
|
|
|
|
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
|
|
|
|
ProdReadyTask byId = getById(prodReadyTask.getHandle());
|
|
|
|
|
|
|
|
if (byId.getStatus().equals(STATUS_CANCEL)) {
|
|
|
|
|
|
|
|
throw new BaseException("产前准备任务已取消");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (byId.getStatus().equals(STATUS_FINISH) && byId.getResult().equals(Constants.RSESULT_OK)) {
|
|
|
|
|
|
|
|
throw new BaseException("产前准备任务已完成");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<ProdReadyTaskDetail> prodReadyTaskDetailList = prodReadyTask.getProdReadyTaskDetailList();
|
|
|
|
|
|
|
|
prodReadyTask.setStatus(STATUS_FINISH);
|
|
|
|
|
|
|
|
prodReadyTask.setCompleteUser(user);
|
|
|
|
|
|
|
|
prodReadyTask.setCompleteDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
prodReadyTask.setModifyUser(user);
|
|
|
|
|
|
|
|
prodReadyTask.setModifiedDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
updateById(prodReadyTask);
|
|
|
|
|
|
|
|
if (prodReadyTaskDetailList != null && prodReadyTaskDetailList.size() > 0) {
|
|
|
|
|
|
|
|
for (ProdReadyTaskDetail prodReadyTaskDetail : prodReadyTaskDetailList) {
|
|
|
|
|
|
|
|
String detailHandle = HandleEnum.PROD_READY_TASK_DETAIL.getHandle(prodReadyTask.getHandle(), prodReadyTaskDetail.getInspectionItem());
|
|
|
|
|
|
|
|
prodReadyTaskDetail.setHandle(detailHandle);
|
|
|
|
|
|
|
|
prodReadyTaskDetail.setModifyUser(user);
|
|
|
|
|
|
|
|
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
prodReadyTaskDetailService.updateById(prodReadyTaskDetail);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<Map<String, Object>> getInspectionDetailList(Map<String, String> param) {
|
|
|
|
public List<Map<String, Object>> getInspectionDetailList(Map<String, String> param) {
|
|
|
|
String type = param.get("type");
|
|
|
|
String type = param.get("type");
|
|
|
@ -327,10 +405,10 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
ProdReadyTask byId = getById(prodReadyTask.getHandle());
|
|
|
|
ProdReadyTask byId = getById(prodReadyTask.getHandle());
|
|
|
|
if (byId.getStatus().equals(STATUS_CANCEL)) {
|
|
|
|
if (byId.getStatus().equals(STATUS_CANCEL)) {
|
|
|
|
throw new BaseException("产前准备任务任务已取消");
|
|
|
|
throw new BaseException("产前准备任务已取消");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (byId.getStatus().equals(STATUS_FINISH) && byId.getResult().equals(Constants.RSESULT_OK)) {
|
|
|
|
if (byId.getStatus().equals(STATUS_FINISH) && byId.getResult().equals(Constants.RSESULT_OK)) {
|
|
|
|
throw new BaseException("产前准备任务任务已完成");
|
|
|
|
throw new BaseException("产前准备任务已完成");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<ProdReadyTaskDetail> prodReadyTaskDetailList = prodReadyTask.getProdReadyTaskDetailList();
|
|
|
|
List<ProdReadyTaskDetail> prodReadyTaskDetailList = prodReadyTask.getProdReadyTaskDetailList();
|
|
|
|
prodReadyTask.setStatus(STATUS_FINISH);
|
|
|
|
prodReadyTask.setStatus(STATUS_FINISH);
|
|
|
@ -365,7 +443,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
String resrce = sfcDispatchDto.getResrce();
|
|
|
|
String resrce = sfcDispatchDto.getResrce();
|
|
|
|
String printName = customFieldsService.getCustomFieldsValue(HandleEnum.RESOURCE.getHandle(site, resrce), CustomFieldConstant.RESRCE_CUSTOM_FIELD_PRINT_NAME);
|
|
|
|
String printName = customFieldsService.getCustomFieldsValue(HandleEnum.RESOURCE.getHandle(site, resrce), CustomFieldConstant.RESRCE_CUSTOM_FIELD_PRINT_NAME);
|
|
|
|
if (StringUtil.isBlank(printName)) {
|
|
|
|
if (StringUtil.isBlank(printName)) {
|
|
|
|
throw new BaseException("资源维护的打印机不能为空");
|
|
|
|
throw new BaseException("资源" + resrce + "维护的打印机不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String item = prodReadyTask.getItem();
|
|
|
|
String item = prodReadyTask.getItem();
|
|
|
|
Item selectCurrent = itemService.selectCurrent(site, item);
|
|
|
|
Item selectCurrent = itemService.selectCurrent(site, item);
|
|
|
@ -401,7 +479,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
seq = i;
|
|
|
|
seq = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (seq != stepOperationList.size()-1) {
|
|
|
|
if (seq != stepOperationList.size() - 1) {
|
|
|
|
RouterStepDto stepOperation = stepOperationList.get(seq + 1);
|
|
|
|
RouterStepDto stepOperation = stepOperationList.get(seq + 1);
|
|
|
|
labelPrintDto.setOperation(stepOperation.getOperationDesc());
|
|
|
|
labelPrintDto.setOperation(stepOperation.getOperationDesc());
|
|
|
|
|
|
|
|
|
|
|
@ -522,13 +600,36 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
messageService.save(message);
|
|
|
|
messageService.save(message);
|
|
|
|
activeMQUtil.wechatSendMessage(sendUsers.toString(),sendMessage);
|
|
|
|
activeMQUtil.wechatSendMessage(sendUsers.toString(), sendMessage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void doReadyList(List<ProdReadyTask> list) {
|
|
|
|
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
|
|
|
|
for (ProdReadyTask prodReadyTask : list) {
|
|
|
|
|
|
|
|
prodReadyTask = getById(prodReadyTask.getHandle());
|
|
|
|
|
|
|
|
String result = prodReadyTask.getResult();
|
|
|
|
|
|
|
|
if (prodReadyTask.getStatus().equals(STATUS_CANCEL)) {
|
|
|
|
|
|
|
|
throw new BaseException("产品条码" + prodReadyTask.getSfc() + "产前准备任务已取消");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StringUtil.notBlank(result) && prodReadyTask.getResult().equals(Constants.RSESULT_OK)) {
|
|
|
|
|
|
|
|
throw new BaseException("产品条码" + prodReadyTask.getSfc() + "产前准备任务已完成");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
prodReadyTask.setStatus(STATUS_FINISH);
|
|
|
|
|
|
|
|
prodReadyTask.setResult(Constants.RSESULT_OK);
|
|
|
|
|
|
|
|
prodReadyTask.setCompleteUser(user);
|
|
|
|
|
|
|
|
prodReadyTask.setCompleteDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
prodReadyTask.setModifyUser(user);
|
|
|
|
|
|
|
|
prodReadyTask.setModifiedDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
updateById(prodReadyTask);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String formatMessage(ProdReadyTask prodReadyTask, String messageType, String site) {
|
|
|
|
public String formatMessage(ProdReadyTask prodReadyTask, String messageType, String site) {
|
|
|
|
//找到消息内容
|
|
|
|
//找到消息内容
|
|
|
|
String locale = LocaleContextHolder.getLocale().getLanguage();
|
|
|
|
String locale = LocaleContextHolder.getLocale().getLanguage();
|
|
|
@ -548,7 +649,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
//根据车间找到对应车间的描述
|
|
|
|
//根据车间找到对应车间的描述
|
|
|
|
WorkCenter workCenter = workCenterMapper.findWorkCenterDescriptionByWorkCenter(site, prodReadyTask.getWorkCenter(), locale);
|
|
|
|
WorkCenter workCenter = workCenterMapper.findWorkCenterDescriptionByWorkCenter(site, prodReadyTask.getWorkCenter(), locale);
|
|
|
|
//根据资源找到对应的产线的描述
|
|
|
|
//根据资源找到对应的产线的描述
|
|
|
|
Resrce byResrce = resrceService.getById(HandleEnum.RESOURCE.getHandle(site,prodReadyTask.getResrce()));
|
|
|
|
Resrce byResrce = resrceService.getById(HandleEnum.RESOURCE.getHandle(site, prodReadyTask.getResrce()));
|
|
|
|
Item selectCurrent = itemService.selectCurrent(site, prodReadyTask.getItem());
|
|
|
|
Item selectCurrent = itemService.selectCurrent(site, prodReadyTask.getItem());
|
|
|
|
//项目号
|
|
|
|
//项目号
|
|
|
|
String item = selectCurrent.getItem() + "/" + selectCurrent.getDescription();
|
|
|
|
String item = selectCurrent.getItem() + "/" + selectCurrent.getDescription();
|
|
|
|