|
@@ -17,9 +17,11 @@ import com.jeesite.modules.mes.resp.ParamsResp;
|
|
|
import com.jeesite.modules.mes.service.MesProductRecordService;
|
|
import com.jeesite.modules.mes.service.MesProductRecordService;
|
|
|
import com.jeesite.modules.sys.entity.User;
|
|
import com.jeesite.modules.sys.entity.User;
|
|
|
import com.jeesite.modules.sys.utils.UserUtils;
|
|
import com.jeesite.modules.sys.utils.UserUtils;
|
|
|
|
|
+import com.jeesite.modules.utils.ErrorMsg;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -56,6 +58,11 @@ public class MesProductGp12Controller extends BaseController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private MesProductRecordService mesProductRecordService;
|
|
private MesProductRecordService mesProductRecordService;
|
|
|
|
|
+
|
|
|
|
|
+ @Lazy
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private MesProductRecordController mesProductRecordController;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取数据
|
|
* 获取数据
|
|
|
*/
|
|
*/
|
|
@@ -196,7 +203,23 @@ public class MesProductGp12Controller extends BaseController {
|
|
|
List<MesProductGp12> list = mesProductGp12Service.findList(mesProductGp12);
|
|
List<MesProductGp12> list = mesProductGp12Service.findList(mesProductGp12);
|
|
|
if (list.size() > 0){return renderResult(Global.FALSE, "该记录已存在");}
|
|
if (list.size() > 0){return renderResult(Global.FALSE, "该记录已存在");}
|
|
|
|
|
|
|
|
|
|
+ String stationOprno = oprno;
|
|
|
|
|
+ if (stationOprno.length() == 5) {
|
|
|
|
|
+ stationOprno = stationOprno + "A";
|
|
|
|
|
+ }
|
|
|
|
|
+ String userCode = "";
|
|
|
|
|
+ User user = UserUtils.getUser();
|
|
|
|
|
+ if (user != null && StringUtils.isNotBlank(user.getUserCode())) {
|
|
|
|
|
+ userCode = user.getUserCode();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 提交工位结果前先做质量校验,通过后才允许继续
|
|
|
|
|
+ String ret = mesProductRecordController.checkQualityCommon(stationOprno, sn, lineSn, userCode);
|
|
|
|
|
+ String checkret = ret.substring(3, 5);
|
|
|
|
|
+ if (!"UD".equals(checkret)) {
|
|
|
|
|
+ String lx = ret.substring(0, 3);
|
|
|
|
|
+ return renderResult(Global.FALSE, ErrorMsg.getErrorMsg(checkret, lx));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 向数据库添加数据
|
|
// 向数据库添加数据
|
|
|
MesProductGp12 entry = new MesProductGp12();
|
|
MesProductGp12 entry = new MesProductGp12();
|
|
@@ -208,16 +231,7 @@ public class MesProductGp12Controller extends BaseController {
|
|
|
|
|
|
|
|
FileUploadUtils.saveFileUpload(entry, entry.getId(), "mesProductGp12_image");
|
|
FileUploadUtils.saveFileUpload(entry, entry.getId(), "mesProductGp12_image");
|
|
|
|
|
|
|
|
- // 图片提交成功后,将该工位结果提交为 OK
|
|
|
|
|
- String stationOprno = oprno;
|
|
|
|
|
- if (stationOprno.length() == 5) {
|
|
|
|
|
- stationOprno = stationOprno + "A";
|
|
|
|
|
- }
|
|
|
|
|
- String userCode = "";
|
|
|
|
|
- User user = UserUtils.getUser();
|
|
|
|
|
- if (user != null && StringUtils.isNotBlank(user.getUserCode())) {
|
|
|
|
|
- userCode = user.getUserCode();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 质量校验通过且图片提交成功后,将该工位结果提交为 OK
|
|
|
try {
|
|
try {
|
|
|
List<ParamsResp> params = new ArrayList<>();
|
|
List<ParamsResp> params = new ArrayList<>();
|
|
|
List<BindMaterialResp> bmlists = new ArrayList<>();
|
|
List<BindMaterialResp> bmlists = new ArrayList<>();
|