优化
This commit is contained in:
@@ -93,7 +93,6 @@ public class AcceptMarkServiceImpl implements AcceptMarkService {
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
||||
Long deptId = currentUser.getDeptId();
|
||||
|
||||
WQLObject mstTab = WQLObject.getWQLObject("QL_TEST_AcceptMark");
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("QL_TEST_AcceptMarkBOM");
|
||||
@@ -106,9 +105,9 @@ public class AcceptMarkServiceImpl implements AcceptMarkService {
|
||||
jsonMst.put("mark_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonMst.put("is_delete", "0");
|
||||
jsonMst.put("remark", (String) whereJson.get("remark"));
|
||||
JSONObject jonow = mstTab.query("is_delete='0' and mark_code='" + jsonMst.getString("mark_code") + "'").uniqueResult(0);
|
||||
JSONObject jonow = mstTab.query("is_delete='0' and material_id='" + jsonMst.getString("material_id") + "'").uniqueResult(0);
|
||||
if (jonow != null) {
|
||||
throw new BadRequestException("该牌号已存在!");
|
||||
throw new BadRequestException("该碳化钨已存在!");
|
||||
}
|
||||
jsonMst.put("create_id", currentUserId);
|
||||
jsonMst.put("create_name", nickName);
|
||||
@@ -149,12 +148,12 @@ public class AcceptMarkServiceImpl implements AcceptMarkService {
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
whereJson.remove("tableData");
|
||||
jsonMst = (JSONObject) JSON.toJSON(whereJson);
|
||||
String mark_code = jsonMst.getString("mark_code");
|
||||
String material_id = jsonMst.getString("material_id");
|
||||
String mark_id = jsonMst.getString("mark_id");
|
||||
|
||||
JSONObject oldJO = mstTab.query("mark_id <> '" + mark_id + "' and mark_code='"+mark_code+"'").uniqueResult(0);
|
||||
JSONObject oldJO = mstTab.query("mark_id <> '" + mark_id + "' and material_id='"+material_id+"'").uniqueResult(0);
|
||||
if(oldJO !=null){
|
||||
throw new BadRequestException("已存在相同牌号!");
|
||||
throw new BadRequestException("已存在相同碳化钨!");
|
||||
}
|
||||
JSONObject now = mstTab.query("mark_id = '" + mark_id + "'").uniqueResult(0);
|
||||
//主表
|
||||
|
||||
Reference in New Issue
Block a user