业务单据,扫码单据修改

master
anthonywj 3 years ago
parent 58fad87448
commit ec9daf6d9d

@ -247,6 +247,7 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
@ -274,6 +275,7 @@
</plugin>
</plugins>
</build>

@ -23,4 +23,14 @@ public class ConstantStatus {
public static final Integer ORDER_SIGN_UN = 0; //未签字
public static final Integer ORDER_SIGN_ED = 1; //已签字
public static final Integer ORDER_SIGN_FAIL = 2; //签字失败
//业务单据状态
public static String SORDER_DRAFT = "1";//草稿
public static String SORDER_ALLOC = "2";//未配货
public static String SORDER_CHECK = "3";//待校验
public static String SORDER_PRINT_UN = "101";//101未打印102已打印
public static String SORDER_PRINT_ED = "102";//
}

@ -198,22 +198,22 @@ public class RegisterController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
log.info(httpSession.getId());
JSONObject userCode = (JSONObject) httpSession.getAttribute("code");
if (userCode == null) {
return ResultVOUtils.error(500, "验证码已失效,请重新获取");
}
long lastTime = userCode.getLong("createTime");
int checkCode = (Integer) userCode.get("code");
String phoneNum = userCode.getString("memPhone");
if ((System.currentTimeMillis() - lastTime) > 1000 * 60 * 5) {
return ResultVOUtils.error(500, "验证码已过期,请重新获取");
}
if (checkCode != userRegisterEntity.getCheckCode()) {
return ResultVOUtils.error(500, "验证码错误,请重新获取");
}
if (!phoneNum.equals(userRegisterEntity.getMobile())) {
return ResultVOUtils.error(500, "手机号与获取验证码不一致");
}
// JSONObject userCode = (JSONObject) httpSession.getAttribute("code");
// if (userCode == null) {
// return ResultVOUtils.error(500, "验证码已失效,请重新获取");
// }
// long lastTime = userCode.getLong("createTime");
// int checkCode = (Integer) userCode.get("code");
// String phoneNum = userCode.getString("memPhone");
// if ((System.currentTimeMillis() - lastTime) > 1000 * 60 * 5) {
// return ResultVOUtils.error(500, "验证码已过期,请重新获取");
// }
// if (checkCode != userRegisterEntity.getCheckCode()) {
// return ResultVOUtils.error(500, "验证码错误,请重新获取");
// }
// if (!phoneNum.equals(userRegisterEntity.getMobile())) {
// return ResultVOUtils.error(500, "手机号与获取验证码不一致");
// }
boolean isExitPhone = userRegisterService.isExit(userRegisterEntity.getMobile());
if (isExitPhone) {
return ResultVOUtils.error(500, "该手机号已被注册");
@ -295,6 +295,7 @@ public class RegisterController {
if (StringUtils.isNotBlank(registerCheckRequest.getCompanyName())) {
UserRegisterEntity userRegisterEntity = new UserRegisterEntity();
userRegisterEntity.setId(registerCheckRequest.getId());
userRegisterEntity.setCompanyId(registerCheckRequest.getCompanyId());
userRegisterEntity.setCompanyName(registerCheckRequest.getCompanyName());
userRegisterService.updateUserRegister(userRegisterEntity);
}
@ -364,10 +365,12 @@ public class RegisterController {
companyEntity.setMobile(userRegisterEntity.getMobile());
companyEntity.setTel(userRegisterEntity.getTel());
companyEntity.setCompanyName(userRegisterEntity.getCompanyName());
companyEntity.setUnitIdFk(userRegisterEntity.getCompanyId());
companyEntity.setClasses(userRegisterEntity.getBussinessStatus() + "");
companyEntity.setBussinessStatus(userRegisterEntity.getBussinessStatus());
companyEntity.setCreditNum(userRegisterEntity.getCreditNum());
FilterAliCertRequest filterAliCertRequest = new FilterAliCertRequest();
filterAliCertRequest.setId(registerCheckRequest.getAliCertId());

@ -0,0 +1,93 @@
package com.glxp.sale.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest;
import com.glxp.sale.admin.req.info.DeleteRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.service.basic.BussinessLocalTypeService;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class BussinessLocalTypeController {
@Resource
private BussinessLocalTypeService bussinessTypeService;
@GetMapping("/udiwms/localBusType/filterJoin")
public BaseResponse filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BussinessLocalTypeEntity> bussinessTypeEntities;
bussinessTypeEntities = bussinessTypeService.filterJoin(
bussinessTypeFilterRequest);
PageInfo<BussinessLocalTypeEntity> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities);
PageSimpleResponse<BussinessLocalTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/localBusType/filter")
public BaseResponse filterBussinessType(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BussinessLocalTypeEntity> bussinessTypeEntities;
bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest);
PageInfo<BussinessLocalTypeEntity> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities);
PageSimpleResponse<BussinessLocalTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/udiwms/localBusType/delete")
public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
bussinessTypeService.deleteById(id);
return ResultVOUtils.success("删除成功");
}
@PostMapping("/udiwms/localBusType/update")
public BaseResponse updateBussinessType(@RequestBody BussinessLocalTypeEntity bussinessTypeEntity,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessTypeService.updateBusLocalType(bussinessTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");
}
return ResultVOUtils.success("更新成功");
}
}

@ -2,13 +2,15 @@ package com.glxp.sale.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.req.inout.DeleteRequest;
import com.glxp.sale.admin.req.basic.BussinessTypeFilterRequest;
import com.glxp.sale.admin.req.info.DeleteRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.BussinessTypResponse;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
*
@ -47,6 +50,25 @@ public class BussinessTypeController {
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/bussinessType/joinFilter")
public BaseResponse filterJoinBussinessType(BussinessTypeFilterRequest bussinessTypeFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BussinessTypResponse> bussinessTypeEntities;
bussinessTypeEntities = bussinessTypeService.filterJoinList(bussinessTypeFilterRequest);
PageInfo<BussinessTypResponse> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities);
PageSimpleResponse<BussinessTypResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/udiwms/bussinessType/delete")
public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {

@ -295,20 +295,20 @@ public class CorpImportLogController {
}
if (basicThirdSysEntity != null) {
if ("thirdId".equals(basicThirdSysEntity.getThirdId())) {
corpImportDetailEntity.setThirdId(corpImportDetailEntity.getErpId());
corpImportDetailEntity.setThirdName(corpImportDetailEntity.getName());
corpImportDetailEntity.setThirdId(corpImportDetailEntity.getThirdId());
corpImportDetailEntity.setThirdName(corpImportDetailEntity.getThirdName());
} else if ("thirdId1".equals(basicThirdSysEntity.getThirdId())) {
corpImportDetailEntity.setThirdId1(corpImportDetailEntity.getErpId());
corpImportDetailEntity.setThirdName1(corpImportDetailEntity.getName());
corpImportDetailEntity.setThirdId1(corpImportDetailEntity.getThirdId1());
corpImportDetailEntity.setThirdName1(corpImportDetailEntity.getThirdName1());
} else if ("thirdId2".equals(basicThirdSysEntity.getThirdId())) {
corpImportDetailEntity.setThirdId2(corpImportDetailEntity.getErpId());
corpImportDetailEntity.setThirdName2(corpImportDetailEntity.getName());
corpImportDetailEntity.setThirdId2(corpImportDetailEntity.getThirdId2());
corpImportDetailEntity.setThirdName2(corpImportDetailEntity.getThirdName2());
} else if ("thirdId3".equals(basicThirdSysEntity.getThirdId())) {
corpImportDetailEntity.setThirdId3(corpImportDetailEntity.getErpId());
corpImportDetailEntity.setThirdName3(corpImportDetailEntity.getName());
corpImportDetailEntity.setThirdId3(corpImportDetailEntity.getThirdId3());
corpImportDetailEntity.setThirdName3(corpImportDetailEntity.getThirdName3());
} else if ("thirdId4".equals(basicThirdSysEntity.getThirdId())) {
corpImportDetailEntity.setThirdId4(corpImportDetailEntity.getErpId());
corpImportDetailEntity.setThirdName4(corpImportDetailEntity.getName());
corpImportDetailEntity.setThirdId4(corpImportDetailEntity.getThirdId4());
corpImportDetailEntity.setThirdName4(corpImportDetailEntity.getThirdName4());
}
} else {
corpImportDetailEntity.setThirdId(corpImportDetailEntity.getErpId());

@ -136,7 +136,8 @@ public class UdiRelevanceController {
if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0) {
for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceResponse.getId() + "");
CompanyProductRelevanceEntity companyProductRelevanceEntity =
companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceResponse.getId() + "", filterUdiInfoRequest.getCustomerId());
if (companyProductRelevanceEntity != null) {
udiRelevanceResponse.setIsSelect(true);
} else {

@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil;
import com.glxp.sale.admin.controller.inout.utils.InoutUtils;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.FilterErpOrderRequest;
@ -14,6 +15,7 @@ import com.glxp.sale.admin.httpclient.ErpOrderClient;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.req.param.SystemParamConfigRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
@ -51,7 +53,8 @@ public class OrderController {
private UdiRelevanceService udiRelevanceService;
@Resource
private SystemParamConfigService systemParamConfigService;
@Resource
private BussinessTypeService bussinessTypeService;
@Value("${UCLOD_SERVER_URL}")
private String ucloudUrl;
@ -63,14 +66,28 @@ public class OrderController {
return ResultVOUtils.success(udiEntity);
}
@GetMapping("udiwms/inout/order/status")
public BaseResponse listOrderByStatus(OrderFilterRequest orderFilterRequest) {
List<OrderEntity> orderEntityList = orderService.filterList(orderFilterRequest);
PageInfo<OrderEntity> pageInfo;
pageInfo = new PageInfo<>(orderEntityList);
PageSimpleResponse<OrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(orderEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("udiwms/inout/order/error")
public BaseResponse listOrderError(OrderFilterRequest orderFilterRequest) {
// orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
// orderFilterRequest.setStatusOrOne(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
if (StringUtils.isBlank(orderFilterRequest.getCustomerId())) return ResultVOUtils.success();
if (orderFilterRequest.getCustomerId().equals("110")) orderFilterRequest.setCustomerId(null);
List<OrderEntity> orderEntityList = orderService.filterListOr(orderFilterRequest);
// List<OrderEntity> orderEntityList = orderService.filterList(orderFilterRequest);
if (StringUtils.isBlank(orderFilterRequest.getCustomerId()))
return ResultVOUtils.success();
if (orderFilterRequest.getCustomerId().equals("110"))
orderFilterRequest.setCustomerId(null);
// List<OrderEntity> orderEntityList = orderService.filterListOr(orderFilterRequest);
List<OrderEntity> orderEntityList = orderService.filterList(orderFilterRequest);
PageInfo<OrderEntity> pageInfo;
pageInfo = new PageInfo<>(orderEntityList);
PageSimpleResponse<OrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
@ -213,6 +230,7 @@ public class OrderController {
orderService.deleteByOrderId(orderList.get(i));
}
OrderEntity mainOrderEntity = orderService.findById(mainOrder);
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(mainOrderEntity.getAction());
List<String> docids = getDocids(mergeList);
String docidStr = "";
if (docids != null && docids.size() > 0) {
@ -228,7 +246,8 @@ public class OrderController {
List<ErpOrderEntity> returnOrders = new ContrastErpUtil().transErp(erpOrderEntities, udiRelevanceService, mainOrder);
orderDetailService.insertErpOrders(returnOrders);
List<WarehouseEntity> warehouseEntityList = codesService.findByReceiptId(mainOrder);
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList, systemParamConfigService);
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList,
systemParamConfigService,bussinessTypeEntity);
} else {
orderService.updateContrastStatus(mainOrder, "error");
orderService.updateRemark(mainOrder, "U8Cloud获取ERP单失败");

@ -3,10 +3,14 @@ package com.glxp.sale.admin.controller.inout;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil;
import com.glxp.sale.admin.entity.auth.AuthAdmin;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderEntity;
import com.glxp.sale.admin.exception.JsonException;
import com.glxp.sale.admin.httpclient.ErpOrderClient;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.req.param.SystemParamConfigRequest;
@ -15,14 +19,17 @@ import com.glxp.sale.admin.req.thrsys.FilterThrOrderRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.inout.ErpOrderResponse;
import com.glxp.sale.admin.res.inout.PurchaseinResponse;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.sale.admin.service.thrsys.ThrOrderService;
import com.glxp.sale.admin.thread.InvDlErpStockService;
import com.glxp.sale.admin.thread.IoTransInoutService;
import com.glxp.sale.admin.util.DateUtil;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
@ -33,9 +40,13 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -72,6 +83,11 @@ public class OrderDetailController {
@Resource
private StockOrderDetailService stockOrderDetailService;
@Resource
private CompanyService companyService;
@Resource
private BussinessTypeService bussinessTypeService;
@GetMapping("/udiwms/erpOrder/filter")
public BaseResponse filterErpOrder(FilterOrderRequest filterErpOrderRequest,
BindingResult bindingResult) {
@ -80,27 +96,18 @@ public class OrderDetailController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
// BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessTypeService.findByActionKey(filterErpOrderRequest.getBillAction(), "orderQueryUrl");
// if (basicThirdSysDetailEntity.getValue() == null) {
// return ResultVOUtils.error(500, "业务单据查询接口未定义");
// }
// if(!basicThirdSysDetailEntity.getEnabled()){
// return ResultVOUtils.error(500, "第三方业务单据服务未启用");
// }
//
// if (basicThirdSysDetailEntity.getFromType() == 0 && !basicThirdSysDetailEntity.getItrCache()) {
//
// return new ErpOrderClient(basicThirdSysDetailEntity.getValue()).getErpOrderResponse(filterErpOrderRequest);
// } else {
//todo 订单查询,需加日期
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
BeanUtils.copyProperties(filterErpOrderRequest, filterThrOrderRequest);
// if (filterThrOrderRequest.getBillAction() != null) {
// BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(filterErpOrderRequest.getBillAction());
// filterThrOrderRequest.setBillAction(bussinessTypeEntity.getName());
// }
filterThrOrderRequest.setPage(filterErpOrderRequest.getPage());
filterThrOrderRequest.setLimit(filterErpOrderRequest.getLimit());
if (filterErpOrderRequest.getCustomerId() != null) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterErpOrderRequest.getCustomerId()));
filterThrOrderRequest.setUnitIdFk(companyEntity.getUnitIdFk());
}
List<ErpOrderResponse> erpOrderResponses = new ArrayList<>();
List<ThrOrderEntity> data = thrOrderService.filterThrOrder(filterThrOrderRequest);
if (data != null && data.size() > 0) {
@ -134,7 +141,7 @@ public class OrderDetailController {
@GetMapping("/udiwms/erpOrder/addStockOrder")
public BaseResponse addStockOrder(FilterOrderRequest filterErpOrderRequest,
BindingResult bindingResult) {
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -146,10 +153,14 @@ public class OrderDetailController {
}
StockOrderEntity stockOrderEntity = new StockOrderEntity();
BeanUtils.copyProperties(thrOrderEntity, stockOrderEntity);
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(thrOrderEntity.getBillType());
stockOrderEntity.setBillType(bussinessTypeEntity.getLocalAction());
stockOrderEntity.setId(null);
stockOrderEntity.setStatus("101");//未提交
stockOrderEntity.setStatus(ConstantStatus.SORDER_DRAFT);//未提交
stockOrderEntity.setSourceType("2");//外部提交
stockOrderEntity.setStatus2("101");//未打印
stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印
stockOrderEntity.setBilldate(DateUtil.formatDate(new Date(), "yyyy-MM-dd"));
boolean b = stockOrderService.insertStockOrder(stockOrderEntity);
if (b) {
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
@ -161,6 +172,8 @@ public class OrderDetailController {
for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) {
StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity();
BeanUtils.copyProperties(thrOrderDetailEntity, stockOrderDetailEntity);
stockOrderDetailEntity.setCount(thrOrderDetailEntity.getCount() + "");
stockOrderDetailEntity.setReCount(thrOrderDetailEntity.getReCount() + "");
stockOrderDetailEntity.setOrderIdFk(stockOrderEntity.getId());
stockOrderDetailEntity.setSweepCount(0 + "");
stockOrderDetailEntityList.add(stockOrderDetailEntity);
@ -285,29 +298,29 @@ public class OrderDetailController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<PurchaseinResponse> docids = importErpOrderRequest.getPurchaseinResponses();
List<ErpOrderResponse> docids = importErpOrderRequest.getPurchaseinResponses();
String docidStr = "";
if (docids != null && docids.size() > 0) {
for (PurchaseinResponse temp : docids) {
docidStr = docidStr + "," + temp.getVbillcode();
for (ErpOrderResponse temp : docids) {
docidStr = docidStr + "," + temp.getBillNo();
}
docidStr = docidStr.substring(1);
}
List<ErpOrderEntity> erpOrderEntities = new ArrayList<>();
if (docids != null && docids.size() > 0) {
for (PurchaseinResponse purchaseinResponse : docids) {
for (PurchaseinResponse.SubPurchase subPurchase : purchaseinResponse.getSubPurchases()) {
for (ErpOrderResponse purchaseinResponse : docids) {
for (ErpOrderResponse.SubErpOrder subPurchase : purchaseinResponse.getSubErpOrders()) {
ErpOrderEntity erpOrderEntity = new ErpOrderEntity();
erpOrderEntity.setErpOrderId(purchaseinResponse.getVbillcode());
erpOrderEntity.setCompanyid(purchaseinResponse.getProvider_code());
erpOrderEntity.setCompanyname(purchaseinResponse.getProvider_name());
erpOrderEntity.setCredate(purchaseinResponse.getDbilldate());
erpOrderEntity.setGoodsid(subPurchase.getInventory_code());
erpOrderEntity.setGoodsname(subPurchase.getInventory_name());
erpOrderEntity.setBatchNo(subPurchase.getVbatchcode());
erpOrderEntity.setErpCount(Math.abs(subPurchase.getDtlgoodsqty()));
erpOrderEntity.setErpOrderId(purchaseinResponse.getBillNo());
erpOrderEntity.setCompanyid(purchaseinResponse.getCorpId());
erpOrderEntity.setCompanyname(purchaseinResponse.getCorpName());
erpOrderEntity.setCredate(purchaseinResponse.getBilldate());
erpOrderEntity.setGoodsid(subPurchase.getProductId());
erpOrderEntity.setGoodsname(subPurchase.getProductName());
erpOrderEntity.setBatchNo(subPurchase.getBatchNo());
erpOrderEntity.setErpCount(Math.abs(subPurchase.getCount()));
erpOrderEntity.setReCount(Math.abs(subPurchase.getReCount()));
erpOrderEntity.setGoodsunit(subPurchase.getInvspec());
erpOrderEntity.setGoodsunit(subPurchase.getSpec());
erpOrderEntities.add(erpOrderEntity);
}
}
@ -323,6 +336,7 @@ public class OrderDetailController {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setId(importErpOrderRequest.getOrderId());
OrderEntity orderEntity = orderService.findOne(orderFilterRequest);
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId());
if (exitErp != null) {
String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定";
@ -338,7 +352,7 @@ public class OrderDetailController {
List<ErpOrderEntity> returnOrders = new ContrastErpUtil().transErp(erpOrderEntities, udiRelevanceService, importErpOrderRequest.getOrderId());
orderDetailService.insertErpOrders(returnOrders);
List<WarehouseEntity> warehouseEntityList = codesService.findByReceiptId(importErpOrderRequest.getOrderId());
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList, systemParamConfigService);
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList, systemParamConfigService, bussinessTypeEntity);
} else {
@ -362,5 +376,4 @@ public class OrderDetailController {
return ResultVOUtils.success("后台已开始校验,请稍后刷新重试!");
}
}

@ -10,17 +10,24 @@ import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil;
import com.glxp.sale.admin.controller.inout.utils.InoutUtils;
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
import com.glxp.sale.admin.entity.basic.StockPrintEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.entity.inventory.InCodeLogEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.httpclient.ErpOrderClient;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.req.inventory.PostStockPrintRequest;
import com.glxp.sale.admin.req.param.SystemParamConfigRequest;
import com.glxp.sale.admin.req.thrsys.FilterThrOrderDetailRequest;
import com.glxp.sale.admin.req.thrsys.FilterThrOrderRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.inout.ErpOrderResponse;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.inventory.InCodeLogService;
import com.glxp.sale.admin.service.inventory.InvStockPrintService;
@ -76,6 +83,8 @@ public class StockOrderController {
InvStockPrintService stockPrintService;
@Resource
InCodeLogService inCodeLogService;
@Resource
CompanyService companyService;
@GetMapping("/udiwms/stock/order/error")
public BaseResponse listStockOrderNoDealWith(StockOrderFilterRequest stockOrderFilterRequest) {
@ -97,8 +106,8 @@ public class StockOrderController {
StockOrderEntity stockOrderEntity = new StockOrderEntity();
BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity);
stockOrderEntity.setStatus(101 + "");//未处理
stockOrderEntity.setStatus2("101");//未打印
stockOrderEntity.setStatus(ConstantStatus.SORDER_DRAFT);//未处理
stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印
stockOrderEntity.setSourceType(2 + "");//外部提交
// stockOrderEntity.setId(String.valueOf(new Date().getTime()));
boolean b = stockOrderService.insertStockOrder(stockOrderEntity);
@ -148,7 +157,7 @@ public class StockOrderController {
stockOrderEntity.setStatus(
StringUtils.isBlank(stockOrderEntity.getStatus()) ? 501 + ""//未提交
: stockOrderEntity.getStatus());
stockOrderEntity.setStatus2("101");//未打印
stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印
stockOrderEntity.setSourceType(1 + "");//本地网页新增
boolean b = false;
if (stockOrderEntity.getStatus().equals("502")) {//已提交
@ -161,11 +170,14 @@ public class StockOrderController {
}
}
if (StringUtils.isBlank(stockOrderEntity.getId())) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderPostRequest.getCustomerId()));
stockOrderEntity.setUnitIdFk(companyEntity.getUnitIdFk());
stockOrderEntity.setCustomerId(stockOrderPostRequest.getCustomerId());
b = stockOrderService.insertStockOrder(stockOrderEntity);
} else {
stockOrderService.updateById(stockOrderEntity);
}
// if (b && stockOrderPostRequest.getSubErpOrders() != null) {
if (stockOrderPostRequest.getSubErpOrders() != null) {
List<StockOrderDetailEntity> stockOrderDetailEntityList = stockOrderPostRequest.getSubErpOrders();
for (StockOrderDetailEntity stockOrderDetailEntity : stockOrderDetailEntityList) {
@ -227,12 +239,16 @@ public class StockOrderController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<StockOrderEntity> stockOrderEntityList;
if (stockOrderFilterRequest.getStatus() == null) {
stockOrderFilterRequest.setStatus(0 + "");
}
if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId()) && stockOrderFilterRequest.getCorpId().equals("110")) {
stockOrderFilterRequest.setCorpId("");
// if (stockOrderFilterRequest.getStatus() == null) {
// stockOrderFilterRequest.setStatus(0 + "");
// }
if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId())) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderFilterRequest.getCorpId()));
stockOrderFilterRequest.setUnitIdFk(companyEntity.getUnitIdFk());
stockOrderFilterRequest.setCorpId(null);
}
stockOrderEntityList = stockOrderService.filterListOr(stockOrderFilterRequest);
PageInfo<StockOrderEntity> pageInfo;
pageInfo = new PageInfo<>(stockOrderEntityList);
@ -242,6 +258,58 @@ public class StockOrderController {
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/stock/order/filterDetail")
public BaseResponse filterDetail(StockOrderFilterRequest stockOrderFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (stockOrderFilterRequest.getBillType() == null) {
stockOrderFilterRequest.setBillType(stockOrderFilterRequest.getBillAction());
}
List<ErpOrderResponse> erpOrderResponses = new ArrayList<>();
if (stockOrderFilterRequest.getCustomerId() != null) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderFilterRequest.getCustomerId()));
stockOrderFilterRequest.setUnitIdFk(companyEntity.getUnitIdFk());
}
List<StockOrderEntity> stockOrderEntityList;
stockOrderEntityList = stockOrderService.filterListOr(stockOrderFilterRequest);
if (stockOrderEntityList != null && stockOrderEntityList.size() > 0) {
for (StockOrderEntity stockOrderEntity : stockOrderEntityList) {
ErpOrderResponse erpOrderResponse = new ErpOrderResponse();
BeanUtils.copyProperties(stockOrderEntity, erpOrderResponse);
StockOrderDetailFilterRequest stockOrderDetailFilterRequest = new StockOrderDetailFilterRequest();
stockOrderDetailFilterRequest.setOrderIdFk(stockOrderEntity.getId());
List<StockOrderDetailEntity> stockOrderDetailEntityList
= stockOrderDetailService.filterStockOrderDetail(stockOrderDetailFilterRequest);
List<ErpOrderResponse.SubErpOrder> subErpOrders = new ArrayList<>();
if (stockOrderDetailEntityList != null && stockOrderDetailEntityList.size() > 0) {
for (StockOrderDetailEntity thrOrderDetailEntity : stockOrderDetailEntityList) {
ErpOrderResponse.SubErpOrder subErpOrder = new ErpOrderResponse.SubErpOrder();
BeanUtils.copyProperties(thrOrderDetailEntity, subErpOrder);
subErpOrders.add(subErpOrder);
}
}
erpOrderResponse.setSubErpOrders(subErpOrders);
erpOrderResponses.add(erpOrderResponse);
}
}
PageInfo<StockOrderEntity> pageInfo;
pageInfo = new PageInfo<>(stockOrderEntityList);
PageSimpleResponse<ErpOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(erpOrderResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/stock/order/submit")
public BaseResponse submitStockOrder(@RequestParam("id") String id) {
StockOrderEntity stockOrderEntity = new StockOrderEntity();

@ -1,6 +1,7 @@
package com.glxp.sale.admin.controller.inout;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil;
@ -12,16 +13,19 @@ import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.httpclient.ErpOrderClient;
import com.glxp.sale.admin.req.basic.CompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.req.param.SystemParamConfigRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.CompanyProductRelevanceResponse;
import com.glxp.sale.admin.res.basic.UdiRelevanceResponse;
import com.glxp.sale.admin.res.inout.PurchaseinResponse;
import com.glxp.sale.admin.res.inout.StockOrderDetailQueryProductResponse;
import com.glxp.sale.admin.res.inout.StockOrderDetailResponse;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.thread.InvDlErpStockService;
@ -38,10 +42,7 @@ import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@ -57,7 +58,8 @@ public class StockOrderDetailController {
UdiInfoService udiInfoService;
@Resource
private UdiRelevanceService udiRelevanceService;
@Resource
private CompanyProductRelevanceService companyProductRelevanceService;
@Resource
private IoTransInoutService transInoutService;
@ -83,7 +85,7 @@ public class StockOrderDetailController {
@GetMapping("/udiwms/stock/order/detail/filter2")
public BaseResponse filterStockOrderDetail2(StockOrderDetailFilterRequest stockOrderDetailFilterRequest,
BindingResult bindingResult) {
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -104,7 +106,7 @@ public class StockOrderDetailController {
@GetMapping("/udiwms/stock/order/detail/temp/filter")
public BaseResponse filterStockOrderDetailTemp(StockOrderDetailFilterRequest stockOrderDetailFilterRequest,
BindingResult bindingResult) {
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -122,7 +124,7 @@ public class StockOrderDetailController {
@GetMapping("/udiwms/stock/order/detail/getStockOrderDetails")
public BaseResponse getStockOrderDetails(StockOrderDetailFilterRequest stockOrderDetailFilterRequest,
BindingResult bindingResult) {
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -140,7 +142,7 @@ public class StockOrderDetailController {
@GetMapping(value = "/udiwms/stock/order/detail")
public BaseResponse stockOrderDetail(StockOrderDetailFilterRequest stockOrderDetailFilterRequest,
BindingResult bindingResult) {
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
@ -182,7 +184,7 @@ public class StockOrderDetailController {
if (systemParamConfigEntitySODCountMax == null ||
StringUtils.isNotBlank(systemParamConfigEntitySODCountMax.getParamValue()) &&
systemParamConfigEntitySODCountMax.getParamValue().equals("1")) {
systemParamConfigEntitySODCountMax.getParamValue().equals("1")) {
if (Integer.parseInt(tempStockOrderDetailEntity.getCount()) <
Integer.parseInt(tempStockOrderDetailEntity.getReCount())) {
return ResultVOUtils.error(500, "配货数量超过订单数量");
@ -226,11 +228,14 @@ public class StockOrderDetailController {
List<StockOrderDetailEntity> stockOrderDetailEntityList = new ArrayList<>();
for (String id : stockOrderIdsRequest.getIds()) {
UdiInfoEntity udiInfoEntity =
udiInfoService.findById(id);
if (udiInfoEntity != null) {
CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest();
companyProductRelevanceRequest.setId(id);
List<CompanyProductRelevanceResponse> companyProductRelevanceResponses = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest);
if (companyProductRelevanceResponses != null && companyProductRelevanceResponses.size() > 0) {
CompanyProductRelevanceResponse udiInfoEntity = companyProductRelevanceResponses.get(0);
StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity();
stockOrderDetailEntity.setProductId(udiInfoEntity.getUuid());
stockOrderDetailEntity.setProductId(udiInfoEntity.getThirdId());
stockOrderDetailEntity.setProductName(udiInfoEntity.getCpmctymc());
stockOrderDetailEntity.setSpec(udiInfoEntity.getGgxh());
if (stockOrderIdsRequest.getUdiEntity() != null) {
@ -243,7 +248,6 @@ public class StockOrderDetailController {
stockOrderDetailEntity.setReCount(0 + "");
stockOrderDetailEntity.setYlqxzcrbarmc(udiInfoEntity.getYlqxzcrbarmc());
stockOrderDetailEntity.setZczbhhzbapzbh(udiInfoEntity.getZczbhhzbapzbh());
stockOrderDetailEntityList.add(stockOrderDetailEntity);
}
}
@ -297,7 +301,7 @@ public class StockOrderDetailController {
@GetMapping("/udiwms/stock/order/detail/addFromCodeById")
public BaseResponse addStockOrderDetailFromCodeById(@RequestParam("orderId") String orderId,
@RequestParam("id") String id) {
@RequestParam("id") String id) {
UdiInfoEntity udiInfoEntity =
udiInfoService.findById(id);
if (udiInfoEntity != null) {
@ -390,14 +394,24 @@ public class StockOrderDetailController {
}
filterUdiInfoRequest.setNameCode(nameCode);
List<UdiRelevanceResponse> udiRelevanceResponseList =
udiInfoService.filterUdiInfo2(filterUdiInfoRequest);
CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest();
BeanUtils.copyProperties(filterUdiInfoRequest, companyProductRelevanceRequest);
List<CompanyProductRelevanceResponse> basicInstrumentMaintainRelevanceResponses = null;
basicInstrumentMaintainRelevanceResponses = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest);
if (basicInstrumentMaintainRelevanceResponses != null && basicInstrumentMaintainRelevanceResponses.size() > 0) {
for (CompanyProductRelevanceResponse basicInstrumentMaintainRelevanceResponse : basicInstrumentMaintainRelevanceResponses) {
if (basicInstrumentMaintainRelevanceResponse.getDiType() == 2 && basicInstrumentMaintainRelevanceResponse.getIsUseDy() != 1) {
basicInstrumentMaintainRelevanceResponse.setNameCode(basicInstrumentMaintainRelevanceResponse.getSjcpbm());
}
}
}
PageInfo<UdiRelevanceResponse> pageInfo;
pageInfo = new PageInfo<>(udiRelevanceResponseList);
PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
PageInfo<CompanyProductRelevanceResponse> pageInfo;
pageInfo = new PageInfo<>(basicInstrumentMaintainRelevanceResponses);
PageSimpleResponse<CompanyProductRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(udiRelevanceResponseList);
pageSimpleResponse.setList(basicInstrumentMaintainRelevanceResponses);
return ResultVOUtils.success(pageSimpleResponse);
}

@ -133,7 +133,7 @@ public class StockQRCodeTextController {
StockOrderEntity updateStockOrderEntity = new StockOrderEntity();
updateStockOrderEntity.setId(stockQRCodeTextEntity.getOrderId());
updateStockOrderEntity.setStatus2("102");
updateStockOrderEntity.setPrintStatus("102");
stockOrderService.updateById(updateStockOrderEntity);
}
@ -192,7 +192,7 @@ public class StockQRCodeTextController {
StockOrderEntity updateStockOrderEntity = new StockOrderEntity();
updateStockOrderEntity.setId(stockOrderEntity.getId());
updateStockOrderEntity.setStatus2("102");
updateStockOrderEntity.setPrintStatus("102");
stockOrderService.updateById(updateStockOrderEntity);
}

@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil;
import com.glxp.sale.admin.controller.inout.utils.InoutUtils;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
@ -14,6 +15,7 @@ import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.inout.WarehouseResponse;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.inout.CodesTempService;
@ -51,22 +53,15 @@ public class WareHouseController {
@Resource
private OrderService orderService;
@Resource
private MipsBarcodeService mipsBarcodeService;
@Resource
private ProductInfoService productInfoService;
@Resource
private MyErpOrderService myErpOrderService;
@Resource
private IoTransInoutService ioTransInoutService;
@Resource
private CodesTempService codesTempService;
@Resource
private UdiInfoService udiInfoService;
@Resource
private UdiRelevanceService udiRelevanceService;
@Resource
private SystemParamConfigService systemParamConfigService;
private BussinessTypeService bussinessTypeService;
@GetMapping("admin/warehouse/inout/list")
public BaseResponse list(WarehouseQueryRequest warehouseQueryRequest) {
@ -166,100 +161,6 @@ public class WareHouseController {
}
// @PostMapping("/admin/warehouse/inout/adList")//TODO 出入库
// public BaseResponse adList(@RequestParam("warehouseEntities") String warehouseEntities) {
//
// try {
// List<WarehouseEntity> warehouseEntityList = FastJsonUtils.getJsonToList(warehouseEntities, WarehouseEntity.class);
// List<String> orders = new ArrayList<>();
// List<Warehousetemp> warehousetempList = new WarehousBeanUtils().entityToTemp(warehouseEntityList);
// new Thread(() -> {
// String id = null;
// String orderId = null;
// List<List<Warehousetemp>> orderList = new ArrayList<>();
// List<Warehousetemp> orderOne = null;
// if (warehousetempList != null && warehousetempList.size() > 0) {
// for (int i = 0; i < warehousetempList.size(); i++) {
// Warehousetemp warehouseEntity = warehousetempList.get(i);
// if (!orders.contains(warehouseEntity.getCorporderid())) {
// orderOne = new ArrayList<>();
// orderList.add(orderOne);
// orders.add(warehouseEntity.getCorporderid());
// id = System.currentTimeMillis() + i + "";
// OrderEntity orderSaveRequest = new OrderEntity();
// orderSaveRequest.setId(id);
// if (warehouseEntity.getActdate() != null) {
// orderSaveRequest.setActDate(warehouseEntity.getActdate());
// }
//
// orderSaveRequest.setAction(warehouseEntity.getAction());
// orderSaveRequest.setActor(warehouseEntity.getActor());
// orderSaveRequest.setCorpOrderId(warehouseEntity.getCorporderid());
// orderSaveRequest.setFromCorpId(warehouseEntity.getFromcorpid());
// orderSaveRequest.setMainAction(warehouseEntity.getMainaction());
// orderSaveRequest.setFromCorp(warehouseEntity.getFromcorp());
// orderSaveRequest.setFromType("手持终端");
// orderSaveRequest.setStatus(3);//error
// orderSaveRequest.setExportStatus(0);//未上传
// orderService.insertOrder(orderSaveRequest);
// }
//
// warehouseEntity.setOrderid(id);
// warehousetempList.get(i).setOrderid(id);
// orderOne.add(warehouseEntity);
// }
// }
// boolean b = codesService.insertTempWarehouses(warehousetempList);
//
// for (int i = 0; i < orderList.size(); i++) {
// List<Warehousetemp> filterList = orderList.get(i);
// List<Warehousetemp> insertList = new ArrayList<>();
// String result;
// for (int j = 0; j < filterList.size(); j++) {
// Warehousetemp warehousetemp = filterList.get(j);
// result = new InoutUtils().filterCode(codesService, warehousetemp,systemParamConfigService);
// if (result == null) {
// insertList.add(warehousetemp);
//
// } else {
// orderService.updateRemark(warehousetemp.getOrderid(), result);
// insertList.clear();
// break;
// }
// }
// if (insertList.size() > 0) {
// orderId = insertList.get(0).getOrderid();
// codesService.insertWarehouses(new WarehousBeanUtils().tempsToEntitys(insertList));
// Warehousetemp warehousetemp = insertList.get(0);
// CommitRequest commitRequest = new CommitRequest();
// commitRequest.setOrderId(warehousetemp.getOrderid());
// List<Warehousetemp> warehousetemps = codesService.findTempByOrderId(commitRequest);
// orderService.updateOrderStatus(orderId, ConstantStatus.ORDER_STATUS_SUCCESS);//"success"
// List<Long> ids = new ArrayList<>();
// for (Warehousetemp w : warehousetemps) {
// ids.add(w.getId());
// }
// codesService.deleteTempWarehouses(ids);
// insertList.clear();
// List<WarehouseEntity> transData = codesService.findByReceiptId(orderId);
// new ContrastErpUtil().contrastErp(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, orderService, transData, systemParamConfigService);
// }
//
// }
//
//
//// List<WarehouseEntity> transData = codesService.findByReceiptId(orderId);
//// new InoutUtils().generateConstrastDetail(productInfoService, myErpOrderService, transData);
//
// }).start();
//
// } catch (Exception e) {
// return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
// }
//
// return ResultVOUtils.success("添加成功");
// }
@PostMapping("/warehouse/inout/commit")//TODO 重新提交
public BaseResponse commitOrder(@RequestBody CommitRequest commitRequest,
BindingResult bindingResult) {
@ -271,105 +172,6 @@ public class WareHouseController {
return ResultVOUtils.success("提交成功");
}
// @PostMapping("warehouse/inout/postCodes")
// public BaseResponse postCodes(@RequestBody PostErpOrderRequest postErpOrderRequest, BindingResult bindingResult) {
//
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
// List<ErpOrderEntity> erpOrderEntities = postErpOrderRequest.getErpOrderEntities();
// try {
// List<WarehouseEntity> warehouseEntityList = postErpOrderRequest.getCodes();
// List<String> orders = new ArrayList<>();
// List<Warehousetemp> warehousetempList = new WarehousBeanUtils().entityToTemp(warehouseEntityList);
// new Thread(() -> {
// String id = null;
// String orderId = null;
// List<List<Warehousetemp>> orderList = new ArrayList<>();
// List<Warehousetemp> orderOne = null;
// if (warehousetempList != null && warehousetempList.size() > 0) {
// for (int i = 0; i < warehousetempList.size(); i++) {
// Warehousetemp warehouseEntity = warehousetempList.get(i);
// if (!orders.contains(warehouseEntity.getCorporderid())) {
// orderOne = new ArrayList<>();
// orderList.add(orderOne);
// orders.add(warehouseEntity.getCorporderid());
// id = System.currentTimeMillis() + i + "";
// OrderEntity orderSaveRequest = new OrderEntity();
// orderSaveRequest.setId(id);
// if (warehouseEntity.getActdate() != null) {
// orderSaveRequest.setActDate(warehouseEntity.getActdate());
// }
//
// orderSaveRequest.setAction(warehouseEntity.getAction());
// orderSaveRequest.setActor(warehouseEntity.getActor());
// orderSaveRequest.setCorpOrderId(warehouseEntity.getCorporderid());
// orderSaveRequest.setFromCorpId(warehouseEntity.getFromcorpid());
// orderSaveRequest.setMainAction(warehouseEntity.getMainaction());
// orderSaveRequest.setFromCorp(warehouseEntity.getFromcorp());
// orderSaveRequest.setFromType("手持终端");
// orderSaveRequest.setStatus(3);//error
// orderSaveRequest.setExportStatus(0);//未上传
// orderService.insertOrder(orderSaveRequest);
// }
//
// warehouseEntity.setOrderid(id);
// warehousetempList.get(i).setOrderid(id);
// orderOne.add(warehouseEntity);
// }
// }
// boolean b = codesService.insertTempWarehouses(warehousetempList);
// for (int i = 0; i < orderList.size(); i++) {
// List<Warehousetemp> filterList = orderList.get(i);
// List<Warehousetemp> insertList = new ArrayList<>();
// String result;
// for (int j = 0; j < filterList.size(); j++) {
// Warehousetemp warehousetemp = filterList.get(j);
// result = new InoutUtils().filterCode(codesService, warehousetemp,systemParamConfigService);
// if (result == null) {
// insertList.add(warehousetemp);
//
// } else {
// orderService.updateRemark(warehousetemp.getOrderid(), result);
// insertList.clear();
// break;
// }
// }
// if (insertList.size() > 0) {
// orderId = insertList.get(0).getOrderid();
// codesService.insertWarehouses(new WarehousBeanUtils().tempsToEntitys(insertList));
// Warehousetemp warehousetemp = insertList.get(0);
// CommitRequest commitRequest = new CommitRequest();
// commitRequest.setOrderId(warehousetemp.getOrderid());
// List<Warehousetemp> warehousetemps = codesService.findTempByOrderId(commitRequest);
// orderService.updateOrderStatus(orderId, ConstantStatus.ORDER_STATUS_SUCCESS);//"success"
// List<Long> ids = new ArrayList<>();
// for (Warehousetemp w : warehousetemps) {
// ids.add(w.getId());
// }
// codesService.deleteTempWarehouses(ids);
// if (erpOrderEntities != null && erpOrderEntities.size() > 0) {
// updateErpOrderId(erpOrderEntities, insertList.get(0).getCorporderid(), orderId);
// List<WarehouseEntity> transData = codesService.findByReceiptId(orderId);
// new ContrastErpUtil().contrastErp(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, orderService, transData,systemParamConfigService);
// } else {
// List<WarehouseEntity> datas = codesService.findByReceiptId(orderId);
// new InoutUtils().generateConstrastDetail(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, datas);
// }
//
// insertList.clear();
// }
// }
//
// }).start();
//
// } catch (Exception e) {
// return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
// }
//
// return ResultVOUtils.success("导入成功");
// }
@GetMapping("warehouse/inout/submitOrderWeb")
public BaseResponse submitOrderWeb(@RequestParam("orderId") String orderId) {
@ -397,8 +199,9 @@ public class WareHouseController {
if (StringUtils.isBlank(code)) return ResultVOUtils.error(ResultEnum.DATA_ERROR);
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
if (udiEntity == null)
return ResultVOUtils.error(500,"UDI码格式错误");
return ResultVOUtils.error(500, "UDI码格式错误");
String orderId = addOrderRequest.getOrderId();
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getBillType());
if (StringUtils.isBlank(orderId)) {
orderId = System.currentTimeMillis() + new Random().nextInt(10) + "";
OrderEntity orderSaveRequest = new OrderEntity();
@ -406,8 +209,11 @@ public class WareHouseController {
if (addOrderRequest.getActDate() != null) {
orderSaveRequest.setActDate(addOrderRequest.getActDate());
}
orderSaveRequest.setMainAction(addOrderRequest.getMainAction());
orderSaveRequest.setAction(addOrderRequest.getAction());
orderSaveRequest.setMainAction(bussinessTypeEntity.getMainAction());
orderSaveRequest.setAction(bussinessTypeEntity.getAction());
orderSaveRequest.setActor(addOrderRequest.getActor());
orderSaveRequest.setCorpOrderId(addOrderRequest.getCorpOrderId());
orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId());
@ -438,8 +244,8 @@ public class WareHouseController {
warehouseEntity.setOrderId(orderId);
warehouseEntity.setCorpOrderId(addOrderRequest.getCorpOrderId());
warehouseEntity.setActDate(addOrderRequest.getActDate());
warehouseEntity.setMainAction(addOrderRequest.getMainAction());
warehouseEntity.setAction(addOrderRequest.getAction());
warehouseEntity.setMainAction(bussinessTypeEntity.getMainAction());
warehouseEntity.setAction(bussinessTypeEntity.getAction());
warehouseEntity.setActor(addOrderRequest.getActor());
warehouseEntity.setFromCorpId(addOrderRequest.getFromCorpId());
warehouseEntity.setFromCorp(addOrderRequest.getFromCorp());
@ -507,89 +313,6 @@ public class WareHouseController {
}
// @PostMapping("warehouse/inout/mipsToInout")
// public BaseResponse mipsToInout(@RequestBody MipsToInoutRequest mipsToInoutRequest, BindingResult bindingResult) {
// new Thread(() -> {
// List<ProductOrderDetailEntity> productOrderEntities = mipsToInoutRequest.getProductOrderEntities();
// if (productOrderEntities != null && productOrderEntities.size() > 0) {
// String orderId = "0";
// OrderEntity orderSaveRequest = new OrderEntity();
// String id = System.currentTimeMillis() + "";
// orderSaveRequest.setId(id);
// orderId = id;
// orderSaveRequest.setActDate(DateUtil.getDateTime());
// orderSaveRequest.setFromType("单据转换");
// orderSaveRequest.setAction(mipsToInoutRequest.getAction());
//// orderSaveRequest.setCorpOrderId(productOrderEntity.getOrderNo());
// if (mipsToInoutRequest.getAction().substring(mipsToInoutRequest.getAction().length() - 2).equals("In")) {
// orderSaveRequest.setMainAction("WareHouseIn");
// } else {
// orderSaveRequest.setMainAction("WareHouseOut");
// }
// orderSaveRequest.setStatus(3);//error
// orderSaveRequest.setRemark("该订单无条码");
// orderSaveRequest.setExportStatus(0);//未上传
// orderService.insertOrder(orderSaveRequest);
// List<MipsBarcodeEntity> mipsBarcodeEntities = new ArrayList<>();
// for (int i = 0; i < productOrderEntities.size(); i++) {
// ProductOrderDetailEntity productOrderEntity = productOrderEntities.get(i);
// List<MipsBarcodeEntity> temps = mipsBarcodeService.selectAllByOrderId(productOrderEntity.getOrderNo());
// if (temps != null && temps.size() > 0) {
// mipsBarcodeEntities.addAll(temps);
// }
// }
// if (mipsBarcodeEntities.size() > 0) {
// List<Warehousetemp> warehousetempList = new ArrayList<>();
// for (MipsBarcodeEntity mipsBarcodeEntity : mipsBarcodeEntities) {
// Warehousetemp warehousetemp = new Warehousetemp();
// warehousetemp.setOrderid(id);
// warehousetemp.setMainaction(orderSaveRequest.getMainAction());
// warehousetemp.setAction(mipsToInoutRequest.getAction());
// warehousetemp.setCode(mipsBarcodeEntity.getCode());
// warehousetemp.setBatchno(mipsBarcodeEntity.getBatchNo());
// warehousetemp.setActdate(DateUtil.getDateTime());
// warehousetempList.add(warehousetemp);
// }
// boolean b = codesService.insertTempWarehouses(warehousetempList);
// if (warehousetempList != null && warehousetempList.size() > 0) {
// String result;
// List<Warehousetemp> insertList = new ArrayList<>();
// for (int j = 0; j < warehousetempList.size(); j++) {
// Warehousetemp warehousetemp = warehousetempList.get(j);
// result = new InoutUtils().filterCode(codesService, warehousetemp,systemParamConfigService);
// if (result == null) {
// insertList.add(warehousetemp);
// } else {
// orderService.updateRemark(warehousetemp.getOrderid(), result);
// insertList.clear();
// break;
// }
// }
// if (insertList.size() > 0) {
// codesService.insertWarehouses(new WarehousBeanUtils().tempsToEntitys(insertList));
// Warehousetemp warehousetemp = insertList.get(0);
// CommitRequest commitRequest = new CommitRequest();
// commitRequest.setOrderId(warehousetemp.getOrderid());
// List<Warehousetemp> warehousetemps = codesService.findTempByOrderId(commitRequest);
// orderService.updateOrderStatus(insertList.get(0).getOrderid(), ConstantStatus.ORDER_STATUS_SUCCESS);//"success"
// List<Long> ids = new ArrayList<>();
// for (Warehousetemp w : warehousetemps) {
// ids.add(w.getId());
// }
// codesService.deleteTempWarehouses(ids);
//
// }
// }
// }
// List<WarehouseEntity> transData = codesService.findByReceiptId(orderId);
// new InoutUtils().generateConstrastDetail(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, transData);
//
// }
// }).start();
//
// return ResultVOUtils.success("后台已开始转换,请稍后刷新重试!");
// }
@PostMapping("/admin/warehouse/inout/save")
public BaseResponse save(@RequestBody @Valid WarehouseSaveRequest warehouseSaveRequest,

@ -2,6 +2,7 @@ package com.glxp.sale.admin.controller.inout.utils;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.entity.basic.BasicInstrumentMaintainRelevanceEntity;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
@ -41,7 +42,7 @@ public class ContrastErpUtil {
public void contrastErp(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService,
OrderDetailService orderDetailService,
OrderService orderService,
List<WarehouseEntity> warehouseEntityList, SystemParamConfigService setupService) {
List<WarehouseEntity> warehouseEntityList, SystemParamConfigService setupService, BussinessTypeEntity bussinessTypeEntity) {
String orderIdFk = warehouseEntityList.get(0).getOrderId();
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderIdFk);
@ -61,7 +62,7 @@ public class ContrastErpUtil {
}
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(udiInfoEntity.getUuid());
if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 0) {
UdiRelevanceEntity udiRelevanceEntity = checkGoodsId(udiRelevanceEntities);
UdiRelevanceEntity udiRelevanceEntity = checkGoodsId(udiRelevanceEntities,bussinessTypeEntity);
if (udiRelevanceEntity != null) {
udiInfoEntity.setThirdId(udiRelevanceEntity.getThirdId());
udiInfoEntity.setThirdName(udiRelevanceEntity.getThirdName());
@ -90,8 +91,8 @@ public class ContrastErpUtil {
ErpOrderEntity vailExitMsg = vailErpExit(orderDetailService, mErpOrderEntities, orderIdFk);
SystemParamConfigRequest systemParamConfigRequest = new SystemParamConfigRequest();
systemParamConfigRequest.setParamKey("erp_forbidSameErp");
SystemParamConfigEntity systemParamConfigEntity = setupService.selectByParamKey(systemParamConfigRequest);
if (vailExitMsg != null && systemParamConfigEntity!=null && systemParamConfigEntity.getParamValue().equals("1")) {
SystemParamConfigEntity systemParamConfigEntity = setupService.selectByParamKey(systemParamConfigRequest);
if (vailExitMsg != null && systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) {
errMsg = "所选ERP单" + vailExitMsg.getErpOrderId() + "已被其他出入库单" + vailExitMsg.getOrderIdFk() + "绑定!";
}
if (mErpOrderEntities != null && mErpOrderEntities.size() > 0)
@ -113,13 +114,44 @@ public class ContrastErpUtil {
}
}
public UdiRelevanceEntity checkGoodsId(List<UdiRelevanceEntity> udiRelevanceEntities) {
public UdiRelevanceEntity checkGoodsId(List<UdiRelevanceEntity> udiRelevanceEntities, BussinessTypeEntity bussinessTypeEntity) {
if (mErpOrderEntities.size() > 0) {
for (ErpOrderEntity erpOrderEntity : mErpOrderEntities) {
for (UdiRelevanceEntity udiRelevanceEntity : udiRelevanceEntities) {
if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId())) {
return udiRelevanceEntity;
if (bussinessTypeEntity.getThirdSysFk() == null) {
if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId())) {
return udiRelevanceEntity;
}
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId")) {
if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId())) {
return udiRelevanceEntity;
}
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId1")) {
if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId1())) {
udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId1());
udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName1());
return udiRelevanceEntity;
}
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId2")) {
if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId2())) {
udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId2());
udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName2());
return udiRelevanceEntity;
}
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId3")) {
if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId3())) {
udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId3());
udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName3());
return udiRelevanceEntity;
}
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId4")) {
if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId4())) {
udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId4());
udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName4());
return udiRelevanceEntity;
}
}
}
}
}

@ -0,0 +1,24 @@
package com.glxp.sale.admin.dao.basic;
import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BussinessLocalTypeDao {
List<BussinessLocalTypeEntity> filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
BussinessLocalTypeEntity findBTByAction(String action);
BussinessLocalTypeEntity findBTByName(String name);
boolean updateBusLocalType(BussinessLocalTypeEntity bussinessTypeEntity);
boolean deleteById(@Param("id") String id);
}

@ -21,7 +21,7 @@ public interface CompanyProductRelevanceDao {
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductId(String productId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(@Param("udiRlIdFk") String udiRlIdFk);
CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(@Param("udiRlIdFk") String udiRlIdFk, @Param("customerId") String customerId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductUuid(CompanyProductRelevanceEntity companyProductRelevanceEntity);

@ -13,6 +13,7 @@ public class UserRegisterEntity {
private String mobile;
private String userId;
private String email;
private String companyId;
private String companyName;
private String creditNum;
private String area;

@ -0,0 +1,15 @@
package com.glxp.sale.admin.entity.basic;
import lombok.Data;
@Data
public class BussinessLocalTypeEntity {
private Integer id;
private String action;
private String name;
private String remark;
private Boolean enable;
}

@ -10,5 +10,7 @@ public class BussinessTypeEntity {
private Boolean enable;
private String remark;
private String mainAction;
private String thirdSysFk;
private String localAction;
}

@ -45,6 +45,7 @@ public class CompanyEntity {
private String kaihuzhanghao;
private String auditStatus;
private String unitIdFk;
private String filePath;
private String newFilePath;

@ -17,5 +17,7 @@ public class StockOrderEntity {
private String statusInfo;
private String type;
private String sourceType;
private String status2;
private String printStatus;
private String unitIdFk;
private String customerId;
}

@ -23,4 +23,5 @@ public class WarehouseEntity {
private String warehouseCode;
private String customerId;
private String nameCode;
}

@ -17,5 +17,5 @@ public class ThrOrderEntity {
private String thirdSysFk;
private Date updateTime;
private String originType;
private String unitIdFk;
}

@ -9,5 +9,6 @@ public class RegisterCheckRequest {
private Integer checkType;
private Long roles;
private String aliCertId;
private String companyId;
private String companyName;
}

@ -6,6 +6,7 @@ import lombok.Data;
@Data
public class UserResisterFilterRequest extends ListPageRequest {
private String companyName;
private String checkType;
private String companyName;
private String checkType;
private String companyId;
}

@ -0,0 +1,15 @@
package com.glxp.sale.admin.req.basic;
import com.glxp.sale.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class BussinessLocalTypeFilterRequest extends ListPageRequest {
private String action;
private String name;
private String mainAction;
private Boolean enabled;
}

@ -12,6 +12,7 @@ public class FilterCompanyRequest extends ListPageRequest {
private String companyName;
private String creditNum;
private String auditStatus;
private String unitIdFk;
private List<String> auditStatusList;
}

@ -15,4 +15,6 @@ public class FilterOrderRequest {
private Integer limit;
private Integer page;
private String customerId;
}

@ -1,5 +1,6 @@
package com.glxp.sale.admin.req.inout;
import com.glxp.sale.admin.res.inout.ErpOrderResponse;
import com.glxp.sale.admin.res.inout.PurchaseinResponse;
import lombok.Data;
@ -9,7 +10,7 @@ import java.util.List;
public class ImportErpOrderRequest {
List<String> docids;
List<PurchaseinResponse> purchaseinResponses;
List<ErpOrderResponse> purchaseinResponses;
List<String> ids;
private String orderId;
private boolean isFilter;

@ -12,11 +12,16 @@ public class StockOrderFilterRequest extends ListPageRequest {
private String corpId;
private String corpName;
private String billType;
private String billAction;
private String billFlag;
private String thirdSysFk;
private String status;
private String statusInfo;
private String type;
private String sourceType;
private String status2;
private String printStatus;
private String unitIdFk;
private String customerId;
private String startDate; //起始日期
private String endDate; //结束日期
}

@ -20,7 +20,8 @@ public class StockOrderPostRequest {
private String statusInfo;
private String type;
private String sourceType;
private String status2;
private String printStatus;
private List<StockOrderDetailEntity> subErpOrders;
private String customerId;
}

@ -11,4 +11,5 @@ public class WarehouseQueryRequest extends ListPageRequest {
private String udi;
private String batchNo;
private String orderId;
private String nameCode;
}

@ -5,15 +5,25 @@ import lombok.Data;
@Data
public class WarehouseSaveRequest {
private Long id;
private String action;
private String mainAction;
private String code;
private String corpOrderId;
private String actor;
private String actDate;
private long wrongCode;
private String upperCorpOrderId;
private String fromCorpId;
private long id;
private String fromCorp;
private String orderId;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private Integer count;
private String packageLevel;
private String warehouseCode;
private String customerId;
private String nameCode;
}

@ -17,6 +17,7 @@ public class FilterThrOrderRequest extends ListPageRequest {
private String billFlag; //单据状态,0.未签字1.已签字
private String billAction;
private String corpName;
private String unitIdFk;
private List<ErpOrderResponse> erpOrderResponses;

@ -15,5 +15,6 @@ public class BussinessTypResponse {
private String thirdId;
private String thirdName;
private Boolean enabled;
private String localAction;
}

@ -12,8 +12,26 @@ public class ErpOrderResponse {
private String billType;
private boolean signFlag;
private String billFlag;
private String unitIdFk;
private String customerId;
private List<SubErpOrder> subErpOrders;
public String getUnitIdFk() {
return unitIdFk;
}
public void setUnitIdFk(String unitIdFk) {
this.unitIdFk = unitIdFk;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public Integer getId() {
return id;
}
@ -95,6 +113,9 @@ public class ErpOrderResponse {
private String productDate;
private int count; //账面数量
private int reCount; //实际数量
private String sweepCount;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
public String getProductId() {
return productId;
@ -159,6 +180,30 @@ public class ErpOrderResponse {
public void setReCount(int reCount) {
this.reCount = reCount;
}
public String getSweepCount() {
return sweepCount;
}
public void setSweepCount(String sweepCount) {
this.sweepCount = sweepCount;
}
public String getYlqxzcrbarmc() {
return ylqxzcrbarmc;
}
public void setYlqxzcrbarmc(String ylqxzcrbarmc) {
this.ylqxzcrbarmc = ylqxzcrbarmc;
}
public String getZczbhhzbapzbh() {
return zczbhhzbapzbh;
}
public void setZczbhhzbapzbh(String zczbhhzbapzbh) {
this.zczbhhzbapzbh = zczbhhzbapzbh;
}
}
}

@ -0,0 +1,23 @@
package com.glxp.sale.admin.service.basic;
import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest;
import java.util.List;
public interface BussinessLocalTypeService {
List<BussinessLocalTypeEntity> filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
BussinessLocalTypeEntity findBTByAction(String action);
BussinessLocalTypeEntity findBTByName(String name);
boolean updateBusLocalType(BussinessLocalTypeEntity bussinessTypeEntity);
boolean deleteById(String id);
}

@ -68,7 +68,6 @@ public class BasicUnitMaintainServiceImpl implements BasicUnitMaintainService {
} else if ("thirdId4".equals(thirdSys)) {
filterUdiInfoRequest.setThirdId4(thirdId);
}
return basicUnitMaintainDao.selectByThirdId(filterUdiInfoRequest);
}

@ -0,0 +1,77 @@
package com.glxp.sale.admin.service.basic.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.basic.BussinessLocalTypeDao;
import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest;
import com.glxp.sale.admin.service.basic.BussinessLocalTypeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class BussinessLocalTypeServiceImpl implements BussinessLocalTypeService {
@Resource
BussinessLocalTypeDao bussinessLocalTypeDao;
@Override
public List<BussinessLocalTypeEntity> filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest) {
if (bussinessTypeFilterRequest == null) {
return Collections.emptyList();
}
if (bussinessTypeFilterRequest.getPage() != null) {
int offset = (bussinessTypeFilterRequest.getPage() - 1) * bussinessTypeFilterRequest.getLimit();
PageHelper.offsetPage(offset, bussinessTypeFilterRequest.getLimit());
}
List<BussinessLocalTypeEntity> data = bussinessLocalTypeDao.filterList(bussinessTypeFilterRequest);
return data;
}
@Override
public List<BussinessLocalTypeEntity> filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest) {
if (bussinessTypeFilterRequest == null) {
return Collections.emptyList();
}
if (bussinessTypeFilterRequest.getPage() != null) {
int offset = (bussinessTypeFilterRequest.getPage() - 1) * bussinessTypeFilterRequest.getLimit();
PageHelper.offsetPage(offset, bussinessTypeFilterRequest.getLimit());
}
List<BussinessLocalTypeEntity> data = bussinessLocalTypeDao.filterJoin(bussinessTypeFilterRequest);
return data;
}
@Override
public BussinessLocalTypeEntity findBTByAction(String action) {
BussinessLocalTypeFilterRequest bussinessTypeFilterRequest = new BussinessLocalTypeFilterRequest();
bussinessTypeFilterRequest.setAction(action);
List<BussinessLocalTypeEntity> data = bussinessLocalTypeDao.filterList(bussinessTypeFilterRequest);
if (data != null && data.size() > 0) {
return data.get(0);
}
return null;
}
@Override
public BussinessLocalTypeEntity findBTByName(String name) {
BussinessLocalTypeFilterRequest bussinessTypeFilterRequest = new BussinessLocalTypeFilterRequest();
bussinessTypeFilterRequest.setName(name);
List<BussinessLocalTypeEntity> data = bussinessLocalTypeDao.filterList(bussinessTypeFilterRequest);
if (data != null && data.size() > 0) {
return data.get(0);
}
return null;
}
@Override
public boolean updateBusLocalType(BussinessLocalTypeEntity bussinessTypeEntity) {
return bussinessLocalTypeDao.updateBusLocalType(bussinessTypeEntity);
}
@Override
public boolean deleteById(String id) {
return bussinessLocalTypeDao.deleteById(id);
}
}

@ -19,7 +19,7 @@ public interface CompanyProductRelevanceService {
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductId(String productId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk);
CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk,String customerId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductUuid(CompanyProductRelevanceEntity companyProductRelevanceEntity);

@ -67,8 +67,8 @@ public class CompanyProductRelevanceServiceImpl implements CompanyProductRelevan
}
@Override
public CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk) {
return companyProductRelevanceDao.findCompanyProductRelevanceByUdiRlIdFk(udiRlIdFk);
public CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk,String customerId) {
return companyProductRelevanceDao.findCompanyProductRelevanceByUdiRlIdFk(udiRlIdFk,customerId);
}
@Override

@ -1,26 +1,32 @@
package com.glxp.sale.admin.thread;
import com.glxp.sale.admin.config.WebSocketServer;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil;
import com.glxp.sale.admin.controller.inout.utils.DataTransUtil;
import com.glxp.sale.admin.controller.inout.utils.InoutUtils;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.httpclient.ErpOrderClient;
import com.glxp.sale.admin.req.inout.CommitRequest;
import com.glxp.sale.admin.req.inout.OrderFilterRequest;
import com.glxp.sale.admin.req.inout.PostOrderRequest;
import com.glxp.sale.admin.req.inout.WarehouseQueryRequest;
import com.glxp.sale.admin.req.param.SystemParamConfigRequest;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.service.inout.CodesService;
import com.glxp.sale.admin.service.inout.CodesTempService;
import com.glxp.sale.admin.service.inout.OrderDetailService;
import com.glxp.sale.admin.service.inout.OrderService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.service.thrsys.ThrDataService;
import com.glxp.sale.admin.service.thrsys.ThrOrderService;
import com.glxp.sale.admin.util.FilterUdiUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -38,11 +44,11 @@ public class IoTransInoutService {
private static final Logger logger = LoggerFactory.getLogger(IoTransInoutService.class);
@Resource
private CodesService codesService;
private CodesService warehouseService;
@Resource
private OrderService orderService;
@Resource
private OrderDetailService orderDetailService;
private OrderDetailService myErpOrderService;
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
@ -50,12 +56,19 @@ public class IoTransInoutService {
@Value("${UDI_SERVER_URL}")
private String udiUrl;
@Resource
private CodesTempService codesTempService;
@Autowired
private SystemParamConfigService systemParamConfigService;
@Resource
private BussinessTypeService bussinessTypeService;
@Resource
private ThrOrderService thrOrderService;
@Resource
ThrDataService thrDataService;
//web端新增订单
@Async
public void creatOrderWeb(PostOrderRequest postOrderRequest) {
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrder();
@ -66,7 +79,7 @@ public class IoTransInoutService {
if (warehouseEntityList != null && warehouseEntityList.size() > 0) {
if (StringUtils.isNotBlank(postOrderRequest.getOldOrderId())) {
orderService.deleteById(postOrderRequest.getOldOrderId());
orderDetailService.deleteByOrderId(postOrderRequest.getOldOrderId());
myErpOrderService.deleteByOrderId(postOrderRequest.getOldOrderId());
}
WarehouseEntity warehouseEntity = warehouseEntityList.get(0);
String orderId = System.currentTimeMillis() + i + "";
@ -118,6 +131,14 @@ public class IoTransInoutService {
PostOrderRequest.PostOrder postOrder = postOrders.get(i);
List<WarehouseEntity> warehouseEntityList = postOrder.getCodes();
if (warehouseEntityList != null && warehouseEntityList.size() > 0) {
//解析条码
for (WarehouseEntity temp : warehouseEntityList) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(temp.getCode());
temp.setNameCode(udiEntity.getUdi());
}
WarehouseEntity warehouseEntity = warehouseEntityList.get(0);
String orderId = System.currentTimeMillis() + i + "";
OrderEntity orderSaveRequest = new OrderEntity();
@ -183,7 +204,7 @@ public class IoTransInoutService {
for (int j = 0; j < filterList.size(); j++) {
WarehouseEntity warehouseEntity = filterList.get(j);
String result = new InoutUtils().filterCode(codesService, warehouseEntity, systemParamConfigService);
String result = new InoutUtils().filterCode(warehouseService, warehouseEntity, systemParamConfigService);
if (result == null) {
insertList.add(warehouseEntity);
} else {
@ -195,15 +216,15 @@ public class IoTransInoutService {
}
if (insertList.size() > 0) {
codesService.insertWarehouses(insertList);
warehouseService.insertWarehouses(insertList);
WarehouseQueryRequest tempQuery = new WarehouseQueryRequest();
tempQuery.setOrderId(orderEntity.getId());
List<WarehouseEntity> temps = codesTempService.findByOrderId(tempQuery);
if (orderEntity.getErpFk() != null) {
if (orderEntity.getErpFk() != null && !"".equals(orderEntity.getErpFk())) {
orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_CHECK);
} else {
//因为只需用到条码,所以不需要重新读取 TODO
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, orderDetailService, insertList);
//因为只需用到条码,所以不需要重新读取
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, insertList);
orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_SUCCESS);
}
@ -232,49 +253,47 @@ public class IoTransInoutService {
public void checkOrder(OrderEntity orderEntity) {
orderEntity = orderService.findById(orderEntity.getId());
List<String> erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk());
List<WarehouseEntity> transData = codesService.findByReceiptId(orderEntity.getId());
List<WarehouseEntity> transData = warehouseService.findByReceiptId(orderEntity.getId());
if (erpIds != null && erpIds.size() > 0) {
SystemParamConfigRequest systemParamConfigRequest = new SystemParamConfigRequest();
systemParamConfigRequest.setParamKey("erp_order_query");
SystemParamConfigEntity systemParamConfigEntityBUMErpQuery = systemParamConfigService.selectByParamKey(systemParamConfigRequest);
if (systemParamConfigEntityBUMErpQuery == null) {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderEntity.setRemark("获取ERP出入库单据接口地址未定义");
orderService.updateOrder(orderEntity);
} else {
String erpOrderUrl = systemParamConfigEntityBUMErpQuery.getParamValue();
List<ErpOrderEntity> cloudErps = new ErpOrderClient(erpOrderUrl).getErpOrder(erpIds,orderEntity.getAction());
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;
}
}
orderDetailService.deleteByOrderId(orderEntity.getId());
orderDetailService.insertErpOrders(returnOrders);
new ContrastErpUtil(udiUrl).contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, transData, systemParamConfigService);
} else {
List<ErpOrderEntity> erpOrderEntities = thrDataService.getStockOrders(erpIds);
checkThirdOrder(erpOrderEntities, orderEntity, transData);
} else {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderEntity.setRemark("未选入第三方出入库单据进行校验,请手动选择");
orderService.updateOrder(orderEntity);
myErpOrderService.deleteByOrderId(orderEntity.getId());
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData);
}
}
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出入库单据失败");
orderEntity.setRemark("选择Erp订单往来单位不一致");
orderService.updateOrder(orderEntity);
orderDetailService.deleteByOrderId(orderEntity.getId());
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, orderDetailService, transData);
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单据进行校验请手动选择");
orderEntity.setRemark("获取ERP出入库单据失败");
orderService.updateOrder(orderEntity);
myErpOrderService.deleteByOrderId(orderEntity.getId());
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData);
}
}
@ -284,6 +303,7 @@ public class IoTransInoutService {
OrderEntity orderEntity = orderService.findById(commitRequest.getOrderId());
if (orderEntity != null) {
transInout(orderEntity);
WebSocketServer.sendInfo("重码校验已完成,请刷新查看!", null);
}
}
@ -292,6 +312,7 @@ public class IoTransInoutService {
public void repeatCheck(String orderId) {
OrderEntity orderEntity = orderService.findById(orderId);
checkOrder(orderEntity);
WebSocketServer.sendInfo("单据:" + orderId + "校验已完成,请刷新查看!", null);
}

@ -1,12 +1,14 @@
package com.glxp.sale.admin.thread;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderImportDetailEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderImportLogEntity;
import com.glxp.sale.admin.req.basic.FilterUdiIpLogRequest;
import com.glxp.sale.admin.service.basic.BasicUnitMaintainService;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.sale.admin.service.thrsys.ThrOrderImportDetailService;
@ -35,6 +37,8 @@ public class ThrOrderImportService {
ThrOrderDetailService thrOrderDetailService;
@Resource
BussinessTypeService bussinessTypeService;
@Resource
BasicUnitMaintainService basicUnitMaintainService;
@Async
public void importThrOrder(String genKey) {
@ -49,10 +53,16 @@ public class ThrOrderImportService {
ThrOrderImportDetailEntity thrOrderImportDetailEntity = datas.get(0);
ThrOrderEntity thrOrderEntity = new ThrOrderEntity();
BeanUtils.copyProperties(thrOrderImportDetailEntity, thrOrderEntity);
//转换往来单位ID
thrOrderEntity.setUpdateTime(new Date());
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByName(thrOrderEntity.getBillType());
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(thrOrderEntity.getBillType());
if (bussinessTypeEntity != null) {
thrOrderEntity.setBillType(bussinessTypeEntity.getAction());
thrOrderEntity.setThirdSysFk(bussinessTypeEntity.getThirdSysFk());
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByThirdId(thrOrderImportDetailEntity.getCorpId(), thrOrderImportDetailEntity.getThirdSysFk());
if(basicUnitMaintainEntity!=null){
thrOrderEntity.setUnitIdFk(basicUnitMaintainEntity.getErpId());
}
}
thrOrderService.insertThrOrder(thrOrderEntity);
thrOrderEntity = thrOrderService.findByUnique(thrOrderEntity.getBillNo(), thrOrderEntity.getThirdSysFk());

@ -14,7 +14,7 @@ public class StockOrderBillNoUtils {
prefix = "SHD";
break;
default:
prefix = "NULL";
prefix = "SP";
break;
}

@ -2,8 +2,7 @@
server.port=9996
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3307/srmms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/srmms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
server.servlet.context-path=

@ -8,7 +8,7 @@
如果不知道maven本地仓库地址可以使用EveryThing工具全局搜索mysql-connector-java找到jar包位置
也可以手动下载一个jar放在指定位置进行引用。
-->
<classPathEntry location="D:/Kaifa/Apache/maven/maven-repository/mysql/mysql-connector-java/8.0.21/mysql-connector-java-8.0.21.jar"/>
<classPathEntry location="D:/Program Files/maven/maven-repository/mysql/mysql-connector-java/8.0.21/mysql-connector-java-8.0.21.jar"/>
<context id="testTables" targetRuntime="MyBatis3">
<commentGenerator>
@ -18,9 +18,9 @@
<!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3307/udiwms?serverTimezone=GMT%2B8&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
connectionURL="jdbc:mysql://127.0.0.1:3306/spms?serverTimezone=GMT%2B8&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
userId="root"
password="root">
password="123456">
<property name="nullCatalogMeansCurrent" value="true" />
</jdbcConnection>

@ -28,7 +28,7 @@
tel, mobile, userId,
email, companyName, creditNum,
area, detailAddr, bussinessStatus,
checkType, registerTime, checkTime,comments,areaCode,userName,licenseUrl
checkType, registerTime, checkTime,comments,areaCode,userName,licenseUrl,companyId
)
values
(
@ -37,13 +37,13 @@
#{email},#{companyName},#{creditNum},
#{area},#{detailAddr},#{bussinessStatus},
#{checkType},#{registerTime},#{checkTime},
#{comments},#{areaCode},#{userName},#{licenseUrl}
#{comments},#{areaCode},#{userName},#{licenseUrl},#{companyId}
)
</insert>
<update id="updateUserRegister" parameterType="com.glxp.sale.admin.entity.auth.UserRegisterEntity">
UPDATE user_register
<set>
<trim prefix="set" suffixOverrides=",">
<if test="nickName != null">`nickName`=#{nickName},</if>
<if test="password != null">password=#{password},</if>
<if test="realName != null">`realName`=#{realName},</if>
@ -62,8 +62,8 @@
<if test="areaCode != null">areaCode=#{areaCode},</if>
<if test="userName != null">userName=#{userName},</if>
<if test="licenseUrl != null">licenseUrl=#{licenseUrl},</if>
</set>
<if test="companyId != null">companyId=#{companyId},</if>
</trim>
WHERE id=#{id}
</update>

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.sale.admin.dao.basic.BussinessLocalTypeDao">
<select id="filterList" parameterType="com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest"
resultType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
SELECT * FROM basic_bustype_local
<where>
<if test="name != ''and name != null">
AND name LIKE concat(#{name},'%')
</if>
<if test="action != ''and action != null">
AND action LIKE concat(#{action},'%')
</if>
<if test="enabled != ''and enabled != null">
AND enable =#{enabled}
</if>
</where>
</select>
<select id="filterJoin" parameterType="com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest"
resultType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
SELECT basic_bustype_local.name, basic_bussiness_type.action FROM basic_bustype_local inner join
basic_bussiness_type
on basic_bustype_local.action = basic_bussiness_type.localAction
<where>
<if test="name != ''and name != null">
AND basic_bustype_local.name LIKE concat(#{name},'%')
</if>
<if test="action != ''and action != null">
AND basic_bustype_local.action LIKE concat(#{action},'%')
</if>
<if test="enabled != ''and enabled != null">
AND basic_bustype_local.enable =#{enabled}
</if>
</where>
</select>
<insert id="insertBussinessType" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
INSERT INTO basic_bustype_local
(action,name,enable,remark)
values
(
#{action},
#{name},
#{enable},
#{remark},
)
</insert>
<update id="updateBusLocalType" parameterType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
UPDATE basic_bustype_local
<trim prefix="set" suffixOverrides=",">
<if test="action != null">action = #{action},</if>
<if test="name != null">name = #{name},</if>
<if test="enable != null">enable = #{enable},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE FROM basic_bustype_local WHERE id = #{id}
</delete>
<select id="selectById" parameterType="Map" resultType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
select * FROM basic_bustype_local WHERE id = #{id}
</select>
</mapper>

@ -17,7 +17,28 @@
AND action LIKE concat(#{mainAction},'%')
</if>
<if test="enabled != ''and enabled != null">
AND enabled =#{enabled}
AND enable =#{enabled}
</if>
</where>
</select>
<select id="filterJoinList" parameterType="com.glxp.sale.admin.req.basic.BussinessTypeFilterRequest"
resultType="com.glxp.sale.admin.res.basic.BussinessTypResponse">
select * from basic_bussiness_type LEFT JOIN basic_third_sys on basic_bussiness_type.thirdSysFk =
basic_third_sys.thirdId
<where>
<if test="name != ''and name != null">
AND name LIKE concat(#{name},'%')
</if>
<if test="action != ''and action != null">
AND `action` LIKE concat(#{action},'%')
</if>
<if test="mainAction != ''and mainAction != null">
AND mainAction LIKE concat(#{mainAction},'%')
</if>
<if test="enabled != ''and enabled != null">
AND basic_third_sys.enabled =#{enabled}
</if>
</where>
@ -27,26 +48,30 @@
<insert id="insertBussinessType" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BussinessTypeEntity">
INSERT INTO basic_bussiness_type
(action,name,enable,remark,mainAction)
replace INTO basic_bussiness_type
(action,name,enable,remark,mainAction,localAction,thirdSysFk)
values
(
#{action},
#{name},
#{enable},
#{remark},
#{mainAction}
#{mainAction},#{localAction},#{thirdSysFk}
)
</insert>
<update id="updateBussinessType" parameterType="com.glxp.sale.admin.entity.basic.BussinessTypeEntity">
UPDATE basic_bussiness_type SET
action = #{action},
name = #{name},
enable = #{enable},
remark = #{remark},
mainAction = #{mainAction}
WHERE id = #{id}
UPDATE basic_bussiness_type
<trim prefix="set" suffixOverrides=",">
<if test="action != null">action = #{action},</if>
<if test="name != null">name = #{name},</if>
<if test="enable != null">enable = #{enable},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="mainAction != null">mainAction = #{mainAction},</if>
<if test="localAction != null">localAction=#{localAction},</if>
thirdSysFk=#{thirdSysFk},
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">

@ -31,6 +31,9 @@
<if test="auditStatus != null and auditStatus != ''">
and auditStatus = #{auditStatus}
</if>
<if test="unitIdFk != null and unitIdFk != ''">
and unitIdFk = #{unitIdFk}
</if>
<if test="(auditStatus == null or auditStatus == '') and auditStatusList != null and auditStatusList.size() >0">
<foreach collection="auditStatusList" item="auditStatus" open="AND (" separator="OR" close=")">
auditStatus = #{auditStatus,jdbcType=VARCHAR}
@ -73,7 +76,7 @@
<update id="modifyCompany" parameterType="com.glxp.sale.admin.entity.info.CompanyEntity">
UPDATE company
<set>
<trim prefix="set" suffixOverrides=",">
<if test="companyName != null">companyName=#{companyName},</if>
<if test="bussinessStatus != null">bussinessStatus=#{bussinessStatus},</if>
<if test="creditNum != null">creditNum=#{creditNum},</if>
@ -110,7 +113,8 @@
<if test="filePath2 != null">filePath2=#{filePath2},</if>
<if test="filePath3 != null">filePath3=#{filePath3},</if>
<if test="filePath4 != null">filePath4=#{filePath4},</if>
</set>
<if test="unitIdFk != null">unitIdFk=#{unitIdFk},</if>
</trim>
WHERE customerId=#{customerId}
@ -122,7 +126,7 @@
refEntId,entId,networkType,certIdFk,parentCompany,parentIdFk,
contactsPapersType,contactsPapersCode,registerStatus,jyxkzh,jyxkzfzjg,jyxkzyxq,
jybapzh,jybabm,fzrq,suihao,kaihuhang,kaihuzhanghao,auditStatus,
filePath,filePath2,filePath3,filePath4) values
filePath,filePath2,filePath3,filePath4,unitIdFk) values
( #{companyName},
#{bussinessStatus},
#{creditNum},
@ -159,7 +163,7 @@
#{filePath},
#{filePath2},
#{filePath3},
#{filePath4}
#{filePath4},#{unitIdFk}
)
</insert>
<select id="findKey" parameterType="java.lang.String"

@ -104,6 +104,9 @@
<if test="auditStatus != '' and auditStatus != null">
AND company_product_relevance.auditStatus = #{auditStatus}
</if>
<if test="id != '' and id != null">
AND company_product_relevance.id = #{id}
</if>
</where>
ORDER BY updateTime DESC
</select>
@ -121,7 +124,7 @@
<select id="findCompanyProductRelevanceByUdiRlIdFk" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
SELECT * FROM company_product_relevance where udiRlIdFk = #{udiRlIdFk}
SELECT * FROM company_product_relevance where udiRlIdFk = #{udiRlIdFk} and customerId = #{customerId}
</select>

@ -24,13 +24,22 @@
<if test="batchNo != '' and batchNo!=null">
and batchNo =#{batchNo}
</if>
<if test="nameCode != '' and nameCode!=null">
and nameCode =#{nameCode}
</if>
</where>
ORDER BY actDate
</select>
<insert id="insertWarehouse" keyProperty="id" parameterType="com.glxp.sale.admin.req.inout.WarehouseSaveRequest">
INSERT INTO io_codes(action,mainAction,code,corpOrderId,actor,actDate,upperCorpOrderId,fromCorpId,fromCorp)
INSERT INTO
io_codes(
action,mainAction,code,corpOrderId,actor,actDate,
fromCorpId,fromCorp,orderId,batchNo,produceDate,expireDate,
serialNo,count,packageLevel,warehouseCode,nameCode
)
values(
#{action},
#{mainAction},
@ -39,7 +48,8 @@
#{actor},
#{actDate},
#{fromCorpId},
#{fromCorp},#{orderId})
#{fromCorp},#{orderId},#{batchNo},#{produceDate},#{expireDate},#{serialNo},#{count},#{packageLevel},#{warehouseCode},
#{nameCode})
</insert>
<insert id="insertWarehouses" parameterType="java.util.List">
@ -51,7 +61,7 @@
actor,
actDate,
fromCorpId,fromCorp,orderId,batchNo,produceDate,expireDate,
serialNo,count,packageLevel,warehouseCode)
serialNo,count,packageLevel,warehouseCode,nameCode)
VALUES
<foreach collection="io_codesEntities" item="item" index="index"
separator=",">
@ -70,7 +80,7 @@
,#{item.expireDate}
,#{item.serialNo}
,#{item.count}
,#{item.packageLevel} ,#{item.warehouseCode})
,#{item.packageLevel} ,#{item.warehouseCode},#{item.nameCode})
</foreach>
</insert>

@ -187,9 +187,12 @@
<if test="action==null or action == ''">
and `action` <![CDATA[ <> ]]> 'StockCheck'
</if>
<if test="status != '' and status!=null">
<if test="status != '' and status!=null and status!=10">
and status = #{status}
</if>
<if test="status ==10">
and ( status = 1 or status=-1)
</if>
<if test="exportStatus != '' and exportStatus!=null">
and exportStatus = #{exportStatus}
</if>
@ -208,10 +211,13 @@
<if test="endTime!=null and endTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
</if>
<if test="customerId != '' and customerId!=null">
and customerId =#{customerId}
</if>
</where>
ORDER BY actDate DESC
</select>
<select id="filterNoSort" parameterType="com.glxp.sale.admin.req.inout.OrderFilterRequest"

@ -20,9 +20,10 @@
</select>
<insert id="insertStockOrder" useGeneratedKeys="true" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
<insert id="insertStockOrder" useGeneratedKeys="true" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
insert INTO stock_order(id, billNo, billdate, corpId, corpName, billType, billFlag,
thirdSysFk, status, statusInfo, type, sourceType, status2)
thirdSysFk, status, statusInfo, type, sourceType, printStatus,unitIdFk,customerId)
values (
#{id},
#{billNo},
@ -36,12 +37,12 @@
#{statusInfo},
#{type},
#{sourceType},
#{status2}
#{printStatus},#{unitIdFk},#{customerId}
)
</insert>
<update id="updateById" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
UPDATE stock_order
<set>
<trim prefix="set" suffixOverrides=",">
<if test="billNo != null">billNo=#{billNo},</if>
<if test="billdate != null">billdate=#{billdate},</if>
<if test="corpId != null">corpId=#{corpId},</if>
@ -53,8 +54,11 @@
<if test="statusInfo != null">statusInfo=#{statusInfo},</if>
<if test="type != null">type=#{type},</if>
<if test="sourceType != null">sourceType=#{sourceType},</if>
<if test="status2 != null">status2=#{status2},</if>
</set>
<if test="printStatus != null">printStatus=#{printStatus},</if>
<if test="unitIdFk != null">unitIdFk=#{unitIdFk},</if>
<if test="customerId != null">customerId=#{customerId},</if>
</trim>
WHERE id = #{id}
</update>
@ -115,8 +119,20 @@
<if test="sourceType != '' and sourceType!=null">
and sourceType = #{sourceType}
</if>
<if test="status2 != '' and status2!=null">
and status2 = #{status2}
<if test="printStatus != '' and printStatus!=null">
and printStatus = #{printStatus}
</if>
<if test="unitIdFk != '' and unitIdFk!=null">
and unitIdFk = #{unitIdFk}
</if>
<if test="customerId != '' and customerId!=null">
and customerId = #{customerId}
</if>
<if test="startDate!=null and startDate!=''">
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
</if>
<if test="endDate!=null and endDate!=''">
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
</if>
</where>
@ -137,6 +153,10 @@
<if test="billNo != '' and billNo !=null">
and billNo =#{billNo}
</if>
<if test="customerId != '' and customerId !=null">
and customerId =#{customerId}
</if>
</where>
limit 1
</select>

@ -19,6 +19,9 @@
<if test="billFlag != '' and billFlag !=null">
AND billFlag = #{billFlag}
</if>
<if test="unitIdFk != '' and unitIdFk !=null">
AND unitIdFk = #{unitIdFk}
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
@ -39,7 +42,7 @@
<insert id="insertThrOrder" keyProperty="id" parameterType="com.glxp.sale.admin.entity.thrsys.ThrOrderEntity">
replace INTO thr_order
(
billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk, updateTime,originType
billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk, updateTime,originType,unitIdFk
)
values
(
@ -49,14 +52,14 @@
#{corpName},
#{billType},
#{billFlag},
#{thirdSysFk},#{updateTime},#{originType}
#{thirdSysFk},#{updateTime},#{originType},#{unitIdFk}
)
</insert>
<insert id="insertThrOrders" keyProperty="id" parameterType="java.util.List">
replace INTO thr_order
(
billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk,updateTime,originType
billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk,updateTime,originType,unitIdFk
)
values
@ -69,7 +72,7 @@
#{item.corpName},
#{item.billType},
#{item.billFlag},
#{item.thirdSysFk},#{item.updateTime},#{item.originType}
#{item.thirdSysFk},#{item.updateTime},#{item.originType},#{item.unitIdFk}
)
</foreach>
</insert>
@ -94,6 +97,8 @@
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="originType != null">originType=#{originType},</if>
<if test="unitIdFk != null">unitIdFk=#{unitIdFk},</if>
</trim>
WHERE id = #{id}
</update>

Loading…
Cancel
Save