往来单位库存信息等改动

master
anthonywj 3 years ago
parent c96422e87f
commit 3f91437abe

@ -166,22 +166,24 @@
</dependency>
<!--解析excel-->
<!--xls-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>RELEASE</version>
<version>4.0.0</version>
</dependency>
<!--xlsx-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>RELEASE</version>
<version>4.0.0</version>
</dependency>
<!-- PDF打印 -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.10</version>
<version>5.5.13.1</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>

@ -6,6 +6,7 @@ package com.glxp.api.admin.constant;
public class ConstantStatus {
//订单状态
public static final Integer ORDER_STATUS_TEMP_SAVE = -1; //等待提交
public static final Integer ORDER_STATUS_PROCESS = 1; //等待处理
public static final Integer ORDER_STATUS_CHECK = 2; //等待校验
public static final Integer ORDER_STATUS_FAIL = 3; //重码校验失败

@ -154,6 +154,8 @@ public class BasicUnitMaintainController {
SrtBasicUnitResponse srtBasicUnitResponse = new SrtBasicUnitResponse();
srtBasicUnitResponse.setUnitId(basicUnitMaintainEntity.getErpId());
srtBasicUnitResponse.setUnitName(basicUnitMaintainEntity.getName());
srtBasicUnitResponse.setThirdId(basicUnitMaintainEntity.getThirdId());
srtBasicUnitResponse.setSpell(basicUnitMaintainEntity.getSpell());
srtBasicUnitResponses.add(srtBasicUnitResponse);
}
PageInfo<BasicUnitMaintainEntity> pageInfo;

@ -188,4 +188,43 @@ public class UdiInfoExportLogController {
return ResultVOUtils.success(pageSimpleResponse);
}
//产品信息接口查询(第三方使用)
@GetMapping("/udiwms/basic/products/pcFilter")
public BaseResponse pcFilterProducts(FilterUdiInfoRequest filterUdiInfoRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (filterUdiInfoRequest.getThirdSys() != null && filterUdiInfoRequest.getThirdCode() != null) {
if ("thirdId1".equals(filterUdiInfoRequest.getThirdSys())) {
filterUdiInfoRequest.setThirdId1(filterUdiInfoRequest.getThirdCode());
} else if ("thirdId2".equals(filterUdiInfoRequest.getThirdSys())) {
filterUdiInfoRequest.setThirdId2(filterUdiInfoRequest.getThirdCode());
} else if ("thirdId3".equals(filterUdiInfoRequest.getThirdSys())) {
filterUdiInfoRequest.setThirdId3(filterUdiInfoRequest.getThirdCode());
} else if ("thirdId4".equals(filterUdiInfoRequest.getThirdSys())) {
filterUdiInfoRequest.setThirdId4(filterUdiInfoRequest.getThirdCode());
} else {
filterUdiInfoRequest.setThirdId(filterUdiInfoRequest.getThirdCode());
}
}
List<UdiRelevanceResponse> udiRelevanceResponses = null;
udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
List<UdiRlDlResponse> udiRlDlResponses = udiRelevanceResponses.stream().map(item ->
{
UdiRlDlResponse udiRlDlResponse = new UdiRlDlResponse();
BeanUtils.copyProperties(item, udiRlDlResponse);
return udiRlDlResponse;
}).collect(Collectors.toList());
PageInfo<UdiRelevanceResponse> pageInfo;
pageInfo = new PageInfo<>(udiRelevanceResponses);
PageSimpleResponse<UdiRlDlResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(udiRlDlResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -157,7 +157,7 @@ public class UdiInfoImportLogController {
if ((row.getCell(0) == null || row.getCell(1) == null || row.getCell(2) == null
|| row.getCell(3) == null || row.getCell(4) == null || row.getCell(5) == null|| row.getCell(6) == null) ||
(!"udiCode".equals(row.getCell(0).getStringCellValue())
|| !"医保码".equals(row.getCell(1).getStringCellValue())
|| !"医保码".equals(row.getCell(1).getStringCellValue())
|| !"商品条码".equals(row.getCell(2).getStringCellValue())
|| !"thirdId".equals(row.getCell(3).getStringCellValue())
|| !"thirdId1".equals(row.getCell(4).getStringCellValue())

@ -100,7 +100,6 @@ public class UdiRelevanceController {
List<UdiRelevanceResponse> udiRelevanceResponses = null;
filterUdiInfoRequest.setDiType(1);
if (filterUdiInfoRequest.getUdiCode() != null && !filterUdiInfoRequest.getUdiCode().isEmpty()) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiInfoRequest.getUdiCode());
filterUdiInfoRequest.setNameCode(udiEntity.getUdi());
@ -245,7 +244,7 @@ public class UdiRelevanceController {
}
}
removeProducts(combineRequest);
udiRelevanceEntity.setId(combineRequest.getRelId());
udiRelevanceEntity.setUuid(key);
udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime());
@ -263,7 +262,18 @@ public class UdiRelevanceController {
return ResultVOUtils.success("合并成功");
}
public void removeProducts(CombineRequest combineRequest) {
UdiRelevanceEntity temp = udiRelevanceService.selectById(combineRequest.getRelId());
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(combineRequest.getThirdId());
filterUdiInfoRequest.setUuid(temp.getUuid());
List<UdiInfoEntity> udiInfoEntities = udiInfoService.filterUdiInfo(filterUdiInfoRequest);
if (udiInfoEntities != null && udiInfoEntities.size() > 0) {
UdiInfoEntity udiInfoEntity = udiInfoEntities.get(0);
if (udiInfoEntity.getDeviceRecordKey() == null)
udiInfoService.deleteById(udiInfoEntities.get(0).getId() + "");
}
}
//选入查询结果的所有DI
@GetMapping("/udi/udirel/combineAll")
public BaseResponse combineAll(FilterUdiInfoRequest productInfoFilterRequest) {
@ -279,6 +289,7 @@ public class UdiRelevanceController {
udiRelevanceEntity.setId(combineRequest.getRelId());
udiRelevanceEntity = setThird(combineRequest, udiRelevanceEntity);
udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime());
removeProducts(combineRequest);
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
return ResultVOUtils.success("更新成功");
}
@ -622,6 +633,26 @@ public class UdiRelevanceController {
udiRelevanceEntity.setThirdId4(combineRequest.getThirdId());
udiRelevanceEntity.setThirdName4(combineRequest.getErpName());
}
BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys();
String mainSys = basicThirdSysEntity.getThirdId();
if (mainSys.equals("thirdId")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName());
} else if (mainSys.equals("thirdId1")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId1());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName1());
} else if (mainSys.equals("thirdId2")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId2());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName2());
} else if (mainSys.equals("thirdId3")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId3());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName3());
} else if (mainSys.equals("thirdId4")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId4());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName4());
}
if (combineRequest.getErpProductsResponse() != null) {
udiRelevanceEntity.setMeasname(combineRequest.getErpProductsResponse().getMeasname());
udiRelevanceEntity.setManufactory(combineRequest.getErpProductsResponse().getManufactory());

@ -5,6 +5,7 @@ import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.controller.inout.utils.ContrastErpUtil;
import com.glxp.api.admin.controller.inout.utils.InoutUtils;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
import com.glxp.api.admin.httpclient.ErpOrderClient;
import com.glxp.api.admin.entity.inout.OrderEntity;
@ -188,6 +189,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) {
@ -204,13 +206,13 @@ public class OrderController {
return ResultVOUtils.error(500, "ERP出入库单据查询接口地址未定义");
}
List<ErpOrderEntity> erpOrderEntities = null;
if(basicThirdSysDetailEntity.getEnabled()){
if ( basicThirdSysDetailEntity.getFromType() == 0 ) {
if (basicThirdSysDetailEntity.getEnabled()) {
if (basicThirdSysDetailEntity.getFromType() == 0) {
erpOrderEntities = new ErpOrderClient(basicThirdSysDetailEntity.getValue()).getErpOrder(docids, mainOrderEntity.getAction());
} else {
erpOrderEntities = thrOrderService.filterAllOrders(docids, basicThirdSysDetailEntity.getThirdSysFk());
}
}else {
} else {
return ResultVOUtils.error(500, "第三方业务单据服务未启用!");
}
@ -219,7 +221,8 @@ public class OrderController {
List<ErpOrderEntity> returnOrders = new ContrastErpUtil().transErp(erpOrderEntities, udiRelevanceService, mainOrder);
myErpOrderService.insertErpOrders(returnOrders);
List<WarehouseEntity> warehouseEntityList = warehouseService.findByReceiptId(mainOrder);
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, myErpOrderService, orderService, warehouseEntityList, systemParamConfigService);
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, myErpOrderService,
orderService, warehouseEntityList, systemParamConfigService, bussinessTypeEntity);
} else {
mainOrderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
mainOrderEntity.setRemark("获取ERP单失败");

@ -89,32 +89,38 @@ public class OrderDetailController {
return ResultVOUtils.error(500, "第三方业务单据服务未启用");
}
if (basicThirdSysDetailEntity.getThirdSysFk() == null) {
return ResultVOUtils.error(500, "第三方业务单据服务未关联");
}
if (filterErpOrderRequest.getIsDownThrSys() != null && filterErpOrderRequest.getIsDownThrSys()) {
return new ErpOrderClient(basicThirdSysDetailEntity.getValue()).getErpOrderResponse(filterErpOrderRequest);
}
if (filterErpOrderRequest.getIsLocal() != null && filterErpOrderRequest.getIsLocal()) {
// if (filterErpOrderRequest.getIsLocal() != null && filterErpOrderRequest.getIsLocal()) {
// return getLoaclData(filterErpOrderRequest);
// }
if (basicThirdSysDetailEntity.getLocalAction() != null) {
filterErpOrderRequest.setLocalAction(basicThirdSysDetailEntity.getLocalAction());
return getLoaclData(filterErpOrderRequest);
}
if (basicThirdSysDetailEntity.getFromType() == 0) {
if (basicThirdSysDetailEntity.getFromType() != null && basicThirdSysDetailEntity.getFromType() == 0) {
if (basicThirdSysDetailEntity.getValue() == null) {
return ResultVOUtils.error(500, "业务单据查询接口未定义");
}
BaseResponse<PageSimpleResponse<ErpOrderResponse>> baseResponse = new ErpOrderClient(basicThirdSysDetailEntity.getValue()).getErpOrderResponse(filterErpOrderRequest);
//
// if (basicThirdSysDetailEntity.getLocalAction() != null) {
// if (baseResponse.getData().getList() != null) {
// BaseResponse<PageSimpleResponse<ErpOrderResponse>> loca = getLoaclData(filterErpOrderRequest);
// baseResponse.getData().getList().addAll(loca.getData().getList());
// }
// }
//
// if ((baseResponse == null || baseResponse.getCode() != 20000 || baseResponse.getData().getList().size() == 0)
// && basicThirdSysDetailEntity.getIsLocal()) {
// return
// }
if (basicThirdSysDetailEntity.getLocalAction() != null) {
if (baseResponse.getData().getList() != null) {
BaseResponse<PageSimpleResponse<ErpOrderResponse>> loca = getLoaclData(filterErpOrderRequest);
baseResponse.getData().getList().addAll(loca.getData().getList());
}
}
return baseResponse;
@ -304,30 +310,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());
erpOrderEntities.add(erpOrderEntity);
erpOrderEntity.setGoodsunit(subPurchase.getSpec());
}
}
}
@ -342,6 +347,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(myErpOrderService, erpOrderEntities, importErpOrderRequest.getOrderId());
if (exitErp != null) {
String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定";
@ -357,7 +363,8 @@ public class OrderDetailController {
List<ErpOrderEntity> returnOrders = new ContrastErpUtil().transErp(erpOrderEntities, udiRelevanceService, importErpOrderRequest.getOrderId());
myErpOrderService.insertErpOrders(returnOrders);
List<WarehouseEntity> warehouseEntityList = warehouseService.findByReceiptId(importErpOrderRequest.getOrderId());
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, myErpOrderService, orderService, warehouseEntityList, systemParamConfigService);
new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService,
myErpOrderService, orderService, warehouseEntityList, systemParamConfigService, bussinessTypeEntity);
} else {

@ -1,7 +1,10 @@
package com.glxp.api.admin.controller.inout;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.inout.OrderEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.req.inout.*;
import com.glxp.api.admin.res.PageSimpleResponse;
@ -9,11 +12,14 @@ import com.glxp.api.admin.res.inout.WarehouseResponse;
import com.glxp.api.admin.service.basic.BussinessTypeService;
import com.glxp.api.admin.service.inout.CodesTempService;
import com.glxp.api.admin.service.inout.CodesService;
import com.glxp.api.admin.service.inout.OrderService;
import com.glxp.api.admin.thread.IoTransInoutService;
import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.admin.util.FilterUdiUtils;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
@ -22,6 +28,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
@RestController
@ -34,6 +41,8 @@ public class WareHouseController {
private CodesTempService codesTempService;
@Resource
private BussinessTypeService bussinessTypeService;
@Resource
private OrderService orderService;
@PostMapping("/warehouse/inout/code/deleteCodes")
public BaseResponse deleteCodes(@RequestBody DeleteCodeRequest deleteCodeRequest, BindingResult bindingResult) {
@ -115,6 +124,7 @@ public class WareHouseController {
}
//手持终端上传
@PostMapping("warehouse/inout/postOrders")
public BaseResponse postOrders(@RequestBody PostOrderRequest postOrderRequest, BindingResult bindingResult) {
@ -166,6 +176,7 @@ public class WareHouseController {
return ResultVOUtils.success("导入成功");
}
//单据立即提交校验
@PostMapping("/warehouse/inout/commit")
public BaseResponse commitOrder(@RequestBody CommitRequest commitRequest,
BindingResult bindingResult) {
@ -178,4 +189,106 @@ public class WareHouseController {
}
//网页端数据上传调用接口
@PostMapping("warehouse/inout/addOrderWeb")
public BaseResponse addOrderWeb(@RequestBody AddOrderRequest addOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
try {
String code = addOrderRequest.getCode();
if (StringUtils.isBlank(code)) return ResultVOUtils.error(ResultEnum.DATA_ERROR);
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
if (udiEntity == null)
return ResultVOUtils.error(500,"UDI码格式错误");
String orderId = addOrderRequest.getOrderId();
if (StringUtils.isBlank(orderId)) {
orderId = System.currentTimeMillis() + new Random().nextInt(10) + "";
OrderEntity orderSaveRequest = new OrderEntity();
orderSaveRequest.setId(orderId);
if (addOrderRequest.getActDate() != null) {
orderSaveRequest.setActDate(addOrderRequest.getActDate());
}
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getAction());
orderSaveRequest.setMainAction(bussinessTypeEntity.getMainAction());
orderSaveRequest.setAction(addOrderRequest.getAction());
orderSaveRequest.setActor(addOrderRequest.getActor());
orderSaveRequest.setCorpOrderId(addOrderRequest.getCorpOrderId());
orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId());
orderSaveRequest.setFromCorp(addOrderRequest.getFromCorp());
orderSaveRequest.setFromType(addOrderRequest.getFromType());
orderSaveRequest.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
orderSaveRequest.setExportStatus(ConstantStatus.ORDER_EXPORT_UN);
orderSaveRequest.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderSaveRequest.setSignStatus(ConstantStatus.ORDER_SIGN_UN);
orderService.insertOrder(orderSaveRequest);
}
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
warehouseQueryRequest.setOrderId(orderId);
warehouseQueryRequest.setCode(code);
List<WarehouseEntity> warehouseEntitys = codesTempService.findByOrderIdAndCode(warehouseQueryRequest);
WarehouseEntity warehouseEntity = new WarehouseEntity();
if (warehouseEntitys.size() > 0) {
warehouseEntity = warehouseEntitys.get(0);
warehouseEntity.setCount(warehouseEntity.getCount() + 1);
if (StringUtils.isBlank(warehouseEntity.getSerialNo())) {
codesTempService.updateById(warehouseEntity);
} else {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
}
} else {
warehouseEntity.setCode(code);
warehouseEntity.setOrderId(orderId);
warehouseEntity.setCorpOrderId(addOrderRequest.getCorpOrderId());
warehouseEntity.setActDate(addOrderRequest.getActDate());
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getAction());
warehouseEntity.setMainAction(bussinessTypeEntity.getMainAction());
warehouseEntity.setAction(addOrderRequest.getAction());
warehouseEntity.setActor(addOrderRequest.getActor());
warehouseEntity.setFromCorpId(addOrderRequest.getFromCorpId());
warehouseEntity.setFromCorp(addOrderRequest.getFromCorp());
warehouseEntity.setBatchNo(udiEntity.getBatchNo());
warehouseEntity.setProduceDate(udiEntity.getProduceDate());
warehouseEntity.setExpireDate(udiEntity.getExpireDate());
warehouseEntity.setSerialNo(udiEntity.getSerialNo());
warehouseEntity.setCount(1);
List<WarehouseEntity> warehouseEntityList = new ArrayList<>();
warehouseEntityList.add(warehouseEntity);
codesTempService.insertCodesTempSingle(warehouseEntity);
}
return ResultVOUtils.success(orderId);
} catch (Exception e) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
}
//网页端数据上传调用接口
@PostMapping("warehouse/inout/postOrdersWeb")
public BaseResponse postOrdersWeb(@RequestBody PostOrderRequest postOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
try {
transInoutService.creatOrderWeb(postOrderRequest);
} catch (Exception e) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success("导入成功");
}
@GetMapping("warehouse/inout/submitOrderWeb")
public BaseResponse submitOrderWeb(@RequestParam("orderId") String orderId) {
orderService.updateOrderStatus(orderId, ConstantStatus.ORDER_STATUS_PROCESS);
return ResultVOUtils.success();
}
}

@ -1,6 +1,8 @@
package com.glxp.api.admin.controller.inout.utils;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.basic.UdiInfoEntity;
import com.glxp.api.admin.entity.basic.UdiRelevanceEntity;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
@ -11,22 +13,29 @@ import com.glxp.api.admin.entity.inout.FilterErpOrderRequest;
import com.glxp.api.admin.req.basic.FilterUdiInfoRequest;
import com.glxp.api.admin.req.inout.OrderFilterRequest;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysService;
import com.glxp.api.admin.service.basic.UdiInfoService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.service.info.SystemParamConfigService;
import com.glxp.api.admin.service.inout.OrderDetailService;
import com.glxp.api.admin.service.inout.OrderService;
import com.glxp.api.admin.thread.InvProductsTrService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class ContrastErpUtil {
int erpTotalCount;
List<ErpOrderEntity> mErpOrderEntities;
String udiUrl = "";
@Resource
InvProductsTrService invProductsTrService;
public ContrastErpUtil() {
@ -39,7 +48,7 @@ public class ContrastErpUtil {
public void contrastErp(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService,
OrderDetailService myErpOrderService,
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);
@ -59,7 +68,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());
@ -86,8 +95,8 @@ public class ContrastErpUtil {
orderFilterRequest.setId(orderIdFk);
OrderEntity orderEntity = orderService.findOne(orderFilterRequest);
ErpOrderEntity vailExitMsg = vailErpExit(myErpOrderService, mErpOrderEntities, orderIdFk);
SystemParamConfigEntity systemParamConfigEntity = setupService.selectByParamKey("erp_forbidSameErp");
if (vailExitMsg != null && systemParamConfigEntity!=null && systemParamConfigEntity.getParamValue().equals("1")) {
SystemParamConfigEntity systemParamConfigEntity = setupService.selectByParamKey("erp_forbidSameErp");
if (vailExitMsg != null && systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) {
errMsg = "所选ERP单" + vailExitMsg.getErpOrderId() + "已被其他出入库单" + vailExitMsg.getOrderIdFk() + "绑定!";
}
if (mErpOrderEntities != null && mErpOrderEntities.size() > 0)
@ -102,6 +111,7 @@ public class ContrastErpUtil {
orderEntity.setRemark(errMsg);
} else {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_SUCCESS);
invProductsTrService.genInvProducts(orderEntity.getId());
}
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderService.updateOrder(orderEntity);
@ -110,13 +120,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;
}
}
}
}
}

@ -99,7 +99,7 @@ public class InoutUtils {
}
} else if (warehousetemp.getAction().equals(ConstantType.TYPE_OUT_SALE)) {
SystemParamConfigEntity systemParamConfigEntity = configService.selectByParamKey("io_isSalesWareHouseOut");
if (systemParamConfigEntity==null || "0".equals(systemParamConfigEntity.getParamValue())) {
if (systemParamConfigEntity==null || "1".equals(systemParamConfigEntity.getParamValue())) {
return null;
} else {
return warehousetemp.getCode() + "不允许零库存销售出库";
@ -180,7 +180,8 @@ public class InoutUtils {
List<UdiInfoEntity> returnOrderDetail = new ArrayList<>();
Map<String, UdiInfoEntity> sortMaps = new HashMap<>();
for (UdiInfoEntity detailCodeEntity : udiInfoEntities) {
String key = detailCodeEntity.getNameCode();
// String key = detailCodeEntity.getNameCode();
String key = detailCodeEntity.getUuid() + detailCodeEntity.getBatchNo();//todo 20211118 从nameCode修改为UUID未测试
UdiInfoEntity temp = sortMaps.get(key);
if (temp != null) {
detailCodeEntity.setCount(temp.getCount() + detailCodeEntity.getCount());
@ -202,7 +203,10 @@ public class InoutUtils {
erpOrderEntity.setBatchNo(erpDetailCodeEntity.getBatchNo());
erpOrderEntity.setCount(erpDetailCodeEntity.getCount());
erpOrderEntity.setOrderIdFk(warehouseEntityList.get(0).getOrderId());
erpOrderEntity.setProductCompany(erpDetailCodeEntity.getYlqxzcrbarmc());
erpOrderEntity.setProductDate(erpDetailCodeEntity.getProduceDate());
erpOrderEntity.setExpireDate(erpDetailCodeEntity.getExpireDate());
erpOrderEntity.setUuidFk(erpDetailCodeEntity.getUuid());
// erpOrderEntity.setProductCompany(erpDetailCodeEntity.getYlqxzcrbarmc());
erpOrderEntity.setAuthCode(erpDetailCodeEntity.getZczbhhzbapzbh());
erpOrderEntity.setPackSpec(erpDetailCodeEntity.getGgxh());
erpOrderEntities.add(erpOrderEntity);

@ -0,0 +1,75 @@
package com.glxp.api.admin.controller.inventory;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.service.inventory.InvProductDetailService;
import com.glxp.api.admin.service.inventory.InvProductService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.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 InvProductsController {
@Resource
InvProductService invProductService;
@Resource
InvProductDetailService invProductDetailService;
@GetMapping("spms/inv/products/filter")
public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
List<InvProductResponse> invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest);
PageInfo<InvProductResponse> pageInfo;
pageInfo = new PageInfo<>(invProductResponses);
PageSimpleResponse<InvProductResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(invProductResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("spms/inv/products/filterDetail")
public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductRequest) {
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest);
PageInfo<InvProductDetailEntity> pageInfo;
pageInfo = new PageInfo<>(invProductDetailEntities);
PageSimpleResponse<InvProductDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(invProductDetailEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("spms/inv/products/delete")
public BaseResponse deleteInvProduct(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
InvProductEntity invProductEntity = invProductService.selectById(id);
if (invProductEntity != null) {
invProductService.deleteById(id);
invProductDetailService.deleteByProductId(invProductEntity.getId() + "");
return ResultVOUtils.success("删除成功");
} else {
return ResultVOUtils.error(500, "删除失败!");
}
}
}

@ -110,7 +110,10 @@ public class ThrOrderController {
if (thrOrderImportLogEntity == null) {
thrOrderImportLogEntity = new ThrOrderImportLogEntity();
thrOrderImportLogEntity.setGenKey(genKey);
thrOrderImportLogEntity.setFromType("第三方系统上传");
if (postThrOrderRequest.getUploadType() != null) {
thrOrderImportLogEntity.setFromType("文件上传");
} else
thrOrderImportLogEntity.setFromType("第三方系统上传");
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
@ -149,6 +152,54 @@ public class ThrOrderController {
return ResultVOUtils.success("单据上传成功!");
}
@PostMapping("/udiwms/thrsys/postFileOrder")
public BaseResponse postFileOrder(@RequestBody PostFileThrOrderRequest postThrOrderRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String genKey = postThrOrderRequest.getGenKey();
if (genKey == null) {
genKey = CustomUtil.getId();
}
ThrOrderImportLogEntity thrOrderImportLogEntity = thrOrderImportLogService.selectByGenKey(genKey);
if (thrOrderImportLogEntity == null) {
thrOrderImportLogEntity = new ThrOrderImportLogEntity();
thrOrderImportLogEntity.setGenKey(genKey);
if (postThrOrderRequest.getUploadType() != null) {
thrOrderImportLogEntity.setFromType("文件上传");
} else
thrOrderImportLogEntity.setFromType("第三方系统上传");
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
}
List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities = postThrOrderRequest.getDatas();
if (thrOrderImportDetailEntities != null && thrOrderImportDetailEntities.size() > 0) {
String finalGenKey = genKey;
for (ThrOrderImportDetailEntity thrOrderImportDetailEntity : thrOrderImportDetailEntities) {
thrOrderImportDetailEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
thrOrderImportDetailEntity.setGenKeyFk(genKey);
thrOrderImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
thrOrderImportDetailEntity.setUpdateTime(new Date(System.currentTimeMillis()));
}
thrOrderImportDetailService.insertOrderImportDetails(thrOrderImportDetailEntities);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
thrOrderImportService.importThrOrder(finalGenKey);
} else {
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
return ResultVOUtils.error(500, "上传数据为空");
}
return ResultVOUtils.success("单据上传成功!");
}
@PostMapping("/udiwms/thrsys/delOrder")
public BaseResponse delOrder(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
@ -209,7 +260,7 @@ public class ThrOrderController {
if (filterThrProductsRequest.getErpOrderResponses() != null) {//选中导出
thrOrdersDlService.importSelectOrders(genKey, filterThrProductsRequest.getErpOrderResponses(), filterThrProductsRequest.getThirdSysFk());
} else { //结果导出
thrOrdersDlService.importOrders(genKey, filterThrProductsRequest.getBillAction(),null);
thrOrdersDlService.importOrders(genKey, filterThrProductsRequest.getBillAction(), null);
}
return ResultVOUtils.success("后台开始下载更新,请稍后刷新查看");
}
@ -234,14 +285,15 @@ public class ThrOrderController {
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogEntity.setThirdSysFk(filterThrProductsRequest.getThirdSysFk());
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
if (filterThrProductsRequest.getErpOrderResponses() != null && filterThrProductsRequest.getErpOrderResponses().size()>0) {//选中导出
if (filterThrProductsRequest.getErpOrderResponses() != null && filterThrProductsRequest.getErpOrderResponses().size() > 0) {//选中导出
thrOrdersDlService.importSelectOrders(genKey, filterThrProductsRequest.getErpOrderResponses(), filterThrProductsRequest.getThirdSysFk());
} else { //结果导出
thrOrdersDlService.importOrders(genKey, filterThrProductsRequest.getBillAction(),filterThrProductsRequest);
thrOrdersDlService.importOrders(genKey, filterThrProductsRequest.getBillAction(), filterThrProductsRequest);
}
return ResultVOUtils.success("后台开始下载更新,请稍后刷新查看");
}
}
@PostMapping("/udiwms/smp/postOrder")
public BaseResponse postSmpOrder(@RequestBody PostSmpOrderRequest postSmpOrderRequest,
BindingResult bindingResult) {

@ -174,14 +174,14 @@ public class ThrOrderExportLogController {
}
BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessTypeService.findByActionKey(filterErpOrderRequest.getBillAction(), "orderQueryUrl");
if (!basicThirdSysDetailEntity.getEnabled()|| basicThirdSysDetailEntity.getThirdSysFk() == null) {
return ResultVOUtils.error(500, "第三方业务单据服务未启用");
}
if (basicThirdSysDetailEntity.getValue() == null) {
return ResultVOUtils.error(500, "业务单据查询接口未定义");
}
if (!basicThirdSysDetailEntity.getEnabled()) {
return ResultVOUtils.error(500, "第三方业务单据服务未启用");
}
if (basicThirdSysDetailEntity.getFromType() == 0 ) {
if (basicThirdSysDetailEntity.getFromType()!=null && basicThirdSysDetailEntity.getFromType() == 0 ) {
return new ErpOrderClient(basicThirdSysDetailEntity.getValue()).getErpOrderResponse(filterErpOrderRequest);
} else {
//todo 订单查询,需加日期

@ -112,7 +112,7 @@ public class ThrOrderImportLogController {
@PostMapping("/udiwms/thrOrder/importLog/upload")
public BaseResponse uploadProducts(@RequestParam("file") List<MultipartFile> files, @RequestParam("thirdSys") String thirdSys) {
public BaseResponse uploadOrders(@RequestParam("file") List<MultipartFile> files, @RequestParam("thirdSys") String thirdSys) {
String filePath = "D:\\udiwms\\filePath\\";
File createFile = new File(filePath);

@ -2,6 +2,7 @@ package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsImportLogEntity;
import com.glxp.api.admin.req.basic.FilterUdiInfoRequest;
@ -11,6 +12,7 @@ import com.glxp.api.admin.req.thrsys.PostThrProductsRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpProductsResponse;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.service.thrsys.ThrProductsImportLogService;
import com.glxp.api.admin.service.thrsys.ThrProductsService;
@ -40,6 +42,8 @@ public class ThrProductsController {
ThrProductsImportLogService thrProductsImportLogService;
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
BasicThirdSysService basicThirdSysService;
@GetMapping("/udiwms/thrsys/getThrProducts")
@ -60,6 +64,33 @@ public class ThrProductsController {
}
@GetMapping("/udiwms/thrsys/filterProducts")
public BaseResponse filterThrProducts(FilterThrProductsRequest filterThrProductsRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<ThrProductsEntity> thrCorpEntities
= thrProductsService.filterThrProductsRequest(filterThrProductsRequest);
if (thrCorpEntities != null && thrCorpEntities.size() > 0) {
for (ThrProductsEntity thrProductsEntity : thrCorpEntities) {
BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(thrProductsEntity.getThirdSysFk());
thrProductsEntity.setThirdSysName(basicThirdSysEntity.getThirdName());
}
}
PageInfo<ThrProductsEntity> pageInfo;
pageInfo = new PageInfo<>(thrCorpEntities);
PageSimpleResponse<ThrProductsEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(thrCorpEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/udiwms/thrsys/delThrProducts")
public BaseResponse delThrProducts(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
@ -203,7 +234,7 @@ public class ThrProductsController {
if (filterThrProductsRequest.getThrProductsEntities() != null && filterThrProductsRequest.getThrProductsEntities().size() > 0) {//选中导出
thrProductsDlService.importSelectProducrs(genKey, filterThrProductsRequest.getThrProductsEntities(), filterThrProductsRequest.getThirdSysFk());
} else { //结果导出
thrProductsDlService.importProducrs(genKey,filterThrProductsRequest );
thrProductsDlService.importProducrs(genKey, filterThrProductsRequest);
}
// thrProductsDlService.importProducrs(genKey, filterThrProductsRequest.getThirdSysFk());

@ -17,4 +17,12 @@ public interface CodesTempDao {
List<WarehouseEntity> findByOrderId(WarehouseQueryRequest warehouseQueryRequest);
int insertCodesTempSingle(WarehouseEntity warehouseEntitie);
int updateById(WarehouseEntity warehouseEntitie);
int deleteCodesTempById(WarehouseEntity warehouseEntitie);
List<WarehouseEntity> findByOrderIdAndCode(WarehouseQueryRequest warehouseQueryRequest);
}

@ -0,0 +1,27 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvProductDao {
List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
boolean insertInvProduct(InvProductEntity invProductEntity);
boolean updateInvProduct(InvProductEntity invProductEntity);
InvProductEntity selectById(@Param("id") String id);
boolean deleteById(@Param("id") String id);
}

@ -0,0 +1,25 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvProductDetailDao {
List<InvProductDetailEntity> filterInvProductDetail(FilterInvProductDetailRequest filterInvProductDetailRequest);
boolean insertInvProductDetail(InvProductDetailEntity invProductDetailEntity);
boolean insertInvProductDetails(List<InvProductDetailEntity> invProductDetailEntitys);
boolean updateInvProductDetail(InvProductDetailEntity invProductDetailEntity);
boolean deleteById(@Param("id") String id);
boolean deleteByProductId(@Param("productIdFk") String productIdFk);
}

@ -24,5 +24,7 @@ public class UdiRelevanceEntity {
private String ybbm;
private String sptm;
private Boolean isDisable;
private String mainId;
private String mainName;
}

@ -39,7 +39,7 @@ public class ErpOrderEntity {
private int erpCount;
private String originType;
private int reCount;
private String uuidFk;
private String nameCode;
private String productCompany;

@ -0,0 +1,17 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
import java.util.Date;
@Data
public class InvProductDetailEntity {
private Integer id;
private String code;
private String productIdFk;
private String orderIdFk;
private String mainAction;
private String action;
private Integer count;
private Date updateTime;
}

@ -0,0 +1,32 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
@Data
public class InvProductEntity {
private Integer id;
private String productsName;
private String nameCode;
private String relIdFk;
private String ggxh;
private String batchNo;
private String productionDate;
private String expireDate;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
private Integer inCount;
private Integer outCount;
private Integer reCount;
public Integer getInCount() {
if (inCount == null)
return 0;
return inCount;
}
public Integer getOutCount() {
if (outCount == null)
return 0;
return outCount;
}
}

@ -26,6 +26,8 @@ public class ThrProductsEntity {
private String cpms;
private Date updateTime;
private String thirdSysName;
private boolean isChecked;
}

@ -11,13 +11,15 @@ public class FilterUdiInfoRequest extends ListPageRequest {
private String nameCode;
private String uuid;
private String ggxh;
private String thirdId;
private String id;
private String thirdId;
private String thirdId1;
private String thirdId2;
private String thirdId3;
private String thirdId4;
private String ybbm;
private String sptm;
private String thirdCode;
@ -31,6 +33,7 @@ public class FilterUdiInfoRequest extends ListPageRequest {
private String unionCode;
private String udiCode;
private String thrPiId;
private String unionFilterStr;//产品名称,规格,批文,生产厂家联合查询
private Boolean isCheck;

@ -0,0 +1,20 @@
package com.glxp.api.admin.req.inout;
import lombok.Data;
@Data
public class AddOrderRequest {
private String corpOrderId;
private String code;
private String actor;
private String mainAction;
private String action;
private String fromCorpId;
private String fromCorp;
private String fromType;
private String actDate;
private String billType;
private String orderId;
private String customerId;
}

@ -1,5 +1,6 @@
package com.glxp.api.admin.req.inout;
import com.glxp.api.admin.res.inout.ErpOrderResponse;
import com.glxp.api.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;

@ -18,5 +18,6 @@ public class OrderFilterRequest extends ListPageRequest {
private String startTime;
private String endTime;
private String stockCheckFk;
private Integer process;
}

@ -4,9 +4,11 @@ import com.glxp.api.admin.entity.inout.WarehouseEntity;
import lombok.Data;
import java.util.List;
@Data
public class PostOrderRequest {
List<PostOrder> postOrders;
int submitType;//0提交1保存
String oldOrderId;//保存再编辑后再保存或提交根据旧id删除旧数据。
public List<PostOrder> getPostOrder() {
return postOrders;

@ -0,0 +1,15 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class FilterInvProductDetailRequest extends ListPageRequest {
private String id;
private String code;
private String productIdFk;
private String mainAction;
private String action;
private Integer count;
}

@ -0,0 +1,22 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class FilterInvProductRequest extends ListPageRequest {
private String id;
private String cpmctymc;
private String nameCode;
private String relIdFk;
private String ggxh;
private String batchNo;
private String productionDate;
private String expireDate;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
private String productsName;
}

@ -17,4 +17,8 @@ public class FilterThrProductsRequest extends ListPageRequest {
private String thirdSys;
private String thirdSysFk;
private String unionCode;
private String sptm;
private String ybbm;
}

@ -0,0 +1,17 @@
package com.glxp.api.admin.req.thrsys;
import com.glxp.api.admin.entity.thrsys.ThrOrderImportDetailEntity;
import com.glxp.api.admin.res.inout.ErpOrderResponse;
import lombok.Data;
import java.util.List;
@Data
public class PostFileThrOrderRequest {
private String genKey;
private String thirdSys;
private String uploadType;
private List<ThrOrderImportDetailEntity> datas;
}

@ -10,6 +10,7 @@ public class PostThrOrderRequest {
private String genKey;
private String thirdSys;
private String uploadType;
private List<ErpOrderResponse> datas;
}

@ -17,4 +17,5 @@ public class BussinessTypResponse {
private Boolean enabled;
private String localAction;
}

@ -7,4 +7,6 @@ public class SrtBasicUnitResponse {
private String unitId;
private String unitName;
private String thirdId;
private String spell;
}

@ -49,4 +49,6 @@ public class UdiRelevanceResponse {
private String erpId;
private String erpName;
private Integer productType;
private String mainId;
private String mainName;
}

@ -44,6 +44,7 @@ public class UdiRlDlResponse {
private String ybbm;
private String sptm;
private Integer productType;
private String mainId;
public Integer getProductType() {
if (productType == null) return 0

@ -0,0 +1,33 @@
package com.glxp.api.admin.res.inventory;
import lombok.Data;
@Data
public class InvProductResponse {
private Integer id;
private String cpmctymc;
private String nameCode;
private String relIdFk;
private String ggxh;
private String batchNo;
private String productionDate;
private String expireDate;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
private Integer inCount;
private Integer outCount;
private Integer reCount;
private String customerId;
public Integer getInCount() {
if (inCount == null)
return 0;
return inCount;
}
public Integer getOutCount() {
if (outCount == null)
return 0;
return outCount;
}
}

@ -23,8 +23,11 @@ public class UdiInfoServiceImpl implements UdiInfoService {
if (filterUdiInfoRequest == null) {
return Collections.emptyList();
}
int offset = (filterUdiInfoRequest.getPage() - 1) * filterUdiInfoRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiInfoRequest.getLimit());
if(filterUdiInfoRequest.getPage()!=null){
int offset = (filterUdiInfoRequest.getPage() - 1) * filterUdiInfoRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiInfoRequest.getLimit());
}
List<UdiInfoEntity> data = udiInfoDao.filterUdiInfo(filterUdiInfoRequest);
return data;
}

@ -187,6 +187,26 @@ public class UdiRelevanceServiceImpl implements UdiRelevanceService {
@Override
public boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity) {
BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys();
String mainSys = basicThirdSysEntity.getThirdId();
if (mainSys.equals("thirdId")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName());
} else if (mainSys.equals("thirdId1")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId1());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName1());
} else if (mainSys.equals("thirdId2")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId2());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName2());
} else if (mainSys.equals("thirdId3")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId3());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName3());
} else if (mainSys.equals("thirdId4")) {
udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId4());
udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName4());
}
return udiRelevanceDao.updateUdiRelevance(udiRelevanceEntity);
}

@ -13,4 +13,14 @@ public interface CodesTempService {
List<WarehouseEntity> findByOrderId(WarehouseQueryRequest warehouseQueryRequest);
int insertCodesTempSingle(WarehouseEntity warehouseEntitie);
int updateById(WarehouseEntity warehouseEntitie);
int deleteCodesTempById(WarehouseEntity warehouseEntitie);
List<WarehouseEntity> findByOrderIdAndCode(WarehouseQueryRequest warehouseQueryRequest);
}

@ -40,4 +40,32 @@ public class CodesTempServiceImpl implements CodesTempService {
}
return codesTempDao.findByOrderId(warehouseQueryRequest);
}
@Override
public int insertCodesTempSingle(WarehouseEntity warehouseEntitie) {
return codesTempDao.insertCodesTempSingle(warehouseEntitie);
}
@Override
public int updateById(WarehouseEntity warehouseEntitie) {
return codesTempDao.updateById(warehouseEntitie);
}
@Override
public int deleteCodesTempById(WarehouseEntity warehouseEntitie) {
return codesTempDao.deleteCodesTempById(warehouseEntitie);
}
@Override
public List<WarehouseEntity> findByOrderIdAndCode(WarehouseQueryRequest warehouseQueryRequest) {
if (warehouseQueryRequest == null) {
return Collections.emptyList();
}
if (warehouseQueryRequest.getPage() != null) {
int offset = (warehouseQueryRequest.getPage() - 1) * warehouseQueryRequest.getLimit();
PageHelper.offsetPage(offset, warehouseQueryRequest.getLimit());
}
return codesTempDao.findByOrderIdAndCode(warehouseQueryRequest);
}
}

@ -0,0 +1,23 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import java.util.List;
public interface InvProductDetailService {
List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity);
boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys);
boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity);
boolean deleteById(String id);
boolean deleteByProductId(String productIdFk);
}

@ -0,0 +1,26 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import java.util.List;
public interface InvProductService {
List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
InvProductEntity selectByUuid(String uuid, String batchNo);
InvProductEntity selectById(String id);
boolean insertInvProduct(InvProductEntity invProductEntity);
boolean updateInvProduct(InvProductEntity invProductEntity);
boolean deleteById(String id);
}

@ -0,0 +1,58 @@
package com.glxp.api.admin.service.inventory.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.inventory.InvProductDetailDao;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.service.inventory.InvProductDetailService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class InvProductDetailServiceImpl implements InvProductDetailService {
@Resource
InvProductDetailDao invProductDetailDao;
@Override
public List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest == null) {
return Collections.emptyList();
}
if (filterInvProductDetailRequest.getPage() != null) {
int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit());
}
List<InvProductDetailEntity> data = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
return data;
}
@Override
public boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity) {
return invProductDetailDao.insertInvProductDetail(invProductDetailEntity);
}
@Override
public boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys) {
return invProductDetailDao.insertInvProductDetails(invProductDetailEntitys);
}
@Override
public boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity) {
return invProductDetailDao.updateInvProductDetail(invProductDetailEntity);
}
@Override
public boolean deleteById(String id) {
return invProductDetailDao.deleteById(id);
}
@Override
public boolean deleteByProductId(String productIdFk) {
return false;
}
}

@ -0,0 +1,78 @@
package com.glxp.api.admin.service.inventory.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.inventory.InvProductDao;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.service.inventory.InvProductService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class InvProductServiceImpl implements InvProductService {
@Resource
InvProductDao invProductDao;
@Override
public List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (filterInvProductRequest == null) {
return Collections.emptyList();
}
if (filterInvProductRequest.getPage() != null) {
int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductRequest.getLimit());
}
List<InvProductEntity> data = invProductDao.filterInvProduct(filterInvProductRequest);
return data;
}
@Override
public List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (filterInvProductRequest == null) {
return Collections.emptyList();
}
if (filterInvProductRequest.getPage() != null) {
int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductRequest.getLimit());
}
List<InvProductResponse> data = invProductDao.filterJoinInvProduct(filterInvProductRequest);
return data;
}
@Override
public InvProductEntity selectByUuid(String uuid, String batchNo) {
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
filterInvProductRequest.setRelIdFk(uuid);
filterInvProductRequest.setBatchNo(batchNo);
List<InvProductEntity> data = filterInvProduct(filterInvProductRequest);
if (data != null && data.size() > 0) {
return data.get(0);
}
return null;
}
@Override
public InvProductEntity selectById(String id) {
return invProductDao.selectById(id);
}
@Override
public boolean insertInvProduct(InvProductEntity invProductEntity) {
return invProductDao.insertInvProduct(invProductEntity);
}
@Override
public boolean updateInvProduct(InvProductEntity invProductEntity) {
return invProductDao.updateInvProduct(invProductEntity);
}
@Override
public boolean deleteById(String id) {
return invProductDao.deleteById(id);
}
}

@ -70,10 +70,6 @@ public class BasicBackUpdateProductService {
Map<String, ErpProductsResponse> erpProductsMap = new HashMap<>();
if (invmandocResponses != null && invmandocResponses.size() > 0) {
List<String> inventoryCodes = new ArrayList<>();
// if (filterErpGoodsRequest.getCode() != null) {
// inventoryCodes.add(filterErpGoodsRequest.getCode());
// erpProductsMap.put(filterErpGoodsRequest.getCode(), invmandocResponses.get(0));
// } else {
for (ErpProductsResponse invmandocResponse : invmandocResponses) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(invmandocResponse.getCode(), thirdSysId);
if (udiRelevanceEntity == null) {

@ -188,7 +188,8 @@ public class BasicUdiInfoImportService {
}
public void updateValue(UdiRelevanceEntity udiRelevanceEntity, UdiInfoImportDetailEntity udiInfoImportDetailEntity, UdiInfoImportLogEntity udiInfoImportLogEntity, String mainId) {
public void updateValue(UdiRelevanceEntity udiRelevanceEntity, UdiInfoImportDetailEntity udiInfoImportDetailEntity,
UdiInfoImportLogEntity udiInfoImportLogEntity, String mainId) {
udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime());
if (udiInfoImportDetailEntity.getYbbm() != null && !udiInfoImportDetailEntity.getYbbm().trim().equals("")) {
udiRelevanceEntity.setYbbm(udiInfoImportDetailEntity.getYbbm());
@ -203,6 +204,8 @@ public class BasicUdiInfoImportService {
if (mainId != null && udiInfoImportDetailEntity.getThirdId().equals(mainId)) {
udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory());
udiRelevanceEntity.setMeasname(thrProductsEntity.getMeasname());
udiRelevanceEntity.setMainId(mainId);
udiRelevanceEntity.setMainName(thrProductsEntity.getName());
}
udiRelevanceEntity.setThirdName(thrProductsEntity.getName());
udiRelevanceEntity.setThirdId(udiInfoImportDetailEntity.getThirdId());
@ -220,6 +223,8 @@ public class BasicUdiInfoImportService {
if (mainId != null && udiInfoImportDetailEntity.getThirdId1().equals(mainId)) {
udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory());
udiRelevanceEntity.setMeasname(thrProductsEntity.getMeasname());
udiRelevanceEntity.setMainId(mainId);
udiRelevanceEntity.setMainName(thrProductsEntity.getName());
}
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
udiRelevanceEntity.setThirdName1(thrProductsEntity.getName());
@ -237,6 +242,8 @@ public class BasicUdiInfoImportService {
if (mainId != null && udiInfoImportDetailEntity.getThirdId2().equals(mainId)) {
udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory());
udiRelevanceEntity.setMeasname(thrProductsEntity.getMeasname());
udiRelevanceEntity.setMainId(mainId);
udiRelevanceEntity.setMainName(thrProductsEntity.getName());
}
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
udiRelevanceEntity.setThirdId2(udiInfoImportDetailEntity.getThirdId2());
@ -255,6 +262,8 @@ public class BasicUdiInfoImportService {
if (mainId != null && udiInfoImportDetailEntity.getThirdId3().equals(mainId)) {
udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory());
udiRelevanceEntity.setMeasname(thrProductsEntity.getMeasname());
udiRelevanceEntity.setMainId(mainId);
udiRelevanceEntity.setMainName(thrProductsEntity.getName());
}
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
udiRelevanceEntity.setThirdId3(udiInfoImportDetailEntity.getThirdId3());
@ -273,6 +282,8 @@ public class BasicUdiInfoImportService {
if (mainId != null && udiInfoImportDetailEntity.getThirdId4().equals(mainId)) {
udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory());
udiRelevanceEntity.setMeasname(thrProductsEntity.getMeasname());
udiRelevanceEntity.setMainId(mainId);
udiRelevanceEntity.setMainName(thrProductsEntity.getName());
}
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
udiRelevanceEntity.setThirdName4(thrProductsEntity.getName());

@ -3,10 +3,7 @@ package com.glxp.api.admin.thread;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.basic.UdiInfoEntity;
import com.glxp.api.admin.entity.basic.UdiRelevanceEntity;
import com.glxp.api.admin.entity.basic.*;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
import com.glxp.api.admin.entity.thrsys.ThrInvProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsEntity;
@ -22,6 +19,7 @@ import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpProductsResponse;
import com.glxp.api.admin.res.inventory.ErpInvProductResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.basic.BasicThirdSysService;
import com.glxp.api.admin.service.basic.UdiInfoService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.service.info.SystemParamConfigService;
@ -62,6 +60,8 @@ public class BasicUpdateProductService {
SystemParamConfigService systemParamConfigService;
@Resource
BasicThirdSysDetailService basicThirdSysDetailService;
@Resource
BasicThirdSysService basicThirdSysService;
public String addProduct(CombineRequest combineRequest, String url) {
@ -211,6 +211,25 @@ public class BasicUpdateProductService {
udiRelevanceEntity1.setUuid(udiInfoEntity.getUuid());
udiRelevanceEntity1.setThirdName(thrProductsEntity.getName());
udiRelevanceEntity1.setUpdateTime(DateUtil.getDateTime());
BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys();
String mainSys = basicThirdSysEntity.getThirdId();
if (mainSys.equals("thirdId")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName());
} else if (mainSys.equals("thirdId1")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId1());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName1());
} else if (mainSys.equals("thirdId2")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId2());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName2());
} else if (mainSys.equals("thirdId3")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId3());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName3());
} else if (mainSys.equals("thirdId4")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId4());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName4());
}
udiRelevanceService.insertUdiRelevance(udiRelevanceEntity1);
}
}
@ -252,6 +271,25 @@ public class BasicUpdateProductService {
udiRelevanceEntity1.setThirdName4(onhandQueryResponse.getName());
}
BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys();
String mainSys = basicThirdSysEntity.getThirdId();
if (mainSys.equals("thirdId")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName());
} else if (mainSys.equals("thirdId1")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId1());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName1());
} else if (mainSys.equals("thirdId2")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId2());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName2());
} else if (mainSys.equals("thirdId3")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId3());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName3());
} else if (mainSys.equals("thirdId4")) {
udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId4());
udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName4());
}
udiRelevanceEntity1.setThirdId(onhandQueryResponse.getCode());
udiRelevanceEntity1.setThirdName(onhandQueryResponse.getName());
udiRelevanceEntity1.setUpdateTime(DateUtil.getDateTime());

@ -0,0 +1,146 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.constant.ConstantType;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.basic.UdiInfoEntity;
import com.glxp.api.admin.entity.inout.ErpOrderEntity;
import com.glxp.api.admin.entity.inout.FilterErpOrderRequest;
import com.glxp.api.admin.entity.inout.OrderEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.basic.FilterUdiInfoRequest;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.service.basic.BussinessTypeService;
import com.glxp.api.admin.service.basic.UdiInfoService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.service.inout.CodesService;
import com.glxp.api.admin.service.inout.OrderDetailService;
import com.glxp.api.admin.service.inout.OrderService;
import com.glxp.api.admin.service.inventory.InvProductDetailService;
import com.glxp.api.admin.service.inventory.InvProductService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service
public class InvProductsTrService {
@Resource
private OrderService orderService;
@Resource
private OrderDetailService myErpOrderService;
@Resource
private CodesService codesService;
@Resource
private UdiRelevanceService udiRelevanceService;
@Resource
private UdiInfoService udiInfoService;
@Resource
private BussinessTypeService bussinessTypeService;
@Resource
private InvProductService invProductService;
@Resource
private InvProductDetailService invProductDetailService;
@Async
public void genInvProducts(String orderId) {
OrderEntity orderEntity = orderService.findById(orderId);
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_SUCCESS &&
(orderEntity.getContrastStatus() == ConstantStatus.ORDER_CHECK_SUCCESS ||
orderEntity.getContrastStatus() == ConstantStatus.ORDER_CHECK_UN)) {
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderId);
List<ErpOrderEntity> erpOrderEntities = myErpOrderService.filterAllMyErpOrder(filterErpOrderRequest);
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
if (erpOrderEntities != null && erpOrderEntities.size() > 0) {
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
String nameCode = erpOrderEntity.getNameCode();
String erpId = erpOrderEntity.getGoodsid();
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(nameCode);
if (bussinessTypeEntity.getThirdSysFk() != null) {
if (bussinessTypeEntity.getThirdSysFk().equals("thirdId")) {
filterUdiInfoRequest.setThirdId(erpId);
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId1")) {
filterUdiInfoRequest.setThirdId1(erpId);
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId2")) {
filterUdiInfoRequest.setThirdId2(erpId);
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId3")) {
filterUdiInfoRequest.setThirdId3(erpId);
} else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId4")) {
filterUdiInfoRequest.setThirdId4(erpId);
}
}
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
String relId = null;
if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0) {
relId = udiRelevanceResponses.get(0).getId() + "";
}
if (relId != null) {
InvProductEntity invProductEntity = invProductService.selectByUuid(relId, erpOrderEntity.getBatchNo());
if (invProductEntity == null) {
invProductEntity = new InvProductEntity();
invProductEntity.setRelIdFk(relId);
invProductEntity.setBatchNo(erpOrderEntity.getBatchNo());
invProductEntity.setExpireDate(erpOrderEntity.getExpireDate());
invProductEntity.setProductionDate(erpOrderEntity.getProductDate());
invProductEntity.setGgxh(erpOrderEntity.getPackSpec());
invProductEntity.setNameCode(erpOrderEntity.getNameCode());
invProductEntity.setProductsName(erpOrderEntity.getCoName());
invProductEntity.setYlqxzcrbarmc(erpOrderEntity.getProductCompany());
invProductEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode());
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invProductEntity.setOutCount(erpOrderEntity.getCount());
} else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invProductEntity.setInCount(erpOrderEntity.getCount());
}
invProductService.insertInvProduct(invProductEntity);
invProductEntity = invProductService.selectByUuid(relId, erpOrderEntity.getBatchNo());
} else {
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invProductEntity.setOutCount(invProductEntity.getOutCount() + erpOrderEntity.getCount());
} else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invProductEntity.setInCount(invProductEntity.getInCount() + erpOrderEntity.getCount());
}
invProductService.updateInvProduct(invProductEntity);
}
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderId);
if (warehouseEntities != null && warehouseEntities.size() > 0) {
for (WarehouseEntity warehouseEntity : warehouseEntities) {
UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(warehouseEntity.getNameCode());
if (udiInfoEntity.getUuid().equals(erpOrderEntity.getUuidFk())) {
if ((warehouseEntity.getBatchNo() == null && erpOrderEntity.getBatchNo() == null) ||
warehouseEntity.getBatchNo().equals(erpOrderEntity.getBatchNo())) {
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
invProductDetailEntity.setProductIdFk(invProductEntity.getId() + "");
invProductDetailEntity.setCode(warehouseEntity.getCode());
invProductDetailEntity.setAction(warehouseEntity.getAction());
invProductDetailEntity.setMainAction(warehouseEntity.getMainAction());
invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId());
invProductDetailEntity.setCount(warehouseEntity.getCount());
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailService.insertInvProduct(invProductDetailEntity);
}
}
}
}
}
}
}
}
}
}

@ -4,6 +4,7 @@ import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.controller.inout.utils.DataTransUtil;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
import com.glxp.api.admin.httpclient.ErpOrderClient;
@ -29,6 +30,7 @@ import com.glxp.api.admin.service.inout.CodesService;
import com.glxp.api.admin.service.thrsys.ThrDataService;
import com.glxp.api.admin.service.thrsys.ThrOrderService;
import com.glxp.api.admin.util.FilterUdiUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -57,7 +59,6 @@ public class IoTransInoutService {
@Value("${UDI_SERVER_URL}")
private String udiUrl;
@Resource
private CodesTempService codesTempService;
@Autowired
@ -68,6 +69,8 @@ public class IoTransInoutService {
private ThrOrderService thrOrderService;
@Resource
ThrDataService thrDataService;
@Resource
InvProductsTrService invProductsTrService;
//生成订单,插入零时表
@Async
@ -126,6 +129,60 @@ public class IoTransInoutService {
}
}
//web端新增订单
@Async
public void creatOrderWeb(PostOrderRequest postOrderRequest) {
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrder();
if (postOrders != null && postOrders.size() > 0) {
for (int i = 0; i < postOrders.size(); i++) {
PostOrderRequest.PostOrder postOrder = postOrders.get(i);
List<WarehouseEntity> warehouseEntityList = postOrder.getCodes();
if (warehouseEntityList != null && warehouseEntityList.size() > 0) {
if (StringUtils.isNotBlank(postOrderRequest.getOldOrderId())) {
orderService.deleteById(postOrderRequest.getOldOrderId());
myErpOrderService.deleteByOrderId(postOrderRequest.getOldOrderId());
}
WarehouseEntity warehouseEntity = warehouseEntityList.get(0);
String orderId = System.currentTimeMillis() + i + "";
OrderEntity orderSaveRequest = new OrderEntity();
orderSaveRequest.setId(orderId);
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(postOrderRequest.getSubmitType() == 0 ?
ConstantStatus.ORDER_STATUS_PROCESS : ConstantStatus.ORDER_STATUS_TEMP_SAVE);
orderSaveRequest.setExportStatus(ConstantStatus.ORDER_EXPORT_UN);
orderSaveRequest.setStockCheckFk(postOrder.getStockIdFk());
orderSaveRequest.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderSaveRequest.setSignStatus(ConstantStatus.ORDER_SIGN_UN);
List<String> docidsList = postOrder.getErpOrders();
String docidStr = "";
if (docidsList != null) {
for (String key : docidsList) {
docidStr = docidStr + "," + key;
}
if (docidStr.length() > 1) {
docidStr = docidStr.substring(1);
orderSaveRequest.setErpFk(docidStr);
}
}
orderService.insertOrder(orderSaveRequest);
for (int index = 0; index < warehouseEntityList.size(); index++) {
warehouseEntityList.get(index).setOrderId(orderId);
}
codesTempService.insertCodesTemp(warehouseEntityList);
}
}
}
}
//查找等待处理单据,转入正式表
@Async
public void transInout() {
@ -173,6 +230,7 @@ public class IoTransInoutService {
//因为只需用到条码,所以不需要重新读取
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, insertList);
orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_SUCCESS);
invProductsTrService.genInvProducts(orderEntity.getId());
}
List<Long> ids = new ArrayList<>();
@ -267,6 +325,7 @@ public class IoTransInoutService {
}
public void checkThirdOrder(List<ErpOrderEntity> cloudErps, OrderEntity orderEntity, List<WarehouseEntity> transData) {
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
if (cloudErps != null && cloudErps.size() > 0) {
List<ErpOrderEntity> returnOrders = new ContrastErpUtil().transErp(cloudErps, udiRelevanceService, orderEntity.getId());
ErpOrderEntity temp = returnOrders.get(0);
@ -281,7 +340,7 @@ public class IoTransInoutService {
}
myErpOrderService.deleteByOrderId(orderEntity.getId());
myErpOrderService.insertErpOrders(returnOrders);
new ContrastErpUtil(udiUrl).contrastErp(udiInfoService, udiRelevanceService, myErpOrderService, orderService, transData, systemParamConfigService);
new ContrastErpUtil(udiUrl).contrastErp(udiInfoService, udiRelevanceService, myErpOrderService, orderService, transData, systemParamConfigService,bussinessTypeEntity);
} else {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);

@ -163,15 +163,15 @@ public class ThrOrdersDlService {
} else {//一键导出
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", thrOrderExportRequest.getThirdSysFk());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
if (!basicThirdSysDetailEntity.getEnabled() || basicThirdSysDetailEntity.getThirdSysFk() == null) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("往来单位接口地址未定义");
thrOrderExportLogEntity.setRemark("第三方业务单据服务未启用");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
if (!basicThirdSysDetailEntity.getEnabled()) {
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("第三方往来单位服务未启用");
thrOrderExportLogEntity.setRemark("业务单据接口地址未定义");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}

@ -4,8 +4,8 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
#spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms_new?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
#spring.datasource.password=root
#spring.datasource.password=123456
spring.datasource.password=root
server.servlet.context-path=
logging.level.com.glxp.api.admin.dao=debug

@ -1,4 +1,4 @@
spring.profiles.active=dev
spring.profiles.active=pro
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

@ -48,15 +48,15 @@
<insert id="insertBussinessType" keyProperty="id"
parameterType="com.glxp.api.admin.entity.basic.BussinessTypeEntity">
INSERT INTO basic_bussiness_type
(action,name,enable,remark,mainAction,localAction)
replace INTO basic_bussiness_type
(action,name,enable,remark,mainAction,localAction,thirdSysFk)
values
(
#{action},
#{name},
#{enable},
#{remark},
#{mainAction},#{localAction}
#{mainAction},#{localAction},#{thirdSysFk}
)
</insert>
@ -68,8 +68,8 @@
<if test="enable != null">enable = #{enable},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="mainAction != null">mainAction = #{mainAction},</if>
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
<if test="localAction != null">localAction=#{localAction},</if>
thirdSysFk=#{thirdSysFk},
</trim>
WHERE id = #{id}
</update>

@ -20,7 +20,7 @@
basic_products.flbm,basic_products.ggxh,basic_products.qxlb,basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,basic_products.uuid,basic_products.sjcpbm,basic_products.versionNumber,basic_products.diType
,basic_products.productType
,basic_products.productType,basic_udirel.mainId,basic_udirel.mainName
FROM basic_udirel
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid
@ -37,6 +37,24 @@
<if test="thirdId != '' and thirdId != null">
AND thirdId LIKE concat(#{thirdId},'%')
</if>
<if test="thirdId1 != '' and thirdId1 != null">
AND thirdId1 LIKE concat(#{thirdId1},'%')
</if>
<if test="thirdId2 != '' and thirdId2 != null">
AND thirdId2 LIKE concat(#{thirdId2},'%')
</if>
<if test="thirdId3 != '' and thirdId3 != null">
AND thirdId3 LIKE concat(#{thirdId3},'%')
</if>
<if test="thirdId4 != '' and thirdId4 != null">
AND thirdId4 LIKE concat(#{thirdId4},'%')
</if>
<if test="ybbm != '' and ybbm != null">
AND ybbm LIKE concat(#{ybbm},'%')
</if>
<if test="sptm != '' and sptm != null">
AND sptm LIKE concat(#{sptm},'%')
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
@ -49,6 +67,12 @@
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="unionFilterStr != '' and unionFilterStr != null">
or basic_products.cpmctymc LIKE concat('%',#{unionFilterStr},'%')
or basic_products.ylqxzcrbarmc LIKE concat('%',#{unionFilterStr},'%')
or basic_products.ggxh LIKE concat('%',#{unionFilterStr},'%')
or basic_products.zczbhhzbapzbh LIKE concat('%',#{unionFilterStr},'%')
</if>
</where>
ORDER BY updateTime DESC
@ -65,6 +89,7 @@
basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4,
basic_udirel.manufactory,basic_udirel.measname,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,basic_products.bhxjcpbm,basic_products.bzcj,basic_products.addType,basic_products.deviceRecordKey,basic_products.cpmctymc,basic_products.cplb,basic_products.flbm,basic_products.ggxh,basic_products.qxlb,basic_products.tyshxydm,basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,basic_products.ylqxzcrbarywmc,basic_products.sydycpbs,basic_products.uuid,basic_products.sjcpbm,basic_products.versionNumber,basic_products.diType
,basic_udirel.mainId,basic_udirel.mainName
FROM basic_products
right JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
@ -80,17 +105,17 @@
</if>
<if test="unionCode != '' and unionCode != null">
or nameCode LIKE concat('%',#{unionCode},'%')
or basic_udirel.ybbm LIKE concat('%',#{unionCode},'%')
or basic_udirel.sptm LIKE concat('%',#{unionCode},'%')
or nameCode LIKE concat('%',#{unionCode},'%')
or basic_udirel.ybbm LIKE concat('%',#{unionCode},'%')
or basic_udirel.sptm LIKE concat('%',#{unionCode},'%')
</if>
<if test="thrPiId != '' and thrPiId != null">
or thirdId LIKE concat('%',#{thrPiId},'%')
or thirdId1 LIKE concat('%',#{thrPiId},'%')
or thirdId2 LIKE concat('%',#{thrPiId},'%')
or thirdId3 LIKE concat('%',#{thrPiId},'%')
or thirdId4 LIKE concat('%',#{thrPiId},'%')
or thirdId LIKE concat('%',#{thrPiId},'%')
or thirdId1 LIKE concat('%',#{thrPiId},'%')
or thirdId2 LIKE concat('%',#{thrPiId},'%')
or thirdId3 LIKE concat('%',#{thrPiId},'%')
or thirdId4 LIKE concat('%',#{thrPiId},'%')
</if>
@ -108,7 +133,7 @@
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '' )
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '' )
and basic_products.flbm <![CDATA[<>]]> ''
</if>
@ -117,27 +142,27 @@
</if>
<if test="filterType != null and filterType == 3">
AND thirdId is NULL and basic_products.flbm <![CDATA[<>]]> ''
AND thirdId is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
AND thirdId1 is NULL and basic_products.flbm <![CDATA[<>]]> ''
AND thirdId1 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 5">
AND thirdId2 is NULL and basic_products.flbm <![CDATA[<>]]> ''
AND thirdId2 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 6">
AND thirdId3 is NULL and basic_products.flbm <![CDATA[<>]]> ''
AND thirdId3 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 7">
AND thirdId4 is NULL and basic_products.flbm <![CDATA[<>]]> ''
AND thirdId4 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
</where>
ORDER BY updateTime DESC
</select>
<!-- GROUP BY
uuid,basic_udirel.thirdId,basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4-->
<!-- GROUP BY
uuid,basic_udirel.thirdId,basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4-->
<select id="selectByUuid" parameterType="java.lang.String"
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
select * FROM basic_udirel
@ -207,7 +232,9 @@
replace INTO basic_udirel
(
thirdId,thirdName,uuid,isUseDy,updateTime,
thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,measname,ybbm,sptm,isDisable
thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,
measname,ybbm,sptm,isDisable
,mainId,mainName
)
values
(
@ -219,6 +246,7 @@
#{thirdId1}, #{thirdId2}, #{thirdId3}, #{thirdId4},
#{thirdName1}, #{thirdName2}, #{thirdName3}, #{thirdName4},
#{manufactory}, #{measname},#{ybbm},#{sptm},#{isDisable}
,#{mainId},#{mainName}
)
</insert>
@ -257,6 +285,8 @@
<if test="sptm != null">sptm=#{sptm},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="isDisable != null">isDisable=#{isDisable},</if>
<if test="mainId != null">mainId=#{mainId},</if>
<if test="mainName != null">mainName=#{mainName},</if>
</set>
WHERE id = #{id}
</update>

@ -29,6 +29,29 @@
)
</foreach>
</insert>
<insert id="insertCodesTempSingle" keyProperty="id" parameterType="com.glxp.api.admin.entity.inout.WarehouseEntity">
INSERT INTO io_codes_temp(action, mainAction, code, corpOrderId, actor, actDate,
fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate, serialNo, count)
values(
#{action},
#{mainAction},
#{code},
#{corpOrderId},
#{actor},
#{actDate},
#{fromCorpId},
#{fromCorp},
#{orderId},
#{batchNo},
#{produceDate},
#{expireDate},
#{serialNo},
#{count}
)
</insert>
<select id="findByOrderId" parameterType="com.glxp.api.admin.req.inout.WarehouseQueryRequest"
resultType="com.glxp.api.admin.entity.inout.WarehouseEntity">
SELECT *
@ -46,10 +69,37 @@
</where>
</select>
<select id="findByOrderIdAndCode" parameterType="com.glxp.api.admin.req.inout.WarehouseQueryRequest"
resultType="com.glxp.api.admin.entity.inout.WarehouseEntity">
SELECT *
FROM io_codes_temp
<where>
<if test="orderId != '' and orderId!=null">
and orderId =#{orderId}
</if>
<if test="code != '' and code!=null">
and code =#{code}
</if>
</where>
</select>
<delete id="deleteCodesTemp" parameterType="java.util.List">
DELETE FROM io_codes_temp WHERE id IN
<foreach collection="codes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<delete id="deleteCodesTempById" parameterType="com.glxp.api.admin.entity.inout.WarehouseEntity">
DELETE FROM io_codes_temp WHERE id = #{id}
</delete>
<update id="updateById" parameterType="com.glxp.api.admin.entity.inout.WarehouseEntity">
UPDATE io_codes_temp
<set>
<if test="count != null">`count`=#{count},</if>
</set>
WHERE id=#{id}
</update>
</mapper>

@ -116,9 +116,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>
@ -138,6 +141,7 @@
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
</if>
</where>
ORDER BY actDate DESC

@ -111,7 +111,7 @@
batchNoId,goodsname,companyname,
batchNo,erpCount,credate,nameCode,productCompany,
coName,authCode,packSpec,packRatio,bhzxxsbzsl,
zxxsbzbhsydysl,orderIdFk,count,reCount)
zxxsbzbhsydysl,orderIdFk,count,reCount,uuidFk,productDate,expireDate)
values(
#{id},
#{companyid},
@ -127,7 +127,7 @@
#{erpCount},
#{credate},
#{nameCode},#{productCompany},#{coName},#{authCode},#{packSpec},#{packRatio},
#{bhzxxsbzsl},#{zxxsbzbhsydysl},#{orderIdFk},#{count},#{reCount}
#{bhzxxsbzsl},#{zxxsbzbhsydysl},#{orderIdFk},#{count},#{reCount},#{uuidFk},#{productDate},#{expireDate}
)
</insert>
@ -135,7 +135,7 @@
replace INTO io_order_detail(id,
companyid,erpOrderId,iodtlId,inoutId,goodsunit,goodsid,batchNoId,goodsname,companyname,
batchNo,erpCount,credate,nameCode,productCompany,
coName,authCode,packSpec,packRatio,bhzxxsbzsl,zxxsbzbhsydysl,orderIdFk,count,reCount)
coName,authCode,packSpec,packRatio,bhzxxsbzsl,zxxsbzbhsydysl,orderIdFk,count,reCount,uuidFk,productDate,expireDate)
values
<foreach collection="erpOrderEntities" item="item" index="index"
separator=",">
@ -155,7 +155,8 @@
#{item.erpCount}, #{item.credate},
#{item.nameCode}, #{item.productCompany}, #{item.coName}, #{item.authCode}, #{item.packSpec},
#{item.packRatio}, #{item.bhzxxsbzsl},
#{item.zxxsbzbhsydysl}, #{item.orderIdFk}, #{item.count},#{item.reCount})
#{item.zxxsbzbhsydysl}, #{item.orderIdFk}, #{item.count},#{item.reCount},#{item.uuidFk}
,#{item.productDate},#{item.expireDate})
</foreach>
</insert>

@ -0,0 +1,134 @@
<?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.api.admin.dao.inventory.InvProductDao">
<select id="filterInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
SELECT * FROM inv_product
<where>
<if test="productsName != '' and productsName != null">
AND productsName = #{productsName}
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode = #{nameCode}
</if>
<if test="relIdFk != '' and relIdFk != null">
AND relIdFk = #{relIdFk}
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh = #{ggxh}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="productionDate != '' and productionDate != null">
AND productionDate = #{productionDate}
</if>
<if test="expireDate != '' and expireDate != null">
AND expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
</where>
</select>
<select id="selectById" parameterType="Map"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
SELECT * FROM inv_product WHERE id = #{id}
</select>
<select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.api.admin.res.inventory.InvProductResponse">
SELECT
inv_product.id,
basic_products.cpmctymc,basic_products.nameCode,inv_product.relIdFk,basic_products.ggxh,
inv_product.batchNo
,inv_product.productionDate,inv_product.expireDate,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
inv_product.inCount,inv_product.outCount
,inv_product.reCount
FROM inv_product
inner join basic_udirel on inv_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid
<where>
basic_products.diType=1
<if test="cpmctymc != '' and cpmctymc != null">
AND basic_products.cpmctymc = #{cpmctymc}
</if>
<if test="nameCode != '' and nameCode != null">
AND basic_products.nameCode = #{nameCode}
</if>
<if test="relIdFk != '' and relIdFk != null">
AND inv_product.relIdFk = #{relIdFk}
</if>
<if test="ggxh != '' and ggxh != null">
AND basic_products.ggxh = #{ggxh}
</if>
<if test="batchNo != '' and batchNo != null">
AND inv_product.batchNo = #{batchNo}
</if>
<if test="productionDate != '' and productionDate != null">
AND inv_product.productionDate = #{productionDate}
</if>
<if test="expireDate != '' and expireDate != null">
AND inv_product.expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND basic_products.ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND basic_products.zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
</where>
</select>
<insert id="insertInvProduct" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
insert INTO inv_product
(productsName,nameCode,relIdFk,ggxh,batchNo,
productionDate,expireDate,ylqxzcrbarmc,zczbhhzbapzbh,
inCount,outCount,reCount)
values
(
#{productsName},#{nameCode},
#{relIdFk},#{ggxh},#{batchNo},
#{productionDate},#{expireDate},
#{ylqxzcrbarmc},#{zczbhhzbapzbh},
#{inCount},#{outCount},#{reCount}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM inv_product WHERE id = #{id}
</delete>
<update id="updateInvProduct" parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
UPDATE inv_product
<trim prefix="set" suffixOverrides=",">
<if test="productsName != null">productsName=#{productsName},</if>
<if test="nameCode != null">nameCode=#{nameCode},</if>
<if test="relIdFk != null">relIdFk=#{relIdFk},</if>
<if test="ggxh != null">ggxh=#{ggxh},</if>
<if test="batchNo != null">batchNo=#{batchNo},</if>
<if test="productionDate != null">productionDate=#{productionDate},</if>
<if test="expireDate != null">expireDate=#{expireDate},</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
<if test="inCount != null">inCount=#{inCount},</if>
<if test="outCount != null">outCount=#{outCount},</if>
<if test="reCount != null">reCount=#{reCount},</if>
</trim>
WHERE id = #{id}
</update>
</mapper>

@ -0,0 +1,79 @@
<?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.api.admin.dao.inventory.InvProductDetailDao">
<select id="filterInvProductDetail" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest"
resultType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
SELECT * FROM inv_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="mainAction != '' and mainAction != null">
AND mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND action = #{action}
</if>
<if test="count != '' and count != null">
AND count = #{count}
</if>
</where>
</select>
<insert id="insertInvProductDetail" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
insert INTO inv_product_detail
(code,productIdFk,orderIdFk,mainAction,action,count,updateTime)
values
(
#{code},
#{productIdFk},#{orderIdFk},
#{mainAction},#{action},#{count},#{updateTime}
)
</insert>
<insert id="insertInvProductDetails" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
insert INTO inv_product_detail
(code,productIdFk,mainAction,action,count,updateTime)
values
<foreach collection="stockPrintEntities" item="item" index="index"
separator=",">
(
#{item.code},
#{item.productIdFk},#{item.orderIdFk},
#{item.mainAction},#{item.action},#{item.count},#{item.updateTime}
)
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM inv_product_detail WHERE id = #{id}
</delete>
<delete id="deleteByProductId" parameterType="Map">
DELETE FROM inv_product_detail WHERE productIdFk = #{productIdFk}
</delete>
<update id="updateInvProductDetail" parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
UPDATE inv_product_detail
<set>
<if test="code != null">code=#{code},</if>
<if test="productIdFk != null">productIdFk=#{productIdFk},</if>
<if test="mainAction != null">mainAction=#{mainAction},</if>
<if test="action != null">action=#{action},</if>
<if test="count != null">count=#{count},</if>
</set>
WHERE id = #{id}
</update>
</mapper>

@ -41,8 +41,8 @@
<insert id="insertOrderdDetailImports" keyProperty="id" parameterType="java.util.List">
insert INTO thr_order_import_detail
(
billNo,billdate,corpId,corpName,billType,billFlag,productId,productName,spec,
batchNo,expireDate,productDate,count,reCount,status,updateTime,remark,genKeyFk,thirdSysFk
billNo,billdate,corpId,corpName,billType,billFlag,productId,productName,spec,
batchNo,expireDate,productDate,count,reCount,status,updateTime,remark,genKeyFk,thirdSysFk
)
values
<foreach collection="orders" item="item" index="index"

@ -13,6 +13,12 @@
<if test="code != '' and code != null">
AND code LIKE concat('%',#{code},'%')
</if>
<if test="sptm != '' and sptm != null">
AND sptm LIKE concat('%',#{sptm},'%')
</if>
<if test="ybbm != '' and ybbm != null">
AND ybbm LIKE concat('%',#{ybbm},'%')
</if>
<if test="registerNo != '' and registerNo != null">
AND registerNo LIKE concat('%',#{registerNo},'%')
</if>
@ -22,12 +28,9 @@
<if test="spec != '' and spec != null">
AND spec LIKE concat('%',#{spec},'%')
</if>
<if test="unionCode != '' and unionCode != null">
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE concat('%',#{unionCode},'%')
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>

Loading…
Cancel
Save