bug修复

master
anthonyywj2 3 years ago
parent cb57084fee
commit 5736662672

@ -74,6 +74,9 @@ public class LoginController {
authAdmin = authAdminService.findByUser(loginRequest.getUsername(), Constant.SYSTEM_CUSTOMER_ID);
} else {
authAdmin = authAdminService.findByUserName(loginRequest.getUsername());
if (authAdmin == null) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
if (authAdmin.getCustomerId() != 110) {
if (authAdmin.getUserFlag() == 0) {
throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!");
@ -85,7 +88,7 @@ public class LoginController {
if (customerInfoEntity.getUserFlag() == 0) {
throw new JsonException(ResultEnum.DATA_NOT, "该企业账户已被禁用!");
}
}else{
} else {
if (authAdmin.getUserFlag() == 0) {
throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!");
}

@ -151,6 +151,7 @@ public class BasicUnitMaintainController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
basicUnitMaintainFilterRequest.setOutType(ConstantStatus.CORP_SICK_SICK);
List<BasicUnitMaintainEntity> basicUnitMaintainEntities;
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);

@ -118,10 +118,10 @@ public class OrderDetailController {
filterThrOrderRequest.setPage(filterErpOrderRequest.getPage());
filterThrOrderRequest.setLimit(filterErpOrderRequest.getLimit());
if (filterErpOrderRequest.getCustomerId() != null) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterErpOrderRequest.getCustomerId()));
filterThrOrderRequest.setUnitIdFk(companyEntity.getUnitIdFk());
}
// if (filterErpOrderRequest.getCustomerId() != null) {
// CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterErpOrderRequest.getCustomerId()));
// filterThrOrderRequest.setUnitIdFk(companyEntity.getUnitIdFk());
// }
// filterErpOrderRequest.setBillAction(filterErpOrderRequest.getOriginType());
List<ErpOrderResponse> erpOrderResponses = new ArrayList<>();
@ -218,6 +218,9 @@ public class OrderDetailController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String customerId = customerService.getCustomerId() + "";
ThrOrderEntity thrOrderEntity = thrOrderService.findById(String.valueOf(filterErpOrderRequest.getId()));
if (thrOrderEntity == null) {
return ResultVOUtils.error(ResultEnum.DATA_NOT);
@ -228,21 +231,21 @@ public class OrderDetailController {
return ResultVOUtils.error(500, "单据已被选入,请勿重复选入!");
}
StockOrderEntity stockOrderEntity = new StockOrderEntity();
BeanUtils.copyProperties(thrOrderEntity, stockOrderEntity);
String billNo = CustomUtil.getId();
stockOrderEntity.setBillNo(billNo);
BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finAllByAction(thrOrderEntity.getBillType());
BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finByThirdAction(thrOrderEntity.getBillType());
stockOrderEntity.setBillType(bussinessOriginTypeResponse.getLocalAction());
stockOrderEntity.setId(null);
stockOrderEntity.setCustomerId(customerId);
stockOrderEntity.setUnitIdFk(customerId);
stockOrderEntity.setStatus(ConstantStatus.SORDER_ALLOC);//未提交
stockOrderEntity.setThirdOrderFk(thrOrderEntity.getBillNo());
stockOrderEntity.setSourceType(ConstantStatus.ST_THIRD_SEL);//外部提交
stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印
stockOrderEntity.setBilldate(DateUtil.formatDate(new Date()));
boolean b = stockOrderService.insertStockOrder(stockOrderEntity);
stockOrderEntity = stockOrderService.findByBillNo(billNo);
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + "");
@ -252,13 +255,13 @@ public class OrderDetailController {
List<StockOrderDetailEntity> stockOrderDetailEntityList = new ArrayList<>();
for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) {
StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity();
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(thrOrderDetailEntity.getProductId(), thrOrderDetailEntity.getThirdSysFk());
if (udiRelevanceEntity == null) {
return ResultVOUtils.error(500, "单据里含有未维护的产品信息,选入失败!");
}
// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(thrOrderDetailEntity.getProductId(), thrOrderDetailEntity.getThirdSysFk());
//
// if (udiRelevanceEntity == null) {
// return ResultVOUtils.error(500, "单据里含有未维护的产品信息,选入失败!");
// }
BeanUtils.copyProperties(thrOrderDetailEntity, stockOrderDetailEntity);
stockOrderDetailEntity.setProductId(udiRelevanceEntity.getId());
stockOrderDetailEntity.setProductId(thrOrderDetailEntity.getProductId());
stockOrderDetailEntity.setCount(thrOrderDetailEntity.getCount() + "");
stockOrderDetailEntity.setReCount(thrOrderDetailEntity.getReCount() + "");
stockOrderDetailEntity.setOrderIdFk(stockOrderEntity.getId());
@ -267,7 +270,7 @@ public class OrderDetailController {
}
stockOrderDetailService.insertStockOrderDetails(stockOrderDetailEntityList);
}
boolean b = stockOrderService.insertStockOrder(stockOrderEntity);
return ResultVOUtils.success();
}
@ -449,6 +452,7 @@ public class OrderDetailController {
erpOrderEntity.setErpCount(Math.abs(Integer.parseInt(subPurchase.getCount())));
erpOrderEntity.setReCount(Math.abs(Integer.parseInt(subPurchase.getReCount())));
erpOrderEntity.setGoodsunit(subPurchase.getSpec());
erpOrderEntity.setBindRlFk(subPurchase.getRelId());
erpOrderEntities.add(erpOrderEntity);
}
}

@ -228,7 +228,7 @@ public class StockOrderDetailController {
udiInfoService.findByNameCode(udiEntity.getUdi());
if (udiInfoEntity != null) {
StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity();
stockOrderDetailEntity.setProductId(udiInfoEntity.getNameCode());
// stockOrderDetailEntity.setProductId(udiInfoEntity.getNameCode());
stockOrderDetailEntity.setProductName(udiInfoEntity.getCpmctymc());
stockOrderDetailEntity.setSpec(udiInfoEntity.getGgxh());
stockOrderDetailEntity.setBatchNo(udiEntity.getBatchNo());
@ -274,6 +274,7 @@ public class StockOrderDetailController {
CompanyProductRelevanceResponse udiInfoEntity = companyProductRelevanceResponses.get(0);
StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity();
stockOrderDetailEntity.setProductId(udiInfoEntity.getRlId() + "");
stockOrderDetailEntity.setRelId(udiInfoEntity.getRlId() + "");
stockOrderDetailEntity.setProductName(udiInfoEntity.getCpmctymc());
stockOrderDetailEntity.setSpec(udiInfoEntity.getGgxh());
stockOrderDetailEntity.setCount(0 + "");

@ -7,7 +7,9 @@ import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest;
import com.glxp.sale.admin.req.inout.StockOrderFilterRequest;
import com.glxp.sale.admin.res.basic.BussinessOriginTypeResponse;
import com.glxp.sale.admin.res.basic.UdiRelevanceResponse;
import com.glxp.sale.admin.service.basic.BussinessOriginTypeService;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.inout.OrderDetailService;
@ -37,6 +39,9 @@ public class CheckOrderUtils {
@Resource
BussinessTypeService bussinessTypeService;
@Resource
BussinessOriginTypeService bussinessOriginTypeService;
public void check(String orderId, List<ErpOrderEntity> vailOrderEntities) {
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderId);
@ -47,30 +52,9 @@ public class CheckOrderUtils {
for (ErpOrderEntity myErpOrder : myErpOrders) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(myErpOrder.getNameCode());
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(myErpOrder.getBindRlFk());
// List<UdiRelevanceResponse> udiRelevanceEntities = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
// if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 1 && myErpOrder.getBindRlFk() == null) {
// myErpOrder.setBindStatus(ConstantStatus.ORDER_DETAIL_DI_MUTI);
// orderDetailService.updateErpOrder(myErpOrder);
// orderEntity.setRemark("该产品DI绑定多个产品ID请在扫码单据详情绑定对应产品ID");
// orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
// orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
// orderService.updateOrder(orderEntity);
// return;
// } else {
for (ErpOrderEntity vailOrderEntity : vailOrderEntities) {
// UdiRelevanceResponse udiRelevanceResponse = null;
// if (udiRelevanceEntities.size() == 1) {
// udiRelevanceResponse = udiRelevanceEntities.get(0);
// } else {
// for (UdiRelevanceResponse temps : udiRelevanceEntities) {
// if ((temps.getId() + "").equals(myErpOrder.getBindRlFk())) {
// udiRelevanceResponse = temps;
// }
// }
// }
if (checkId(vailOrderEntity, udiRelevanceResponse) == null
if (checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity) == null
&& checkBatchNo(vailOrderEntity, myErpOrder) == null
&& checkProductDate(vailOrderEntity, myErpOrder) == null
&& checkExpireDate(vailOrderEntity, myErpOrder) == null
@ -91,7 +75,7 @@ public class CheckOrderUtils {
} else {
errMsg = checkBatchNo(vailOrderEntity, myErpOrder);
if (errMsg == null) {
errMsg = checkId(vailOrderEntity, udiRelevanceResponse);
errMsg = checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity);
if (errMsg == null) {
errMsg = checkProductDate(vailOrderEntity, myErpOrder);
if (errMsg == null) {
@ -232,13 +216,34 @@ public class CheckOrderUtils {
return true;
}
public String checkId(ErpOrderEntity vailOrderEntity, UdiRelevanceResponse udiRelevanceResponse) {
public String checkId(ErpOrderEntity vailOrderEntity, UdiRelevanceResponse udiRelevanceResponse, BussinessTypeEntity bussinessTypeEntity) {
if (vailOrderEntity.getGoodsid() != null && udiRelevanceResponse != null) {
if (vailOrderEntity.getBindRlFk() != null) {
if (vailOrderEntity.getBindRlFk().equals(udiRelevanceResponse.getId() + ""))
return null;
} else if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getId() + ""))
return null;
} else { //如果未绑定关联ID则对比产品ID
BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finByMainAction(bussinessTypeEntity.getAction());
if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId")) {
if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId() + ""))
return null;
} else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId1")) {
if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId1() + ""))
return null;
} else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId2")) {
if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId2() + ""))
return null;
} else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId3")) {
if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId3() + ""))
return null;
} else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId4")) {
if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId4() + ""))
return null;
}
return "产品ID不匹配";
}
} else {
return "产品ID不匹配";
}

@ -264,16 +264,6 @@ public class InoutUtils {
}
}
// public int getActCount(UdiInfoEntity udiInfoBean) {
// if (udiInfoBean != null) {
// if (udiInfoBean.getZxxsbzbhsydysl() > 1) {
// return udiInfoBean.getZxxsbzbhsydysl() * udiInfoBean.getBhzxxsbzsl();
// } else {
// return udiInfoBean.getBhzxxsbzsl();
// }
// }
// return 1;
// }
public int getActCount(WarehouseEntity warehouseEntity, UdiRelevanceService udiRelevanceService) {
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());

@ -77,10 +77,15 @@ public class InvProductsController {
@GetMapping("spms/inv/products/filter")
public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
boolean showSup = false;
if (SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
String customerId = customerService.getCustomerId() + "";
if (StrUtil.isNotEmpty(filterInvProductRequest.getUdiCode())) {
filterInvProductRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvProductRequest.getUdiCode()));
}
if (SYSTEM_CUSTOMER_ID.equals(customerId)) {
filterInvProductRequest.setCustomerId(null);
showSup = true;
if (StrUtil.isEmpty(filterInvProductRequest.getInvStorageCode() )) {
if (StrUtil.isEmpty(filterInvProductRequest.getInvStorageCode())) {
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.selectCodeByUser(customerService.getUserId() + "");
if (!warehouseUserEntities.isEmpty()) {
List<String> invCodes = new ArrayList<>();
@ -93,7 +98,7 @@ public class InvProductsController {
}
} else {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId()));
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(customerId));
filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
filterInvProductRequest.setInvStorageCode(invWarehouseEntity.getCode());
@ -259,15 +264,15 @@ public class InvProductsController {
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterCodeTraceRequest.getCode());
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
List<UdiInfoEntity> udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid());
String code = null;
if (udiInfoEntities != null && udiInfoEntities.size() > 1) {
code = FilterUdiUtils.transGlxpNoSerStr(udiEntity);
} else {
code = filterCodeTraceRequest.getCode();
}
// String code = null;
// if (udiInfoEntities != null && udiInfoEntities.size() > 1) {
// code = FilterUdiUtils.transGlxpNoSerStr(udiEntity);
// } else {
// code = filterCodeTraceRequest.getCode();
// }
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setCode(code);
filterInvProductDetailRequest.setCode(filterCodeTraceRequest.getCode());
filterInvProductDetailRequest.setSupId(filterCodeTraceRequest.getSupId());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
if (invProductDetailEntities.size() > 0) {

@ -21,4 +21,6 @@ public class BussinessLocalTypeEntity {
private int corpType;
private String defaultUnit;
private boolean genUnit;
private String thirdAction;
private String thirdSys;
}

@ -44,5 +44,7 @@ public class BussinessTypeEntity {
//补单类型
private String supplementOrderType;
private String thirdAction;
private String thirdSys;
}

@ -21,6 +21,7 @@ public class StockOrderDetailEntity {
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
private BigDecimal price;
private String relId;
//销售清单号(第二票)
private String secSalesListNo;

@ -10,4 +10,7 @@ public class BussinessOriginTypeFilterRequest extends ListPageRequest {
private String thirdSys;
private String thirdSysName;
private Boolean enable;
private String thirdAction;
private String mainAction;
private String localAction;
}

@ -36,4 +36,5 @@ public class FilterInvProductRequest extends ListPageRequest {
private String groupType;
private List<String> invCodes;
private String udiCode;
}

@ -18,4 +18,7 @@ public class BasicUnitMaintainResponse {
private String mobile;
private String thirdName;
private String unitId;
private int corpType;
private int outType;
}

@ -8,4 +8,5 @@ public class BussinessOriginTypeResponse {
private String action;
private String localAction;
private String thirdAction;
private String thirdSys;
}

@ -231,6 +231,15 @@ public class ErpOrderResponse {
private String detailId; //明细ID
private String corpName; //往来单位
private BigDecimal price; //单价
private String relId;
public String getRelId() {
return relId;
}
public void setRelId(String relId) {
this.relId = relId;
}
public String getDetailId() {
return detailId;

@ -16,7 +16,11 @@ public interface BussinessOriginTypeService {
List<BussinessOriginTypeEntity> filterEnableList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest);
BussinessOriginTypeResponse finAllByAction(String action);
BussinessOriginTypeResponse finByThirdAction(String action);
BussinessOriginTypeResponse finByLocalAction(String action);
BussinessOriginTypeResponse finByMainAction(String action);
BasicThirdSysDetailEntity findSysByAction(String action, String key);

@ -39,9 +39,31 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic
}
@Override
public BussinessOriginTypeResponse finAllByAction(String action) {
public BussinessOriginTypeResponse finByThirdAction(String action) {
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
bussinessOriginTypeFilterRequest.setAction(action);
bussinessOriginTypeFilterRequest.setThirdAction(action);
List<BussinessOriginTypeResponse> bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest);
if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) {
return bussinessOriginTypeEntities.get(0);
}
return null;
}
@Override
public BussinessOriginTypeResponse finByLocalAction(String action) {
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
bussinessOriginTypeFilterRequest.setThirdAction(action);
List<BussinessOriginTypeResponse> bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest);
if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) {
return bussinessOriginTypeEntities.get(0);
}
return null;
}
@Override
public BussinessOriginTypeResponse finByMainAction(String action) {
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
bussinessOriginTypeFilterRequest.setMainAction(action);
List<BussinessOriginTypeResponse> bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest);
if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) {
return bussinessOriginTypeEntities.get(0);

@ -106,8 +106,6 @@ public class IoTransInoutService {
@Resource
private CheckOrderUtils checkOrderUtils;
@Resource
InvProductDetailService invProductDetailService;
@Resource
InvProductService invProductService;
@Resource
InvPreProductService invPreProductService;
@ -428,14 +426,6 @@ public class IoTransInoutService {
orderService.updateRemark(orderEntity.getId(), "udi码" + warehouseEntity.getCode() + "该产品不允许以使用单元入库!");
return;
}
// if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
// CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findByUdiRlIdUnitFk(udiRelevanceResponse.getId() + "", warehouseEntity.getFromCorpId());
// if (companyProductRelevanceEntity == null) {
// orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL);
// orderService.updateRemark(orderEntity.getId(), udiRelevanceResponse.getCpmctymc() + "该产品非此供应商配送");
// return;
// }
// }
}
}
@ -702,145 +692,6 @@ public class IoTransInoutService {
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, warehouseEntityList);
}
public void checkMutiDi(String orderId, BussinessTypeEntity bussinessTypeEntity) {
//校验是否di绑定多个产品ID
OrderEntity orderEntity = orderService.findById(orderId);
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderId);
List<ErpOrderEntity> erpOrderEntities = myErpOrderService.filterAllMyErpOrder(filterErpOrderRequest);
int checkStatus = ConstantStatus.ORDER_STATUS_CHECK;
if (erpOrderEntities != null && erpOrderEntities.size() > 0) {
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
//校验DI是否绑定多个产品ID
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(erpOrderEntity.getNameCode());
List<UdiRelevanceResponse> udiRelevanceEntities = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 1 && erpOrderEntity.getBindRlFk() == null) {
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_DI_MUTI);
myErpOrderService.updateErpOrder(erpOrderEntity);
orderEntity.setRemark("该产品维护多个产品信息,请在扫码单据详情绑定对应产品产品信息");
checkStatus = ConstantStatus.ORDER_CHECK_FAIL;
} else {
if ((erpOrderEntity.getSupId() == null || erpOrderEntity.getSupId().equals("MUTI"))) {
if (erpOrderEntity.getSupId() == null) {
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_NONE);
orderEntity.setRemark("该产品未指定供应商");
} else {
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_MUTI);
orderEntity.setRemark("该产品指定多个供应商");
}
checkStatus = ConstantStatus.ORDER_CHECK_FAIL;
} else {
CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findByUdiRlIdUnitFk(erpOrderEntity.getBindRlFk(), erpOrderEntity.getSupId());
if (companyProductRelevanceEntity == null) {
orderEntity.setRemark(erpOrderEntity.getCoName() + "该产品非此供应商配送");
checkStatus = ConstantStatus.ORDER_CHECK_FAIL;
} else {
orderEntity.setContrastStatus(checkStatus);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
orderService.updateOrder(orderEntity);
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_ONE);
}
}
}
myErpOrderService.updateErpOrder(erpOrderEntity);
}
orderEntity.setContrastStatus(checkStatus);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderService.updateOrder(orderEntity);
}
}
public void updateSuccess(OrderEntity orderEntity, int checkStatus, int status, String remark) {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
orderService.updateOrder(orderEntity);
}
// //校验ERP单
@Async
public void checkOrder() {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
List<OrderEntity> orderEntities = orderService.findAllOrders(orderFilterRequest);
for (int i = 0; i < orderEntities.size(); i++) {
OrderEntity orderEntity = orderEntities.get(i);
checkOrder(orderEntity);
}
}
@Async
public void repeatPrint(OrderEntity orderEntity) {
syncprintOrder(orderEntity.getId());
invProductsTrService.genInvProducts(orderEntity.getId());
}
public void checkOrder(OrderEntity orderEntity) {
orderEntity = orderService.findById(orderEntity.getId());
List<String> erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk());
List<WarehouseEntity> transData = warehouseService.findByReceiptId(orderEntity.getId());
myErpOrderService.deleteByOrderId(orderEntity.getId());
genOrderDetail(transData);
if (erpIds != null && erpIds.size() > 0) {
List<ErpOrderEntity> erpOrderEntities = thrDataService.getStockOrders(erpIds);
checkOrderUtils.check(orderEntity.getId(), erpOrderEntities);
} else {
// orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
// orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
// orderEntity.setRemark("未选入第三方出入库单据进行校验,请手动选择");
// orderService.updateOrder(orderEntity);
// myErpOrderService.deleteByOrderId(orderEntity.getId());
// new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData);
// printOrder(orderEntity.getId());
// if (orderEntity.getCustomerId().equals(Constant.SYSTEM_CUSTOMER_ID)) {
// invProductsTrService.genInvProducts(orderEntity.getId());
// }
}
}
public void checkThirdOrder(List<ErpOrderEntity> cloudErps, OrderEntity orderEntity, List<WarehouseEntity> transData) {
if (cloudErps != null && cloudErps.size() > 0) {
List<ErpOrderEntity> returnOrders = new ContrastErpUtil().transErp(cloudErps, udiRelevanceService, orderEntity.getId());
ErpOrderEntity temp = returnOrders.get(0);
for (int i = 0; i < returnOrders.size(); i++) {
if (!temp.getCompanyname().equals(returnOrders.get(i).getCompanyname())) {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderEntity.setRemark("选择Erp订单往来单位不一致");
orderService.updateOrder(orderEntity);
return;
}
}
myErpOrderService.deleteByOrderId(orderEntity.getId());
myErpOrderService.insertErpOrders(returnOrders);
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
new ContrastErpUtil(udiUrl).contrastErp(udiInfoService, udiRelevanceService, myErpOrderService,
orderService, transData, systemParamConfigService, bussinessTypeEntity);
} else {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderEntity.setRemark("获取ERP出入库单据失败");
orderService.updateOrder(orderEntity);
myErpOrderService.deleteByOrderId(orderEntity.getId());
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData);
}
}
//重码校验错误重新提交
@Async
@ -852,13 +703,6 @@ public class IoTransInoutService {
}
}
//重新校验
@Async
public void repeatCheck(String orderId) {
OrderEntity orderEntity = orderService.findById(orderId);
checkOrder(orderEntity);
WebSocketServer.sendInfo("单据:" + orderId + "校验已完成,请刷新查看!", null);
}
//校验ERP单后订单详情转入等待打印
@Async
@ -886,6 +730,7 @@ public class IoTransInoutService {
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity();
stockOrderDetailEntity.setProductId(erpOrderEntity.getGoodsid());
stockOrderDetailEntity.setRelId(erpOrderEntity.getGoodsid());
stockOrderDetailEntity.setProductName(erpOrderEntity.getGoodsname());
if (erpOrderEntity.getGoodsid() == null)
@ -910,27 +755,6 @@ public class IoTransInoutService {
if (erpOrderEntity.getErpCount() != null) {
stockOrderDetailEntity.setCount(erpOrderEntity.getErpCount() + "");
}
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// filterUdiInfoRequest.setNameCode(erpOrderEntity.getNameCode());
// List<UdiRelevanceResponse> udiRelevanceEntities = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
// if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 1 && erpOrderEntity.getBindRlFk() == null) {
// isError = true;
// erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_DI_MUTI);
// myErpOrderService.updateErpOrder(erpOrderEntity);
// } else if (udiRelevanceEntities.size() == 1) {
// UdiRelevanceResponse udiRelevanceEntity = udiRelevanceEntities.get(0);
// setThridName(bussinessTypeEntity, stockOrderDetailEntity, udiRelevanceEntity);
//
// } else if (erpOrderEntity.getBindRlFk() != null) {
// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(erpOrderEntity.getBindRlFk());
// UdiRelevanceResponse udiRelevanceResponse = new UdiRelevanceResponse();
// BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceResponse);
// udiRelevanceResponse.setId(Integer.parseInt(udiRelevanceEntity.getId()));
// setThridName(bussinessTypeEntity, stockOrderDetailEntity, udiRelevanceResponse);
// erpOrderEntity.setGoodsid(stockOrderDetailEntity.getProductId());
// erpOrderEntity.setGoodsname(stockOrderDetailEntity.getProductName());
// myErpOrderService.updateErpOrder(erpOrderEntity);
// }
stockOrderDetailEntities.add(stockOrderDetailEntity);
}
@ -1024,29 +848,6 @@ public class IoTransInoutService {
return stockOrderEntity;
}
public void setThridName(BussinessTypeEntity bussinessTypeEntity, StockOrderDetailEntity stockOrderDetailEntity, UdiRelevanceResponse udiRelevanceEntity) {
if (bussinessTypeEntity.getThirdSysFk() == null) {
stockOrderDetailEntity.setProductId(udiRelevanceEntity.getId() + "");
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId")) {
stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId());
stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName());
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId1")) {
stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId1());
stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName1());
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId2")) {
stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId2());
stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName2());
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId3")) {
stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId3());
stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName3());
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId4")) {
stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId4());
stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName4());
}
}
}

@ -59,12 +59,13 @@
basic_bussiness_type.name ,
basic_bussiness_type.action,basic_bussiness_type.checkEnable,basic_bustype_local.advanceType,basic_bustype_local.changeEnable,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction,
basic_bussiness_type.defaultUnit,basic_bussiness_type.genUnit
basic_bussiness_type.defaultUnit,basic_bussiness_type.genUnit,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys
FROM basic_bustype_local
inner join basic_bussiness_type on basic_bustype_local.action = basic_bussiness_type.localAction
INNER JOIN inv_warehouse_bussiness_type on basic_bussiness_type.action = inv_warehouse_bussiness_type.action
INNER JOIN inv_warehouse on inv_warehouse_bussiness_type.`code` = inv_warehouse.`code`
INNER JOIN inv_warehouse_user on inv_warehouse.`code` =inv_warehouse_user.`code`
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action
<where>
<if test="name != ''and name != null">
AND basic_bustype_local.name LIKE concat('%',#{name},'%')

@ -23,20 +23,27 @@
select basic_bustype_origin.name,
basic_bustype_origin.action thirdAction,
basic_bussiness_type.action,
basic_bustype_local.action localAction,
basic_bustype_local.action localAction,basic_bustype_origin.thirdSys
from basic_bustype_origin
LEFT JOIN basic_bussiness_type on basic_bussiness_type.thirdAction = basic_bustype_origin.action
LEFT JOIN basic_bustype_local on basic_bustype_local.originAction = basic_bustype_origin.action
LEFT JOIN basic_bussiness_type on basic_bussiness_type.localAction = basic_bustype_local.action
<where>
<if test="name != ''and name != null">
AND basic_bustype_origin.name LIKE concat(#{name},'%')
</if>
<if test="thirdAction != ''and thirdAction != null">
AND basic_bustype_origin.action = #{thirdAction}
</if>
<if test="mainAction != ''and mainAction != null">
AND basic_bussiness_type.action = #{mainAction}
</if>
<if test="localAction != ''and localAction != null">
AND basic_bustype_local.action = #{localAction}
</if>
<if test="action != ''and action != null">
AND basic_bustype_origin.action LIKE concat(#{action},'%')
AND basic_bustype_origin.action = #{thirdAction}
</if>
</where>
GROUP BY basic_bustype_origin.action;
</select>

@ -16,9 +16,10 @@
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,
basic_bussiness_type.secCheckBalacne, defaultUnit
basic_bussiness_type.secCheckBalacne, defaultUnit,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys
FROM basic_bussiness_type LEFT JOIN basic_bustype_local
on basic_bussiness_type.localAction = basic_bustype_local.action
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action
<where>
<if test="name != ''and name != null">
AND basic_bussiness_type.name LIKE concat('%',#{name},'%')
@ -39,7 +40,7 @@
AND basic_bustype_local.spUse =#{spUse}
</if>
</where>
GROUP BY basic_bussiness_type.id
</select>
<select id="filterJoinList" parameterType="com.glxp.sale.admin.req.basic.BussinessTypeFilterRequest"
resultType="com.glxp.sale.admin.res.basic.BussinessTypResponse">
@ -92,9 +93,10 @@
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,defaultUnit,
basic_bussiness_type.secCheckBalacne
basic_bussiness_type.secCheckBalacne,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys
FROM basic_bussiness_type LEFT JOIN basic_bustype_local
on basic_bussiness_type.localAction = basic_bustype_local.action
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action
INNER JOIN inv_warehouse_bussiness_type on basic_bussiness_type.action = inv_warehouse_bussiness_type.action
INNER JOIN inv_warehouse on inv_warehouse_bussiness_type.`code` = inv_warehouse.`code`
INNER JOIN inv_warehouse_user on inv_warehouse.`code` =inv_warehouse_user.`code`

@ -32,7 +32,7 @@
stock_order_detail.id,stock_order_detail.orderIdFk,stock_order_detail.productId,
basic_products.cpmctymc,basic_products.ggxh,
stock_order_detail.batchNo,stock_order_detail.expireDate,stock_order_detail.productDate,
stock_order_detail.count,stock_order_detail.reCount,stock_order_detail.sweepCount,
stock_order_detail.count,stock_order_detail.reCount,stock_order_detail.sweepCount,stock_order_detail.relId,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,stock_order_detail.price
from stock_order_detail
right JOIN basic_products
@ -62,7 +62,7 @@
replace
INTO stock_order_detail(id,
orderIdFk,productId,productName,spec,batchNo,productDate,
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price)
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId)
values(
#{id},
#{orderIdFk},
@ -76,14 +76,14 @@
#{reCount},
#{sweepCount},
#{ylqxzcrbarmc},
#{zczbhhzbapzbh},#{price}
#{zczbhhzbapzbh},#{price},#{relId}
)
</insert>
<insert id="insertStockOrderDetails" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.StockOrderDetailEntity">
replace INTO stock_order_detail(id,
orderIdFk,productId,productName,spec,batchNo,productDate,
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price)
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId)
values
<foreach collection="stockOrderDetailEntities" item="item" index="index"
separator=",">
@ -100,7 +100,7 @@
#{item.reCount},
#{item.sweepCount},
#{item.ylqxzcrbarmc},
#{item.zczbhhzbapzbh},#{item.price}
#{item.zczbhhzbapzbh},#{item.price},#{item.relId}
)
</foreach>
@ -120,6 +120,8 @@
<if test="firstSalesInvNo != null">firstSalesInvNo=#{firstSalesInvNo},</if>
<if test="secSalesInvNo != null">secSalesInvNo=#{secSalesInvNo},</if>
<if test="invoiceDate != null">invoiceDate=#{invoiceDate},</if>
<if test="relId != null">relId=#{relId},</if>
</set>
WHERE id = #{id}
</update>

@ -18,7 +18,7 @@
AND a.code = #{code}
</if>
<if test="name != '' and name != null">
AND a.name = #{name}
AND a.name like concat('%',#{name},'%')
</if>
<if test="advanceType != null">
AND a.advanceType = #{advanceType}

Loading…
Cancel
Save