|
|
@@ -509,7 +509,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
@PostMapping(value = "save")
|
|
|
@ResponseBody
|
|
|
public String save(@Validated MesProductRecord mesProductRecord,HttpServletRequest request) {
|
|
|
- if(mesProductRecord.getIsNewRecord() && mesProductRecord.getLineSn().isEmpty()){ // 新增
|
|
|
+ if(mesProductRecord.getIsNewRecord() && StringUtils.isBlank(mesProductRecord.getLineSn())){ // 新增
|
|
|
return renderResult(Global.FALSE, text("产线编号不能为空!"));
|
|
|
}
|
|
|
|
|
|
@@ -3477,6 +3477,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
mesProductRecord.getSqlMap().getOrder().setOrderBy("a.update_date DESC");
|
|
|
|
|
|
Page<MesProductRecord> page = mesProductRecordService.findPage(mesProductRecord);
|
|
|
+ fillWorkOperators(page.getList());
|
|
|
// for (int i=0;i<page.getList().size();i++){
|
|
|
// MesProductRecord mesProductRecord1 = new MesProductRecord();
|
|
|
// mesProductRecord1.setSn(page.getList().get(i).getSn());
|
|
|
@@ -3491,6 +3492,29 @@ public class MesProductRecordController extends BaseController {
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+ private void fillWorkOperators(List<MesProductRecord> list) {
|
|
|
+ if (ListUtils.isEmpty(list)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Map<String, String> operatorMap = new HashMap<>();
|
|
|
+ for (MesProductRecord record : list) {
|
|
|
+ if (StringUtils.isBlank(record.getSn()) || StringUtils.isBlank(record.getOprno())
|
|
|
+ || StringUtils.isBlank(record.getLineSn())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String key = record.getSn() + "|" + record.getLineSn() + "|" + record.getOprno();
|
|
|
+ if (!operatorMap.containsKey(key)) {
|
|
|
+ MesPdaScanRecord scanRecord = mesPdaScanRecordService.findLatestNormalBySnLineOprno(
|
|
|
+ record.getSn(), record.getLineSn(), record.getOprno());
|
|
|
+ operatorMap.put(key, ObjectUtils.isEmpty(scanRecord) ? "" : StringUtils.trim(scanRecord.getUcode()));
|
|
|
+ }
|
|
|
+ String operator = operatorMap.get(key);
|
|
|
+ if (StringUtils.isNotBlank(operator)) {
|
|
|
+ record.setUpdateBy(operator);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value = "winfo")
|
|
|
public String winfo(MesProductRecord mesProductRecord,Model model, HttpServletRequest request, HttpServletResponse response) {
|
|
|
MesProductRecord mesProductRecord1 = new MesProductRecord();
|