diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index 47624d9f..e4c18bd7 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -42,10 +42,7 @@ import com.glxp.api.service.inout.*; import com.glxp.api.service.inv.*; import com.glxp.api.service.purchase.SupProductService; import com.glxp.api.service.system.SystemParamConfigService; -import com.glxp.api.util.CustomUtil; -import com.glxp.api.util.DateUtil; -import com.glxp.api.util.GennerOrderUtils; -import com.glxp.api.util.OrderNoTypeBean; +import com.glxp.api.util.*; import com.glxp.api.util.udi.FilterUdiUtils; import com.glxp.api.util.udi.UdiCalCountUtil; import org.apache.commons.lang3.StringUtils; @@ -379,7 +376,7 @@ public class IoCodeTempController extends BaseController { if (udiInfoEntity == null) { return ResultVOUtils.error(500, "耗材字典不存在此产品!"); } - if (!udiInfoEntity.getAllowNoBatch()) { + if (!IntUtil.value(udiInfoEntity.getAllowNoBatch())) { if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) { return ResultVOUtils.error(500, "序列号与批次号不能同时为空!"); } diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index dbd9872f..d4acef7f 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -14,6 +14,7 @@ import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.Constant; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.InvBusUserEntity; import com.glxp.api.entity.auth.InvWarehouseEntity; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; @@ -687,7 +688,7 @@ public class IoOrderController extends BaseController { @PostMapping("/udiwms/stock/order/change") public BaseResponse stockOrderChange(@RequestBody AddOrderChangeRequest addOrderChangeRequest) { - + AuthAdmin authAdmin = getUser(); IoOrderEntity originOrder = orderService.findByBillNo(addOrderChangeRequest.getOrderId()); IoOrderEntity newOrder = new IoOrderEntity(); List originCodes = codeService.findByOrderId(originOrder.getBillNo()); @@ -699,7 +700,8 @@ public class IoOrderController extends BaseController { InvWarehouseEntity fromInv = invWarehouseService.findByInvSubByCode(addOrderChangeRequest.getFromInvCode()); newOrder.setFromDeptCode(fromInv.getParentId()); } - + newOrder.setCreateUser(authAdmin.getId() + ""); + newOrder.setUpdateUser(authAdmin.getId() + ""); InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(addOrderChangeRequest.getInvCode()); newOrder.setInvCode(addOrderChangeRequest.getInvCode()); diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrOrderController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrOrderController.java index 7666b833..bf25f95e 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrOrderController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrOrderController.java @@ -287,14 +287,13 @@ public class ThrOrderController { @PostMapping("/udiwms/thrsys/orders/orderDownload") public BaseResponse orderDownload(@RequestBody FilterThrOrderRequest filterThrProductsRequest) { String data = (String) redisUtil.get(Constant.dlThrOrders); - if (false) {//(data != null && data.equals("true")) { + if ((data != null && data.equals("true"))) { return ResultVOUtils.error(500, "当前任务正在下载更新业务单据信息,请稍后重试!"); } else { - redisUtil.set(Constant.dlThrOrders, "true", 10 * 30); + redisUtil.set(Constant.dlThrOrders, "true", 1 * 60); if (filterThrProductsRequest.getBillAction() == null) { return ResultVOUtils.error(500, "未选择业务类型!"); } - ThrOrderImportLogEntity thrOrderImportLogEntity = new ThrOrderImportLogEntity(); String genKey = CustomUtil.getId(); thrOrderImportLogEntity.setGenKey(genKey); diff --git a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java index e514a549..168162a8 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java @@ -99,28 +99,4 @@ public class UdiProductEntity { private Long uid; - - public Boolean getAllowNoBatch() { - if (allowNoBatch == null) - return false; - return allowNoBatch; - } - - public Boolean getAllowNoExpire() { - if (allowNoExpire == null) - return false; - return allowNoExpire; - } - - public Boolean getAllowNoProduct() { - if (allowNoProduct == null) - return false; - return allowNoProduct; - } - - public Boolean getAllowNoSerial() { - if (allowNoSerial == null) - return false; - return allowNoSerial; - } } diff --git a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java index bf2f491c..3fb3626d 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java @@ -766,7 +766,9 @@ public class IoCheckInoutService { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW); } } - + if (StrUtil.isEmpty(orderEntity.getCheckUser())) { + orderEntity.setCheckUser(orderEntity.getCreateUser()); + } if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) { orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_REW); orderEntity.setUpdateTime(new Date()); @@ -828,8 +830,10 @@ public class IoCheckInoutService { orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_CHECK); orderEntity.setUpdateTime(new Date()); orderEntity.setAuditTime(new Date()); + if (StrUtil.isEmpty(orderEntity.getReviewUser())) { + orderEntity.setReviewUser(orderEntity.getReviewUser()); + } orderService.update(orderEntity); - List codeEntities = codeService.findByOrderId(orderEntity.getBillNo()); genInv(orderEntity, bussinessTypeEntity); } } diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java b/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java index 2ad63028..729e6f22 100644 --- a/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java +++ b/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java @@ -3,6 +3,7 @@ package com.glxp.api.service.thrsys; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.config.WebSocketServer; import com.glxp.api.constant.BasicProcessStatus; import com.glxp.api.constant.Constant; @@ -46,8 +47,6 @@ public class ThrOrdersDlService { ThrOrderExportLogService thrOrderExportLogService; @Resource ThrOrderImportDetailService thrOrderImportDetailService; -// @Resource -// ThrOrderImportService thrOrderImportService; @Resource private ErpOrderClient erpOrderClient; @@ -56,6 +55,8 @@ public class ThrOrdersDlService { SyncDataSetService syncDataSetService; @Resource HttpOkClient httpOkClient; + @Resource + private IThrBusTypeOriginService iThrBusTypeOriginService; public String getIpUrl() { SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet(); @@ -67,22 +68,22 @@ public class ThrOrdersDlService { ThrOrderImportLogEntity thrOrderImportLogEntity = thrOrderImportLogService.selectByGenKey(genKey); - //todo单据还没设计好 -// BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessTypeService.findByActionKey(action, "orderQueryUrl"); -// if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) { -// WebSocketServer.sendInfo("业务单据查询接口未设置!", "sid"); -// return; -// } - ThrSystemDetailEntity thrSystemDetailEntity=new ThrSystemDetailEntity(); + ThrSystemDetailEntity thrSystemDetailEntity = iThrBusTypeOriginService.findSysByAction(action, "orderQueryUrl"); + if (thrSystemDetailEntity == null || !thrSystemDetailEntity.getEnabled()) { + WebSocketServer.sendInfo("业务单据查询接口未设置!", "sid"); + return; + } + if (thrSystemDetailEntity.getThirdSysFk() == null) { + WebSocketServer.sendInfo("业务单据查询接口未设置!", "sid"); + return; + } int page = 1; int limit = 100; while (page != -1) { - page = getOrders(page, limit, thrSystemDetailEntity.getValue(), thrSystemDetailEntity.getThirdSysFk(), thrOrderImportLogEntity, action, filterThrProductsRequest); + page = getOrders(page, limit, thrSystemDetailEntity.getThirdSysFk(), thrOrderImportLogEntity, action, filterThrProductsRequest); } - thrOrderImportLogService.importThrOrder(genKey); - redisUtil.set(Constant.dlThrProducts, "false"); WebSocketServer.sendInfo("业务单据信息下载已完成,请刷新查看!", "sid"); thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); @@ -94,20 +95,27 @@ public class ThrOrdersDlService { ThrOrderImportLogEntity thrOrderImportLogEntity = thrOrderImportLogService.selectByGenKey(genKey); if (erpOrderResponses != null && erpOrderResponses.size() > 0) { for (ThrOrderResponse erpOrderResponse : erpOrderResponses) { - List thrOrderDetailEntities = new ArrayList<>(); + ThrOrderEntity thrOrderEntity = new ThrOrderEntity(); + BeanUtils.copyProperties(erpOrderResponse, thrOrderEntity); + ThrOrderEntity originEntity = thrOrderService.findByUnique(thrOrderEntity.getBillNo(), thrOrderEntity.getThirdSysFk()); + if (originEntity != null) { + thrOrderService.deleteById(originEntity.getId() + ""); + thrOrderDetailService.deleteByOrderIdFk(originEntity.getId() + ""); + } + thrOrderService.insertThrOrder(thrOrderEntity); + List thrOrderDetailEntities = new ArrayList<>(); for (ThrOrderResponse.SubErpOrder subPurchase : erpOrderResponse.getSubErpOrders()) { - ThrOrderImportDetailEntity thrOrderDetailEntity = new ThrOrderImportDetailEntity(); + ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity(); + thrOrderDetailEntity.setUpdateTime(new Date()); + BeanUtils.copyProperties(subPurchase, thrOrderDetailEntity); BeanUtils.copyProperties(subPurchase, thrOrderDetailEntity); - BeanUtils.copyProperties(erpOrderResponse, thrOrderDetailEntity); - thrOrderDetailEntity.setGenKeyFk(thrOrderImportLogEntity.getGenKey()); thrOrderDetailEntity.setThirdSysFk(thirdSys); thrOrderDetailEntity.setUpdateTime(new Date()); thrOrderDetailEntities.add(thrOrderDetailEntity); } - thrOrderImportDetailService.insertOrderImportDetails(thrOrderDetailEntities); + thrOrderDetailService.insertThrOrderDetails(thrOrderDetailEntities); } } - thrOrderImportLogService.importThrOrder(genKey); redisUtil.set(Constant.dlThrProducts, "false"); WebSocketServer.sendInfo("业务单据信息下载已完成,请刷新查看!", "sid"); thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); @@ -213,209 +221,7 @@ public class ThrOrdersDlService { // thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); } -// -// -// @Async -// public void genJsonFile(String genKey, ThrOrderExportRequest thrOrderExportRequest) { -// ThrOrderExportJsonResponse thrOrderExportJsonResponse = new ThrOrderExportJsonResponse(); -// ThrOrderExportLogEntity thrOrderExportLogEntity = thrOrderExportLogService.selectByGenKey(genKey); -// BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(thrOrderExportRequest.getBillAction()); -// List erpOrderResponses = thrOrderExportRequest.getErpOrderResponses(); -// //选中导出 -// if (thrOrderExportRequest.getErpOrderResponses() != null && thrOrderExportRequest.getErpOrderResponses().size() > 0) { -// BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); -// bussinessTypeFilterRequest.setEnabled(true); -// if (erpOrderResponses != null && erpOrderResponses.size() > 0) { -// List thrOrderEntities = new ArrayList<>(); -// List thrOrderDetailEntities = new ArrayList<>(); -// for (ErpOrderResponse erpOrderResponse : erpOrderResponses) { -// ThrOrderEntity thrOrderEntity = new ThrOrderEntity(); -// BeanUtils.copyProperties(erpOrderResponse, thrOrderEntity); -// thrOrderEntities.add(thrOrderEntity); -// if (erpOrderResponse.getSubErpOrders() != null && erpOrderResponse.getSubErpOrders().size() > 0) { -// for (ErpOrderResponse.SubErpOrder subErpOrder : erpOrderResponse.getSubErpOrders()) { -// ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity(); -// BeanUtils.copyProperties(subErpOrder, thrOrderDetailEntity); -// thrOrderDetailEntities.add(thrOrderDetailEntity); -// } -// } -// } -// thrOrderExportJsonResponse.setThrOrderEntityList(thrOrderEntities); -// thrOrderExportJsonResponse.setThrOrderDetailEntities(thrOrderDetailEntities); -// } -// } else {//一键导出 -// BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", bussinessTypeEntity.getThirdSysFk()); -// if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) { -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL); -// thrOrderExportLogEntity.setRemark("业务单据接口地址未定义"); -// thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); -// return; -// } -// if (!basicThirdSysDetailEntity.getEnabled() || basicThirdSysDetailEntity.getThirdSysFk() == null) { -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL); -// thrOrderExportLogEntity.setRemark("第三方系统业务单据接口服务未启用"); -// thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); -// return; -// } -// if (basicThirdSysDetailEntity.getFromType() == 0) { -// FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest(); -// filterThrOrderRequest.setThirdSysFk(bussinessTypeEntity.getThirdSysFk()); -// BeanUtils.copyProperties(thrOrderExportRequest, filterThrOrderRequest); -// erpOrderResponses = getThrOrders(filterThrOrderRequest); -// if (erpOrderResponses != null && erpOrderResponses.size() > 0) { -// List thrOrderEntities = new ArrayList<>(); -// List thrOrderDetailEntities = new ArrayList<>(); -// for (ErpOrderResponse erpOrderResponse : erpOrderResponses) { -// ThrOrderEntity thrOrderEntity = new ThrOrderEntity(); -// BeanUtils.copyProperties(erpOrderResponse, thrOrderEntity); -// thrOrderEntities.add(thrOrderEntity); -// if (erpOrderResponse.getSubErpOrders() != null && erpOrderResponse.getSubErpOrders().size() > 0) { -// for (ErpOrderResponse.SubErpOrder subErpOrder : erpOrderResponse.getSubErpOrders()) { -// ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity(); -// BeanUtils.copyProperties(subErpOrder, thrOrderDetailEntity); -// thrOrderDetailEntities.add(thrOrderDetailEntity); -// } -// } -// } -// thrOrderExportJsonResponse.setThrOrderEntityList(thrOrderEntities); -// thrOrderExportJsonResponse.setThrOrderDetailEntities(thrOrderDetailEntities); -// } -// } else { -// FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest(); -// BeanUtils.copyProperties(thrOrderExportRequest, filterThrOrderRequest); -// List thrOrderEntities = thrOrderService.filterThrOrder(filterThrOrderRequest); -// List results = new ArrayList<>(); -// for (ThrOrderEntity thrOrderEntity : thrOrderEntities) { -// FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest(); -// filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + ""); -// List thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest); -// if (thrOrderDetailEntities != null) { -// results.addAll(thrOrderDetailEntities); -// } -// -// } -// -// thrOrderExportJsonResponse.setThrOrderEntityList(thrOrderEntities); -// thrOrderExportJsonResponse.setThrOrderDetailEntities(results); -// } -// -// } -// FileWriter writer = new FileWriter(thrOrderExportLogEntity.getFilePath()); -// writer.write(JSONUtil.toJsonStr(thrOrderExportJsonResponse)); -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); -// thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); -// } -// -// -// @Async -// public void uploadSpssync(String genKey, ThrOrderExportRequest thrOrderExportRequest) { -// -// ThrOrderExportJsonResponse thrOrderExportJsonResponse = new ThrOrderExportJsonResponse(); -// ThrOrderExportLogEntity thrOrderExportLogEntity = thrOrderExportLogService.selectByGenKey(genKey); -// BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(thrOrderExportRequest.getBillAction()); -// List erpOrderResponses = thrOrderExportRequest.getErpOrderResponses(); -// //选中导出 -// if (thrOrderExportRequest.getErpOrderResponses() != null && thrOrderExportRequest.getErpOrderResponses().size() > 0) { -// BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); -// bussinessTypeFilterRequest.setEnabled(true); -// if (erpOrderResponses != null && erpOrderResponses.size() > 0) { -// List thrOrderEntities = new ArrayList<>(); -// List thrOrderDetailEntities = new ArrayList<>(); -// for (ErpOrderResponse erpOrderResponse : erpOrderResponses) { -// ThrOrderEntity thrOrderEntity = new ThrOrderEntity(); -// BeanUtils.copyProperties(erpOrderResponse, thrOrderEntity); -// thrOrderEntities.add(thrOrderEntity); -// if (erpOrderResponse.getSubErpOrders() != null && erpOrderResponse.getSubErpOrders().size() > 0) { -// for (ErpOrderResponse.SubErpOrder subErpOrder : erpOrderResponse.getSubErpOrders()) { -// ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity(); -// BeanUtils.copyProperties(subErpOrder, thrOrderDetailEntity); -// thrOrderDetailEntities.add(thrOrderDetailEntity); -// } -// } -// } -// thrOrderExportJsonResponse.setThrOrderEntityList(thrOrderEntities); -// thrOrderExportJsonResponse.setThrOrderDetailEntities(thrOrderDetailEntities); -// } -// } else {//一键导出 -// BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", bussinessTypeEntity.getThirdSysFk()); -// if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) { -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL); -// thrOrderExportLogEntity.setRemark("业务单据接口地址未定义"); -// thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); -// return; -// } -// if (!basicThirdSysDetailEntity.getEnabled() || basicThirdSysDetailEntity.getThirdSysFk() == null) { -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL); -// thrOrderExportLogEntity.setRemark("第三方系统业务单据接口服务未启用"); -// thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); -// return; -// } -// if (basicThirdSysDetailEntity.getFromType() == 0) { -// FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest(); -// filterThrOrderRequest.setThirdSysFk(bussinessTypeEntity.getThirdSysFk()); -// BeanUtils.copyProperties(thrOrderExportRequest, filterThrOrderRequest); -// erpOrderResponses = getThrOrders(filterThrOrderRequest); -// if (erpOrderResponses != null && erpOrderResponses.size() > 0) { -// List thrOrderEntities = new ArrayList<>(); -// List thrOrderDetailEntities = new ArrayList<>(); -// for (ErpOrderResponse erpOrderResponse : erpOrderResponses) { -// ThrOrderEntity thrOrderEntity = new ThrOrderEntity(); -// BeanUtils.copyProperties(erpOrderResponse, thrOrderEntity); -// thrOrderEntities.add(thrOrderEntity); -// if (erpOrderResponse.getSubErpOrders() != null && erpOrderResponse.getSubErpOrders().size() > 0) { -// for (ErpOrderResponse.SubErpOrder subErpOrder : erpOrderResponse.getSubErpOrders()) { -// ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity(); -// BeanUtils.copyProperties(subErpOrder, thrOrderDetailEntity); -// thrOrderDetailEntities.add(thrOrderDetailEntity); -// } -// } -// } -// thrOrderExportJsonResponse.setThrOrderEntityList(thrOrderEntities); -// thrOrderExportJsonResponse.setThrOrderDetailEntities(thrOrderDetailEntities); -// } -// } else { -// FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest(); -// BeanUtils.copyProperties(thrOrderExportRequest, filterThrOrderRequest); -// List thrOrderEntities = thrOrderService.filterThrOrder(filterThrOrderRequest); -// List results = new ArrayList<>(); -// for (ThrOrderEntity thrOrderEntity : thrOrderEntities) { -// FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest(); -// filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + ""); -// List thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest); -// if (thrOrderDetailEntities != null) { -// results.addAll(thrOrderDetailEntities); -// } -// -// } -// -// thrOrderExportJsonResponse.setThrOrderEntityList(thrOrderEntities); -// thrOrderExportJsonResponse.setThrOrderDetailEntities(results); -// } -// -// } -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); -// thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); -// String response = httpOkClient.uCloudPost(getIpUrl() + "/spssync/thirdsys/order/upload", thrOrderExportJsonResponse); -// BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference() { -// }); -// if (baseResponse.getCode() == 20000) { -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); -// } else { -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL); -// } -// thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); -// thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity); -// } -// -// public String getName(List bussinessTypeEntities, String action) { -// for (BussinessTypeEntity bussinessTypeEntity : bussinessTypeEntities) { -// if (bussinessTypeEntity.getAction().equals(action)) { -// return bussinessTypeEntity.getName(); -// } -// } -// return action; -// } -// + @Async public void uploadSmp(String genKey, ThrOrderExportRequest thrOrderExportRequest) { @@ -494,7 +300,7 @@ public class ThrOrdersDlService { } - public int getOrders(int page, int limit, String orderUrl, String thirdSys, ThrOrderImportLogEntity + public int getOrders(int page, int limit, String thirdSys, ThrOrderImportLogEntity thrOrderImportLogEntity, String action, FilterThrOrderRequest filterThrOrderRequest) { if (filterThrOrderRequest == null) filterThrOrderRequest = new FilterThrOrderRequest(); @@ -513,7 +319,6 @@ public class ThrOrdersDlService { thrOrderEntity.setThirdSysFk(thirdSys); thrOrderEntity.setUpdateTime(new Date()); thrOrderService.insertThrOrder(thrOrderEntity); -// thrOrderEntity = thrOrderService.findByUnique(thrOrderEntity.getBillNo(), thrOrderEntity.getThirdSysFk()); List thrOrderDetailEntities = new ArrayList<>(); for (ThrOrderResponse.SubErpOrder subPurchase : erpOrderResponse.getSubErpOrders()) { ThrOrderImportDetailEntity thrOrderDetailEntity = new ThrOrderImportDetailEntity(); @@ -543,60 +348,7 @@ public class ThrOrdersDlService { } return -1; } -// -// public List> exportThrOrders(FilterThrOrderRequest filterThrOrderRequest) { -// BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); -// bussinessTypeFilterRequest.setEnabled(true); -// List bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest); -// BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", filterThrOrderRequest.getThirdSysFk()); -// int page = 1; -// int limit = 100; -// List erpOrderResponseList = new ArrayList<>(); -// while (true) { -// List datas = getThrOrders(page, limit, basicThirdSysDetailEntity.getValue(), filterThrOrderRequest); -// if (datas != null && datas.size() >= limit) { -// erpOrderResponseList.addAll(datas); -// page++; -// -// } else { -// if (datas != null) { -// erpOrderResponseList.addAll(datas); -// } -// break; -// } -// } -// List> excelData = new ArrayList<>(); -// for (ErpOrderResponse erpOrderResponse : erpOrderResponseList) { -// for (ErpOrderResponse.SubErpOrder subPurchase : erpOrderResponse.getSubErpOrders()) { -// List rows = new ArrayList<>(); -// rows.add(erpOrderResponse.getBillNo()); -// rows.add(erpOrderResponse.getBilldate()); -// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByThirdId(erpOrderResponse.getCorpId(), filterThrOrderRequest.getThirdSysFk()); -//// if (basicUnitMaintainEntity != null) -//// rows.add(basicUnitMaintainEntity.getErpId()); -//// else -// rows.add(erpOrderResponse.getCorpId()); -//// rows.add(basicUnitMaintainEntity.getErpId()); -//// rows.add(erpOrderResponse.getCorpId()); -// rows.add(erpOrderResponse.getCorpName()); -// rows.add(getName(bussinessTypeEntities, erpOrderResponse.getBillType())); -//// rows.add(erpOrderResponse.getBillType()); -// rows.add(erpOrderResponse.getBillFlag()); -// rows.add(subPurchase.getProductId()); -// rows.add(subPurchase.getProductName()); -// rows.add(subPurchase.getSpec()); -// rows.add(subPurchase.getBatchNo()); -// rows.add(subPurchase.getProductDate()); -// rows.add(subPurchase.getExpireDate()); -// rows.add(subPurchase.getCount() + ""); -// rows.add(subPurchase.getReCount() + ""); -// rows.add(erpOrderResponse.getOriginType()); -// excelData.add(rows); -// } -// } -// return excelData; -// } -// + public List getThrOrders(FilterThrOrderRequest filterThrOrderRequest) { ThrSystemDetailEntity thrSystemDetailEntity = thrSystemDetailService.selectByKey("orderQueryUrl", filterThrOrderRequest.getThirdSysFk()); int page = 1; @@ -634,48 +386,4 @@ public class ThrOrdersDlService { return null; } -// -// public List> genExcelData(FilterThrOrderRequest filterThrOrderRequest) { -// -// BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); -// bussinessTypeFilterRequest.setEnabled(true); -// List bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest); -// List> excelData = new ArrayList<>(); -// List thrOrderEntities = thrOrderService.filterThrOrder(filterThrOrderRequest); -// for (ThrOrderEntity thrOrderEntity : thrOrderEntities) { -// FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest(); -// filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + ""); -// List thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest); -// if (thrOrderDetailEntities != null) { -// for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) { -// List rows = new ArrayList<>(); -// rows.add(thrOrderEntity.getBillNo()); -// rows.add(thrOrderEntity.getBilldate()); -// -//// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByThirdId(thrOrderEntity.getCorpId(), filterThrOrderRequest.getThirdSysFk()); -//// if (basicUnitMaintainEntity != null) -//// rows.add(basicUnitMaintainEntity.getErpId()); -//// else -// rows.add(thrOrderEntity.getCorpId()); -// -//// rows.add(thrOrderEntity.getCorpId()); -// rows.add(thrOrderEntity.getCorpName()); -// rows.add(getName(bussinessTypeEntities, thrOrderEntity.getBillType())); -// rows.add(thrOrderEntity.getBillFlag()); -// rows.add(thrOrderDetailEntity.getProductId()); -// rows.add(thrOrderDetailEntity.getProductName()); -// rows.add(thrOrderDetailEntity.getSpec()); -// rows.add(thrOrderDetailEntity.getBatchNo()); -// rows.add(thrOrderDetailEntity.getProductDate()); -// rows.add(thrOrderDetailEntity.getExpireDate()); -// rows.add(thrOrderDetailEntity.getCount() + ""); -// rows.add(thrOrderDetailEntity.getReCount() + ""); -// rows.add(thrOrderEntity.getOriginType()); -// excelData.add(rows); -// } -// } -// -// } -// return excelData; -// } } diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml index 979afc6e..ec925f6b 100644 --- a/src/main/resources/application-pro.yml +++ b/src/main/resources/application-pro.yml @@ -3,7 +3,7 @@ server: spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - jdbc-url: jdbc:mysql://192.168.0.66:3364/udi_spms_ljy?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:mysql://127.0.0.1:3306/udi_spms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: Glxp@6066 hikari: @@ -51,4 +51,4 @@ SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs API_KEY: 1101 API_SECRET: zBITspLNvuoEd4FaamlSoqxRHmNsmQ9L -WEB_TITLE: 平潭协和医院 +WEB_TITLE: 漳州市中医院 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e9e4b1db..cc8bc4c7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: test + active: dev jmx: enabled: false servlet: diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml index 6ddd2a8b..d605cbc4 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml @@ -6,7 +6,7 @@ resultType="com.glxp.api.entity.thrsys.ThrOrderEntity"> SELECT thr_order.*, thr_bustype_origin.name billTypeName FROM thr_order - left join thr_bustype_origin on thr_order.billType = thr_bustype_origin.action + left join thr_bustype_origin on thr_order.billType = thr_bustype_origin.action AND billNo = #{billNo} @@ -46,14 +46,14 @@ ORDER BY thr_order.updateTime DESC - + replace - INTO thr_order - (id, billFlag, billNo, billdate, billType, billTypeName, corpId, corpName, inoutType, deptCode, deptName, - invCode, invName, thirdSysFk, createUser, createTime, updateUser, updateTime, reviewUser, reviewTime, address, - linkMan, linkTel, remark) - values (#{id}, - #{billFlag}, + INTO thr_order + (billFlag, billNo, billdate, billType, billTypeName, corpId, corpName, inoutType, deptCode, deptName, + invCode, invName, thirdSysFk, createUser, createTime, updateUser, updateTime, reviewUser, reviewTime, + address, + linkMan, linkTel, remark) + values (#{billFlag}, #{billNo}, #{billdate}, #{billType}, @@ -80,10 +80,12 @@ replace - INTO thr_order - (id, billFlag, billNo, billdate, billType, billTypeName, corpId, corpName, inoutType, deptCode, deptName, - invCode, invName, thirdSysFk, createUser, createTime, updateUser, updateTime, reviewUser, reviewTime, address, - linkMan, linkTel, remark) + INTO thr_order + (id, billFlag, billNo, billdate, billType, billTypeName, corpId, corpName, inoutType, deptCode, + deptName, + invCode, invName, thirdSysFk, createUser, createTime, updateUser, updateTime, reviewUser, reviewTime, + address, + linkMan, linkTel, remark) values (#{id}, #{billFlag}, #{billNo}, @@ -112,10 +114,11 @@ replace INTO thr_order - (billFlag, billNo, billdate, billType, billTypeName, corpId, corpName, inoutType, deptCode, deptName, - invCode, invName, thirdSysFk, createUser, createTime, updateUser, updateTime, reviewUser, reviewTime, address, - linkMan, linkTel, remark) - values + (billFlag, billNo, billdate, billType, billTypeName, corpId, corpName, inoutType, deptCode, deptName, + invCode, invName, thirdSysFk, createUser, createTime, updateUser, updateTime, reviewUser, reviewTime, + address, + linkMan, linkTel, remark) + values (#{item.billFlag},