diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java new file mode 100644 index 00000000..a5430c6c --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -0,0 +1,103 @@ +package com.glxp.api.controller.inout; + + +import cn.hutool.core.util.StrUtil; +import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.Constant; +import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.basic.BasicBussinessTypeEntity; +import com.glxp.api.entity.inout.IoOrderDetailBizEntity; +import com.glxp.api.entity.inout.IoOrderEntity; +import com.glxp.api.req.inout.AddBizProductReqeust; +import com.glxp.api.req.system.DeleteRequest; +import com.glxp.api.res.basic.UdiRelevanceResponse; +import com.glxp.api.service.basic.IBasicBussinessTypeService; +import com.glxp.api.service.basic.UdiRelevanceService; +import com.glxp.api.service.inout.IoOrderDetailBizService; +import com.glxp.api.service.inout.IoOrderService; +import com.glxp.api.util.GennerOrderUtils; +import com.glxp.api.util.OrderNoTypeBean; +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.Date; + +/** + * 单据业务详情 + */ + +@RestController +public class IoOrderDetailBizController extends BaseController { + + @Resource + IoOrderService orderService; + @Resource + IoOrderDetailBizService orderDetailBizService; + @Resource + UdiRelevanceService udiRelevanceService; + @Resource + GennerOrderUtils gennerOrderUtils; + @Resource + private IBasicBussinessTypeService basicBussinessTypeService; + + //录入业务单据详情 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/order/addBizProduct") + public BaseResponse addBizProduct(@RequestBody AddBizProductReqeust addBizProductReqeust) { + + AuthAdmin authAdmin = getUser(); + if (addBizProductReqeust.getRelId() == null) + return ResultVOUtils.error(500, "未选择产品信息"); + if (addBizProductReqeust.getOrderEntity() == null) + return ResultVOUtils.error(500, "未指定订单"); + IoOrderEntity orderEntity = addBizProductReqeust.getOrderEntity(); + if (StrUtil.isEmpty(orderEntity.getBillNo())) { + BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); + String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); + orderEntity.setBillNo(orderNo); + orderEntity.setCreateUser(authAdmin.getId() + ""); + orderEntity.setCreateTime(new Date()); + } + UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(addBizProductReqeust.getRelId()); + IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); + ioOrderDetailBizEntity.setOrderIdFk(orderEntity.getBillNo()); + ioOrderDetailBizEntity.setBindRlFk(udiRelevanceResponse.getId()); + ioOrderDetailBizEntity.setUuidFk(udiRelevanceResponse.getUuid()); + ioOrderDetailBizEntity.setCoName(udiRelevanceResponse.getCpmctymc()); + ioOrderDetailBizEntity.setCertCode(udiRelevanceResponse.getZczbhhzbapzbh()); + ioOrderDetailBizEntity.setYlqxzcrbarmc(udiRelevanceResponse.getYlqxzcrbarmc()); + ioOrderDetailBizEntity.setManufacturer(udiRelevanceResponse.getManufactory()); + ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname()); + ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh()); + ioOrderDetailBizEntity.setPrice(udiRelevanceResponse.getPrice()); + orderDetailBizService.insert(ioOrderDetailBizEntity); + orderEntity.setUpdateTime(new Date()); + orderEntity.setUpdateUser(authAdmin.getId() + ""); + orderService.insertOrUpdate(orderEntity); + return ResultVOUtils.success(orderEntity); + } + + //修改业务单据详情 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/order/updateBizProduct") + public BaseResponse updateBizProduct(@RequestBody IoOrderDetailBizEntity orderDetailBizEntity) { + boolean isExit = orderDetailBizService.isExit(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo()); + if (isExit) { + return ResultVOUtils.error(500, "存在相同产品,相同批次号,请检查后保存!"); + } + return orderDetailBizService.update(orderDetailBizEntity) > 0 ? ResultVOUtils.success("保存成功!") : ResultVOUtils.error(500, "保存失败"); + } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/order/delBizProduct") + public BaseResponse delBizProduct(@RequestBody DeleteRequest deleteRequest) { + return orderDetailBizService.deleteById(Integer.parseInt(deleteRequest.getId())) > 0 ? ResultVOUtils.success("保存成功!") : ResultVOUtils.error(500, "保存失败"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailController.java index ab928816..918c8603 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailController.java @@ -4,9 +4,14 @@ import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.dao.inout.IoOrderDetailCodeDao; +import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; +import com.glxp.api.req.basic.UdiCombineRequest; +import com.glxp.api.req.inout.AddBizProductReqeust; import com.glxp.api.res.PageSimpleResponse; 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; @@ -31,6 +36,6 @@ public class IoOrderDetailController { } - //录入业务单据详情 + } diff --git a/src/main/java/com/glxp/api/dao/inout/IoCodeTempDao.java b/src/main/java/com/glxp/api/dao/inout/IoCodeTempDao.java index aa422f0c..d079aad8 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoCodeTempDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoCodeTempDao.java @@ -1,7 +1,6 @@ package com.glxp.api.dao.inout; import com.glxp.api.dao.BaseMapperPlus; -import com.glxp.api.entity.inout.IoCodeEnttity; import com.glxp.api.entity.inout.IoCodeTempEntity; public interface IoCodeTempDao extends BaseMapperPlus { diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java index ba00c851..4204c4e9 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java @@ -1,7 +1,6 @@ package com.glxp.api.dao.inout; import com.glxp.api.dao.BaseMapperPlus; -import com.glxp.api.entity.inout.IoCodeTempEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; public interface IoOrderDetailCodeDao extends BaseMapperPlus { diff --git a/src/main/java/com/glxp/api/entity/basic/UdiRlSupEntity.java b/src/main/java/com/glxp/api/entity/basic/UdiRlSupEntity.java index 9ab26074..74874e17 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiRlSupEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiRlSupEntity.java @@ -1,11 +1,13 @@ package com.glxp.api.entity.basic; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.math.BigDecimal; import java.util.Date; +/** + * 供应商关联耗材字典表 + */ @Data public class UdiRlSupEntity { 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 7c374a76..da462466 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import java.io.Serializable; import java.math.BigDecimal; + import lombok.Data; @Data @@ -24,7 +26,7 @@ public class IoOrderDetailBizEntity implements Serializable { * 耗材字典ID外键 */ @TableField(value = "bindRlFk") - private String bindRlFk; + private Long bindRlFk; /** * DI信息UUID外键 diff --git a/src/main/java/com/glxp/api/entity/inv/InvPreinDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/InvPreinDetailEntity.java new file mode 100644 index 00000000..0edfa446 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/inv/InvPreinDetailEntity.java @@ -0,0 +1,79 @@ +package com.glxp.api.entity.inv; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +import lombok.Data; + +@Data +@TableName(value = "inv_prein_detail") +public class InvPreinDetailEntity implements Serializable { + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 条码 + */ + @TableField(value = "code") + private String code; + + /** + * 单据号外键 + */ + @TableField(value = "orderId") + private String orderId; + + /** + * 最小销售表示 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 生产日期 + */ + @TableField(value = "produceDate") + private String produceDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 耗材字典主键 + */ + @TableField(value = "relId") + private Integer relId; + + /** + * 扫码数量 + */ + @TableField(value = "`count`") + private Integer count; + + /** + * 实际数量 + */ + @TableField(value = "reCount") + private Integer reCount; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/inv/InvPreinOrderEntity.java b/src/main/java/com/glxp/api/entity/inv/InvPreinOrderEntity.java new file mode 100644 index 00000000..56213152 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/inv/InvPreinOrderEntity.java @@ -0,0 +1,96 @@ +package com.glxp.api.entity.inv; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +@Data +@TableName(value = "inv_prein_order") +public class InvPreinOrderEntity implements Serializable { + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 单据号 + */ + @TableField(value = "billNo") + private String billNo; + + /** + * 单据类型 + */ + @TableField(value = "`action`") + private String action; + + /** + * 往来单位 + */ + @TableField(value = "fromCorp") + private String fromCorp; + + /** + * 来源 + */ + @TableField(value = "fromType") + private String fromType; + + /** + * 创建人 + */ + @TableField(value = "`createUser`") + private String createUser; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private Date createTime; + + /** + * 更新人 + */ + @TableField(value = "updateUser") + private String updateUser; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + /** + * 验收人 + */ + @TableField(value = "reviewUser") + private String reviewUser; + + /** + * 验收时间 + */ + @TableField(value = "auditTime") + private Date auditTime; + + /** + * 客户ID + */ + @TableField(value = "customerId") + private Integer customerId; + + /** + * 当前仓库 + */ + @TableField(value = "invCode") + private String invCode; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/inv/InvProductDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/InvProductDetailEntity.java new file mode 100644 index 00000000..34699c1e --- /dev/null +++ b/src/main/java/com/glxp/api/entity/inv/InvProductDetailEntity.java @@ -0,0 +1,120 @@ +package com.glxp.api.entity.inv; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +@Data +@TableName(value = "inv_product_detail") +public class InvProductDetailEntity implements Serializable { + @TableId(value = "id", type = IdType.INPUT) + private Integer id; + + /** + * UDI码 + */ + @TableField(value = "code") + private String code; + + /** + * 订单号外键 + */ + @TableField(value = "orderId") + private String orderId; + + /** + * 耗材字典ID + */ + @TableField(value = "relId") + private String relId; + + /** + * 最小销售标识 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 生产日期 + */ + @TableField(value = "produceDate") + private Date produceDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private Date expireDate; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 供应商 + */ + @TableField(value = "supId") + private Integer supId; + + /** + * 扫码数量 + */ + @TableField(value = "`count`") + private Integer count; + + /** + * 实际数量 + */ + @TableField(value = "reCount") + private String reCount; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 仓库编码 + */ + @TableField(value = "invCode") + private String invCode; + + /** + * 货位编码 + */ + @TableField(value = "invSpaceCode") + private String invSpaceCode; + + /** + * 原始编码 + */ + @TableField(value = "originCode") + private String originCode; + + /** + * 采购类型 + */ + @TableField(value = "purchaseType") + private String purchaseType; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java b/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java new file mode 100644 index 00000000..dbd084dc --- /dev/null +++ b/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java @@ -0,0 +1,96 @@ +package com.glxp.api.entity.inv; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +@Data +@TableName(value = "inv_product") +public class InvProductEntity implements Serializable { + @TableId(value = "id", type = IdType.INPUT) + private Integer id; + + /** + * 耗材字典ID + */ + @TableField(value = "relIdFk") + private String relIdFk; + + /** + * 最小销售标识 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 生产日期 + */ + @TableField(value = "productionDate") + private Date productionDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private Date expireDate; + + /** + * 入库数量 + */ + @TableField(value = "inCount") + private String inCount; + + /** + * 出库数量 + */ + @TableField(value = "outCount") + private String outCount; + + /** + * 实际数量 + */ + @TableField(value = "reCount") + private String reCount; + + /** + * 客户ID + */ + @TableField(value = "customerId") + private Integer customerId; + + /** + * 供应商ID + */ + @TableField(value = "supId") + private Integer supId; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 仓库编码 + */ + @TableField(value = "invCode") + private String invCode; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/req/inout/AddBizProductReqeust.java b/src/main/java/com/glxp/api/req/inout/AddBizProductReqeust.java new file mode 100644 index 00000000..0daf33ca --- /dev/null +++ b/src/main/java/com/glxp/api/req/inout/AddBizProductReqeust.java @@ -0,0 +1,13 @@ +package com.glxp.api.req.inout; + +import com.glxp.api.entity.inout.IoOrderEntity; +import lombok.Data; + +@Data +public class AddBizProductReqeust { + + private IoOrderEntity orderEntity; + private Long relId; + private String zczbhhzbapzbh; + +} diff --git a/src/main/java/com/glxp/api/req/inout/FilterOrderBizRequest.java b/src/main/java/com/glxp/api/req/inout/FilterOrderBizRequest.java new file mode 100644 index 00000000..9e720b0f --- /dev/null +++ b/src/main/java/com/glxp/api/req/inout/FilterOrderBizRequest.java @@ -0,0 +1,10 @@ +package com.glxp.api.req.inout; + +import lombok.Data; + +@Data +public class FilterOrderBizRequest { + + private Long relId; + private String batchNo; +} diff --git a/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java b/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java index 2a36b9d0..781aca75 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java @@ -1,9 +1,7 @@ package com.glxp.api.service.inout; -import com.glxp.api.entity.inout.IoCodeTempEntity; import com.glxp.api.entity.inout.IoCodeTempEntity; import com.glxp.api.req.inout.FilterIoCodeRequest; -import com.glxp.api.util.page.PageQuery; import com.glxp.api.util.page.TableDataInfo; import java.util.List; 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 4c7634fd..7a933a2f 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java @@ -11,4 +11,8 @@ public interface IoOrderDetailBizService { int insert(IoOrderDetailBizEntity orderDetailBizEntity); int update(IoOrderDetailBizEntity orderDetailBizEntity); + + int deleteById(Integer id); + + boolean isExit(Long relId, String bacthNo); } 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 0dce7c0b..a84400ca 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderService.java @@ -7,11 +7,13 @@ import java.util.List; public interface IoOrderService { - List selectAll(); + List selectAll(); IoOrderEntity findById(String orderId); IoOrderEntity findByBillNo(String billNO); int insertOrder(IoOrderEntity orderEntity); + + int insertOrUpdate(IoOrderEntity orderEntity); } diff --git a/src/main/java/com/glxp/api/service/inout/IoTransInoutService.java b/src/main/java/com/glxp/api/service/inout/IoTransInoutService.java index 28296d7f..7729aaa4 100644 --- a/src/main/java/com/glxp/api/service/inout/IoTransInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoTransInoutService.java @@ -5,13 +5,11 @@ import cn.hutool.core.util.StrUtil; import com.glxp.api.constant.Constant; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; -import com.glxp.api.entity.basic.UdiEntity; import com.glxp.api.entity.basic.UdiRlSupEntity; import com.glxp.api.entity.inout.IoCodeEnttity; import com.glxp.api.entity.inout.IoCodeTempEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderEntity; -import com.glxp.api.req.basic.CompanyProductRelevanceRequest; import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest; import com.glxp.api.req.inout.PdaCodeEntity; import com.glxp.api.req.inout.PostOrderRequest; @@ -19,18 +17,14 @@ import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.service.basic.UdiRelevanceService; import com.glxp.api.service.basic.UdiRlSupService; import com.glxp.api.service.basic.IBasicBussinessTypeService; -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.udi.FilterUdiUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.math.BigDecimal; import java.util.ArrayList; -import java.util.Date; import java.util.List; @Service diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoCodeTempServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoCodeTempServiceImpl.java index d138023f..1d3b1b27 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoCodeTempServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoCodeTempServiceImpl.java @@ -1,10 +1,7 @@ package com.glxp.api.service.inout.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.glxp.api.dao.inout.IoCodeDao; import com.glxp.api.dao.inout.IoCodeTempDao; -import com.glxp.api.entity.auth.SysDictData; -import com.glxp.api.entity.inout.IoCodeTempEntity; import com.glxp.api.entity.inout.IoCodeTempEntity; import com.glxp.api.req.inout.FilterIoCodeRequest; import com.glxp.api.service.inout.IoCodeTempService; 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 0180e0ab..8ae1bb6d 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 @@ -30,5 +30,16 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { return ioOrderDetailBizDao.updateById(orderDetailBizEntity); } + @Override + public int deleteById(Integer id) { + return ioOrderDetailBizDao.deleteById(id); + } + + + @Override + public boolean isExit(Long relId, String bacthNo) { + return ioOrderDetailBizDao.exists(new QueryWrapper().eq("bindRlFk", relId).eq("batchNo", bacthNo)); + } + } 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 da9a872f..9f825495 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 @@ -2,6 +2,7 @@ package com.glxp.api.service.inout.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.glxp.api.dao.inout.IoOrderDao; +import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.service.inout.IoOrderService; import org.springframework.stereotype.Service; @@ -34,4 +35,15 @@ public class IoOrderServiceImpl implements IoOrderService { public int insertOrder(IoOrderEntity orderEntity) { return orderDao.insert(orderEntity); } + + + @Override + public int insertOrUpdate(IoOrderEntity orderEntity) { + IoOrderEntity temp = orderDao.selectOne(new QueryWrapper().eq("billNo", orderEntity.getBillNo())); + if (temp == null) { + return orderDao.insert(orderEntity); + } else { + return orderDao.updateById(orderEntity); + } + } }