|
|
@@ -644,6 +644,53 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
return executeSNBindMaterial(accessKey,requestId,reqData);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @add xiaost 2026-06-04
|
|
|
+ * 校验SN序列号是否绑定完整正确
|
|
|
+ * {
|
|
|
+ * "code": "CHECKSNBIND",
|
|
|
+ * "data": {
|
|
|
+ * "sncode":"W20211230029A1" ,
|
|
|
+ * "prodcode": "01.ER0.60R4J02010A",
|
|
|
+ * "macode":"MA2026052801-1"
|
|
|
+ * }
|
|
|
+ * @param accessKey
|
|
|
+ * @param requestId
|
|
|
+ * @param rawJson
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ApiResult<Map<Object, Object>> checkSNBind(String accessKey, String requestId, String rawJson) {
|
|
|
+ String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
+ SpObserver.putSp(AE_MASTER); //切换数据源
|
|
|
+ //保存传参数据原始JSON串,记录日志
|
|
|
+ savelog("校验SN序列号绑定数据",rawJson,accessKey,requestId);
|
|
|
+ Map<Object, Object> map = BaseUtil.parseFormStoreToMap(rawJson);
|
|
|
+ if(!map.containsKey("data") || !StringUtil.hasText(map.get("data"))){
|
|
|
+ return ApiResponse.failRsp(ErrorMessage.BUSINESS_ILLEGAL.getCode(), requestId, "参数错误sncode不能为空");
|
|
|
+ }
|
|
|
+ Map<Object, Object> map1 = BaseUtil.parseFormStoreToMap(map.get("data").toString());
|
|
|
+ if(!map1.containsKey("sncode") || !StringUtil.hasText(map1.get("sncode"))){
|
|
|
+ return ApiResponse.failRsp(ErrorMessage.BUSINESS_ILLEGAL.getCode(), requestId, "参数错误sncode不能为空");
|
|
|
+ }
|
|
|
+ if(!map1.containsKey("prodcode") || !StringUtil.hasText(map1.get("prodcode"))){
|
|
|
+ return ApiResponse.failRsp(ErrorMessage.BUSINESS_ILLEGAL.getCode(), requestId, "参数错误prodcode不能为空");
|
|
|
+ }
|
|
|
+ if(!map1.containsKey("macode") || !StringUtil.hasText(map1.get("macode"))){
|
|
|
+ return ApiResponse.failRsp(ErrorMessage.BUSINESS_ILLEGAL.getCode(), requestId, "参数错误macode不能为空");
|
|
|
+ }
|
|
|
+ String sncode = map1.get("sncode").toString();
|
|
|
+ String prodcode = map1.get("prodcode").toString();
|
|
|
+ String macode = map1.get("macode").toString();
|
|
|
+ //调用存储过程判断
|
|
|
+ String data = baseDao.callProcedure("SP_SNBIND_CHECK",new Object[] {sncode,prodcode,macode});
|
|
|
+ if(StringUtil.hasText(data)){
|
|
|
+ return ApiResponse.failRsp(ErrorMessage.BUSINESS_ILLEGAL.getCode(), requestId, "校验失败," + data);
|
|
|
+ }else{
|
|
|
+ return ApiResponse.successRsp("0",requestId,"校验成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Transactional
|
|
|
public ApiResult<Map<Object, Object>> executeSNBindMaterial(String accessKey, String requestId, SNBindMaterialRequest reqData) {
|