From c03200393663cd98ee3c9c2a49799742a42e6614 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 4 May 2023 22:04:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=8A=E7=BA=BFbug=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/BasicExportStatusTimeEnum.java | 38 ++++++++++-------- .../basic/UdiContrastController.java | 38 ++++++++++++++++++ .../inout/IoOrderDetailBizController.java | 4 +- .../inout/IoOrderInvoiceController.java | 40 +++++++++++++++++++ .../sync/SpsSyncDownloadController.java | 2 +- .../api/dao/inout/IoOrderInvoiceMapper.java | 3 +- .../entity/inout/IoOrderInvoiceEntity.java | 2 +- .../entity/sync/SyncDataBustypeEntity.java | 2 +- .../api/entity/sync/SyncDataSetEntity.java | 2 + .../glxp/api/req/basic/UdiCombineRequest.java | 1 + .../api/req/inout/IoOrderInvoiceRequest.java | 2 +- .../api/req/inout/RefreshInoiceRequest.java | 11 +++++ .../api/res/inout/IoOrderInvoiceResponse.java | 2 +- .../api/res/system/SyncDataSetResponse.java | 2 + .../impl/BasicBussinessTypeServiceImpl.java | 4 +- .../service/inout/IoChangeInoutService.java | 3 +- .../service/inout/IoCheckInoutService.java | 8 ++++ .../api/service/inout/IoGenInvService.java | 2 + .../service/inout/IoOrderInvoiceService.java | 6 ++- .../inout/impl/IoOrderInvoiceServiceImpl.java | 9 +++-- .../inout/impl/IoOrderServiceImpl.java | 7 ++-- .../impl/InvPreProductDetailServiceImpl.java | 3 +- .../service/sync/SpsSyncDownloadService.java | 30 ++++++++++++-- .../com/glxp/api/task/AsyncHeartTask.java | 2 +- src/main/resources/application-dev.yml | 2 +- .../mybatis/mapper/basic/UdiProductDao.xml | 6 +-- .../mapper/inout/IoOrderInvoiceMapper.xml | 20 ++++++---- .../mybatis/mapper/sync/SyncDataSetDao.xml | 4 +- .../mapper/system/SyncDataBustypeDao.xml | 4 +- src/main/resources/schemas/schema_v2.1.sql | 5 +++ 30 files changed, 209 insertions(+), 55 deletions(-) create mode 100644 src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java create mode 100644 src/main/java/com/glxp/api/req/inout/RefreshInoiceRequest.java diff --git a/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java index cc65ce41..fb84b47f 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java @@ -45,77 +45,83 @@ public enum BasicExportStatusTimeEnum { /** * 业务单据类型 */ - BASIC_BUSSINESS_TYPE("basic_bussiness_type","扫码单据类型"), + BASIC_BUSSINESS_TYPE("basic_bussiness_type", "扫码单据类型"), /** * 扫码单据类型 */ - BASIC_BUSTYPE_CHANGE("basic_bustype_change","业务单据类型"), + BASIC_BUSTYPE_CHANGE("basic_bustype_change", "业务单据类型"), /** * 业务单据类型 */ - THR_BUSTYPE_ORIGIN("thr_bustype_origin","第三方单据类型"), + THR_BUSTYPE_ORIGIN("thr_bustype_origin", "第三方单据类型"), /** * 部门数据 */ - DEPARTMENT("department","部门数据"), + DEPARTMENT("department", "部门数据"), /** * 仓库数据 */ - WAREHOUSE_DICT("warehouse_dict","仓库数据"), + WAREHOUSE_DICT("warehouse_dict", "仓库数据"), /** * 用户数据 */ - USER_DATA("user_data","用户数据"), + USER_DATA("user_data", "用户数据"), /** * 第三方部门信息 */ - THR_DEPT("thr_dept","第三方部门信息"), + THR_DEPT("thr_dept", "第三方部门信息"), /** * 第三方仓库信息 */ - THR_WAREHOUSE("thr_warehouse","第三方仓库信息"), + THR_WAREHOUSE("thr_warehouse", "第三方仓库信息"), /** * 第三方产品信息 */ - THR_PRODUCTS("thr_products","第三方产品信息"), + THR_PRODUCTS("thr_products", "第三方产品信息"), /** * 第三方往来单位信息 */ - THR_CORP("thr_corp","第三方往来单位信息"), + THR_CORP("thr_corp", "第三方往来单位信息"), /** * 系统运行参数 */ - SYSTEM_PARAM_CONFIG("system_param_config","系统运行参数"), + SYSTEM_PARAM_CONFIG("system_param_config", "系统运行参数"), /** * 委托验收 - * */ - ENTRUST_ACCEPT("entrust_accept","委托验收"), + */ + ENTRUST_ACCEPT("entrust_accept", "委托验收"), /** * 打印设置 */ - PRINT_CONFIG("print_config","打印设置"), + PRINT_CONFIG("print_config", "打印设置"), /** * 自动建出入库单设置 */ - SCAN_CHANGE("scan_change","自动建出入库单设置"), + SCAN_CHANGE("scan_change", "自动建出入库单设置"), /** * 自动建业务单设置 */ - BUS_TYPE_CHANGE("bus_type_change","自动建业务单设置"), + BUS_TYPE_CHANGE("bus_type_change", "自动建业务单设置"), + + + /** + * UDI码关联关系 + */ + ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"), ; @EnumValue private String key; diff --git a/src/main/java/com/glxp/api/controller/basic/UdiContrastController.java b/src/main/java/com/glxp/api/controller/basic/UdiContrastController.java index 89b81b63..4bebbf6e 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiContrastController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiContrastController.java @@ -1,12 +1,14 @@ package com.glxp.api.controller.basic; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.AsyncDiDlHelper; import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.entity.basic.CompanyProductRelevanceEntity; @@ -165,6 +167,42 @@ public class UdiContrastController { return ResultVOUtils.success("切换成功!"); } + @Resource + AsyncDiDlHelper asyncDiDlHelper; + + /** + * 切换耗材字典版本号 + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/udirel/syncOnline") + @Log(title = "耗材字典", businessType = BusinessType.UPDATE) + public BaseResponse syncOnline(@RequestBody UdiCombineRequest udiCombineRequest) { + List udiInfoEntities = udiDlHttpClient.getUdiByUuid(udiCombineRequest.getOriginUuid()); + if (CollUtil.isNotEmpty(udiInfoEntities)) { + BaseResponse> listBaseResponse = asyncDiDlHelper.dlByDiRes(udiInfoEntities.get(0).getNameCode()); + if (listBaseResponse.getCode() == 20000) { + List productInfoEntityList = listBaseResponse.getData(); + if (CollUtil.isNotEmpty(productInfoEntityList)) { + productInfoService.insertProductInfos(productInfoEntityList); + } + } + udiInfoEntities = udiDlHttpClient.getUdiByUuid(udiCombineRequest.getOriginUuid()); + udiProductService.deleteByUuid(udiCombineRequest.getUuid()); + for (UdiProductEntity udiProductEntity : udiInfoEntities) { + udiProductEntity.setUuid(udiCombineRequest.getUuid()); + udiProductEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI); + udiProductEntity.setUpdateTime(new Date()); + udiProductEntity.setId(IdUtil.getSnowflakeNextId()); + } + udiProductService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities)); + return ResultVOUtils.success("更新成功!"); + } else { + return ResultVOUtils.error(500, "更新失败!"); + } + + + } + //更改关联第三方产品产品信息 @AuthRuleAnnotation("") diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index ab41eff7..e40a5042 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -2,6 +2,7 @@ package com.glxp.api.controller.inout; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; @@ -582,6 +583,7 @@ public class IoOrderDetailBizController extends BaseController { ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizEntity.getId()); ioOrderInvoiceEntity.setCreateTime(new Date()); ioOrderInvoiceEntity.setUpdateTime(new Date()); + ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId()); boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity); return ResultVOUtils.success("成功"); @@ -599,7 +601,7 @@ public class IoOrderDetailBizController extends BaseController { List list = orderDetailBizService.filterList(orderDetailBizRequest); for (IoOrderDetailBizResponse ioOrderDetailBizResponse : list) { String msg = ""; - IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity(); + IoOrderInvoiceRequest ioOrderInvoiceEntity = new IoOrderInvoiceRequest(); ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizResponse.getOrderIdFk()); List ioOrderInvoiceEntityList = ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceEntity); for (IoOrderInvoiceEntity obj : ioOrderInvoiceEntityList) { diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java new file mode 100644 index 00000000..f086f0aa --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java @@ -0,0 +1,40 @@ +package com.glxp.api.controller.inout; + +import cn.hutool.core.collection.CollUtil; +import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.annotation.Log; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; +import com.glxp.api.entity.inout.IoOrderInvoiceEntity; +import com.glxp.api.req.inout.IoOrderInvoiceRequest; +import com.glxp.api.req.inout.RefreshInoiceRequest; +import com.glxp.api.service.inout.IoOrderInvoiceService; +import org.springframework.beans.BeanUtils; +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 IoOrderInvoiceController { + @Resource + IoOrderInvoiceService ioOrderInvoiceService; + RefreshInoiceRequest refreshInoiceRequest; + + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/order/refrshInvoice") + @Log(title = "发票", businessType = BusinessType.INSERT) + public BaseResponse addBizProduct(@RequestBody RefreshInoiceRequest refreshInoiceRequest) { + + IoOrderInvoiceRequest orderInvoiceRequest = new IoOrderInvoiceRequest(); + BeanUtils.copyProperties(refreshInoiceRequest, orderInvoiceRequest); + List orderInvoiceEntities = ioOrderInvoiceService.selectOrderInvoice(orderInvoiceRequest); + if (CollUtil.isEmpty(orderInvoiceEntities)) + return ResultVOUtils.error(500, "查无发票信息!"); + return ResultVOUtils.success(orderInvoiceEntities); + } +} diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index 2cf91d82..199e42b9 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -684,7 +684,7 @@ public class SpsSyncDownloadController { List orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities(); for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) { - orderInvoiceEntity.setId(null); + orderInvoiceEntity.setId(IdUtil.getSnowflakeNextId()); orderInvoiceMapper.insert(orderInvoiceEntity); } } diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderInvoiceMapper.java b/src/main/java/com/glxp/api/dao/inout/IoOrderInvoiceMapper.java index 971161ec..7f031495 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderInvoiceMapper.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderInvoiceMapper.java @@ -3,6 +3,7 @@ package com.glxp.api.dao.inout; import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.inout.IoOrderInvoiceEntity; +import com.glxp.api.req.inout.IoOrderInvoiceRequest; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -12,6 +13,6 @@ public interface IoOrderInvoiceMapper extends BaseMapperPlus selectOrderInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity); + List selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceEntity); } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java index b739baaa..cef5f2a4 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java @@ -13,7 +13,7 @@ import lombok.Data; @TableName(value = "io_order_invoice") public class IoOrderInvoiceEntity { @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; /** * 订单号外键 diff --git a/src/main/java/com/glxp/api/entity/sync/SyncDataBustypeEntity.java b/src/main/java/com/glxp/api/entity/sync/SyncDataBustypeEntity.java index 335f5a60..12282bc6 100644 --- a/src/main/java/com/glxp/api/entity/sync/SyncDataBustypeEntity.java +++ b/src/main/java/com/glxp/api/entity/sync/SyncDataBustypeEntity.java @@ -13,7 +13,7 @@ import lombok.Data; @TableName(value = "sync_data_bustypes") public class SyncDataBustypeEntity { @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; @TableField(value = "`action`") private String action; @TableField(value = "`name`") diff --git a/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java b/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java index e279acdb..8dd7161a 100644 --- a/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java +++ b/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java @@ -68,5 +68,7 @@ public class SyncDataSetEntity { private int manufacturerCert; private int productCert; + private int orderInvoice; //发票信息 + } diff --git a/src/main/java/com/glxp/api/req/basic/UdiCombineRequest.java b/src/main/java/com/glxp/api/req/basic/UdiCombineRequest.java index 173b00fa..c6122240 100644 --- a/src/main/java/com/glxp/api/req/basic/UdiCombineRequest.java +++ b/src/main/java/com/glxp/api/req/basic/UdiCombineRequest.java @@ -27,6 +27,7 @@ public class UdiCombineRequest { private String price; private boolean idSpliUdi; private String uuid; + private String originUuid; private String ybbm; diff --git a/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java b/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java index 438f4d84..07ee07cc 100644 --- a/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java +++ b/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java @@ -19,7 +19,7 @@ import java.util.List; @Data public class IoOrderInvoiceRequest { - private Integer id; + private Long id; private String orderIdFk; diff --git a/src/main/java/com/glxp/api/req/inout/RefreshInoiceRequest.java b/src/main/java/com/glxp/api/req/inout/RefreshInoiceRequest.java new file mode 100644 index 00000000..139b2650 --- /dev/null +++ b/src/main/java/com/glxp/api/req/inout/RefreshInoiceRequest.java @@ -0,0 +1,11 @@ +package com.glxp.api.req.inout; + +import lombok.Data; + +@Data +public class RefreshInoiceRequest { + private Long id; + private String orderIdFk; + private Long bizIdFk; + +} diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderInvoiceResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderInvoiceResponse.java index 4b9557be..fa94b7db 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderInvoiceResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderInvoiceResponse.java @@ -11,7 +11,7 @@ import java.util.Date; @Data @TableName(value = "io_order_invoice") public class IoOrderInvoiceResponse { - private Integer id; + private Long id; /** * 订单号外键 diff --git a/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java b/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java index f6edc597..765e140d 100644 --- a/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java +++ b/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java @@ -62,4 +62,6 @@ public class SyncDataSetResponse { private int companyCert; private int manufacturerCert; private int productCert; + + private int orderInvoice; //发票信息 } diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java index cf64ea84..bddd8f27 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java @@ -238,11 +238,11 @@ public class BasicBussinessTypeServiceImpl extends ServiceImpl() - .eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT) + .eq("mainAction", ConstantType.TYPE_PUT) .gt("spUse", 0).eq("actionType", 1).eq("enable", true)); break; - +//.eq("corpType", ConstantStatus.CORP_TYPE_OUT) case Constant.ORDER_ACTION_SUP_DELAUDIT: //供应商审核送货单 bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper() .eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT) diff --git a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java index 29cd1e28..a9b7ffb9 100644 --- a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java @@ -2,6 +2,7 @@ package com.glxp.api.service.inout; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.UUID; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.glxp.api.constant.Constant; import com.glxp.api.constant.ConstantStatus; @@ -260,7 +261,7 @@ public class IoChangeInoutService { if (CollUtil.isNotEmpty(invoiceEntities)) { for (IoOrderInvoiceEntity orderInvoiceEntity : invoiceEntities) { orderInvoiceEntity.setOrderIdFk(outOrder.getBillNo()); - orderInvoiceEntity.setId(null); + orderInvoiceEntity.setId(IdUtil.getSnowflakeNextId()); orderInvoiceEntity.setBizIdFk(null); orderInvoiceEntity.setUpdateTime(new Date()); ioOrderInvoiceService.insertInvoice(orderInvoiceEntity); 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 5fa15509..cca7358b 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java @@ -729,6 +729,10 @@ public class IoCheckInoutService { if (!bussinessTypeEntity.isThrCheckCopy()) { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW); } + } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDISP) { + if (!bussinessTypeEntity.isThrCheckSp()) { + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW); + } } } else { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW); @@ -782,6 +786,10 @@ public class IoCheckInoutService { if (!bussinessTypeEntity.isSecCheckCopy()) { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED); } + } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDISP) { + if (!bussinessTypeEntity.isSecCheckSp()) { + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED); + } } } else { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED); diff --git a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java index f179b977..d8bc599b 100644 --- a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java +++ b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java @@ -171,6 +171,7 @@ public class IoGenInvService { BeanUtils.copyProperties(codeEntity, invProductDetailEntity); invProductDetailEntity.setRelId(codeEntity.getRelId()); invProductDetailEntity.setUpdateTime(new Date()); + invProductDetailEntity.setId(null); invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); @@ -253,6 +254,7 @@ public class IoGenInvService { invProductDetailEntity.setRelId(codeEntity.getRelId()); invProductDetailEntity.setUpdateTime(new Date()); invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + invProductDetailEntity.setId(null); if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); } else if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java b/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java index 8c3534ae..aae7dfac 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java @@ -1,11 +1,13 @@ package com.glxp.api.service.inout; +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.inout.IoCodeRelEntity; import com.glxp.api.entity.inout.IoOrderInvoiceEntity; import com.glxp.api.req.inout.IoOrderInvoiceRequest; import java.util.List; -public interface IoOrderInvoiceService { +public interface IoOrderInvoiceService extends IService { List findByBillNo(String billNo); @@ -16,7 +18,7 @@ public interface IoOrderInvoiceService { boolean insertInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity); - List selectOrderInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity); + List selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest); } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java index c4cf3e51..9bdcdf2e 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java @@ -1,7 +1,10 @@ package com.glxp.api.service.inout.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.dao.inout.IoCodeRelMapper; import com.glxp.api.dao.inout.IoOrderInvoiceMapper; +import com.glxp.api.entity.inout.IoCodeRelEntity; import com.glxp.api.entity.inout.IoOrderInvoiceEntity; import com.glxp.api.req.inout.IoOrderInvoiceRequest; import org.springframework.beans.BeanUtils; @@ -16,7 +19,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class IoOrderInvoiceServiceImpl implements IoOrderInvoiceService { +public class IoOrderInvoiceServiceImpl extends ServiceImpl implements IoOrderInvoiceService { @Resource IoOrderInvoiceMapper ioOrderInvoiceMapper; @@ -45,7 +48,7 @@ public class IoOrderInvoiceServiceImpl implements IoOrderInvoiceService { } @Override - public List selectOrderInvoice(IoOrderInvoiceEntity ioOrderInvoiceEntity) { - return ioOrderInvoiceMapper.selectOrderInvoice(ioOrderInvoiceEntity); + public List selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest) { + return ioOrderInvoiceMapper.selectOrderInvoice(ioOrderInvoiceRequest); } } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index 4b686096..36f6f218 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -657,9 +657,10 @@ public class IoOrderServiceImpl implements IoOrderService { @Override public void setInvoiceFiltes(FilterOrderRequest filterOrderRequest) { +// .eq("corpType", ConstantStatus.CORP_TYPE_OUT) List bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper() - .eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT) - .eq("corpType", ConstantStatus.CORP_TYPE_OUT).eq("inStock", false) + .eq("mainAction", ConstantType.TYPE_PUT) + .eq("inStock", false) .gt("spUse", 1).eq("actionType", 1).eq("enable", true)); List actions1 = null; actions1 = bussinessTypeEntities.stream().map(BasicBussinessTypeEntity::getAction).collect(Collectors.toList()); @@ -667,7 +668,7 @@ public class IoOrderServiceImpl implements IoOrderService { filterOrderRequest.setInvoiceActions1(actions1); List bussinessTypeEntities2 = basicBussinessTypeDao.selectList(new QueryWrapper() - .eq("mainAction", ConstantType.TYPE_PUT).eq("corpType", ConstantStatus.CORP_TYPE_OUT) + .eq("mainAction", ConstantType.TYPE_PUT) .eq("inStock", true) .gt("spUse", 0).eq("actionType", 1).eq("enable", true)); List actions2 = null; diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java index a03c7a2b..3c949421 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java @@ -136,7 +136,8 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic response.setActionName(busType.getName()); //设置单据日期 IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("createTime").eq("billNo", response.getOrderId())); - response.setOrderTime(DateUtil.toDateStr(order.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); + if (order != null) + response.setOrderTime(DateUtil.toDateStr(order.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); } @Override diff --git a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java index 31cdbdc6..55cc1ba9 100644 --- a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java +++ b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java @@ -467,6 +467,7 @@ public class SpsSyncDownloadService { StringBuffer remark = new StringBuffer(); BasicExportTypeEnum exportType = BasicExportTypeEnum.OTHER_DATA; //文件数据 + List syncFiles = new ArrayList<>(); Map jsonMap = new WeakHashMap<>(4); Map> totalTimeMap = new WeakHashMap<>(10); Map syncTimeMap = new WeakHashMap<>(3); @@ -489,7 +490,7 @@ public class SpsSyncDownloadService { ); if (CollectionUtil.isNotEmpty(ioCodeLostList)) { remark.append("UDI缺失码:").append(ioCodeLostList.size()).append("条\n"); - jsonMap.put(BasicExportStatusTimeEntity.class.getSimpleName(), ioCodeLostList); + jsonMap.put(IoCodeLostEntity.class.getSimpleName(), ioCodeLostList); } } //确认有开启udi关联关系同步 @@ -513,6 +514,28 @@ public class SpsSyncDownloadService { } } + if (info.getOrderInvoice() == 2) { + Map map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.ORDER_INVOICE, createFile); + totalTimeMap.put(BasicExportStatusTimeEnum.ORDER_INVOICE, map); + List orderInvoiceEntities = orderInvoiceService.list(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class) + .le((boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime, now) + .between(!(boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(orderInvoiceEntities)) { + for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { + if (StrUtil.isNotEmpty(orderInvoiceEntity.getLicenseUrl())) { + syncFiles.add(orderInvoiceEntity.getLicenseUrl()); + } + } + if (CollUtil.isNotEmpty(syncFiles)) { + jsonMap.put("syncFiles", syncFiles); + } + remark.append("扫码单据发票信息:").append(orderInvoiceEntities.size()).append("条\n"); + jsonMap.put(IoOrderInvoiceEntity.class.getSimpleName(), orderInvoiceEntities); + } + } + if (jsonMap.size() > 0) { jsonMap.put(SYNC_REMARK, remark.toString()); @@ -563,6 +586,7 @@ public class SpsSyncDownloadService { */ protected boolean generateDocumentTypeDataFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) { StringBuffer remark = new StringBuffer(); + List syncFiles = new ArrayList<>(); BasicExportTypeEnum exportType = BasicExportTypeEnum.DOCUMENT_TYPE_DATA; //文件数据 Map jsonMap = new WeakHashMap<>(4); @@ -805,8 +829,8 @@ public class SpsSyncDownloadService { SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); FilterOrderRequest orderFilterRequest = new FilterOrderRequest(); BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); - if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) { - for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) { + if (CollUtil.isNotEmpty(syncDataSetEntity.getToInBusTypes())) { + for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getToInBusTypes()) { List temps = orderService.findByStatus(syncDataBustypeEntity.getAction(), syncDataBustypeEntity.getOrderStatus(), DateUtil.parseDate(spsSyncDataRequest.getLastUpdateTime())); if (CollUtil.isNotEmpty(temps)) { orderEntities.addAll(temps); diff --git a/src/main/java/com/glxp/api/task/AsyncHeartTask.java b/src/main/java/com/glxp/api/task/AsyncHeartTask.java index 2812ef7e..49f3cb43 100644 --- a/src/main/java/com/glxp/api/task/AsyncHeartTask.java +++ b/src/main/java/com/glxp/api/task/AsyncHeartTask.java @@ -79,7 +79,7 @@ public class AsyncHeartTask implements SchedulingConfigurer { //定时同步单据最近更新数据至任务表,等待下载 if (syncDataSetEntity.getOrderSyncTime() != null) { - long timeInterval = syncDataSetEntity.getOrderSyncTime() * 60 * 1000; + long timeInterval = syncDataSetEntity.getOrderSyncTime() * 6 * 1000; long curTime = System.currentTimeMillis(); Long lastTime = (Long) redisUtil.get("SPS_ORDER_SYNC_GEN_DATA"); if (lastTime == null) { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index eed086a0..c2a962d2 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,7 +3,7 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 hikari: diff --git a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml index 2a56ca07..541b9614 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml @@ -226,9 +226,9 @@ #{basicPrductRemak8}, #{updateTime}) - + replace INTO basic_products - (id,uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl, + (id, uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl, zxxsbzbhsydysl, bhxjcpbm, bzcj, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, sydycpbs, sjcpbm, versionNumber, diType, ybbm, sptm, manufactory, measname, productType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq, cpms, @@ -240,7 +240,7 @@ - ( #{item.id}, + (#{item.id}, #{item.uuid}, #{item.originUuid}, #{item.nameCode}, diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml index 679fc017..de5cb763 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml @@ -1,25 +1,29 @@ - - INSERT INTO io_order_invoice( orderIdFk, bindRlFk,batchNo, productDate, expireDate - ) + INSERT INTO io_order_invoice(orderIdFk, bindRlFk, batchNo, productDate, expireDate) values (#{orderIdFk}, #{bindRlFk}, #{batchNo}, #{productDate}, - #{expireDate} - ) + #{expireDate}) - + select * + from io_order_invoice + + AND id = #{id} + + + AND bizIdFk = #{bizIdFk} + AND orderIdFk = #{orderIdFk} - diff --git a/src/main/resources/mybatis/mapper/sync/SyncDataSetDao.xml b/src/main/resources/mybatis/mapper/sync/SyncDataSetDao.xml index 42c74c4d..d99cae6d 100644 --- a/src/main/resources/mybatis/mapper/sync/SyncDataSetDao.xml +++ b/src/main/resources/mybatis/mapper/sync/SyncDataSetDao.xml @@ -22,7 +22,7 @@ , unCheckCert, checkedCert, companyCert, manufacturerCert, productCert, basicDept , systemConfig , printConfig, scanChangeConfig, supCert, dbDiCompany, busChangeConfig - , udiCodeLost, udiCodeRel) + , udiCodeLost, udiCodeRel, orderInvoice) values (#{id}, #{typeBus}, #{typeScan}, @@ -51,6 +51,6 @@ #{unCheckCert}, #{checkedCert}, #{companyCert}, #{manufacturerCert}, #{productCert}, #{basicDept}, #{systemConfig}, #{printConfig}, #{scanChangeConfig}, #{supCert}, #{dbDiCompany}, #{busChangeConfig}, - #{udiCodeLost}, #{udiCodeRel}) + #{udiCodeLost}, #{udiCodeRel}, #{orderInvoice}) diff --git a/src/main/resources/mybatis/mapper/system/SyncDataBustypeDao.xml b/src/main/resources/mybatis/mapper/system/SyncDataBustypeDao.xml index 00188394..0e3c6f5a 100644 --- a/src/main/resources/mybatis/mapper/system/SyncDataBustypeDao.xml +++ b/src/main/resources/mybatis/mapper/system/SyncDataBustypeDao.xml @@ -11,12 +11,12 @@ insert INTO sync_data_bustypes - (`action`, `name`, outChange, orderStatus, direct) + (id, `action`, `name`, outChange, orderStatus, direct) values - (#{item.action}, #{item.name}, + (#{item.id}, #{item.action}, #{item.name}, #{item.outChange}, #{item.orderStatus}, #{item.direct}) diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index a5e1798a..518009b1 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -358,3 +358,8 @@ ALTER TABLE `auth_dept_user` CALL Pro_Temp_ColumnWork('sync_data_bustypes', 'id', 'bigint', 2); +CALL Pro_Temp_ColumnWork('sync_data_set', 'orderInvoice', 'tinyint', 1); + +CALL Pro_Temp_ColumnWork('io_order_invoice', 'id', 'bigint ', 2); + + From cfa8a8c257fb6eb39900ba70e9f80349da0e756c Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 5 May 2023 00:17:23 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=85=A5=E8=B4=A6=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/service/inout/IoGenInvService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java index d8bc599b..74dd5105 100644 --- a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java +++ b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java @@ -101,6 +101,7 @@ public class IoGenInvService { BeanUtils.copyProperties(codeEntity, invProductDetailEntity); invProductDetailEntity.setRelId(codeEntity.getRelId()); invProductDetailEntity.setUpdateTime(new Date()); + invProductDetailEntity.setId(null); invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); From 1a56d8e7ad294e8cda87615452d3361fcd09600d Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Fri, 5 May 2023 09:18:25 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/IoOrderController.java | 35 +++++ .../inout/IoOrderDetailBizController.java | 47 +++++- .../com/glxp/api/dao/inout/IoOrderDao.java | 4 +- .../api/dao/inout/IoOrderDetailBizDao.java | 2 + .../entity/inout/IoOrderDetailBizEntity.java | 4 + .../entity/inout/IoOrderInvoiceEntity.java | 4 + .../inout/FilterOrderDetailBizRequest.java | 1 - .../res/inout/IoOrderDetailBizResponse.java | 4 + .../glxp/api/res/inout/IoOrderResponse.java | 5 + .../inout/IoOrderDetailBizService.java | 2 + .../api/service/inout/IoOrderService.java | 2 + .../impl/IoOrderDetailBizServiceImpl.java | 11 ++ .../inout/impl/IoOrderServiceImpl.java | 11 ++ .../mybatis/mapper/inout/IoOrderDao.xml | 144 ++++++++++++++++++ .../mapper/inout/IoOrderDetailBizDao.xml | 27 +++- src/main/resources/schemas/schema_v2.1.sql | 4 + 16 files changed, 300 insertions(+), 7 deletions(-) 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 8de2ba04..a4657eca 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -103,6 +103,41 @@ public class IoOrderController extends BaseController { return ResultVOUtils.page(pageInfo); } + + @AuthRuleAnnotation("") + @GetMapping("/udiwms/inout/order/filterList") + public BaseResponse filterOrderList(FilterOrderRequest filterOrderRequest) { + + + if (StrUtil.isNotBlank(filterOrderRequest.getStatusType())) { + orderService.setFilterStatus(filterOrderRequest); + } + if (StrUtil.isNotBlank(filterOrderRequest.getVueType())) { + orderService.setActions(filterOrderRequest); + } + + if (StrUtil.isNotEmpty(filterOrderRequest.getSupInoivceSearch())) { + orderService.setInvoiceFiltes(filterOrderRequest); + } + + if (filterOrderRequest.getSourceLocalType() != null) { + if (filterOrderRequest.getSourceLocalType() == 1) { + filterOrderRequest.setSourceTypes(Arrays.asList(1, 2, 3, 4, 5)); + } else { + filterOrderRequest.setSourceTypes(Arrays.asList(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17)); + } + } + + String customerId = getCustomerId(); + if (!customerId.equals("110")) { + filterOrderRequest.setFromCorp(customerId); + } + List list = orderService.getfilterList(filterOrderRequest); + + PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.page(pageInfo); + } + @GetMapping("/udiwms/inout/order/filterInvoice") public BaseResponse filterInvoice(FilterOrderRequest filterOrderRequest) { filterOrderRequest.setDealStatuses(Arrays.asList(2, 3)); diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index e40a5042..9308fd39 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -513,6 +513,15 @@ public class IoOrderDetailBizController extends BaseController { return ResultVOUtils.page(pageInfo); } + @GetMapping("/udiwms/inout/bizDetail/filterListInv") + public BaseResponse filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest) { + List list = orderDetailBizService.getfilterList(orderDetailBizRequest); + List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk()); + ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities); + PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.page(pageInfo); + } + @GetMapping("/udiwms/inout/bizDetail/filterListInvoice") public BaseResponse filterListInvoice(FilterOrderDetailBizRequest orderDetailBizRequest) { List list = orderDetailBizService.filterListInv(orderDetailBizRequest); @@ -543,14 +552,33 @@ public class IoOrderDetailBizController extends BaseController { /** * 删除发票表 * - * @param id + * @param * @return */ - @GetMapping("/udiwms/inout/biz/deleteById") + @PostMapping("/udiwms/inout/biz/deleteById") @Log(title = "发票管理", businessType = BusinessType.DELETE) - public BaseResponse deleteById(Integer id) { + public BaseResponse deleteById(@RequestBody IoOrderInvoiceEntity ioOrderInvoiceEntity) { + + ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()); + //更改 登记状态 + IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); + + FilterOrderDetailBizRequest filterOrderDetailBizRequest = new FilterOrderDetailBizRequest(); + + filterOrderDetailBizRequest.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk()); + + ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk()); + + ioOrderDetailBizEntity.setId(ioOrderInvoiceEntity.getRegId()); + + List list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest); + if(list == null && list.size()==0){ + ioOrderDetailBizEntity.setRegStatus(false); + } + orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); + return ResultVOUtils.success(); + - return ResultVOUtils.success(ioOrderInvoiceService.deleteByInvId(id)); } @@ -590,6 +618,17 @@ public class IoOrderDetailBizController extends BaseController { } + @PostMapping("/udiwms/inout/biz/updateorderBiz") + public BaseResponse updateorderBiz(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) { + ioOrderDetailBizEntity.setRegStatus(true); + orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); + + return ResultVOUtils.success("成功"); + + } + + + /** * 查询单据业务详情列表 * diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java b/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java index 46a59feb..b2cfe5dc 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java @@ -20,6 +20,8 @@ public interface IoOrderDao extends BaseMapperPlus filterList(FilterOrderRequest filterOrderRequest); + List getfilterList(FilterOrderRequest filterOrderRequest); + /** * 查询单据实体列表 * @@ -59,4 +61,4 @@ public interface IoOrderDao extends BaseMapperPlus filterList(FilterOrderDetailBizRequest orderDetailBizRequest); + List getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest); + List filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest); /** diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java index 15b29ced..186b3e81 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -197,4 +197,8 @@ public class IoOrderDetailBizEntity { @TableField(exist = false) private String errMsg; + @TableField(value = "regStatus") + private boolean regStatus; + + } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java index cef5f2a4..dd45cbd7 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java @@ -106,6 +106,10 @@ public class IoOrderInvoiceEntity { @TableField(value = "bizIdFk") private Integer bizIdFk; + @TableField(exist = false) + private Integer regId; + + public static final String COL_ID = "id"; public static final String COL_ORDERIDFK = "orderIdFk"; diff --git a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java index ca65a742..a6cc55bc 100644 --- a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java +++ b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java @@ -13,7 +13,6 @@ public class FilterOrderDetailBizRequest extends ListPageRequest { * 耗材字典产品ID */ private Long relId; - /** * 批次号 */ diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java index 54bfe00e..29af9533 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java @@ -163,6 +163,10 @@ public class IoOrderDetailBizResponse { private String invoiceCodes; + private Integer sucCount; + + private boolean regStatus; + } diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java index 757b5ee8..f9ee6dd5 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java @@ -232,6 +232,11 @@ public class IoOrderResponse { private Integer processStatus; private int inCodeStatus; + private Integer allCout; + + private Integer partCount; + + /** * 校验信息 diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java index ab3008c8..bbeb3681 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java @@ -34,6 +34,8 @@ public interface IoOrderDetailBizService { List filterList(FilterOrderDetailBizRequest orderDetailBizRequest); + List getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest); + IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk); List checkOrderList(String orderId); diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderService.java b/src/main/java/com/glxp/api/service/inout/IoOrderService.java index 0c4af4fd..3c117440 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderService.java @@ -54,6 +54,8 @@ public interface IoOrderService { */ List filterList(FilterOrderRequest filterOrderRequest); + List getfilterList(FilterOrderRequest filterOrderRequest); + /** * 查询单据列表 * diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java index e435b746..1b802e98 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java @@ -117,6 +117,17 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { return ioOrderDetailBizDao.filterList(orderDetailBizRequest); } + @Override + public List getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest) { + if (null == orderDetailBizRequest) { + return Collections.emptyList(); + } + if (null != orderDetailBizRequest.getPage() && null != orderDetailBizRequest.getLimit()) { + PageHelper.offsetPage((orderDetailBizRequest.getPage() - 1) * orderDetailBizRequest.getLimit(), orderDetailBizRequest.getLimit()); + } + return ioOrderDetailBizDao.getfilterList(orderDetailBizRequest); + } + @Override public IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk) { QueryWrapper ew = new QueryWrapper<>(); diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index 36f6f218..b417ef87 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -531,6 +531,17 @@ public class IoOrderServiceImpl implements IoOrderService { return orderDao.filterList(filterOrderRequest); } + @Override + public List getfilterList(FilterOrderRequest filterOrderRequest) { + if (null == filterOrderRequest) { + return Collections.emptyList(); + } + if (null != filterOrderRequest.getPage() && null != filterOrderRequest.getLimit()) { + PageHelper.offsetPage((filterOrderRequest.getPage() - 1) * filterOrderRequest.getLimit(), filterOrderRequest.getLimit()); + } + return orderDao.getfilterList(filterOrderRequest); + } + @Override public List filterOrderList(FilterOrderRequest filterOrderRequest) { if (null == filterOrderRequest) { diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml index d5ed8b26..36a7a47b 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml @@ -136,6 +136,150 @@ order by createTime desc + + + + + - select io_order_detail_biz.* + select io_order_detail_biz.*, from io_order_detail_biz left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk left join basic_products bp on bu.uuid = bp.uuid @@ -23,6 +23,31 @@ group by io_order_detail_biz.id + + + +