单据验收人,创建人修改

master
anthonyywj2 3 years ago
parent 4d39ca149e
commit 5a6be7ed07

@ -1,17 +1,26 @@
package com.glxp.sale.admin.controller.auth;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.req.auth.ConnectRequest;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
public class ConnectTestController {
@Resource
CompanyService companyService;
@GetMapping("/udiwms/auth/device/connect")
public BaseResponse index(ConnectRequest connequest) {
return ResultVOUtils.success("连接UDI自助平台成功");
CompanyEntity companyEntity = companyService.findCompany(110L);
return ResultVOUtils.success(companyEntity.getCompanyName());
}

@ -30,6 +30,7 @@ import com.glxp.sale.admin.thread.UdiDlHttpClient;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.DateUtil;
import com.glxp.sale.admin.util.GennerOrderUtils;
import com.glxp.sale.admin.util.UdiInfoUtil;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
@ -145,8 +146,9 @@ public class UdiContrastController {
udiInfoService.deleteByUuid(udiRelevanceEntity.getUuid());
for (UdiInfoEntity udiInfoEntity : udiInfoEntities) {
udiInfoEntity.setUuid(udiRelevanceEntity.getUuid());
}
udiInfoService.insertUdiInfos(udiInfoEntities);
udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities));
// udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid());
udiRelevanceEntity.setUpdateTime(DateUtil.formatDateTime(new Date()));
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
@ -321,6 +323,7 @@ public class UdiContrastController {
udiInfoEntity.setUuid(udiRelevanceEntity.getUuid());
udiInfoEntity.setProductType(ConstantStatus.PRODUCT_TYPE_THIRD);
udiInfoEntity.setDiType(1);
udiInfoEntity = UdiInfoUtil.initUdiInfoEntity(udiInfoEntity);
udiInfoService.insertUdiInfo(udiInfoEntity);
}
@ -382,8 +385,9 @@ public class UdiContrastController {
public void insertUdiInfos(List<UdiInfoEntity> udiInfoEntities) {
if (CollUtil.isNotEmpty(udiInfoEntities)) {
UdiInfoEntity udiInfoEntity = udiInfoService.findByUuid(udiInfoEntities.get(0).getUuid());
if (udiInfoEntity == null) {
udiInfoService.insertUdiInfos(udiInfoEntities);
udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities));
}
}
}

@ -452,16 +452,16 @@ public class WareHouseController {
boolean checkSuccess = true;
String lostMsg = "";
//校验条码完整性
if (!checkUdi.isAllowNoBatch() && StrUtil.isEmpty(udiEntity.getBatchNo())) {
if ("是".equals(checkUdi.getScbssfbhph()) && StrUtil.isEmpty(udiEntity.getBatchNo())) {
checkSuccess = false;
lostMsg = lostMsg + ",批次号";
}
if (!checkUdi.isAllowNoProduct() && StrUtil.isEmpty(udiEntity.getProduceDate())) {
if ("是".equals(checkUdi.getScbssfbhscrq()) && StrUtil.isEmpty(udiEntity.getProduceDate())) {
checkSuccess = false;
lostMsg = lostMsg + ",生产日期";
}
if (!checkUdi.isAllowNoExpire() && StrUtil.isEmpty(udiEntity.getExpireDate())) {
if ("是".equals(checkUdi.getScbssfbhsxrq()) && StrUtil.isEmpty(udiEntity.getExpireDate())) {
checkSuccess = false;
lostMsg = lostMsg + ",失效日期";
}
@ -487,11 +487,12 @@ public class WareHouseController {
}
return ResultVOUtils.success(code);
} else {
if (newCode.startsWith("21")) {
if (newCode.startsWith("21") || (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && newCode.contains("21" + udiEntity.getSerialNo()))) {
if (StrUtil.isEmpty(lostMsg)) {
lostMsg = ",";
}
BaseResponse baseResponse = ResultVOUtils.error(503, "条码完整性错误" + lostMsg.substring(1) + "是否继续添加?");
BaseResponse baseResponse = ResultVOUtils.error(503, "条码完整性错误,缺少" + lostMsg.substring(1) + "是否继续添加?");
baseResponse.setData(code);
return baseResponse;
}
@ -885,13 +886,13 @@ public class WareHouseController {
if (StrUtil.isEmpty(udiEntity.getExpireDate()) && !udiRelevanceResponse.isAllowNoExpire()) {
errMsg = errMsg + ",失效日期";
}
if (StrUtil.isEmpty(udiEntity.getSerialNo()) &&
"是".equals(udiRelevanceResponse.getScbssfbhxlh())) {
errMsg = errMsg + ",序列号";
}
// if (StrUtil.isEmpty(udiEntity.getSerialNo()) &&
// "是".equals(udiRelevanceResponse.getScbssfbhxlh())) {
// errMsg = errMsg + ",序列号";
// }
if (StrUtil.isNotEmpty(errMsg)) {
BaseResponse baseResponse = ResultVOUtils.error(507, "请补齐" + errMsg.substring(1) + "");
BaseResponse baseResponse = ResultVOUtils.error(507, "产品三期缺失请补齐" + errMsg.substring(1) + "");
baseResponse.setData(udiEntity);
return baseResponse;
}

@ -25,6 +25,7 @@ import com.glxp.sale.admin.thread.UdiDlHttpClient;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.DateUtil;
import com.glxp.sale.admin.util.FilterUdiUtils;
import com.glxp.sale.admin.util.UdiInfoUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -191,7 +192,7 @@ public class InoutUtils {
if (udiInfoEntity == null) {
List<UdiInfoEntity> froms = udiDlHttpClient.getUdiByDi(prefix);
if (froms != null && !froms.isEmpty()) {
udiInfoService.insertUdiInfos(froms);
udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(froms));
udiInfoEntity = udiInfoService.findByNameCode(prefix);
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setUuid(udiInfoEntity.getUuid());

@ -1,5 +1,6 @@
package com.glxp.sale.admin.entity.basic;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
@Data
@ -402,4 +403,18 @@ public class UdiInfoEntity {
public void setProductType(Integer productType) {
this.productType = productType;
}
public static UdiInfoEntity initUdiInfoEntity(UdiInfoEntity udiInfoEntity) {
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhph()) && "否".equals(udiInfoEntity.getScbssfbhph())) {
udiInfoEntity.setAllowNoBatch(true);
}
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhscrq()) && "否".equals(udiInfoEntity.getScbssfbhscrq())) {
udiInfoEntity.setAllowNoProduct(true);
}
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhsxrq()) && "否".equals(udiInfoEntity.getScbssfbhsxrq())) {
udiInfoEntity.setAllowNoExpire(true);
}
return udiInfoEntity;
}
}

@ -225,7 +225,7 @@ public class BasicUpdateProductService {
productInfoFilterRequest.setLimit(limit);
List<UdiInfoEntity> udiInfoEntities = getUdiInfoEntity(productInfoFilterRequest);
if (udiInfoEntities != null && udiInfoEntities.size() > 0) {
udiInfoService.insertUdiInfos(udiInfoEntities);
udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities));
for (UdiInfoEntity udiInfoEntity : udiInfoEntities) {
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime());

@ -187,7 +187,7 @@ public class IoTransInoutService {
orderSaveRequest.setOutChangeEnable(postOrder.isOutChangeEnable());
orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId());
if (postOrderRequest.getCustomerId().equals(110)) {
if (postOrderRequest.getCustomerId().equals("110")) {
orderSaveRequest.setCreateUser(postOrderRequest.getUserId());
}
orderSaveRequest.setLocStorageCode(warehouseEntity.getLocStorageCode());
@ -242,7 +242,6 @@ public class IoTransInoutService {
orderEntity.setFromCorp(companyEntity.getCompanyName());
orderEntity.setFromType(ConstantStatus.FROM_UDIMS);
orderEntity.setReceiveStatus(0);
orderEntity.setCreateUser(postUdimsOrderRequest.getUserId());
orderEntity.setMainAction(ConstantType.TYPE_PUT);
orderEntity.setActDate(DateUtil.formatDateTime(new Date()));
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
@ -862,8 +861,10 @@ public class IoTransInoutService {
stockOrderEntity.setCustomerId(orderEntity.getCustomerId());
stockOrderEntity.setUnitIdFk(orderEntity.getFromCorpId());
stockOrderEntity.setSourceType(ConstantStatus.ST_SCAN_ADD);
stockOrderEntity.setCreateUser(orderEntity.getCreateUser());
stockOrderEntity.setReviewUser(orderEntity.getReviewUser());
// if(orderEntity.getCustomerId().equals("110")){
// stockOrderEntity.setCreateUser(orderEntity.getCreateUser());
// stockOrderEntity.setReviewUser(orderEntity.getReviewUser());
// }
stockOrderEntity.setLocStorageCode(orderEntity.getLocStorageCode());
stockOrderEntity.setCorpId(orderEntity.getFromCorpId());
if (bussinessTypeEntity.isSecCheckEnable()) {

@ -50,6 +50,10 @@ public class FilterUdiUtils {
} else {
serialNo = null;
}
}else{
if (last.length() >= 10 && last.substring(8, 10).equals("21")){
serialNo = last.substring(10);
}
}
} else if ((last != null && last.length() >= 2) && last.substring(0, 2).equals("17")) {
expireDate = last.substring(2, 8);
@ -60,6 +64,10 @@ public class FilterUdiUtils {
} else {
serialNo = null;
}
}else {
if (last.length() >= 10 && last.substring(8, 10).equals("21")){
serialNo = last.substring(10);
}
}
} else if ((last != null && last.length() >= 2) && last.substring(0, 2).equals("21")) {
serialNo = last.substring(2, last.length());

@ -0,0 +1,44 @@
package com.glxp.sale.admin.util;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
import java.util.List;
public class UdiInfoUtil {
public static UdiInfoEntity initUdiInfoEntity(UdiInfoEntity udiInfoEntity) {
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhph()) && "否".equals(udiInfoEntity.getScbssfbhph())) {
udiInfoEntity.setAllowNoBatch(true);
}
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhscrq()) && "否".equals(udiInfoEntity.getScbssfbhscrq())) {
udiInfoEntity.setAllowNoProduct(true);
}
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhsxrq()) && "否".equals(udiInfoEntity.getScbssfbhsxrq())) {
udiInfoEntity.setAllowNoExpire(true);
}
return udiInfoEntity;
}
public static List<UdiInfoEntity> initUdiInfoEntitys(List<UdiInfoEntity> udiInfoEntitys) {
if (CollUtil.isNotEmpty(udiInfoEntitys)) {
for (UdiInfoEntity udiInfoEntity : udiInfoEntitys) {
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhph()) && "否".equals(udiInfoEntity.getScbssfbhph())) {
udiInfoEntity.setAllowNoBatch(true);
}
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhscrq()) && "否".equals(udiInfoEntity.getScbssfbhscrq())) {
udiInfoEntity.setAllowNoProduct(true);
}
if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhsxrq()) && "否".equals(udiInfoEntity.getScbssfbhsxrq())) {
udiInfoEntity.setAllowNoExpire(true);
}
}
}
return udiInfoEntitys;
}
}
Loading…
Cancel
Save