opt:优化新增需求
This commit is contained in:
@@ -20,7 +20,7 @@ public enum EasBillTypeEnum {
|
|||||||
WWRKD(9, "委外入库", "WWRKD"),
|
WWRKD(9, "委外入库", "WWRKD"),
|
||||||
IN(10, "入库", "IN"),
|
IN(10, "入库", "IN"),
|
||||||
OUT(11, "出库", "OUT"),
|
OUT(11, "出库", "OUT"),
|
||||||
OTHER(12, "其他", "12"),
|
OTHER(12, "其他", "OTHER"),
|
||||||
SHDJ(13, "收货确认", "SHDJ"),
|
SHDJ(13, "收货确认", "SHDJ"),
|
||||||
DBQR(14, "调拨确认", "DBQR"),
|
DBQR(14, "调拨确认", "DBQR"),
|
||||||
DB(15, "调拨", "DB"),
|
DB(15, "调拨", "DB"),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.nl.common.base.ResultCode;
|
|||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.wms.database.eas.dao.ReceiptBill;
|
import org.nl.wms.database.eas.dao.ReceiptBill;
|
||||||
import org.nl.wms.database.eas.dto.AllocationBillQuery;
|
import org.nl.wms.database.eas.dto.AllocationBillQuery;
|
||||||
|
import org.nl.wms.database.eas.dto.EasOutInBillDetailVO;
|
||||||
import org.nl.wms.database.eas.dto.ReceiptBillQuery;
|
import org.nl.wms.database.eas.dto.ReceiptBillQuery;
|
||||||
import org.nl.wms.ext.srm.WmsToSrmService;
|
import org.nl.wms.ext.srm.WmsToSrmService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -115,11 +116,18 @@ public class ReceiptBillController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@Log("修改")
|
@Log("修改")
|
||||||
//@SaCheckPermission("@el.check(ReceiptBill:edit')")
|
//@SaCheckPermission("@el.check(ReceiptBill:edit')")
|
||||||
public CommonResult update(@RequestBody ReceiptBillVO entity) {
|
public CommonResult update(@RequestBody List<ReceiptBillVO> entityList) {
|
||||||
return RestBusinessTemplate.execute(() -> receiptBillService.update(entity));
|
return RestBusinessTemplate.execute(() -> receiptBillService.update(entityList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除数据
|
* 删除数据
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import jdk.nashorn.internal.ir.annotations.Ignore;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -233,6 +234,13 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
|
|||||||
private String flbz;
|
private String flbz;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分录备注
|
||||||
|
*/
|
||||||
|
private String gzhbm;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已出数量
|
* 已出数量
|
||||||
*/
|
*/
|
||||||
@@ -250,6 +258,11 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
|
|||||||
*/
|
*/
|
||||||
private String cksj;
|
private String cksj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料总数
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Double wlzs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料人
|
* 领料人
|
||||||
@@ -268,6 +281,9 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
|
|||||||
private String trackno;
|
private String trackno;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改人id
|
* 修改人id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ public class ReceiptBill extends Model<ReceiptBill> {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货库位名称
|
||||||
|
*/
|
||||||
|
private String kwmc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public interface EasOutInBillMapper extends BaseMapper<EasOutInBill> {
|
|||||||
//AND STR_TO_DATE( cjsj, '%Y-%m-%d' ) >= CURDATE() - INTERVAL 1 MONTH;
|
//AND STR_TO_DATE( cjsj, '%Y-%m-%d' ) >= CURDATE() - INTERVAL 1 MONTH;
|
||||||
List<EasOutInBillDetail> queryExistBills();
|
List<EasOutInBillDetail> queryExistBills();
|
||||||
|
|
||||||
|
Set<String> queryBills();
|
||||||
|
|
||||||
List<EasOutInBillDetail> queryLocalBills();
|
List<EasOutInBillDetail> queryLocalBills();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
SELECT *
|
SELECT *
|
||||||
FROM EAS_NOBLE.V_UC_OUTINBILL
|
FROM EAS_NOBLE.V_UC_OUTINBILL
|
||||||
WHERE DJZT = '提交'
|
WHERE DJZT = '提交'
|
||||||
AND TO_DATE(cjsj, 'YYYY-MM-DD HH24:MI:SS') >= TRUNC(SYSDATE) - INTERVAL '1' DAY(3)
|
AND TO_DATE(cjsj, 'YYYY-MM-DD HH24:MI:SS') >= TRUNC(SYSDATE) - INTERVAL '14' DAY(3)
|
||||||
</select>
|
</select>
|
||||||
<select id="selectSrmPages" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
<select id="selectSrmPages" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||||
SELECT *,
|
SELECT *,
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
WHERE DJZT = '未入库'
|
WHERE DJZT = '未入库'
|
||||||
AND CJSJ >= DATE_SUB(
|
AND CJSJ >= DATE_SUB(
|
||||||
CURDATE(),
|
CURDATE(),
|
||||||
INTERVAL 1 DAY)
|
INTERVAL 14 DAY)
|
||||||
</select>
|
</select>
|
||||||
<select id="selectPageWithInventory" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
<select id="selectPageWithInventory" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||||
SELECT *
|
SELECT *
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
djbh as billNo,
|
djbh as billNo,
|
||||||
ywrq as bizDate,
|
ywrq as bizDate,
|
||||||
djlx as billType,
|
djlx as billType,
|
||||||
|
ywlx as ywlx,
|
||||||
btbz as description,
|
btbz as description,
|
||||||
update_name as nWhUser,
|
update_name as nWhUser,
|
||||||
djly
|
djly
|
||||||
@@ -39,6 +40,10 @@
|
|||||||
FROM EAS_OUT_IN_BILL_DETAIL
|
FROM EAS_OUT_IN_BILL_DETAIL
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryBills" resultType="java.lang.String">
|
||||||
|
SELECT DJID FROM `eas_out_in_bill` WHERE djzt='提交' or djzt='未入库'
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="queryLocalBills" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
<select id="queryLocalBills" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||||
SELECT FLID,
|
SELECT FLID,
|
||||||
DJID
|
DJID
|
||||||
|
|||||||
@@ -27,25 +27,13 @@
|
|||||||
SELECT *
|
SELECT *
|
||||||
FROM v_wms_recbill_third
|
FROM v_wms_recbill_third
|
||||||
WHERE DJID = #{djid}
|
WHERE DJID = #{djid}
|
||||||
<!-- <if test="fuzzy != null and fuzzy != ''">-->
|
<if test="fuzzy != null and fuzzy != ''">
|
||||||
<!-- AND (-->
|
AND (
|
||||||
<!-- djbh LIKE CONCAT('%', #{fuzzy}, '%')-->
|
djbh LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
<!-- OR wlmc LIKE CONCAT('%', #{fuzzy}, '%')-->
|
OR wlbm LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
<!-- OR ggxh LIKE CONCAT('%', #{fuzzy}, '%')-->
|
OR wlmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
<!-- OR fzsl LIKE CONCAT('%', #{fuzzy}, '%')-->
|
)
|
||||||
<!-- OR jldw LIKE CONCAT('%', #{fuzzy}, '%')-->
|
</if>
|
||||||
<!-- 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>-->
|
|
||||||
ORDER BY WLBM DESC
|
ORDER BY WLBM DESC
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package org.nl.wms.database.eas.dto;
|
package org.nl.wms.database.eas.dto;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.nl.common.domain.query.BaseQuery;
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
|
|
||||||
@@ -119,6 +120,12 @@ public class AllocationBillQuery extends BaseQuery<AllocationBillQuery> {
|
|||||||
*/
|
*/
|
||||||
private String wlbm;
|
private String wlbm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料总数
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Double wlzs;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料名称
|
* 物料名称
|
||||||
@@ -253,6 +260,7 @@ public class AllocationBillQuery extends BaseQuery<AllocationBillQuery> {
|
|||||||
/**
|
/**
|
||||||
* 分录备注
|
* 分录备注
|
||||||
*/
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
private String flbz;
|
private String flbz;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,11 +41,18 @@ public class EasOutInBillDto {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型
|
*单据类型
|
||||||
*/
|
*/
|
||||||
private String billType;
|
private String billType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型
|
||||||
|
*/
|
||||||
|
private String ywlx;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.database.eas.dto;
|
package org.nl.wms.database.eas.dto;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.nl.common.domain.query.BaseQuery;
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
@@ -255,6 +256,12 @@ public class ReceiptBillQuery extends BaseQuery<ReceiptBillQuery> {
|
|||||||
private String btbz;
|
private String btbz;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料总数
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Double wlzs;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核结果
|
* 审核结果
|
||||||
|
|||||||
@@ -1,20 +1,14 @@
|
|||||||
package org.nl.wms.database.eas.service;
|
package org.nl.wms.database.eas.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.nl.common.base.CommonPage;
|
import org.nl.common.base.CommonPage;
|
||||||
import org.nl.wms.database.eas.dao.*;
|
import org.nl.wms.database.eas.dao.*;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import org.nl.common.domain.query.PageQuery;
|
|
||||||
import org.nl.wms.database.eas.dto.AllocationBillQuery;
|
|
||||||
import org.nl.wms.database.eas.dto.EasOutInBillQuery;
|
import org.nl.wms.database.eas.dto.EasOutInBillQuery;
|
||||||
import org.nl.wms.database.eas.dto.ReceiptBillQuery;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,6 +101,13 @@ public interface IeasOutInBillService extends IService<EasOutInBill> {
|
|||||||
*/
|
*/
|
||||||
List<EasOutInBillDetail> queryExistBills();
|
List<EasOutInBillDetail> queryExistBills();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询本地的出入库主单据
|
||||||
|
*
|
||||||
|
* @return List<EasOutInBill>
|
||||||
|
*/
|
||||||
|
Set<String> queryBills();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询本地未提交的出入库单据
|
* 查询本地未提交的出入库单据
|
||||||
|
|||||||
@@ -61,9 +61,11 @@ public interface IreceiptBillService extends IService<ReceiptBill> {
|
|||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
* @param entity /
|
* @param entityList /
|
||||||
*/
|
*/
|
||||||
void update(ReceiptBillVO entity);
|
void update(List<ReceiptBillVO> entityList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多选删除
|
* 多选删除
|
||||||
|
|||||||
@@ -132,12 +132,16 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
|||||||
// 查询总记录数
|
// 查询总记录数
|
||||||
long totalCount = allocationBillMapper.getTotalCount(params.getDjid());
|
long totalCount = allocationBillMapper.getTotalCount(params.getDjid());
|
||||||
List<AllocationBillQuery> allocationBillList = allocationBillMapper.allocationDetailPage(params.getPage(), params.getSize(), params.getDjid(), params.getFuzzy());
|
List<AllocationBillQuery> allocationBillList = allocationBillMapper.allocationDetailPage(params.getPage(), params.getSize(), params.getDjid(), params.getFuzzy());
|
||||||
|
//计算相同物料编码的总数
|
||||||
|
Map<String, Double> totalQty = allocationBillList.stream()
|
||||||
|
.collect(Collectors.groupingBy(AllocationBillQuery::getWlbm, Collectors.summingDouble(bill -> Double.parseDouble(bill.getSl()))));
|
||||||
if (!allocationBillList.isEmpty()) {
|
if (!allocationBillList.isEmpty()) {
|
||||||
allocationBillList = allocationBillList.stream().peek(r -> {
|
allocationBillList = allocationBillList.stream().peek(r -> {
|
||||||
if (r.getJhdrrq().contains("/") || r.getJhdcrq().contains("/")) {
|
if (r.getJhdrrq().contains("/") || r.getJhdcrq().contains("/")) {
|
||||||
r.setJhdrrq(LocalDateTime.parse(r.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
r.setJhdrrq(LocalDateTime.parse(r.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||||
r.setJhdcrq(LocalDateTime.parse(r.getJhdcrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
r.setJhdcrq(LocalDateTime.parse(r.getJhdcrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||||
}
|
}
|
||||||
|
r.setWlzs(totalQty.get(r.getWlbm()));
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
// 获取更新列表
|
// 获取更新列表
|
||||||
List<AllocationBill> updateList = allocationBillMapper.selectList(new LambdaQueryWrapper<AllocationBill>().eq(AllocationBill::getDjid, allocationBillList.get(0).getDjid()));
|
List<AllocationBill> updateList = allocationBillMapper.selectList(new LambdaQueryWrapper<AllocationBill>().eq(AllocationBill::getDjid, allocationBillList.get(0).getDjid()));
|
||||||
|
|||||||
@@ -62,55 +62,57 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
|
|||||||
params.setSize(500);
|
params.setSize(500);
|
||||||
Page<EasOutInBillDetail> result = easOutInBillDetailMapper.selectPage(new Page<>(params.getPage(), params.getSize()), new QueryWrapper<EasOutInBillDetail>()
|
Page<EasOutInBillDetail> result = easOutInBillDetailMapper.selectPage(new Page<>(params.getPage(), params.getSize()), new QueryWrapper<EasOutInBillDetail>()
|
||||||
.lambda()
|
.lambda()
|
||||||
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid()).orderByAsc(EasOutInBillDetail::getWlbm)
|
.eq(ObjectUtil.isNotEmpty(params.getDjid()), EasOutInBillDetail::getDjid, params.getDjid())
|
||||||
|
.like(ObjectUtil.isNotEmpty(params.getFuzzy()), EasOutInBillDetail::getWlbm, params.getWlbm())
|
||||||
|
.like(ObjectUtil.isNotEmpty(params.getFuzzy()), EasOutInBillDetail::getWlmc, params.getWlmc())
|
||||||
|
.orderByAsc(EasOutInBillDetail::getWlbm)
|
||||||
);
|
);
|
||||||
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords();
|
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords();
|
||||||
List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
||||||
|
//计算相同物料编码的总数
|
||||||
|
Map<String, Double> totalQty = easOutInBillDetailList.stream()
|
||||||
|
.collect(Collectors.groupingBy(EasOutInBillDetail::getWlbm, Collectors.summingDouble(bill -> bill.getSl().doubleValue())));
|
||||||
easOutInBillDetailList.forEach(bill -> {
|
easOutInBillDetailList.forEach(bill -> {
|
||||||
|
//设置物料总数
|
||||||
|
bill.setWlzs(totalQty.get(bill.getWlbm()));
|
||||||
//查询库存信息
|
//查询库存信息
|
||||||
List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||||
.filter(inventory -> {
|
.filter(r -> {
|
||||||
boolean isMatched = true;
|
boolean isMatched = true;
|
||||||
//去向部门
|
//去向部门
|
||||||
if (bill.getZzbm() != null && !bill.getZzbm().isEmpty()) {
|
if (bill.getZzbm() != null && !bill.getZzbm().isEmpty()) {
|
||||||
isMatched = Objects.equals(inventory.getZzbm(), bill.getZzbm());
|
isMatched = Objects.equals(r.getZzbm(), bill.getZzbm());
|
||||||
}
|
}
|
||||||
//仓库编码
|
//仓库编码
|
||||||
if (bill.getCkbm() != null && !bill.getCkbm().isEmpty()) {
|
if (bill.getCkbm() != null && !bill.getCkbm().isEmpty()) {
|
||||||
isMatched = Objects.equals(inventory.getCkbm(), bill.getCkbm());
|
isMatched = Objects.equals(r.getCkbm(), bill.getCkbm());
|
||||||
}
|
}
|
||||||
//库位编码
|
//库位编码
|
||||||
if (bill.getTjkwbm() != null && !bill.getTjkwbm().isEmpty()) {
|
if (bill.getTjkwbm() != null && !bill.getTjkwbm().isEmpty()) {
|
||||||
isMatched = Objects.equals(inventory.getTjkwbm(), bill.getTjkwbm());
|
isMatched = Objects.equals(r.getTjkwbm(), bill.getTjkwbm());
|
||||||
}
|
}
|
||||||
|
|
||||||
//物料编码
|
//物料编码
|
||||||
if (bill.getWlbm() != null && !bill.getWlbm().isEmpty()) {
|
if (bill.getWlbm() != null && !bill.getWlbm().isEmpty()) {
|
||||||
isMatched = Objects.equals(inventory.getWlbm(), bill.getWlbm());
|
isMatched = Objects.equals(r.getWlbm(), bill.getWlbm());
|
||||||
}
|
}
|
||||||
// 批次
|
// 批次
|
||||||
if (bill.getPc() != null && !bill.getPc().isEmpty()) {
|
if (bill.getPc() != null && !bill.getPc().isEmpty()) {
|
||||||
isMatched = Objects.equals(inventory.getPc(), bill.getPc());
|
isMatched = Objects.equals(r.getPc(), bill.getPc());
|
||||||
}
|
}
|
||||||
// 跟踪号
|
// 跟踪号
|
||||||
if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) {
|
if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) {
|
||||||
isMatched = Objects.equals(inventory.getTrackno(), bill.getTrackno());
|
isMatched = Objects.equals(r.getTrackno(), bill.getTrackno());
|
||||||
}
|
}
|
||||||
return isMatched;
|
return isMatched;
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.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()
|
Optional<InventoryInfo> minKcsl = matchedInventory.stream()
|
||||||
.filter(r -> r.getUnitno().equals(bill.getJldw()))
|
.filter(r -> r.getUnitno().equals(bill.getJldw()))
|
||||||
.min(Comparator.comparing(InventoryInfo::getKcsl));
|
.min(Comparator.comparing(InventoryInfo::getKcsl));
|
||||||
minKcsl.ifPresent(m -> bill.setKcsl(m.getKcsl()));
|
minKcsl.ifPresent(m -> bill.setKcsl(m.getKcsl()));
|
||||||
|
//增加一个逻辑,当单据明细行物料编码相同时,对物料数量进行相加,赋值到物料总数字段wlzs进行显示
|
||||||
|
|
||||||
});
|
});
|
||||||
result.setRecords(easOutInBillDetailList);
|
result.setRecords(easOutInBillDetailList);
|
||||||
return CommonPage.getPage(result);
|
return CommonPage.getPage(result);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import org.nl.wms.ext.srm.WmsToSrmService;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -90,7 +89,6 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
private RedisUtils redisUtils;
|
private RedisUtils redisUtils;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<HomeBillCounts> getBillsCount() {
|
public List<HomeBillCounts> getBillsCount() {
|
||||||
String cacheKey = "billCounts";
|
String cacheKey = "billCounts";
|
||||||
//从Redis中获取缓存数据
|
//从Redis中获取缓存数据
|
||||||
@@ -239,7 +237,8 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
.or()
|
.or()
|
||||||
.like(EasOutInBill::getCkbm, params.getFuzzy())
|
.like(EasOutInBill::getCkbm, params.getFuzzy())
|
||||||
.or()
|
.or()
|
||||||
.like(EasOutInBill::getCjr, params.getFuzzy())
|
.like(EasOutInBill::getCjr, params.getFuzzy()
|
||||||
|
)
|
||||||
).orderByDesc(EasOutInBill::getCjsj)
|
).orderByDesc(EasOutInBill::getCjsj)
|
||||||
);
|
);
|
||||||
return CommonPage.getPage(easOutInBills);
|
return CommonPage.getPage(easOutInBills);
|
||||||
@@ -277,6 +276,16 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
return easOutInBillMapper.queryExistBills();
|
return easOutInBillMapper.queryExistBills();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询本地的出入库主单据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Set<String> queryBills() {
|
||||||
|
return easOutInBillMapper.queryBills();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询本地未提交的出入库单据
|
* 查询本地未提交的出入库单据
|
||||||
*/
|
*/
|
||||||
@@ -298,17 +307,16 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateOrDeleteBills(List<EasOutInBillDetail> easOutInBillDetails, List<EasOutInBillDetail> existingIds) {
|
public void updateOrDeleteBills(List<EasOutInBillDetail> easOutInBillDetails, List<EasOutInBillDetail> existingIds) {
|
||||||
CompletableFuture.runAsync(() -> {
|
// CompletableFuture.runAsync(() -> {
|
||||||
try {
|
// try {
|
||||||
updateBills(easOutInBillDetails, existingIds);
|
updateBills(easOutInBillDetails, existingIds);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
log.error("异常信息:" + e);
|
// log.error("异常信息:" + e);
|
||||||
}
|
// }
|
||||||
}, pool);
|
// }, pool);
|
||||||
CompletableFuture.runAsync(() -> {
|
// CompletableFuture.runAsync(() -> {
|
||||||
//todo 检查事务是否会失效
|
autoDeleteBill(easOutInBillDetails, existingIds);
|
||||||
autoDeleteBill(easOutInBillDetails, existingIds);
|
// }, pool);
|
||||||
}, pool);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -325,9 +333,9 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
bill.setCzsl(BigDecimal.ZERO);
|
bill.setCzsl(BigDecimal.ZERO);
|
||||||
bill.setCzsl(BigDecimal.ZERO);
|
bill.setCzsl(BigDecimal.ZERO);
|
||||||
bill.setKcsl(BigDecimal.ZERO);
|
bill.setKcsl(BigDecimal.ZERO);
|
||||||
if (bill.getSl().compareTo(BigDecimal.ZERO) < 0) {
|
// if (bill.getSl().compareTo(BigDecimal.ZERO) < 0) {
|
||||||
bill.setSl(bill.getSl().abs());
|
// bill.setSl(bill.getSl().abs());
|
||||||
}
|
// }
|
||||||
bill.setSysl(bill.getSl());
|
bill.setSysl(bill.getSl());
|
||||||
if (bill.getDjly() == null) {
|
if (bill.getDjly() == null) {
|
||||||
bill.setCjsj(LocalDateTime.parse(bill.getCjsj(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
bill.setCjsj(LocalDateTime.parse(bill.getCjsj(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||||
@@ -457,6 +465,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
updateEntity.setCksj(entity.getCksj());
|
updateEntity.setCksj(entity.getCksj());
|
||||||
updateEntity.setLlr(entity.getLlr());
|
updateEntity.setLlr(entity.getLlr());
|
||||||
updateEntity.setTrackno(entity.getTrackno());
|
updateEntity.setTrackno(entity.getTrackno());
|
||||||
|
updateEntity.setGzhbm(entity.getGzhbm());
|
||||||
updateEntity.setXgsj(entity.getXgsj());
|
updateEntity.setXgsj(entity.getXgsj());
|
||||||
easOutInBillDetailMapper.update(updateEntity, new QueryWrapper<EasOutInBillDetail>().eq("flid", entity.getFlid()));
|
easOutInBillDetailMapper.update(updateEntity, new QueryWrapper<EasOutInBillDetail>().eq("flid", entity.getFlid()));
|
||||||
}
|
}
|
||||||
@@ -516,6 +525,23 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
queryWrapper.in(EasOutInBillDetail::getFlid, filds);
|
queryWrapper.in(EasOutInBillDetail::getFlid, filds);
|
||||||
easOutInBillDetailMapper.delete(queryWrapper);
|
easOutInBillDetailMapper.delete(queryWrapper);
|
||||||
}
|
}
|
||||||
|
//查询主单据进行对比
|
||||||
|
Set<String> bills = queryBills();
|
||||||
|
Set<String> easBills = easOutInBillDetails.stream().map(EasOutInBillDetail::getDjid).collect(Collectors.toSet());
|
||||||
|
Set<String> notInExits = bills.stream()
|
||||||
|
.filter(r -> !easBills.contains(r))
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
if (CollectionUtils.isNotEmpty(notInExits)) {
|
||||||
|
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"))
|
||||||
|
.set("djzt", "审核")
|
||||||
|
.set("btbz", "扫描EAS,此单据在EAS已查询不到,或为已审核状态。")
|
||||||
|
.in("djid", notInExits);
|
||||||
|
easOutInBillMapper.update(null, updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("定时删除源头已删除单据-autoDeleteBill接口回滚,出现异常: {}", e);
|
log.error("定时删除源头已删除单据-autoDeleteBill接口回滚,出现异常: {}", e);
|
||||||
}
|
}
|
||||||
@@ -592,6 +618,10 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
List<EasOutInBillDetailDto> billDetails = easOutInBillDetailList.stream().filter(d ->
|
List<EasOutInBillDetailDto> billDetails = easOutInBillDetailList.stream().filter(d ->
|
||||||
Objects.equals(d.getDjid(), b.getBillId())).collect(Collectors.toList());
|
Objects.equals(d.getDjid(), b.getBillId())).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(billDetails)) {
|
if (CollectionUtils.isNotEmpty(billDetails)) {
|
||||||
|
if (b.getYwlx().contains(EasBillTypeEnum.OUT.getCode())) {
|
||||||
|
//只提交大于数量大于0的物料明细
|
||||||
|
billDetails = billDetails.stream().filter(r -> r.getQty().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
||||||
|
}
|
||||||
b.setInWhUser(SecurityUtils.getCurrentNickName() == null ? "admin" : SecurityUtils.getCurrentNickName());
|
b.setInWhUser(SecurityUtils.getCurrentNickName() == null ? "admin" : SecurityUtils.getCurrentNickName());
|
||||||
b.setEntrys(billDetails);
|
b.setEntrys(billDetails);
|
||||||
}
|
}
|
||||||
@@ -626,8 +656,6 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个单据审核
|
* 单个单据审核
|
||||||
*/
|
*/
|
||||||
@@ -643,7 +671,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
msgDto = wmsToEasService.sendWebService(billJson);
|
msgDto = wmsToEasService.sendWebService(billJson);
|
||||||
if (msgDto != null) {
|
if (msgDto != null) {
|
||||||
if (msgDto.getResult() == 0) {
|
if (msgDto.getResult() == 0) {
|
||||||
msg = "审核失败:"+msgDto.getMsg();
|
msg = "审核失败:" + msgDto.getMsg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -652,7 +680,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson, 1);
|
srmMsgDto = wmsToSrmService.sendWebPostData(billJson, 1);
|
||||||
if (srmMsgDto != null) {
|
if (srmMsgDto != null) {
|
||||||
if ("false".equals(srmMsgDto.getSuccess())) {
|
if ("false".equals(srmMsgDto.getSuccess())) {
|
||||||
msg = "审核失败:"+srmMsgDto.getMessage();
|
msg = "审核失败:" + srmMsgDto.getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -674,7 +702,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
easData.setData(bill);
|
easData.setData(bill);
|
||||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue);
|
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue);
|
||||||
wmsToEasService.sendWebService(billJson);
|
wmsToEasService.sendWebService(billJson);
|
||||||
updateBills(bill,"审核成功!");
|
updateBills(bill, "审核成功!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||||
//throw new BadRequestException(e.toString());
|
//throw new BadRequestException(e.toString());
|
||||||
@@ -691,7 +719,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
try {
|
try {
|
||||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
||||||
wmsToSrmService.sendWebPostData(billJson, 1);
|
wmsToSrmService.sendWebPostData(billJson, 1);
|
||||||
updateBills(bill,"审核成功!");
|
updateBills(bill, "审核成功!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||||
//throw new BadRequestException(e.toString());
|
//throw new BadRequestException(e.toString());
|
||||||
@@ -701,15 +729,16 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
|
|
||||||
|
|
||||||
private void updateBills(EasOutInBillDto bill, String msg) {
|
private void updateBills(EasOutInBillDto bill, 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());
|
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)) {
|
if (StringUtils.isNoneBlank(msg)) {
|
||||||
updateWrapper.set("shjg", msg);
|
updateWrapper.set("shjg", msg);
|
||||||
} else {
|
} else {
|
||||||
updateWrapper.set("djzt", "审核");
|
updateWrapper.set("djzt", "审核");
|
||||||
}
|
}
|
||||||
updateWrapper.set("update_id",SecurityUtils.getCurrentUsername());
|
|
||||||
updateWrapper.set("update_name",SecurityUtils.getCurrentNickName());
|
|
||||||
updateWrapper.set("update_time",DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
|
|
||||||
easOutInBillMapper.update(null, updateWrapper);
|
easOutInBillMapper.update(null, updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.database.eas.dao.AllocationBill;
|
import org.nl.wms.database.eas.dao.AllocationBill;
|
||||||
|
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||||
import org.nl.wms.database.eas.dao.ReceiptBill;
|
import org.nl.wms.database.eas.dao.ReceiptBill;
|
||||||
import org.nl.wms.database.eas.dto.*;
|
import org.nl.wms.database.eas.dto.*;
|
||||||
import org.nl.wms.database.eas.dao.mapper.ReceiptBillMapper;
|
import org.nl.wms.database.eas.dao.mapper.ReceiptBillMapper;
|
||||||
@@ -103,6 +106,9 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
Page<ReceiptBillQuery> pageObject = new Page<>(params.getPage(), params.getSize());
|
Page<ReceiptBillQuery> pageObject = new Page<>(params.getPage(), params.getSize());
|
||||||
Page<ReceiptBillQuery> receiptBills = receiptBillMapper.receiptDetailPage(pageObject, params.getDjid(), params.getFuzzy());
|
Page<ReceiptBillQuery> receiptBills = receiptBillMapper.receiptDetailPage(pageObject, params.getDjid(), params.getFuzzy());
|
||||||
List<ReceiptBillQuery> receiptBillList = receiptBills.getRecords();
|
List<ReceiptBillQuery> receiptBillList = receiptBills.getRecords();
|
||||||
|
//计算相同物料编码的总数
|
||||||
|
Map<String, Double> totalQty = receiptBillList.stream()
|
||||||
|
.collect(Collectors.groupingBy(ReceiptBillQuery::getWlbm, Collectors.summingDouble(bill -> Double.parseDouble(bill.getShsl()))));
|
||||||
if (!receiptBillList.isEmpty()) {
|
if (!receiptBillList.isEmpty()) {
|
||||||
List<ReceiptBill> updateList = receiptBillMapper.selectList(
|
List<ReceiptBill> updateList = receiptBillMapper.selectList(
|
||||||
new LambdaQueryWrapper<ReceiptBill>().eq(ReceiptBill::getDjid, receiptBillList.get(0).getDjid()));
|
new LambdaQueryWrapper<ReceiptBill>().eq(ReceiptBill::getDjid, receiptBillList.get(0).getDjid()));
|
||||||
@@ -117,6 +123,7 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
if (updatedBill != null) {
|
if (updatedBill != null) {
|
||||||
receiptBill.setYwrq(updatedBill.getYwrq());
|
receiptBill.setYwrq(updatedBill.getYwrq());
|
||||||
receiptBill.setKwbm(updatedBill.getKwbm());
|
receiptBill.setKwbm(updatedBill.getKwbm());
|
||||||
|
receiptBill.setKwmc(updatedBill.getKwmc());
|
||||||
receiptBill.setCkbm(updatedBill.getCkbm());
|
receiptBill.setCkbm(updatedBill.getCkbm());
|
||||||
receiptBill.setShsl(updatedBill.getShsl());
|
receiptBill.setShsl(updatedBill.getShsl());
|
||||||
receiptBill.setBz(updatedBill.getBz());
|
receiptBill.setBz(updatedBill.getBz());
|
||||||
@@ -130,6 +137,10 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
receiptBillList= receiptBillList.stream().peek(r->{
|
||||||
|
r.setWlzs(totalQty.get(r.getWlbm()));
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
receiptBills.setRecords(receiptBillList);
|
receiptBills.setRecords(receiptBillList);
|
||||||
return CommonPage.getPage(receiptBills);
|
return CommonPage.getPage(receiptBills);
|
||||||
}
|
}
|
||||||
@@ -174,10 +185,11 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
);
|
);
|
||||||
receiptBillDto.setDetails(details);
|
receiptBillDto.setDetails(details);
|
||||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(receiptBillDto, SerializerFeature.WriteMapNullValue);
|
String billJson = com.alibaba.fastjson.JSON.toJSONString(receiptBillDto, SerializerFeature.WriteMapNullValue);
|
||||||
confirmDtl(billJson,params.get(0).getDjid());
|
confirmDtl(billJson, params.get(0).getDjid());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async("taskExecutor")
|
@Async("taskExecutor")
|
||||||
public void confirmDtl(String billJson,String id) {
|
public void confirmDtl(String billJson, String id) {
|
||||||
try {
|
try {
|
||||||
SrmMsgDto srmMsgDto = wmsToSrmService.sendWebPostData(billJson, 2);
|
SrmMsgDto srmMsgDto = wmsToSrmService.sendWebPostData(billJson, 2);
|
||||||
if (srmMsgDto != null) {
|
if (srmMsgDto != null) {
|
||||||
@@ -187,7 +199,7 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
// 如果不存在该记录,则插入数据
|
// 如果不存在该记录,则插入数据
|
||||||
ReceiptBill bill = new ReceiptBill();
|
ReceiptBill bill = new ReceiptBill();
|
||||||
bill.setFlid(id);
|
bill.setFlid(id);
|
||||||
bill.setShjg("审核失败:"+srmMsgDto.getMessage());
|
bill.setShjg("审核失败:" + srmMsgDto.getMessage());
|
||||||
bill.setUpdate_id(SecurityUtils.getCurrentUsername());
|
bill.setUpdate_id(SecurityUtils.getCurrentUsername());
|
||||||
bill.setUpdate_name(SecurityUtils.getCurrentNickName());
|
bill.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||||
bill.setUpdate_time(DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
|
bill.setUpdate_time(DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
|
||||||
@@ -208,7 +220,6 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建
|
* 创建
|
||||||
*
|
*
|
||||||
@@ -224,20 +235,24 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
* 修改收货单
|
* 修改收货单
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void update(ReceiptBillVO entity) {
|
public void update(List<ReceiptBillVO> entityList) {
|
||||||
ReceiptBill receiptBill = this.getById(entity.getFlid());
|
if (CollectionUtils.isNotEmpty(entityList)) {
|
||||||
if (receiptBill == null) {
|
entityList.forEach(r -> {
|
||||||
// 如果不存在该记录,则插入数据
|
ReceiptBill receiptBill = this.getById(r.getFlid());
|
||||||
ReceiptBill receiptBillNew = new ReceiptBill();
|
if (receiptBill == null) {
|
||||||
BeanUtils.copyProperties(entity, receiptBillNew);
|
// 如果不存在该记录,则插入数据
|
||||||
this.save(receiptBillNew);
|
ReceiptBill receiptBillNew = new ReceiptBill();
|
||||||
} else {
|
BeanUtils.copyProperties(r, receiptBillNew);
|
||||||
// 如果存在该记录,则更新数据
|
this.save(receiptBillNew);
|
||||||
BeanUtils.copyProperties(entity, receiptBill);
|
} else {
|
||||||
receiptBill.setUpdate_id(SecurityUtils.getCurrentUsername());
|
// 如果存在该记录,则更新数据
|
||||||
receiptBill.setUpdate_name(SecurityUtils.getCurrentNickName());
|
BeanUtils.copyProperties(r, receiptBill);
|
||||||
receiptBill.setUpdate_time(DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
|
receiptBill.setUpdate_id(SecurityUtils.getCurrentUsername());
|
||||||
this.updateById(receiptBill);
|
receiptBill.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
receiptBill.setUpdate_time(DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
|
||||||
|
this.updateById(receiptBill);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class EasBillSchedule {
|
|||||||
|
|
||||||
|
|
||||||
@Async("taskExecutor")
|
@Async("taskExecutor")
|
||||||
@Scheduled(cron = "0/45 * * * * *")
|
@Scheduled(cron = "0/60 * * * * *")
|
||||||
public void insertOutInBills() {
|
public void insertOutInBills() {
|
||||||
// 获取eas视图查询未提交的单据
|
// 获取eas视图查询未提交的单据
|
||||||
List<EasOutInBillDetail> easOutInBillDetails = easOutInBillDetailMapper.selectEasPages();
|
List<EasOutInBillDetail> easOutInBillDetails = easOutInBillDetailMapper.selectEasPages();
|
||||||
@@ -96,7 +96,7 @@ public class EasBillSchedule {
|
|||||||
|
|
||||||
|
|
||||||
@Async("taskExecutor")
|
@Async("taskExecutor")
|
||||||
@Scheduled(cron = "0/120 * * * * *")
|
@Scheduled(cron = "0/360 * * * * *")
|
||||||
public void insertUsers() {
|
public void insertUsers() {
|
||||||
List<SysUser> newUsers =sysUserMapper.queryUserList();
|
List<SysUser> newUsers =sysUserMapper.queryUserList();
|
||||||
List<SysUser> existingUsers =sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().eq(SysUser::getIs_used,"1"));
|
List<SysUser> existingUsers =sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().eq(SysUser::getIs_used,"1"));
|
||||||
@@ -124,7 +124,7 @@ public class EasBillSchedule {
|
|||||||
* 定时清空单据
|
* 定时清空单据
|
||||||
*/
|
*/
|
||||||
@Async("taskExecutor")
|
@Async("taskExecutor")
|
||||||
//@Scheduled(cron = "0/86400 * * * * *")
|
@Scheduled(cron = "0/86400 * * * * *")
|
||||||
public void autoDeleteTask() {
|
public void autoDeleteTask() {
|
||||||
LocalDate threeMonthsAgo = LocalDate.now().minusMonths(3);
|
LocalDate threeMonthsAgo = LocalDate.now().minusMonths(3);
|
||||||
String days = threeMonthsAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
String days = threeMonthsAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
@@ -152,24 +152,7 @@ public class EasBillSchedule {
|
|||||||
redisUtils.set("billCounts", billsCount, 1, TimeUnit.HOURS);
|
redisUtils.set("billCounts", billsCount, 1, TimeUnit.HOURS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页信息推送
|
|
||||||
*/
|
|
||||||
@Async("taskExecutor")
|
|
||||||
//@Scheduled(cron = "0/4 * * * * *")
|
|
||||||
public void sendHomeInfoTask() {
|
|
||||||
//StopWatch stopWatch = new StopWatch();
|
|
||||||
//stopWatch.start();
|
|
||||||
CopyOnWriteArraySet<SendHomeWebSocketServer> webSocketSet =
|
|
||||||
SendHomeWebSocketServer.getWebSocketSet();
|
|
||||||
if (webSocketSet.size() > 0) {
|
|
||||||
webSocketSet.forEach(c -> {
|
|
||||||
// c.sendDataToClient(easOutInBillService.getBillsCount());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//stopWatch.stop();
|
|
||||||
//System.out.println("1task-首页及头部信息推送-sendHomeInfoTask-花费时间----------------------------------------------------------------****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* eas单据自动审核
|
* eas单据自动审核
|
||||||
*/
|
*/
|
||||||
@@ -210,7 +193,24 @@ public class EasBillSchedule {
|
|||||||
log.error("eas单据自动审核-automaticAuditBills接口回滚,出现异常:", e);
|
log.error("eas单据自动审核-automaticAuditBills接口回滚,出现异常:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 首页信息推送
|
||||||
|
*/
|
||||||
|
@Async("taskExecutor")
|
||||||
|
//@Scheduled(cron = "0/4 * * * * *")
|
||||||
|
public void sendHomeInfoTask() {
|
||||||
|
//StopWatch stopWatch = new StopWatch();
|
||||||
|
//stopWatch.start();
|
||||||
|
CopyOnWriteArraySet<SendHomeWebSocketServer> webSocketSet =
|
||||||
|
SendHomeWebSocketServer.getWebSocketSet();
|
||||||
|
if (webSocketSet.size() > 0) {
|
||||||
|
webSocketSet.forEach(c -> {
|
||||||
|
// c.sendDataToClient(easOutInBillService.getBillsCount());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//stopWatch.stop();
|
||||||
|
//System.out.println("1task-首页及头部信息推送-sendHomeInfoTask-花费时间----------------------------------------------------------------****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
private void updateBillInBatch(List<String> djIdList1, List<String> djIdList2) {
|
private void updateBillInBatch(List<String> djIdList1, List<String> djIdList2) {
|
||||||
if (!djIdList1.isEmpty() || !djIdList2.isEmpty()) {
|
if (!djIdList1.isEmpty() || !djIdList2.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user