Compare commits
7 Commits
master1
...
test-20240
| Author | SHA1 | Date | |
|---|---|---|---|
| e81cabb181 | |||
| fa4025b0a7 | |||
| 0402045eba | |||
| 4ed3265369 | |||
| 8020e53943 | |||
| 2c72d603d2 | |||
| 899d41e888 |
@@ -20,7 +20,11 @@ public enum EasBillTypeEnum {
|
||||
WWRKD(9, "委外入库", "WWRKD"),
|
||||
IN(10, "入库", "IN"),
|
||||
OUT(11, "出库", "OUT"),
|
||||
OTHER(12, "其他", "12");
|
||||
OTHER(12, "其他", "12"),
|
||||
SHDJ(13, "收货确认", "SHDJ"),
|
||||
DBQR(14, "调拨确认", "DBQR"),
|
||||
DB(15, "调拨", "DB"),
|
||||
SH(16, "收货", "SH");
|
||||
|
||||
private int index;
|
||||
private String name;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.nl.wms.database.eas.service.IallocationBillService;
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/allocationBill")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
public class AllocationBillController {
|
||||
|
||||
|
||||
@@ -45,7 +46,7 @@ public class AllocationBillController {
|
||||
*/
|
||||
@PostMapping("/allocationPage")
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<CommonPage<AllocationBill>> allocationPage(@RequestBody AllocationBillQuery params) {
|
||||
public ResponseEntity<CommonPage<AllocationBill>> allocationPage(@RequestBody AllocationBillQuery params) throws InterruptedException {
|
||||
return new ResponseEntity<>(allocationBillService.allocationPage(params), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -80,10 +81,11 @@ public class AllocationBillController {
|
||||
@Log("单据直接调拨")
|
||||
@SaIgnore
|
||||
//@SaCheckPermission("@el.check(allocationConfirm:edit')")
|
||||
public CommonResult confirm(@RequestBody List<AllocationBillVO> params) {
|
||||
public CommonResult confirm(@RequestBody List<AllocationBillVO> params) throws InterruptedException {
|
||||
if (params.isEmpty()) {
|
||||
throw new BadRequestException("参数为空!");
|
||||
}
|
||||
Thread.sleep(5000);
|
||||
// return RestBusinessTemplate.execute(() -> allocationBillService.allocationConfirm(params));
|
||||
return RestBusinessTemplate.execute(() -> null);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.database.eas.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -52,11 +53,12 @@ public class EasOutInBillController {
|
||||
@Log("出入库单据审核")
|
||||
@SaIgnore
|
||||
//@SaCheckPermission("@el.check(EasOutInBill:edit')")
|
||||
public CommonResult audit(@RequestBody List<String> ids) {
|
||||
public CommonResult audit(@RequestBody List<String> ids) throws InterruptedException {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return CommonResult.failed(ResultCode.FAILED);
|
||||
}
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.audit(ids, true));
|
||||
Thread.sleep(5000);
|
||||
return RestBusinessTemplate.execute(()->easOutInBillService.audit(ids, true));
|
||||
}
|
||||
|
||||
|
||||
@@ -80,9 +82,48 @@ public class EasOutInBillController {
|
||||
@PostMapping("/getBillsCount")
|
||||
@Log("首页显示出入库单据数量")
|
||||
public CommonResult<List<HomeBillCounts>> getBillsCount() {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.getBillsCount());
|
||||
return RestBusinessTemplate.execute(() -> {
|
||||
try {
|
||||
return easOutInBillService.getBillsCount();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组织机构信息
|
||||
*/
|
||||
@PostMapping("/getOrganizationInfo")
|
||||
@Log("获取组织机构信息")
|
||||
public CommonResult<List<WarehouseInfo>> getOrganizationInfo() {
|
||||
List<WarehouseInfo> list =new ArrayList<WarehouseInfo>();
|
||||
WarehouseInfo w1=new WarehouseInfo();
|
||||
w1.setKczzbm("08");
|
||||
w1.setKczzmc("浙江宏智物流装备有限公司");
|
||||
list.add(w1);
|
||||
WarehouseInfo w2=new WarehouseInfo();
|
||||
w2.setKczzbm("01.09.10");
|
||||
w2.setKczzmc("高空平台事业部");
|
||||
list.add(w2);
|
||||
WarehouseInfo w3=new WarehouseInfo();
|
||||
w3.setKczzbm("01.09.03");
|
||||
w3.setKczzmc("搬运车厂");
|
||||
list.add(w3);
|
||||
WarehouseInfo w4=new WarehouseInfo();
|
||||
w4.setKczzbm("01.09.04");
|
||||
w4.setKczzmc("电动车厂");
|
||||
list.add(w4);
|
||||
WarehouseInfo w5=new WarehouseInfo();
|
||||
w5.setKczzbm("01.09.0");
|
||||
w5.setKczzmc("计划管理部");
|
||||
list.add(w5);
|
||||
WarehouseInfo w6=new WarehouseInfo();
|
||||
w6.setKczzbm("01");
|
||||
w6.setKczzmc("诺力智能装备股份有限公司");
|
||||
list.add(w6);
|
||||
return RestBusinessTemplate.execute(() -> list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.nl.wms.database.eas.service.IreceiptBillService;
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/receiptBill")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
public class ReceiptBillController {
|
||||
|
||||
|
||||
@@ -83,10 +84,11 @@ public class ReceiptBillController {
|
||||
@Log("收货单确认")
|
||||
@SaIgnore
|
||||
//@SaCheckPermission("@el.check(receiptConfirm:edit')")
|
||||
public CommonResult confirm(@RequestBody List<ReceiptBillVO> params) {
|
||||
public CommonResult confirm(@RequestBody List<ReceiptBillVO> params) throws InterruptedException {
|
||||
if (params.isEmpty()) {
|
||||
throw new BadRequestException("参数为空!");
|
||||
}
|
||||
Thread.sleep(5000);
|
||||
// return RestBusinessTemplate.execute(() -> receiptBillService.receiptConfirm(params));
|
||||
return RestBusinessTemplate.execute(() -> null);
|
||||
}
|
||||
@@ -113,8 +115,8 @@ public class ReceiptBillController {
|
||||
@PostMapping("/update")
|
||||
@Log("修改")
|
||||
//@SaCheckPermission("@el.check(ReceiptBill:edit')")
|
||||
public CommonResult update(@RequestBody ReceiptBillVO entity) {
|
||||
return RestBusinessTemplate.execute(() -> receiptBillService.update(entity));
|
||||
public CommonResult update(@RequestBody List<ReceiptBillVO> entityList) {
|
||||
return RestBusinessTemplate.execute(() -> receiptBillService.update(entityList));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,104 +21,167 @@ 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;
|
||||
/**
|
||||
* 审核结果
|
||||
*/
|
||||
private String shjg;
|
||||
|
||||
/**
|
||||
* 单据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 +190,7 @@ public class AllocationBill extends Model<AllocationBill> {
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.djid;
|
||||
return this.flid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
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 dcckmc;
|
||||
|
||||
|
||||
/**
|
||||
* 调出库位编码
|
||||
*/
|
||||
private String dckwbm;
|
||||
|
||||
|
||||
/**
|
||||
* 调入仓库编码
|
||||
*/
|
||||
private String drckbm;
|
||||
|
||||
/**
|
||||
* 调入仓库编码
|
||||
*/
|
||||
private String drckmc;
|
||||
|
||||
|
||||
/**
|
||||
* 调入库位编码
|
||||
*/
|
||||
private String drkwbm;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 计划调入日期
|
||||
*/
|
||||
private String jhdrrq;
|
||||
|
||||
|
||||
/**
|
||||
* 计划调出日期
|
||||
*/
|
||||
private String jhdcrq;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String flbz;
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.djid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -155,6 +155,12 @@ public class EasOutInBill extends Model<EasOutInBill> {
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 审核结果
|
||||
*/
|
||||
private String shjg;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
|
||||
@@ -43,6 +43,12 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 物料总数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Double wlzs;
|
||||
|
||||
|
||||
/**
|
||||
* 单据id
|
||||
|
||||
@@ -24,72 +24,169 @@ public class ReceiptBill extends Model<ReceiptBill> {
|
||||
|
||||
|
||||
/**
|
||||
* 送货单id
|
||||
* 分录ID
|
||||
*/
|
||||
@TableId(value = "djid", type = IdType.NONE)
|
||||
private String djid;
|
||||
|
||||
|
||||
/**
|
||||
* 送货单号
|
||||
*/
|
||||
private String djbh;
|
||||
|
||||
|
||||
/**
|
||||
* 送货日期
|
||||
*/
|
||||
private String ywrq;
|
||||
|
||||
|
||||
|
||||
|
||||
@TableId(value = "flid", type = IdType.NONE)
|
||||
private String flid;
|
||||
/**
|
||||
* 收货数量
|
||||
*/
|
||||
private String shsl;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物料总数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Double wlzs;
|
||||
|
||||
/**
|
||||
* 收货组织编码
|
||||
* 审核结果
|
||||
*/
|
||||
private String zzbm;
|
||||
|
||||
|
||||
private String shjg;
|
||||
/**
|
||||
* 收货仓库编码
|
||||
* 送货单id
|
||||
*/
|
||||
private String ckbm;
|
||||
|
||||
private String djid;
|
||||
/**
|
||||
* 收货库位编码
|
||||
* 送货单号
|
||||
*/
|
||||
private String kwbm;
|
||||
|
||||
|
||||
private String djbh;
|
||||
/**
|
||||
* 分录ID
|
||||
* 送货日期
|
||||
*/
|
||||
private String flid;
|
||||
|
||||
|
||||
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 bz;
|
||||
|
||||
|
||||
/**
|
||||
* 表头备注
|
||||
*/
|
||||
private String btbz;
|
||||
/**
|
||||
* 明细备注
|
||||
*/
|
||||
private String bz;
|
||||
/**
|
||||
* 订单量
|
||||
*/
|
||||
private String ddsl;
|
||||
/**
|
||||
* 本次送货数量
|
||||
*/
|
||||
private String bcshsl;
|
||||
|
||||
/**
|
||||
* 件数
|
||||
*/
|
||||
private String num;
|
||||
/**
|
||||
* 收货组织编码
|
||||
*/
|
||||
private String zzbm;
|
||||
/**
|
||||
* 收货组织名称
|
||||
*/
|
||||
private String zzmc;
|
||||
/**
|
||||
* 收货仓库编码
|
||||
*/
|
||||
private String ckbm;
|
||||
/**
|
||||
* 收货仓库名称
|
||||
*/
|
||||
private String ckmc;
|
||||
/**
|
||||
* 收货库位编码
|
||||
*/
|
||||
private String kwbm;
|
||||
/**
|
||||
* 收货库位名称
|
||||
*/
|
||||
private String kwmc;
|
||||
/**
|
||||
* 是否质检
|
||||
*/
|
||||
private String sfzj;
|
||||
/**
|
||||
* 批次管理
|
||||
*/
|
||||
private String pcgl;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
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 +197,7 @@ public class ReceiptBill extends Model<ReceiptBill> {
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.djid;
|
||||
return this.flid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
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 ckmc;
|
||||
|
||||
|
||||
/**
|
||||
* 收货库位编码
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,13 +28,24 @@ public class WarehouseInfo implements Serializable {
|
||||
/**
|
||||
* 组织编码
|
||||
*/
|
||||
private String kcbm;
|
||||
private String kczzbm;
|
||||
|
||||
|
||||
/**
|
||||
* 组织名称
|
||||
*/
|
||||
private String kcmc;
|
||||
private String kczzmc;
|
||||
|
||||
/**
|
||||
* 仓管员编码
|
||||
*/
|
||||
private String cgybm;
|
||||
|
||||
|
||||
/**
|
||||
* 仓管员名称
|
||||
*/
|
||||
private String cgymc;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
||||
@@ -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> {
|
||||
|
||||
|
||||
}
|
||||
@@ -15,18 +15,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface AllocationBillMapper extends BaseMapper<AllocationBill> {
|
||||
|
||||
@Select("SELECT COUNT(*) FROM receiptBill")
|
||||
@DS("oracle_eas")
|
||||
@Select("SELECT COUNT(1) FROM receipt_bill2")
|
||||
//@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);
|
||||
Page<AllocationBill> allocationDetailPage(Page<AllocationBill> page, @Param("djid") String djid, @Param("fuzzy") String fuzzy);
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
|
||||
@@ -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> {
|
||||
|
||||
|
||||
}
|
||||
@@ -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")
|
||||
Page<ReceiptBill> receiptDetailPage(Page<ReceiptBill> page, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy);
|
||||
//@DS("mysql_srm")
|
||||
Page<ReceiptBill> receiptDetailPage(Page<ReceiptBill> page, @Param("djid") String djid, @Param("fuzzy") String fuzzy);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -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,19 @@
|
||||
)
|
||||
WHERE <![CDATA[ row_num > #{size} * (#{page} - 1) ]]>
|
||||
</select>
|
||||
<select id="allocationPage" resultType="org.nl.wms.database.eas.dao.AllocationBill">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
allocation_bill2
|
||||
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 djid = #{djid}
|
||||
<!-- <if test="fuzzy != null and fuzzy != ''">-->
|
||||
<!-- AND (-->
|
||||
<!-- djbh LIKE CONCAT('%', #{fuzzy}, '%')-->
|
||||
@@ -66,6 +73,6 @@
|
||||
<!-- OR bz LIKE CONCAT('%', #{fuzzy}, '%')-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
ORDER BY djbh ASC
|
||||
ORDER BY cjsj DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -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>
|
||||
@@ -1,34 +1,23 @@
|
||||
<?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_bill2
|
||||
<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
|
||||
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 djid = #{djid}
|
||||
<!-- <if test="fuzzy != null and fuzzy != ''">-->
|
||||
<!-- AND (-->
|
||||
<!-- djbh LIKE CONCAT('%', #{fuzzy}, '%')-->
|
||||
@@ -48,6 +37,6 @@
|
||||
<!-- OR bz LIKE CONCAT('%', #{fuzzy}, '%')-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
ORDER BY djbh ASC
|
||||
ORDER BY tjsj DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -23,6 +23,10 @@ public class ReceiptBillQuery extends BaseQuery<ReceiptBillQuery> {
|
||||
|
||||
private String djid;
|
||||
|
||||
/**
|
||||
* 收货数量
|
||||
*/
|
||||
private String shsl;
|
||||
|
||||
/**
|
||||
* 送货单号
|
||||
@@ -90,10 +94,7 @@ public class ReceiptBillQuery extends BaseQuery<ReceiptBillQuery> {
|
||||
private String bcshsl;
|
||||
|
||||
|
||||
/**
|
||||
* 收货数量
|
||||
*/
|
||||
private String shsl;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface IallocationBillService extends IService<AllocationBill> {
|
||||
* @param params 查询条件
|
||||
* @return IPage<EasOutInBill>
|
||||
*/
|
||||
CommonPage<AllocationBill> allocationPage(AllocationBillQuery params);
|
||||
CommonPage<AllocationBill> allocationPage(AllocationBillQuery params) throws InterruptedException;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface IeasOutInBillService extends IService<EasOutInBill> {
|
||||
*
|
||||
* @return JSONObject
|
||||
*/
|
||||
List<HomeBillCounts> getBillsCount();
|
||||
List<HomeBillCounts> getBillsCount() throws InterruptedException;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@ public interface IreceiptBillService extends IService<ReceiptBill> {
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param entity /
|
||||
* @param entityList /
|
||||
*/
|
||||
void update(ReceiptBillVO entity);
|
||||
void update(List<ReceiptBillVO> entityList);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -54,7 +58,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
*/
|
||||
@Override
|
||||
@SaIgnore
|
||||
public CommonPage<AllocationBill> allocationPage(AllocationBillQuery params) {
|
||||
public CommonPage<AllocationBill> allocationPage(AllocationBillQuery params) throws InterruptedException {
|
||||
// 查询总记录数
|
||||
long totalCount = allocationBillMapper.getAllocationCount();
|
||||
Page<AllocationBill> pageObject = new Page<>(params.getPage(), params.getSize());
|
||||
@@ -70,25 +74,25 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
*/
|
||||
@Override
|
||||
public CommonPage<AllocationBill> page(AllocationBillQuery params) {
|
||||
if (StringUtils.isBlank(params.getDjbh())) {
|
||||
if (StringUtils.isBlank(params.getDjid())) {
|
||||
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());
|
||||
Page<AllocationBill> allocationBills = allocationBillMapper.allocationDetailPage(pageObject, params.getDjid(), 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 +104,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 +112,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
}
|
||||
}
|
||||
allocationBills.setRecords(allocationBillList);
|
||||
return CommonPage.getPage(allocationBills, totalCount);
|
||||
return CommonPage.getPage(allocationBills);
|
||||
}
|
||||
|
||||
|
||||
@@ -190,16 +194,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
package org.nl.wms.database.eas.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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.*;
|
||||
import org.nl.wms.database.eas.dto.*;
|
||||
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
|
||||
import org.nl.wms.database.eas.service.IeasOutInBillDetailService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.nl.wms.database.eas.dao.InventoryInfo;
|
||||
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
|
||||
import org.nl.wms.database.eas.dto.EasOutInBillDetailVO;
|
||||
import org.nl.wms.database.eas.service.IeasOutInBillDetailService;
|
||||
import org.nl.wms.database.eas.service.IeasOutInBillService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
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 org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -64,53 +64,64 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
|
||||
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid())
|
||||
);
|
||||
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords();
|
||||
List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
||||
for (int i = 0; i < easOutInBillDetailList.size(); i++) {
|
||||
long se = 10L;
|
||||
easOutInBillDetailList.get(i).setKcsl(BigDecimal.valueOf(se + i * 10L));
|
||||
}
|
||||
//计算相同物料编码的总数
|
||||
Map<String, Double> totalQty = easOutInBillDetailList.stream()
|
||||
.collect(Collectors.groupingBy(EasOutInBillDetail::getWlbm, Collectors.summingDouble(bill -> bill.getSl().doubleValue())));
|
||||
easOutInBillDetailList.forEach(bill -> {
|
||||
//查询库存信息
|
||||
List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||
.filter(inventory -> {
|
||||
boolean isMatched = true;
|
||||
//去向部门
|
||||
if (bill.getZzbm() != null && !bill.getZzbm().isEmpty()) {
|
||||
isMatched = Objects.equals(inventory.getZzbm(), bill.getZzbm());
|
||||
}
|
||||
//仓库编码
|
||||
if (bill.getCkbm() != null && !bill.getCkbm().isEmpty()) {
|
||||
isMatched = Objects.equals(inventory.getCkbm(), bill.getCkbm());
|
||||
}
|
||||
//库位编码
|
||||
if (bill.getTjkwbm() != null && !bill.getTjkwbm().isEmpty()) {
|
||||
isMatched = Objects.equals(inventory.getTjkwbm(), bill.getTjkwbm());
|
||||
}
|
||||
|
||||
//物料编码
|
||||
if (bill.getWlbm() != null && !bill.getWlbm().isEmpty()) {
|
||||
isMatched = Objects.equals(inventory.getWlbm(), bill.getWlbm());
|
||||
}
|
||||
// 批次
|
||||
if (bill.getPc() != null && !bill.getPc().isEmpty()) {
|
||||
isMatched = Objects.equals(inventory.getPc(), bill.getPc());
|
||||
}
|
||||
// 跟踪号
|
||||
if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) {
|
||||
isMatched = Objects.equals(inventory.getTrackno(), bill.getTrackno());
|
||||
}
|
||||
return isMatched;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||
// .filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
|
||||
// && Objects.equals(inventory.getCkbm(), bill.getCkbm())
|
||||
// && Objects.equals(inventory.getWlbm(), bill.getWlbm())
|
||||
// && Objects.equals(inventory.getPc(), bill.getPc())
|
||||
// && Objects.equals(inventory.getTrackno(), bill.getTrackno())
|
||||
// && Objects.equals(inventory.getKwbm(), bill.getKwbm()))
|
||||
// .collect(Collectors.toList());
|
||||
Optional<InventoryInfo> minKcsl = matchedInventory.stream()
|
||||
.filter(r -> r.getUnitno().equals(bill.getJldw()))
|
||||
.min(Comparator.comparing(InventoryInfo::getKcsl));
|
||||
minKcsl.ifPresent(m -> bill.setKcsl(m.getKcsl()));
|
||||
//设置物料总数
|
||||
bill.setWlzs(totalQty.get(bill.getWlbm()));
|
||||
});
|
||||
// List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
||||
// easOutInBillDetailList.forEach(bill -> {
|
||||
// //查询库存信息
|
||||
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||
// .filter(inventory -> {
|
||||
// boolean isMatched = true;
|
||||
// //去向部门
|
||||
// if (bill.getZzbm() != null && !bill.getZzbm().isEmpty()) {
|
||||
// isMatched = Objects.equals(inventory.getZzbm(), bill.getZzbm());
|
||||
// }
|
||||
// //仓库编码
|
||||
// if (bill.getCkbm() != null && !bill.getCkbm().isEmpty()) {
|
||||
// isMatched = Objects.equals(inventory.getCkbm(), bill.getCkbm());
|
||||
// }
|
||||
// //库位编码
|
||||
// if (bill.getTjkwbm() != null && !bill.getTjkwbm().isEmpty()) {
|
||||
// isMatched = Objects.equals(inventory.getTjkwbm(), bill.getTjkwbm());
|
||||
// }
|
||||
//
|
||||
// //物料编码
|
||||
// if (bill.getWlbm() != null && !bill.getWlbm().isEmpty()) {
|
||||
// isMatched = Objects.equals(inventory.getWlbm(), bill.getWlbm());
|
||||
// }
|
||||
// // 批次
|
||||
// if (bill.getPc() != null && !bill.getPc().isEmpty()) {
|
||||
// isMatched = Objects.equals(inventory.getPc(), bill.getPc());
|
||||
// }
|
||||
// // 跟踪号
|
||||
// if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) {
|
||||
// isMatched = Objects.equals(inventory.getTrackno(), bill.getTrackno());
|
||||
// }
|
||||
// return isMatched;
|
||||
// })
|
||||
// .collect(Collectors.toList());
|
||||
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||
// .filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
|
||||
// && Objects.equals(inventory.getCkbm(), bill.getCkbm())
|
||||
// && Objects.equals(inventory.getWlbm(), bill.getWlbm())
|
||||
// && Objects.equals(inventory.getPc(), bill.getPc())
|
||||
// && Objects.equals(inventory.getTrackno(), bill.getTrackno())
|
||||
// && Objects.equals(inventory.getKwbm(), bill.getKwbm()))
|
||||
// .collect(Collectors.toList());
|
||||
// Optional<InventoryInfo> minKcsl = matchedInventory.stream()
|
||||
// .filter(r -> r.getUnitno().equals(bill.getJldw()))
|
||||
// .min(Comparator.comparing(InventoryInfo::getKcsl));
|
||||
// minKcsl.ifPresent(m -> bill.setKcsl(m.getKcsl()));
|
||||
// });
|
||||
result.setRecords(easOutInBillDetailList);
|
||||
return CommonPage.getPage(result);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.common.enums.wms.EasBillTypeEnum;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
@@ -77,8 +79,25 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
* 首页显示出入库单据数量
|
||||
*/
|
||||
@Override
|
||||
public List<HomeBillCounts> getBillsCount() {
|
||||
return easOutInBillMapper.getBillsCount();
|
||||
public List<HomeBillCounts> getBillsCount() throws InterruptedException {
|
||||
|
||||
List<HomeBillCounts> allCounts =easOutInBillMapper.getBillsCount();
|
||||
HomeBillCounts allocations =new HomeBillCounts();
|
||||
Long allocation =26L;
|
||||
allocations.setCounts(allocation.toString());
|
||||
allocations.setName(EasBillTypeEnum.DBQR.getName());
|
||||
allocations.setDjlx(EasBillTypeEnum.DBQR.getCode());
|
||||
allocations.setYwlx(EasBillTypeEnum.DB.getCode());
|
||||
HomeBillCounts receipts =new HomeBillCounts();
|
||||
Long receipt = 6L;
|
||||
receipts.setCounts(receipt.toString());
|
||||
receipts.setName(EasBillTypeEnum.SHDJ.getName());
|
||||
receipts.setDjlx(EasBillTypeEnum.SHDJ.getCode());
|
||||
receipts.setYwlx(EasBillTypeEnum.SH.getCode());
|
||||
allCounts.add(allocations);
|
||||
allCounts.add(receipts);
|
||||
return allCounts;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +133,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
.lambda()
|
||||
.eq(ObjectUtil.isNotEmpty(params.getDjlx()), EasOutInBill::getDjlx, params.getDjlx())
|
||||
.eq(ObjectUtil.isNotEmpty(params.getCkbm()), EasOutInBill::getCkbm, params.getCkbm())
|
||||
.eq(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "1".equals(params.getDjzt()) ? "提交" : "审核")
|
||||
.eq(EasOutInBill::getDjzt, "提交")
|
||||
.nested(ObjectUtil.isNotEmpty(params.getFuzzy()),
|
||||
i -> i.like(EasOutInBill::getDjid, params.getFuzzy())
|
||||
.or()
|
||||
@@ -531,23 +550,28 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
EasData easData = new EasData();
|
||||
easData.setData(bill);
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue);
|
||||
msgDto = wmsToEasService.sendWebService(billJson);
|
||||
if (msgDto != null) {
|
||||
if (msgDto.getResult() == 0) {
|
||||
throw new BadRequestException(msgDto.getMsg());
|
||||
}
|
||||
String msg ="审核失败:此入库单在PC端完成操作,单据为:CGRK2024072316142732";
|
||||
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId());
|
||||
if (StringUtils.isNoneBlank(msg)) {
|
||||
updateWrapper.set("shjg", msg);
|
||||
} else {
|
||||
updateWrapper.set("djzt", "审核");
|
||||
}
|
||||
easOutInBillMapper.update(null, updateWrapper);
|
||||
// msgDto = wmsToEasService.sendWebService(billJson);
|
||||
} else {
|
||||
SrmMsgDto srmMsgDto;
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson);
|
||||
if (srmMsgDto != null) {
|
||||
if ("false".equals(srmMsgDto.getSuccess())) {
|
||||
throw new BadRequestException(srmMsgDto.getMessage());
|
||||
}
|
||||
// srmMsgDto = wmsToSrmService.sendWebPostData(billJson);
|
||||
String msg ="";
|
||||
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId());
|
||||
if (StringUtils.isNoneBlank(msg)) {
|
||||
updateWrapper.set("shjg", msg);
|
||||
} else {
|
||||
updateWrapper.set("djzt", "审核");
|
||||
}
|
||||
easOutInBillMapper.update(null, updateWrapper);
|
||||
}
|
||||
updateBills(bill);
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
throw new BadRequestException(e.toString());
|
||||
@@ -564,8 +588,15 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
EasData easData = new EasData();
|
||||
easData.setData(bill);
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue);
|
||||
wmsToEasService.sendWebService(billJson);
|
||||
updateBills(bill);
|
||||
// wmsToEasService.sendWebService(billJson);
|
||||
String msg ="审核失败:此入库单在PC端完成操作,单据为:CGRK2024072316142732";
|
||||
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId());
|
||||
if (StringUtils.isNoneBlank(msg)) {
|
||||
updateWrapper.set("shjg", msg);
|
||||
} else {
|
||||
updateWrapper.set("djzt", "审核");
|
||||
}
|
||||
easOutInBillMapper.update(null, updateWrapper);
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
//throw new BadRequestException(e.toString());
|
||||
@@ -581,7 +612,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
for (EasOutInBillDto bill : bills) {
|
||||
try {
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
||||
wmsToSrmService.sendWebPostData(billJson);
|
||||
// wmsToSrmService.sendWebPostData(billJson);
|
||||
updateBills(bill);
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
package org.nl.wms.database.eas.service.impl;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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 +48,9 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
@Resource
|
||||
private ReceiptBillMapper receiptBillMapper;
|
||||
|
||||
@Resource
|
||||
private ReceiptBill2Mapper receiptBill2Mapper;
|
||||
|
||||
@Resource
|
||||
private WmsToSrmService wmsToSrmService;
|
||||
|
||||
@@ -67,22 +75,25 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
*/
|
||||
@Override
|
||||
public CommonPage<ReceiptBill> page(ReceiptBillVO params) {
|
||||
if (StringUtils.isBlank(params.getDjbh())) {
|
||||
if (StringUtils.isBlank(params.getDjid())) {
|
||||
throw new BadRequestException("单据编号不能为空");
|
||||
}
|
||||
Page<ReceiptBill> pageObject = new Page<>(params.getPage(), params.getSize());
|
||||
Page<ReceiptBill> receiptBills = receiptBillMapper.receiptDetailPage(pageObject, params.getDjbh(), params.getFuzzy());
|
||||
Page<ReceiptBill> receiptBills = receiptBillMapper.receiptDetailPage(pageObject, params.getDjid(), params.getFuzzy());
|
||||
List<ReceiptBill> receiptBillList = receiptBills.getRecords();
|
||||
//计算相同物料编码的总数
|
||||
Map<String, Double> totalQty = receiptBillList.stream()
|
||||
.collect(Collectors.groupingBy(ReceiptBill::getWlbm, Collectors.summingDouble(bill -> Double.parseDouble(bill.getShsl()))));
|
||||
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());
|
||||
@@ -96,6 +107,10 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
receiptBillList= receiptBillList.stream().peek(r->{
|
||||
r.setWlzs(totalQty.get(r.getWlbm()));
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
receiptBills.setRecords(receiptBillList);
|
||||
return CommonPage.getPage(receiptBills);
|
||||
}
|
||||
@@ -170,17 +185,21 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
* 修改收货单
|
||||
*/
|
||||
@Override
|
||||
public void update(ReceiptBillVO entity) {
|
||||
ReceiptBill receiptBill = this.getById(entity.getDjbh());
|
||||
if (receiptBill == null) {
|
||||
// 如果不存在该记录,则插入数据
|
||||
ReceiptBill receiptBillNew = new ReceiptBill();
|
||||
BeanUtils.copyProperties(entity, receiptBillNew);
|
||||
this.save(receiptBillNew);
|
||||
} else {
|
||||
// 如果存在该记录,则更新数据
|
||||
BeanUtils.copyProperties(entity, receiptBill);
|
||||
this.updateById(receiptBill);
|
||||
public void update(List<ReceiptBillVO> entityList) {
|
||||
if (CollectionUtils.isNotEmpty(entityList)) {
|
||||
entityList.forEach(r -> {
|
||||
ReceiptBill receiptBill = this.getById(r.getFlid());
|
||||
if (receiptBill == null) {
|
||||
// 如果不存在该记录,则插入数据
|
||||
ReceiptBill receiptBillNew = new ReceiptBill();
|
||||
BeanUtils.copyProperties(r, receiptBillNew);
|
||||
this.save(receiptBillNew);
|
||||
} else {
|
||||
// 如果存在该记录,则更新数据
|
||||
BeanUtils.copyProperties(r, receiptBill);
|
||||
this.updateById(receiptBill);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class EasBillSchedule {
|
||||
* eas单据数据同步
|
||||
*/
|
||||
@Async("taskExecutor")
|
||||
@Scheduled(cron = "0/120 * * * * *")
|
||||
// @Scheduled(cron = "0/120 * * * * *")
|
||||
public void getEasOutInBills() {
|
||||
// 获取eas视图查询未提交的单据
|
||||
List<EasOutInBillDetail> easOutInBillDetails = easOutInBillDetailMapper.selectPageWithInventory();
|
||||
@@ -83,7 +83,7 @@ public class EasBillSchedule {
|
||||
* 定时清空单据
|
||||
*/
|
||||
@Async("taskExecutor")
|
||||
@Scheduled(cron = "0/86400 * * * * *")
|
||||
// @Scheduled(cron = "0/86400 * * * * *")
|
||||
public void autoDeleteTask() {
|
||||
LocalDate threeMonthsAgo = LocalDate.now().minusMonths(3);
|
||||
String days = threeMonthsAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
@@ -113,7 +113,11 @@ public class EasBillSchedule {
|
||||
SendHomeWebSocketServer.getWebSocketSet();
|
||||
if (webSocketSet.size() > 0) {
|
||||
webSocketSet.forEach(c -> {
|
||||
c.sendDataToClient(easOutInBillService.getBillsCount());
|
||||
try {
|
||||
c.sendDataToClient(easOutInBillService.getBillsCount());
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
//stopWatch.stop();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8011
|
||||
port: 8019
|
||||
#配置数据源
|
||||
spring:
|
||||
autoconfigure:
|
||||
@@ -10,9 +10,9 @@ spring:
|
||||
datasource:
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:NLABC&hl123}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
mysql_srm:
|
||||
# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8012
|
||||
port: 8011
|
||||
#配置数据源
|
||||
spring:
|
||||
autoconfigure:
|
||||
@@ -8,11 +8,17 @@ spring:
|
||||
dynamic:
|
||||
primary: mysql
|
||||
datasource:
|
||||
# mysql:
|
||||
# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# username: ${DB_USER:generallu}
|
||||
# password: ${DB_PWD:123456}
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:generallu}
|
||||
password: ${DB_PWD:123456}
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:NLABC&hl123}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
mysql_srm:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
|
||||
@@ -10,9 +10,9 @@ spring:
|
||||
datasource:
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:NLABC&hl123}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
mysql_srm:
|
||||
# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
|
||||
@@ -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 #初始化时建立物理连接的个数
|
||||
|
||||
Reference in New Issue
Block a user