Browse Source

add: 给前端的测试分支;

test-20240527
龚宝雄 9 months ago
parent
commit
899d41e888
  1. 103
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBill2Controller.java
  2. 1
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java
  3. 2
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java
  4. 103
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBill2Controller.java
  5. 1
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java
  6. 147
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill.java
  7. 131
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill2.java
  8. 152
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill.java
  9. 107
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill2.java
  10. 15
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBill2Mapper.java
  11. 7
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBillMapper.java
  12. 4
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/EasOutInBillMapper.java
  13. 15
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBill2Mapper.java
  14. 4
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBillMapper.java
  15. 14
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBill2Mapper.xml
  16. 28
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml
  17. 12
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBill2Mapper.xml
  18. 25
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBillMapper.xml
  19. 89
      nlsso-server/src/main/java/org/nl/wms/database/eas/dto/AllocationBill2Dto.java
  20. 83
      nlsso-server/src/main/java/org/nl/wms/database/eas/dto/AllocationBill2VO.java
  21. 73
      nlsso-server/src/main/java/org/nl/wms/database/eas/dto/ReceiptBill2Dto.java
  22. 67
      nlsso-server/src/main/java/org/nl/wms/database/eas/dto/ReceiptBill2VO.java
  23. 63
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/IallocationBill2Service.java
  24. 63
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/IreceiptBill2Service.java
  25. 135
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBill2ServiceImpl.java
  26. 33
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java
  27. 135
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/ReceiptBill2ServiceImpl.java
  28. 24
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/ReceiptBillServiceImpl.java
  29. 2
      nlsso-server/src/main/resources/config/application-devLocal.yml
  30. 2
      nlsso-server/src/main/resources/config/application.yml

103
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBill2Controller.java

@ -0,0 +1,103 @@
package org.nl.wms.database.eas.controller;
import java.util.List;
import java.util.Set;
import org.nl.common.base.CommonPage;
import org.nl.common.base.CommonResult;
import org.nl.common.base.RestBusinessTemplate;
import org.nl.wms.database.eas.dao.AllocationBill2;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.database.eas.dto.AllocationBill2VO;
import org.nl.wms.database.eas.service.IallocationBill2Service;
/**
* 调拨单(AllocationBill2)控制层
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/allocationBill2")
@Slf4j
public class AllocationBill2Controller {
@Resource
private IallocationBill2Service allocationBill2Service;
/**
* 分页查询
*
* @param params 传入分页条件或查询条件{"page":"0","size":"10", "fuzzy":"熊一" }
*/
@PostMapping("/page")
@Log("分页查询调拨单")
public ResponseEntity<CommonPage<AllocationBill2>> page(@RequestBody AllocationBill2VO params) {
return new ResponseEntity<>(allocationBill2Service.page(params), HttpStatus.OK);
}
/**
* 条件查询
*
* @param params 传入查询条件{"fuzzy":"熊一" }
*/
@PostMapping("/query")
@Log("条件查询调拨单")
public CommonResult<List<AllocationBill2>> query(@RequestBody AllocationBill2VO params) {
return RestBusinessTemplate.execute(() -> allocationBill2Service.query(params));
}
/**
* 新增数据
*
* @param entity 传入新增对象{"name":"熊大", "age":"16" }
* @return 新增结果
*/
@PostMapping("/create")
@Log("新增调拨单")
public CommonResult create(@RequestBody AllocationBill2VO entity) {
return RestBusinessTemplate.execute(() -> allocationBill2Service.create(entity));
}
/**
* 修改数据
*
* @param entity 传入修改对象包含主键{"id":"1", "name":"熊二" }
* @return 修改结果
*/
@PostMapping("/update")
@Log("修改调拨单")
//@SaCheckPermission("@el.check(AllocationBill2:edit')")
public CommonResult update(@RequestBody AllocationBill2VO entity) {
return RestBusinessTemplate.execute(() -> allocationBill2Service.update(entity));
}
/**
* 删除数据
*
* @param ids 传入单个或多个主键Id["1","2"]
* @return 删除结果
*/
@Log("删除调拨单")
//@SaCheckPermission("@el.check(AllocationBill2:del')")
@PostMapping("/delete")
public CommonResult delete(@RequestBody Set<String> ids) {
return RestBusinessTemplate.execute(() -> allocationBill2Service.delete(ids));
}
}

1
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java

@ -31,6 +31,7 @@ import org.nl.wms.database.eas.service.IallocationBillService;
@RequiredArgsConstructor
@RequestMapping("/api/allocationBill")
@Slf4j
@SaIgnore
public class AllocationBillController {

2
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java

@ -3,6 +3,7 @@ package org.nl.wms.database.eas.controller;
import java.util.List;
import java.util.Set;
import cn.dev33.satoken.annotation.SaIgnore;
import org.nl.common.base.CommonPage;
import org.nl.common.base.CommonResult;
import org.nl.common.base.RestBusinessTemplate;
@ -32,6 +33,7 @@ import org.nl.wms.database.eas.service.IeasOutInBillDetailService;
@RequiredArgsConstructor
@RequestMapping("/api/easOutInBillDetail")
@Slf4j
@SaIgnore
public class EasOutInBillDetailController {

103
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBill2Controller.java

@ -0,0 +1,103 @@
package org.nl.wms.database.eas.controller;
import java.util.List;
import java.util.Set;
import org.nl.common.base.CommonPage;
import org.nl.common.base.CommonResult;
import org.nl.common.base.RestBusinessTemplate;
import org.nl.wms.database.eas.dao.ReceiptBill2;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.database.eas.dto.ReceiptBill2VO;
import org.nl.wms.database.eas.service.IreceiptBill2Service;
/**
* 送货单(ReceiptBill2)控制层
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/receiptBill2")
@Slf4j
public class ReceiptBill2Controller {
@Resource
private IreceiptBill2Service receiptBill2Service;
/**
* 分页查询
*
* @param params 传入分页条件或查询条件{"page":"0","size":"10", "fuzzy":"熊一" }
*/
@PostMapping("/page")
@Log("分页查询送货单")
public ResponseEntity<CommonPage<ReceiptBill2>> page(@RequestBody ReceiptBill2VO params) {
return new ResponseEntity<>(receiptBill2Service.page(params), HttpStatus.OK);
}
/**
* 条件查询
*
* @param params 传入查询条件{"fuzzy":"熊一" }
*/
@PostMapping("/query")
@Log("条件查询送货单")
public CommonResult<List<ReceiptBill2>> query(@RequestBody ReceiptBill2VO params) {
return RestBusinessTemplate.execute(() -> receiptBill2Service.query(params));
}
/**
* 新增数据
*
* @param entity 传入新增对象{"name":"熊大", "age":"16" }
* @return 新增结果
*/
@PostMapping("/create")
@Log("新增送货单")
public CommonResult create(@RequestBody ReceiptBill2VO entity) {
return RestBusinessTemplate.execute(() -> receiptBill2Service.create(entity));
}
/**
* 修改数据
*
* @param entity 传入修改对象包含主键{"id":"1", "name":"熊二" }
* @return 修改结果
*/
@PostMapping("/update")
@Log("修改送货单")
//@SaCheckPermission("@el.check(ReceiptBill2:edit')")
public CommonResult update(@RequestBody ReceiptBill2VO entity) {
return RestBusinessTemplate.execute(() -> receiptBill2Service.update(entity));
}
/**
* 删除数据
*
* @param ids 传入单个或多个主键Id["1","2"]
* @return 删除结果
*/
@Log("删除送货单")
//@SaCheckPermission("@el.check(ReceiptBill2:del')")
@PostMapping("/delete")
public CommonResult delete(@RequestBody Set<String> ids) {
return RestBusinessTemplate.execute(() -> receiptBill2Service.delete(ids));
}
}

1
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java

@ -32,6 +32,7 @@ import org.nl.wms.database.eas.service.IreceiptBillService;
@RequiredArgsConstructor
@RequestMapping("/api/receiptBill")
@Slf4j
@SaIgnore
public class ReceiptBillController {

147
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill.java

@ -21,104 +21,163 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
public class AllocationBill extends Model<AllocationBill> {
private static final long serialVersionUID = -7739291296662381393L;
/**
* 分录ID
*/
@TableId(value = "flid", type = IdType.NONE)
private String flid;
/**
* 单据ID
*/
@TableId(value = "djid", type = IdType.NONE)
private String djid;
/**
* 单据编号
*/
private String djbh;
/**
* 业务类型
*/
private String ywlx;
/**
* 业务日期
*/
private String ywrq;
/**
* 调出库存组织编码
*/
private String dckcbm;
/**
* 调出库存组织名称
*/
private String dckcmc;
/**
* 调入库存组织编码
*/
private String drkcbm;
/**
* 调入库存组织名称
*/
private String drkcmc;
/**
* 调出部门
*/
private String dcbm;
/**
* 调入部门
*/
private String drbm;
/**
* 表头备注
*/
private String btbz;
/**
* 制单时间
*/
private String cjsj;
/**
* 创建人
*/
private String cjr;
/**
* 单据状态
*/
private String djzt;
/**
* 分录序号
*/
private String flxh;
/**
* 分录id
* 物料编码
*/
private String flid;
private String wlbm;
/**
* 物料名称
*/
private String wlmc;
/**
* 规格型号
*/
private String ggxh;
/**
* 批次
*/
private String pc;
/**
* 辅助属性
*/
private String fzsx;
/**
* 计量单位
*/
private String jldw;
/**
* 基本计量单位
*/
private String jbjldw;
/**
* 数量
*/
private String sl;
/**
* 调出仓库
* 库存类型
*/
private String kclx;
/**
* 库存状态
*/
private String kczt;
/**
* 调出仓库编码
*/
private String dcckbm;
/**
* 调出库位
* 调出仓库名称
*/
private String dcckmc;
/**
* 调出库位编码
*/
private String dckwbm;
/**
* 调入仓库
* 调出库位名称
*/
private String dckwmc;
/**
* 调入仓库编码
*/
private String drckbm;
/**
* 调入库位
* 调入仓库名称
*/
private String drckmc;
/**
* 调入库位编码
*/
private String drkwbm;
/**
* 调入库位名称
*/
private String drkwmc;
/**
* 跟踪号
*/
private String gzh;
/**
* 计划调入日期
*/
private String jhdrrq;
/**
* 计划调日期
* 计划调出日期
*/
private String jhdcrq;
/**
* 备注
* 分录备注
*/
private String bz;
private String flbz;
/**
* 获取主键值
@ -127,7 +186,7 @@ public class AllocationBill extends Model<AllocationBill> {
*/
@Override
protected Serializable pkVal() {
return this.djid;
return this.flid;
}
}

131
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill2.java

@ -0,0 +1,131 @@
package org.nl.wms.database.eas.dao;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
/**
* {@code @Description:} 调拨单(AllocationBill2)实体类
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("allocation_bill2")
public class AllocationBill2 extends Model<AllocationBill2> {
private static final long serialVersionUID = -7739291296662381393L;
/**
* 单据ID
*/
private String djid;
/**
* 单据编号
*/
private String djbh;
/**
* 业务日期
*/
private String ywrq;
/**
* 表头备注
*/
private String btbz;
/**
* 分录序号
*/
private String flxh;
/**
* 分录ID
*/
@TableId(value = "flid", type = IdType.NONE)
private String flid;
/**
* 计量单位
*/
private String jldw;
/**
* 数量
*/
private String sl;
/**
* 调出仓库编码
*/
private String dcckbm;
/**
* 调出库位编码
*/
private String dckwbm;
/**
* 调入仓库编码
*/
private String drckbm;
/**
* 调入库位编码
*/
private String drkwbm;
/**
* 计划调入日期
*/
private String jhdrrq;
/**
* 计划调出日期
*/
private String jhdcrq;
/**
* 备注
*/
private String bz;
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.djid;
}
}

152
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill.java

@ -24,72 +24,160 @@ public class ReceiptBill extends Model<ReceiptBill> {
/**
* 送货单id
* 分录ID
*/
@TableId(value = "djid", type = IdType.NONE)
private String djid;
@TableId(value = "flid", type = IdType.NONE)
private String flid;
/**
* 送货单id
*/
private String djid;
/**
* 送货单号
*/
private String djbh;
/**
* 送货日期
*/
private String ywrq;
/**
* 单据状态
*/
private String djzt;
/**
* 提交时间
*/
private String tjsj;
/**
* 采购订单号
*/
private String cgbh;
/**
* 采购公司
*/
private String cggs;
/**
* 物料编码
*/
private String wlbm;
/**
* 物科名称
*/
private String wlmc;
/**
* 规格型号
*/
private String ggxh;
/**
* 采购公司编码
*/
private String cggsbm;
/**
* 单位
*/
private String jldw;
/**
* 分录序号
*/
private String flxh;
/**
* 表头备注
*/
private String btbz;
/**
* 明细备注
*/
private String bz;
/**
* 订单量
*/
private String ddsl;
/**
* 本次送货数量
*/
private String bcshsl;
/**
* 收货数量
*/
private String shsl;
/**
* 件数
*/
private String num;
/**
* 收货组织编码
*/
private String zzbm;
/**
* 收货组织名称
*/
private String zzmc;
/**
* 收货仓库编码
*/
private String ckbm;
/**
* 收货仓库名称
*/
private String ckmc;
/**
* 收货库位编码
*/
private String kwbm;
/**
* 分录ID
* 收货库位名称
*/
private String flid;
private String kwmc;
/**
* 分录序号
* 是否质检
*/
private String flxh;
private String sfzj;
/**
* 备注
* 批次管理
*/
private String bz;
private String pcgl;
/**
* 表头备注
* 批次
*/
private String btbz;
private String pc;
/**
* 所属厂区
*/
private String sscq;
/**
* 供应商编码
*/
private String gysbm;
/**
* 供应商
*/
private String gys;
/**
* 创建日期
*/
private String cjrq;
/**
* 采购员
*/
private String cgy;
/**
* 收货人
*/
private String shy;
/**
* 预计到货日期
*/
private String yjdhrq;
/**
* 收货地址
*/
private String shdz;
/**
* 记录行
*/
private String rec_ok_row;
@ -100,7 +188,7 @@ public class ReceiptBill extends Model<ReceiptBill> {
*/
@Override
protected Serializable pkVal() {
return this.djid;
return this.flid;
}
}

107
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill2.java

@ -0,0 +1,107 @@
package org.nl.wms.database.eas.dao;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
/**
* {@code @Description:} 送货单(ReceiptBill2)实体类
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("receipt_bill2")
public class ReceiptBill2 extends Model<ReceiptBill2> {
private static final long serialVersionUID = -7739291296662381393L;
//@TableId(value = "id", type = IdType.NONE)
/**
* 送货单ID
*/
private String djid;
/**
* 送货单号
*/
private String djbh;
/**
* 送货日期
*/
private String ywrq;
/**
* 收货数量
*/
private String shsl;
/**
* 收货组织编码
*/
private String zzbm;
/**
* 收货仓库编码
*/
private String ckbm;
/**
* 收货库位编码
*/
private String kwbm;
/**
* 分录ID
*/
@TableId(value = "flid", type = IdType.NONE)
private String flid;
/**
* 分录序号
*/
private String flxh;
/**
* 备注
*/
private String bz;
/**
* 表头备注
*/
private String btbz;
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.djid;
}
}

15
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBill2Mapper.java

@ -0,0 +1,15 @@
package org.nl.wms.database.eas.dao.mapper;
import org.nl.wms.database.eas.dao.AllocationBill2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* {@code @Description:} 调拨单(AllocationBill2)数据持久层
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
public interface AllocationBill2Mapper extends BaseMapper<AllocationBill2> {
}

7
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBillMapper.java

@ -16,15 +16,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface AllocationBillMapper extends BaseMapper<AllocationBill> {
@Select("SELECT COUNT(*) FROM receiptBill")
@DS("oracle_eas")
//@DS("oracle_eas")
Long getAllocationCount();
@DS("oracle_eas")
// @DS("oracle_eas")
Page<AllocationBill> allocationPage(Page<AllocationBill> page, @Param("fuzzy") String fuzzy);
@Select("SELECT COUNT(*) FROM EAS_NOBLE.receiptBill WHERE DJBH = #{djbh}")
@DS("oracle_eas")
// @DS("oracle_eas")
Long getTotalCount(@Param("djbh") String djbh);
Page<AllocationBill> allocationDetailPage(Page<AllocationBill> page, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy);

4
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/EasOutInBillMapper.java

@ -41,8 +41,8 @@ public interface EasOutInBillMapper extends BaseMapper<EasOutInBill> {
void insertBatch(List<EasOutInBill> entities);
@Select("SELECT * FROM EAS_NOBLE.V_UC_WAREHOUSEINFO WHERE ZT ='1'")
@DS("oracle_eas")
@Select("SELECT * FROM v_uc_warehouseinfo WHERE ZT ='1' order by kcbm")
//@DS("oracle_eas")
List<WarehouseInfo> getWarehouseInfo();

15
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBill2Mapper.java

@ -0,0 +1,15 @@
package org.nl.wms.database.eas.dao.mapper;
import org.nl.wms.database.eas.dao.ReceiptBill2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* {@code @Description:} 送货单(ReceiptBill2)数据持久层
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
public interface ReceiptBill2Mapper extends BaseMapper<ReceiptBill2> {
}

4
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBillMapper.java

@ -13,9 +13,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @since 2024-05-25
*/
public interface ReceiptBillMapper extends BaseMapper<ReceiptBill> {
@DS("mysql_srm")
//@DS("mysql_srm")
Page<ReceiptBill> receiptPage(Page<ReceiptBill> page, @Param("fuzzy") String fuzzy);
@DS("mysql_srm")
//@DS("mysql_srm")
Page<ReceiptBill> receiptDetailPage(Page<ReceiptBill> page, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy);
}

14
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBill2Mapper.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.database.eas.dao.mapper.AllocationBill2Mapper">
<insert id="insertBatch" keyProperty="djid" useGeneratedKeys="true">
insert into allocation_bill2(djbh, ywrq, btbz, flxh, flid, jldw, sl, dcckbm, dckwbm, drckbm, drkwbm, jhdrrq,
jhdcrq, bz)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.djbh}, #{entity.ywrq}, #{entity.btbz}, #{entity.flxh}, #{entity.flid}, #{entity.jldw},
#{entity.sl}, #{entity.dcckbm}, #{entity.dckwbm}, #{entity.drckbm}, #{entity.drkwbm}, #{entity.jhdrrq},
#{entity.jhdcrq}, #{entity.bz})
</foreach>
</insert>
</mapper>

28
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.database.eas.dao.mapper.AllocationBillMapper">
<select id="allocationPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery">
<select id="allocationPage1" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery">
WITH ranked_data AS (
SELECT
t.*,
@ -41,12 +41,28 @@
)
WHERE <![CDATA[ row_num > #{size} * (#{page} - 1) ]]>
</select>
<select id="allocationPage" resultType="org.nl.wms.database.eas.dao.AllocationBill">
SELECT *
FROM allocation_bill
<if test="fuzzy != null and fuzzy != ''">
WHERE djbh LIKE CONCAT('%', #{fuzzy}, '%')
OR wlmc LIKE CONCAT('%', #{fuzzy}, '%')
OR ggxh LIKE CONCAT('%', #{fuzzy}, '%')
OR jldw LIKE CONCAT('%', #{fuzzy}, '%')
OR sl LIKE CONCAT('%', #{fuzzy}, '%')
OR kclx LIKE CONCAT('%', #{fuzzy}, '%')
OR kczt LIKE CONCAT('%', #{fuzzy}, '%')
OR ywrq LIKE CONCAT('%', #{fuzzy}, '%')
</if>
GROUP BY
djid
ORDER BY cjsj DESC
</select>
<select id="allocationDetailPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery">
<select id="allocationDetailPage" resultType="org.nl.wms.database.eas.dao.AllocationBill">
SELECT *
FROM EAS_NOBLE.allocation
WHERE DJBH = #{djbh}
FROM allocation_bill
WHERE djbh = #{djbh}
<!-- <if test="fuzzy != null and fuzzy != ''">-->
<!-- AND (-->
<!-- djbh LIKE CONCAT('%', #{fuzzy}, '%')-->
@ -66,6 +82,6 @@
<!-- OR bz LIKE CONCAT('%', #{fuzzy}, '%')-->
<!-- )-->
<!-- </if>-->
ORDER BY djbh ASC
ORDER BY cjsj DESC
</select>
</mapper>

12
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBill2Mapper.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.database.eas.dao.mapper.ReceiptBill2Mapper">
<insert id="insertBatch" keyProperty="djid" useGeneratedKeys="true">
insert into receipt_bill2(djbh, ywrq, shsl, zzbm, ckbm, kwbm, flid, flxh, bz, btbz)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.djbh}, #{entity.ywrq}, #{entity.shsl}, #{entity.zzbm}, #{entity.ckbm}, #{entity.kwbm},
#{entity.flid}, #{entity.flxh}, #{entity.bz}, #{entity.btbz})
</foreach>
</insert>
</mapper>

25
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBillMapper.xml

@ -1,34 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.database.eas.dao.mapper.ReceiptBillMapper">
<select id="receiptPage" resultType="org.nl.wms.database.eas.dto.ReceiptBillQuery">
<select id="receiptPage" resultType="org.nl.wms.database.eas.dao.ReceiptBill">
SELECT *
FROM EAS_NOBLE.receiptBill
FROM receipt_bill
<if test="fuzzy != null and fuzzy != ''">
WHERE djbh LIKE CONCAT('%', #{fuzzy}, '%')
OR wlmc LIKE CONCAT('%', #{fuzzy}, '%')
OR ggxh LIKE CONCAT('%', #{fuzzy}, '%')
OR fzsl LIKE CONCAT('%', #{fuzzy}, '%')
OR jldw LIKE CONCAT('%', #{fuzzy}, '%')
OR sl LIKE CONCAT('%', #{fuzzy}, '%')
OR kclx LIKE CONCAT('%', #{fuzzy}, '%')
OR kczt LIKE CONCAT('%', #{fuzzy}, '%')
OR dcck LIKE CONCAT('%', #{fuzzy}, '%')
OR dccw LIKE CONCAT('%', #{fuzzy}, '%')
OR drck LIKE CONCAT('%', #{fuzzy}, '%')
OR drcw LIKE CONCAT('%', #{fuzzy}, '%')
OR trackno LIKE CONCAT('%', #{fuzzy}, '%')
OR ywrq LIKE CONCAT('%', #{fuzzy}, '%')
OR bz LIKE CONCAT('%', #{fuzzy}, '%')
</if>
GROUP BY
djbh
ORDER BY djbh ASC
djid
ORDER BY tjsj DESC
</select>
<select id="receiptDetailPage" resultType="org.nl.wms.database.eas.dto.ReceiptBillQuery">
<select id="receiptDetailPage" resultType="org.nl.wms.database.eas.dao.ReceiptBill">
SELECT *
FROM EAS_NOBLE.receiptBill
WHERE DJBH = #{djbh}
FROM receipt_bill
WHERE djbh = #{djbh}
<!-- <if test="fuzzy != null and fuzzy != ''">-->
<!-- AND (-->
<!-- djbh LIKE CONCAT('%', #{fuzzy}, '%')-->
@ -48,6 +39,6 @@
<!-- OR bz LIKE CONCAT('%', #{fuzzy}, '%')-->
<!-- )-->
<!-- </if>-->
ORDER BY djbh ASC
ORDER BY tjsj DESC
</select>
</mapper>

89
nlsso-server/src/main/java/org/nl/wms/database/eas/dto/AllocationBill2Dto.java

@ -0,0 +1,89 @@
package org.nl.wms.database.eas.dto;
import java.io.Serializable;
import lombok.*;
import lombok.Data;
import lombok.Builder;
/**
* {@code @Description:} 调拨单(AllocationBill2)数据传输类
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AllocationBill2Dto implements Serializable {
private static final long serialVersionUID = -7739291296662381396L;
/**
* 单据ID
*/
private String djid;
/**
* 单据编号
*/
private String djbh;
/**
* 业务日期
*/
private String ywrq;
/**
* 表头备注
*/
private String btbz;
/**
* 分录序号
*/
private String flxh;
/**
* 分录ID
*/
private String flid;
/**
* 计量单位
*/
private String jldw;
/**
* 数量
*/
private String sl;
/**
* 调出仓库编码
*/
private String dcckbm;
/**
* 调出库位编码
*/
private String dckwbm;
/**
* 调入仓库编码
*/
private String drckbm;
/**
* 调入库位编码
*/
private String drkwbm;
/**
* 计划调入日期
*/
private String jhdrrq;
/**
* 计划调出日期
*/
private String jhdcrq;
/**
* 备注
*/
private String bz;
}

83
nlsso-server/src/main/java/org/nl/wms/database/eas/dto/AllocationBill2VO.java

@ -0,0 +1,83 @@
package org.nl.wms.database.eas.dto;
import lombok.Data;
import lombok.*;
import lombok.EqualsAndHashCode;
import org.nl.common.domain.query.BaseQuery;
import org.nl.wms.database.eas.dao.AllocationBill2;
/**
* {@code @Description:} 调拨单(AllocationBill2)查询参数类
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class AllocationBill2VO extends BaseQuery<AllocationBill2> {
/**
* 单据ID
*/
private String djid;
/**
* 单据编号
*/
private String djbh;
/**
* 业务日期
*/
private String ywrq;
/**
* 表头备注
*/
private String btbz;
/**
* 分录序号
*/
private String flxh;
/**
* 分录ID
*/
private String flid;
/**
* 计量单位
*/
private String jldw;
/**
* 数量
*/
private String sl;
/**
* 调出仓库编码
*/
private String dcckbm;
/**
* 调出库位编码
*/
private String dckwbm;
/**
* 调入仓库编码
*/
private String drckbm;
/**
* 调入库位编码
*/
private String drkwbm;
/**
* 计划调入日期
*/
private String jhdrrq;
/**
* 计划调出日期
*/
private String jhdcrq;
/**
* 备注
*/
private String bz;
}

73
nlsso-server/src/main/java/org/nl/wms/database/eas/dto/ReceiptBill2Dto.java

@ -0,0 +1,73 @@
package org.nl.wms.database.eas.dto;
import java.io.Serializable;
import lombok.*;
import lombok.Data;
import lombok.Builder;
/**
* {@code @Description:} 送货单(ReceiptBill2)数据传输类
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ReceiptBill2Dto implements Serializable {
private static final long serialVersionUID = -7739291296662381396L;
/**
* 送货单ID
*/
private String djid;
/**
* 送货单号
*/
private String djbh;
/**
* 送货日期
*/
private String ywrq;
/**
* 收货数量
*/
private String shsl;
/**
* 收货组织编码
*/
private String zzbm;
/**
* 收货仓库编码
*/
private String ckbm;
/**
* 收货库位编码
*/
private String kwbm;
/**
* 分录ID
*/
private String flid;
/**
* 分录序号
*/
private String flxh;
/**
* 备注
*/
private String bz;
/**
* 表头备注
*/
private String btbz;
}

67
nlsso-server/src/main/java/org/nl/wms/database/eas/dto/ReceiptBill2VO.java

@ -0,0 +1,67 @@
package org.nl.wms.database.eas.dto;
import lombok.Data;
import lombok.*;
import lombok.EqualsAndHashCode;
import org.nl.common.domain.query.BaseQuery;
import org.nl.wms.database.eas.dao.ReceiptBill2;
/**
* {@code @Description:} 送货单(ReceiptBill2)查询参数类
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class ReceiptBill2VO extends BaseQuery<ReceiptBill2> {
/**
* 送货单ID
*/
private String djid;
/**
* 送货单号
*/
private String djbh;
/**
* 送货日期
*/
private String ywrq;
/**
* 收货数量
*/
private String shsl;
/**
* 收货组织编码
*/
private String zzbm;
/**
* 收货仓库编码
*/
private String ckbm;
/**
* 收货库位编码
*/
private String kwbm;
/**
* 分录ID
*/
private String flid;
/**
* 分录序号
*/
private String flxh;
/**
* 备注
*/
private String bz;
/**
* 表头备注
*/
private String btbz;
}

63
nlsso-server/src/main/java/org/nl/wms/database/eas/service/IallocationBill2Service.java

@ -0,0 +1,63 @@
package org.nl.wms.database.eas.service;
import org.nl.common.base.CommonPage;
import org.nl.wms.database.eas.dao.AllocationBill2;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.database.eas.dto.AllocationBill2VO;
import java.util.List;
import java.util.Set;
/**
* {@code @Description:} 调拨单(AllocationBill2)服务接口层
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
public interface IallocationBill2Service extends IService<AllocationBill2> {
/**
* 分页查询
*
* @param params 查询条件
* @return CommonPage<AllocationBill2>
*/
CommonPage<AllocationBill2> page(AllocationBill2VO params);
/**
* 条件查询
*
* @param params 查询条件
* @return List<AllocationBill2>
*/
List<AllocationBill2> query(AllocationBill2VO params);
/**
* 创建
*
* @param entity /
*/
void create(AllocationBill2VO entity);
/**
* 编辑
*
* @param entity /
*/
void update(AllocationBill2VO entity);
/**
* 多选删除
*
* @param ids /
*/
void delete(Set<String> ids);
}

63
nlsso-server/src/main/java/org/nl/wms/database/eas/service/IreceiptBill2Service.java

@ -0,0 +1,63 @@
package org.nl.wms.database.eas.service;
import org.nl.common.base.CommonPage;
import org.nl.wms.database.eas.dao.ReceiptBill2;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.database.eas.dto.ReceiptBill2VO;
import java.util.List;
import java.util.Set;
/**
* {@code @Description:} 送货单(ReceiptBill2)服务接口层
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
public interface IreceiptBill2Service extends IService<ReceiptBill2> {
/**
* 分页查询
*
* @param params 查询条件
* @return CommonPage<ReceiptBill2>
*/
CommonPage<ReceiptBill2> page(ReceiptBill2VO params);
/**
* 条件查询
*
* @param params 查询条件
* @return List<ReceiptBill2>
*/
List<ReceiptBill2> query(ReceiptBill2VO params);
/**
* 创建
*
* @param entity /
*/
void create(ReceiptBill2VO entity);
/**
* 编辑
*
* @param entity /
*/
void update(ReceiptBill2VO entity);
/**
* 多选删除
*
* @param ids /
*/
void delete(Set<String> ids);
}

135
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBill2ServiceImpl.java

@ -0,0 +1,135 @@
package org.nl.wms.database.eas.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.nl.wms.database.eas.dao.AllocationBill2;
import org.nl.wms.database.eas.dto.AllocationBill2VO;
import org.nl.wms.database.eas.dao.mapper.AllocationBill2Mapper;
import org.nl.wms.database.eas.service.IallocationBill2Service;
import cn.hutool.core.date.DateUtil;
import org.nl.common.utils.SecurityUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import org.nl.common.base.CommonPage;
import java.util.Set;
import java.util.List;
/**
* {@code @Description:} 调拨单(AllocationBill2)服务实现层
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Service("allocationBill2Service")
public class AllocationBill2ServiceImpl extends ServiceImpl<AllocationBill2Mapper, AllocationBill2> implements IallocationBill2Service {
@Resource
private AllocationBill2Mapper allocationBill2Mapper;
/**
* 分页查询
*
* @param params 查询条件
*/
@Override
public CommonPage<AllocationBill2> page(AllocationBill2VO params) {
Page<AllocationBill2> result = allocationBill2Mapper.selectPage(new Page<>(params.getPage() + 1, params.getSize()), new QueryWrapper<AllocationBill2>()
.lambda()
// .like(StringUtils.isNotBlank(form.name()), User::getName, form.name())
// .between(form.beginTime != null && form.endTime != null, User::getCreateTime, beginTime, endTime)
// .in(form.Status != null, User::getStatus
// , UserStatusEnum.NOT_SUBMITTED
// , UserStatusEnum.TO_REVIEWED)
// .orderByDesc(User::getId)
//.eq(AllocationBill2::getIs_delete, 0)
);
return CommonPage.getPage(result);
}
/**
* 根据条件查询
*
* @param params 查询条件
*/
@Override
public List<AllocationBill2> query(AllocationBill2VO params) {
return allocationBill2Mapper.selectList(new QueryWrapper<AllocationBill2>()
.lambda()
.eq(ObjectUtil.isNotEmpty(params), AllocationBill2::getDjbh, params.getFuzzy())
.or()
.eq(ObjectUtil.isNotEmpty(params), AllocationBill2::getDjid, params.getFuzzy())
);
}
/**
* 创建
*
* @param entity 对象实体
*/
@Override
public void create(AllocationBill2VO entity) {
allocationBill2Mapper.insert(getBasicInfo(entity, true));
}
/**
* 编辑
*
* @param entity 对象实体
*/
@Override
public void update(AllocationBill2VO entity) {
// AllocationBill2 dto = allocationBill2Mapper.selectById(entity.getId());
// if (dto == null) {
// throw new BadRequestException("不存在该数据!");
// }
allocationBill2Mapper.updateById(getBasicInfo(entity, false));
}
/**
* 多选删除
*
* @param ids 多个Id主键
*/
@Override
public void delete(Set<String> ids) {
// 物理删除
allocationBill2Mapper.deleteBatchIds(ids);
}
/**
* 获取实体基础信息
*
* @param entity 对象实体
* @param isCreate 是否创建
*/
private AllocationBill2 getBasicInfo(AllocationBill2VO entity, boolean isCreate) {
// if (isCreate) {
// entity.setId(IdUtil.getStringId());
// entity.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
// entity.setCreate_name(SecurityUtils.getCurrentNickName());
// entity.setCreate_time(DateUtil.now());
// }
// entity.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
// entity.setUpdate_optname(SecurityUtils.getCurrentNickName());
// entity.setUpdate_time(DateUtil.now());
AllocationBill2 allocationBill2 = new AllocationBill2();
BeanUtils.copyProperties(entity, allocationBill2);
return allocationBill2;
}
}

33
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java

@ -8,6 +8,8 @@ import org.apache.commons.lang3.StringUtils;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.database.eas.dao.AllocationBill;
import org.nl.wms.database.eas.dao.AllocationBill2;
import org.nl.wms.database.eas.dao.mapper.AllocationBill2Mapper;
import org.nl.wms.database.eas.dto.*;
import org.nl.wms.database.eas.dao.mapper.AllocationBillMapper;
import org.nl.wms.database.eas.service.IallocationBillService;
@ -43,6 +45,8 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
@Resource
private AllocationBillMapper allocationBillMapper;
@Resource
private AllocationBill2Mapper allocationBill2Mapper;
@Resource
private WmsToEasService wmsToEasService;
@ -56,10 +60,11 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
@SaIgnore
public CommonPage<AllocationBill> allocationPage(AllocationBillQuery params) {
// 查询总记录数
long totalCount = allocationBillMapper.getAllocationCount();
// long totalCount = allocationBillMapper.getAllocationCount();
Page<AllocationBill> pageObject = new Page<>(params.getPage(), params.getSize());
Page<AllocationBill> allocationBills = allocationBillMapper.allocationPage(pageObject, params.getFuzzy());
return CommonPage.getPage(allocationBills, totalCount);
return CommonPage.getPage(allocationBills);
//return CommonPage.getPage(allocationBills, totalCount);
}
@ -74,21 +79,21 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
throw new BadRequestException("单据编号不能为空");
}
// 查询总记录数
long totalCount = allocationBillMapper.getTotalCount(params.getDjbh());
// long totalCount = allocationBillMapper.getTotalCount(params.getDjbh());
Page<AllocationBill> pageObject = new Page<>(params.getPage(), params.getSize());
Page<AllocationBill> allocationBills = allocationBillMapper.allocationDetailPage(pageObject, params.getDjbh(), params.getFuzzy());
List<AllocationBill> allocationBillList = allocationBills.getRecords();
if (!allocationBillList.isEmpty()) {
// 获取更新列表
List<AllocationBill> updateList = allocationBillMapper.selectList(
new LambdaQueryWrapper<AllocationBill>().eq(AllocationBill::getDjid, allocationBillList.get(0).getDjid()));
List<AllocationBill2> updateList = allocationBill2Mapper.selectList(
new LambdaQueryWrapper<AllocationBill2>().eq(AllocationBill2::getDjid, allocationBillList.get(0).getDjid()));
if (!updateList.isEmpty()) {
Map<String, AllocationBill> updateMap = updateList.stream()
.collect(Collectors.toMap(AllocationBill::getFlid, updateBill -> updateBill));
Map<String, AllocationBill2> updateMap = updateList.stream()
.collect(Collectors.toMap(AllocationBill2::getFlid, updateBill -> updateBill));
// 替换为修改记录
allocationBillList = allocationBillList.stream()
.map(allocationBill -> {
AllocationBill updatedBill = updateMap.get(allocationBill.getFlid());
AllocationBill2 updatedBill = updateMap.get(allocationBill.getFlid());
if (updatedBill != null) {
allocationBill.setYwrq(updatedBill.getYwrq());
allocationBill.setBtbz(updatedBill.getBtbz());
@ -100,7 +105,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
allocationBill.setDrkwbm(updatedBill.getDrkwbm());
allocationBill.setJhdrrq(updatedBill.getJhdrrq());
allocationBill.setJhdcrq(updatedBill.getJhdcrq());
allocationBill.setBz(updatedBill.getBz());
allocationBill.setBtbz(updatedBill.getBtbz());
}
return allocationBill;
})
@ -108,7 +113,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
}
}
allocationBills.setRecords(allocationBillList);
return CommonPage.getPage(allocationBills, totalCount);
return CommonPage.getPage(allocationBills);
}
@ -190,16 +195,16 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
*/
@Override
public void update(AllocationBillVO entity) {
AllocationBill allocationBill = this.getById(entity.getDjid());
AllocationBill2 allocationBill = allocationBill2Mapper.selectOne(new LambdaQueryWrapper<AllocationBill2>().eq(AllocationBill2::getDjid,entity.getDjid()));
if (allocationBill == null) {
// 如果不存在该记录,则插入数据
AllocationBill allocationBillNew = new AllocationBill();
AllocationBill2 allocationBillNew = new AllocationBill2();
BeanUtils.copyProperties(entity, allocationBillNew);
this.save(allocationBillNew);
allocationBill2Mapper.insert(allocationBillNew);
} else {
// 如果存在该记录,则更新数据
BeanUtils.copyProperties(entity, allocationBill);
this.updateById(allocationBill);
allocationBill2Mapper.updateById(allocationBill);
}
}

135
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/ReceiptBill2ServiceImpl.java

@ -0,0 +1,135 @@
package org.nl.wms.database.eas.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.nl.wms.database.eas.dao.ReceiptBill2;
import org.nl.wms.database.eas.dto.ReceiptBill2VO;
import org.nl.wms.database.eas.dao.mapper.ReceiptBill2Mapper;
import org.nl.wms.database.eas.service.IreceiptBill2Service;
import cn.hutool.core.date.DateUtil;
import org.nl.common.utils.SecurityUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import org.nl.common.base.CommonPage;
import java.util.Set;
import java.util.List;
/**
* {@code @Description:} 送货单(ReceiptBill2)服务实现层
* {@code @Author:} gbx
*
* @since 2024-05-27
*/
@Service("receiptBill2Service")
public class ReceiptBill2ServiceImpl extends ServiceImpl<ReceiptBill2Mapper, ReceiptBill2> implements IreceiptBill2Service {
@Resource
private ReceiptBill2Mapper receiptBill2Mapper;
/**
* 分页查询
*
* @param params 查询条件
*/
@Override
public CommonPage<ReceiptBill2> page(ReceiptBill2VO params) {
Page<ReceiptBill2> result = receiptBill2Mapper.selectPage(new Page<>(params.getPage() + 1, params.getSize()), new QueryWrapper<ReceiptBill2>()
.lambda()
// .like(StringUtils.isNotBlank(form.name()), User::getName, form.name())
// .between(form.beginTime != null && form.endTime != null, User::getCreateTime, beginTime, endTime)
// .in(form.Status != null, User::getStatus
// , UserStatusEnum.NOT_SUBMITTED
// , UserStatusEnum.TO_REVIEWED)
// .orderByDesc(User::getId)
//.eq(ReceiptBill2::getIs_delete, 0)
);
return CommonPage.getPage(result);
}
/**
* 根据条件查询
*
* @param params 查询条件
*/
@Override
public List<ReceiptBill2> query(ReceiptBill2VO params) {
return receiptBill2Mapper.selectList(new QueryWrapper<ReceiptBill2>()
.lambda()
.eq(ObjectUtil.isNotEmpty(params), ReceiptBill2::getFlid, params.getFuzzy())
.or()
.eq(ObjectUtil.isNotEmpty(params), ReceiptBill2::getDjid, params.getFuzzy())
);
}
/**
* 创建
*
* @param entity 对象实体
*/
@Override
public void create(ReceiptBill2VO entity) {
receiptBill2Mapper.insert(getBasicInfo(entity, true));
}
/**
* 编辑
*
* @param entity 对象实体
*/
@Override
public void update(ReceiptBill2VO entity) {
// ReceiptBill2 dto = receiptBill2Mapper.selectById(entity.getId());
// if (dto == null) {
// throw new BadRequestException("不存在该数据!");
// }
receiptBill2Mapper.updateById(getBasicInfo(entity, false));
}
/**
* 多选删除
*
* @param ids 多个Id主键
*/
@Override
public void delete(Set<String> ids) {
// 物理删除
receiptBill2Mapper.deleteBatchIds(ids);
}
/**
* 获取实体基础信息
*
* @param entity 对象实体
* @param isCreate 是否创建
*/
private ReceiptBill2 getBasicInfo(ReceiptBill2VO entity, boolean isCreate) {
// if (isCreate) {
// entity.setId(IdUtil.getStringId());
// entity.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
// entity.setCreate_name(SecurityUtils.getCurrentNickName());
// entity.setCreate_time(DateUtil.now());
// }
// entity.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
// entity.setUpdate_optname(SecurityUtils.getCurrentNickName());
// entity.setUpdate_time(DateUtil.now());
ReceiptBill2 receiptBill2 = new ReceiptBill2();
BeanUtils.copyProperties(entity, receiptBill2);
return receiptBill2;
}
}

24
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/ReceiptBillServiceImpl.java

@ -8,7 +8,10 @@ import org.apache.commons.lang3.StringUtils;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.database.eas.dao.AllocationBill;
import org.nl.wms.database.eas.dao.AllocationBill2;
import org.nl.wms.database.eas.dao.ReceiptBill;
import org.nl.wms.database.eas.dao.ReceiptBill2;
import org.nl.wms.database.eas.dao.mapper.ReceiptBill2Mapper;
import org.nl.wms.database.eas.dto.*;
import org.nl.wms.database.eas.dao.mapper.ReceiptBillMapper;
import org.nl.wms.database.eas.service.IreceiptBillService;
@ -43,6 +46,9 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
@Resource
private ReceiptBillMapper receiptBillMapper;
@Resource
private ReceiptBill2Mapper receiptBill2Mapper;
@Resource
private WmsToSrmService wmsToSrmService;
@ -74,15 +80,15 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
Page<ReceiptBill> receiptBills = receiptBillMapper.receiptDetailPage(pageObject, params.getDjbh(), params.getFuzzy());
List<ReceiptBill> receiptBillList = receiptBills.getRecords();
if (!receiptBillList.isEmpty()) {
List<ReceiptBill> updateList = receiptBillMapper.selectList(
new LambdaQueryWrapper<ReceiptBill>().eq(ReceiptBill::getDjid, receiptBillList.get(0).getDjid()));
List<ReceiptBill2> updateList = receiptBill2Mapper.selectList(
new LambdaQueryWrapper<ReceiptBill2>().eq(ReceiptBill2::getDjid, receiptBillList.get(0).getDjid()));
if (!updateList.isEmpty()) {
Map<String, ReceiptBill> updateMap = updateList.stream()
.collect(Collectors.toMap(ReceiptBill::getFlid, updateBill -> updateBill));
Map<String, ReceiptBill2> updateMap = updateList.stream()
.collect(Collectors.toMap(ReceiptBill2::getFlid, updateBill -> updateBill));
//替换修改记录
receiptBillList = receiptBillList.stream()
.map(receiptBill -> {
ReceiptBill updatedBill = updateMap.get(receiptBill.getFlid());
ReceiptBill2 updatedBill = updateMap.get(receiptBill.getFlid());
if (updatedBill != null) {
receiptBill.setYwrq(updatedBill.getYwrq());
receiptBill.setKwbm(updatedBill.getKwbm());
@ -171,16 +177,16 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
*/
@Override
public void update(ReceiptBillVO entity) {
ReceiptBill receiptBill = this.getById(entity.getDjbh());
ReceiptBill2 receiptBill = receiptBill2Mapper.selectOne(new LambdaQueryWrapper<ReceiptBill2>().eq(ReceiptBill2::getDjid,entity.getDjid()));
if (receiptBill == null) {
// 如果不存在该记录,则插入数据
ReceiptBill receiptBillNew = new ReceiptBill();
ReceiptBill2 receiptBillNew = new ReceiptBill2();
BeanUtils.copyProperties(entity, receiptBillNew);
this.save(receiptBillNew);
receiptBill2Mapper.insert(receiptBillNew);
} else {
// 如果存在该记录,则更新数据
BeanUtils.copyProperties(entity, receiptBill);
this.updateById(receiptBill);
receiptBill2Mapper.updateById(receiptBill);
}
}

2
nlsso-server/src/main/resources/config/application-devLocal.yml

@ -1,5 +1,5 @@
server:
port: 8012
port: 8019
#配置数据源
spring:
autoconfigure:

2
nlsso-server/src/main/resources/config/application.yml

@ -4,7 +4,7 @@ server:
relaxed-path-chars: [ '|','{','}','[',']' ] #字符问题: https://blog.csdn.net/weixin_41996632/article/details/90715118
spring:
profiles:
active: prod
active: devLocal
datasource:
druid:
initial-size: 5 #初始化时建立物理连接的个数

Loading…
Cancel
Save