opt:数据查询修改
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class AllocationBillController {
|
||||
*/
|
||||
@PostMapping("/allocationPage")
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<CommonPage<AllocationBill>> allocationPage(@RequestBody AllocationBillQuery params) {
|
||||
public ResponseEntity<CommonPage<AllocationBillQuery>> allocationPage(@RequestBody AllocationBillQuery params) {
|
||||
return new ResponseEntity<>(allocationBillService.allocationPage(params), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ public class AllocationBillController {
|
||||
if (params.isEmpty()) {
|
||||
throw new BadRequestException("参数为空!");
|
||||
}
|
||||
// return RestBusinessTemplate.execute(() -> allocationBillService.allocationConfirm(params));
|
||||
return RestBusinessTemplate.execute(() -> null);
|
||||
return RestBusinessTemplate.execute(() -> allocationBillService.allocationConfirm(params));
|
||||
//return RestBusinessTemplate.execute(() -> null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.nl.common.base.RestBusinessTemplate;
|
||||
import org.nl.common.base.ResultCode;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.database.eas.dao.ReceiptBill;
|
||||
import org.nl.wms.database.eas.dto.AllocationBillQuery;
|
||||
import org.nl.wms.database.eas.dto.ReceiptBillQuery;
|
||||
import org.nl.wms.ext.srm.WmsToSrmService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -46,7 +47,7 @@ public class ReceiptBillController {
|
||||
*/
|
||||
@PostMapping("/receiptPage")
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<CommonPage<ReceiptBill>> receiptPage(@RequestBody ReceiptBillQuery params) {
|
||||
public ResponseEntity<CommonPage<AllocationBillQuery>> receiptPage(@RequestBody ReceiptBillQuery params) {
|
||||
return new ResponseEntity<>(receiptBillService.receiptPage(params), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -88,8 +89,8 @@ public class ReceiptBillController {
|
||||
if (params.isEmpty()) {
|
||||
throw new BadRequestException("参数为空!");
|
||||
}
|
||||
// return RestBusinessTemplate.execute(() -> receiptBillService.receiptConfirm(params));
|
||||
return RestBusinessTemplate.execute(() -> null);
|
||||
return RestBusinessTemplate.execute(() -> receiptBillService.receiptConfirm(params));
|
||||
//return RestBusinessTemplate.execute(() -> null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,12 +22,15 @@ public class AllocationBill extends Model<AllocationBill> {
|
||||
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
|
||||
|
||||
/**
|
||||
* 分录id
|
||||
*/
|
||||
@TableId(value = "flid", type = IdType.NONE)
|
||||
private String flid;
|
||||
|
||||
/**
|
||||
* 单据ID
|
||||
*/
|
||||
@TableId(value = "djid", type = IdType.NONE)
|
||||
private String djid;
|
||||
|
||||
/**
|
||||
@@ -61,11 +64,7 @@ public class AllocationBill extends Model<AllocationBill> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分录id
|
||||
*/
|
||||
|
||||
private String flid;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,10 +23,15 @@ public class ReceiptBill extends Model<ReceiptBill> {
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
|
||||
|
||||
/**
|
||||
* 分录ID
|
||||
*/
|
||||
@TableId(value = "flid", type = IdType.NONE)
|
||||
private String flid;
|
||||
|
||||
/**
|
||||
* 送货单id
|
||||
*/
|
||||
@TableId(value = "djid", type = IdType.NONE)
|
||||
private String djid;
|
||||
|
||||
|
||||
@@ -69,10 +74,7 @@ public class ReceiptBill extends Model<ReceiptBill> {
|
||||
private String kwbm;
|
||||
|
||||
|
||||
/**
|
||||
* 分录ID
|
||||
*/
|
||||
private String flid;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,14 +23,14 @@ public interface AllocationBillMapper extends BaseMapper<AllocationBill> {
|
||||
Long getAllocationCount(@Param("fuzzy") String fuzzy);
|
||||
|
||||
@DS("oracle_eas")
|
||||
List<AllocationBill> allocationPage(@Param("fuzzy") String fuzzy, @Param("page") Integer page, @Param("size") Integer size );
|
||||
List<AllocationBillQuery> allocationPage(@Param("fuzzy") String fuzzy, @Param("page") Integer page, @Param("size") Integer size );
|
||||
|
||||
|
||||
@Select("SELECT COUNT(*) FROM EAS_NOBLE.V_UC_STOCKTRANSFERBILL WHERE DJBH = #{djbh}")
|
||||
@Select("SELECT COUNT(*) FROM EAS_NOBLE.V_UC_STOCKTRANSFERBILL WHERE DJID = #{djid}")
|
||||
@DS("oracle_eas")
|
||||
Long getTotalCount(@Param("djbh") String djbh);
|
||||
Long getTotalCount(@Param("djid") String djid);
|
||||
|
||||
@DS("oracle_eas")
|
||||
List<AllocationBillQuery> allocationDetailPage(@Param("page") Integer page, @Param("size") Integer size, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy);
|
||||
List<AllocationBillQuery> allocationDetailPage(@Param("page") Integer page, @Param("size") Integer size, @Param("djid") String djid, @Param("fuzzy") String fuzzy);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,11 @@ package org.nl.wms.database.eas.dao.mapper;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.nl.wms.database.eas.dao.ReceiptBill;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.database.eas.dto.AllocationBillQuery;
|
||||
import org.nl.wms.database.eas.dto.ReceiptBillQuery;
|
||||
|
||||
/**
|
||||
@@ -14,9 +17,17 @@ import org.nl.wms.database.eas.dto.ReceiptBillQuery;
|
||||
* @since 2024-05-25
|
||||
*/
|
||||
public interface ReceiptBillMapper extends BaseMapper<ReceiptBill> {
|
||||
@DS("mysql_srm")
|
||||
Page<ReceiptBill> receiptPage(Page<ReceiptBill> page, @Param("fuzzy") String fuzzy);
|
||||
|
||||
@DS("mysql_srm")
|
||||
Page<ReceiptBillQuery> receiptDetailPage(Page<ReceiptBillQuery> page, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy);
|
||||
@Select("SELECT COUNT(1) FROM (SELECT DJID FROM v_wms_recbill_third GROUP BY DJID) A")
|
||||
Long receiptCounts();
|
||||
|
||||
@DS("mysql_srm")
|
||||
Page<AllocationBillQuery> receiptPage(Page<AllocationBillQuery> page, @Param("fuzzy") String fuzzy);
|
||||
|
||||
|
||||
|
||||
|
||||
@DS("mysql_srm")
|
||||
Page<ReceiptBillQuery> receiptDetailPage(Page<ReceiptBillQuery> page, @Param("djid") String djid, @Param("fuzzy") String fuzzy);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
SELECT * FROM (
|
||||
SELECT V.*, ROW_NUMBER() OVER (ORDER BY V.CJSJ DESC) AS RNUM
|
||||
FROM EAS_NOBLE.V_UC_STOCKTRANSFERBILL V
|
||||
WHERE V.DJBH = #{djbh}
|
||||
WHERE V.DJID = #{djid}
|
||||
)
|
||||
WHERE RNUM BETWEEN (#{page} - 1) * #{size} + 1 AND #{page} * #{size}
|
||||
</select>
|
||||
|
||||
@@ -8,27 +8,21 @@
|
||||
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}, '%')
|
||||
OR djbh LIKE CONCAT('%', #{fuzzy}, '%')
|
||||
OR cggs LIKE CONCAT('%', #{fuzzy}, '%')
|
||||
OR zzmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||
OR ckmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||
OR kwmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||
OR gys LIKE CONCAT('%', #{fuzzy}, '%')
|
||||
</if>
|
||||
GROUP BY
|
||||
djbh
|
||||
ORDER BY djbh ASC
|
||||
DJID
|
||||
ORDER BY TJSJ DESC
|
||||
</select>
|
||||
<select id="receiptDetailPage" resultType="org.nl.wms.database.eas.dto.ReceiptBillQuery">
|
||||
SELECT *
|
||||
FROM v_wms_recbill_third
|
||||
WHERE DJBH = #{djbh}
|
||||
WHERE DJID = #{djid}
|
||||
<!-- <if test="fuzzy != null and fuzzy != ''">-->
|
||||
<!-- AND (-->
|
||||
<!-- djbh LIKE CONCAT('%', #{fuzzy}, '%')-->
|
||||
@@ -48,6 +42,6 @@
|
||||
<!-- OR bz LIKE CONCAT('%', #{fuzzy}, '%')-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
ORDER BY djbh ASC
|
||||
ORDER BY TJSJ DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -36,12 +36,18 @@ public class ReceiptBillDetailDto implements Serializable {
|
||||
/**
|
||||
* 收货仓库编码
|
||||
*/
|
||||
private String ckbm;
|
||||
private String warehouseNo;
|
||||
|
||||
/**
|
||||
* 收货库位编码
|
||||
*/
|
||||
private String kwbm;
|
||||
private String locationNo;
|
||||
|
||||
|
||||
/**
|
||||
* 收货库位编码
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -34,13 +34,9 @@ public class ReceiptBillDto implements Serializable {
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String inWhUser;
|
||||
private String recUser;
|
||||
|
||||
|
||||
/**
|
||||
* 业务日期
|
||||
*/
|
||||
private String bizDate;
|
||||
|
||||
|
||||
/**
|
||||
@@ -55,7 +51,7 @@ public class ReceiptBillDto implements Serializable {
|
||||
private String description;
|
||||
|
||||
|
||||
List<ReceiptBillDetailDto> entrys;
|
||||
List<ReceiptBillDetailDto> details;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ReceiptBillVO extends BaseQuery<ReceiptBill> {
|
||||
/**
|
||||
* 收货库位编码
|
||||
*/
|
||||
private String kwbm;
|
||||
private String kwmc;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface IallocationBillService extends IService<AllocationBill> {
|
||||
* @param params 查询条件
|
||||
* @return IPage<EasOutInBill>
|
||||
*/
|
||||
CommonPage<AllocationBill> allocationPage(AllocationBillQuery params);
|
||||
CommonPage<AllocationBillQuery> allocationPage(AllocationBillQuery params);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.database.eas.service;
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.wms.database.eas.dao.ReceiptBill;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.database.eas.dto.AllocationBillQuery;
|
||||
import org.nl.wms.database.eas.dto.ReceiptBillQuery;
|
||||
import org.nl.wms.database.eas.dto.ReceiptBillVO;
|
||||
|
||||
@@ -24,7 +25,7 @@ public interface IreceiptBillService extends IService<ReceiptBill> {
|
||||
* @param params 查询条件
|
||||
* @return IPage<EasOutInBill>
|
||||
*/
|
||||
CommonPage<ReceiptBill> receiptPage(ReceiptBillQuery params);
|
||||
CommonPage<AllocationBillQuery> receiptPage(ReceiptBillQuery params);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
|
||||
@@ -25,6 +25,8 @@ import javax.annotation.Resource;
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -55,11 +57,19 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
*/
|
||||
@Override
|
||||
@SaIgnore
|
||||
public CommonPage<AllocationBill> allocationPage(AllocationBillQuery params) {
|
||||
public CommonPage<AllocationBillQuery> allocationPage(AllocationBillQuery params) {
|
||||
// 查询总记录数
|
||||
long totalCount = allocationBillMapper.getAllocationCount(params.getFuzzy());
|
||||
List<AllocationBill> allocationBills = allocationBillMapper.allocationPage(params.getFuzzy(),params.getPage(),params.getSize());
|
||||
return CommonPage.getPage(allocationBills, totalCount,params.getPage(),params.getSize());
|
||||
List<AllocationBillQuery> allocationBills = allocationBillMapper.allocationPage(params.getFuzzy(), params.getPage(), params.getSize());
|
||||
if (!allocationBills.isEmpty()) {
|
||||
allocationBills = allocationBills.stream()
|
||||
.peek(r -> {
|
||||
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());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return CommonPage.getPage(allocationBills, totalCount, params.getPage(), params.getSize());
|
||||
}
|
||||
|
||||
|
||||
@@ -70,12 +80,12 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
*/
|
||||
@Override
|
||||
public CommonPage<AllocationBillQuery> page(AllocationBillQuery params) {
|
||||
if (StringUtils.isBlank(params.getDjbh())) {
|
||||
if (StringUtils.isBlank(params.getDjid())) {
|
||||
throw new BadRequestException("单据编号不能为空");
|
||||
}
|
||||
// 查询总记录数
|
||||
long totalCount = allocationBillMapper.getTotalCount(params.getDjbh());
|
||||
List<AllocationBillQuery> allocationBillList = allocationBillMapper.allocationDetailPage(params.getPage(),params.getSize(), params.getDjbh(), params.getFuzzy());
|
||||
long totalCount = allocationBillMapper.getTotalCount(params.getDjid());
|
||||
List<AllocationBillQuery> allocationBillList = allocationBillMapper.allocationDetailPage(params.getPage(), params.getSize(), params.getDjid(), params.getFuzzy());
|
||||
if (!allocationBillList.isEmpty()) {
|
||||
// 获取更新列表
|
||||
List<AllocationBill> updateList = allocationBillMapper.selectList(
|
||||
@@ -96,8 +106,13 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
allocationBill.setDckwbm(updatedBill.getDckwbm());
|
||||
allocationBill.setDrckbm(updatedBill.getDrckbm());
|
||||
allocationBill.setDrkwbm(updatedBill.getDrkwbm());
|
||||
allocationBill.setJhdrrq(updatedBill.getJhdrrq());
|
||||
allocationBill.setJhdcrq(updatedBill.getJhdcrq());
|
||||
if (updatedBill.getJhdrrq().contains("/") || updatedBill.getJhdcrq().contains("/")) {
|
||||
allocationBill.setJhdrrq(LocalDateTime.parse(updatedBill.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||
allocationBill.setJhdcrq(LocalDateTime.parse(updatedBill.getJhdcrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||
} else {
|
||||
allocationBill.setJhdrrq(updatedBill.getJhdrrq());
|
||||
allocationBill.setJhdcrq(updatedBill.getJhdcrq());
|
||||
}
|
||||
allocationBill.setBtbz(updatedBill.getBz());
|
||||
}
|
||||
return allocationBill;
|
||||
@@ -105,7 +120,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
return CommonPage.getPage(allocationBillList, totalCount,params.getPage(), params.getSize());
|
||||
return CommonPage.getPage(allocationBillList, totalCount, params.getPage(), params.getSize());
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +160,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
allocationBillDto.setBillNo(params.get(0).getDjbh());
|
||||
allocationBillDto.setBizDate(params.get(0).getYwrq());
|
||||
allocationBillDto.setDescription(params.get(0).getBz());
|
||||
allocationBillDto.setInWhUser(SecurityUtils.getCurrentNickName() == null ? "admin" : SecurityUtils.getCurrentNickName());
|
||||
allocationBillDto.setInWhUser("A110813006");
|
||||
List<AllocationBillDetailDto> entrys = new ArrayList<>();
|
||||
params.forEach(r -> {
|
||||
AllocationBillDetailDto dto = new AllocationBillDetailDto();
|
||||
@@ -157,8 +172,13 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
dto.setReceiptLocationNo(r.getDrkwbm());
|
||||
dto.setIssueWarehouseNo(r.getDcckbm());
|
||||
dto.setIssueLocationNo(r.getDckwbm());
|
||||
dto.setReceiptPlanDate(r.getJhdrrq());
|
||||
dto.setIssuePlanDate(r.getJhdcrq());
|
||||
if (r.getJhdrrq().contains("/") || r.getJhdcrq().contains("/")) {
|
||||
dto.setReceiptPlanDate(LocalDateTime.parse(r.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||
dto.setIssuePlanDate(LocalDateTime.parse(r.getJhdcrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||
} else {
|
||||
dto.setReceiptPlanDate(r.getJhdrrq());
|
||||
dto.setIssuePlanDate(r.getJhdcrq());
|
||||
}
|
||||
dto.setRemark(r.getBz());
|
||||
entrys.add(dto);
|
||||
}
|
||||
@@ -187,7 +207,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
||||
*/
|
||||
@Override
|
||||
public void update(AllocationBillVO entity) {
|
||||
AllocationBill allocationBill = this.getById(entity.getDjid());
|
||||
AllocationBill allocationBill = this.getById(entity.getFlid());
|
||||
if (allocationBill == null) {
|
||||
// 如果不存在该记录,则插入数据
|
||||
AllocationBill allocationBillNew = new AllocationBill();
|
||||
|
||||
@@ -12,12 +12,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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;
|
||||
import org.nl.wms.database.eas.dao.*;
|
||||
import org.nl.wms.database.eas.dao.mapper.AllocationBillMapper;
|
||||
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
|
||||
import org.nl.wms.database.eas.dao.mapper.EasOutInBillMapper;
|
||||
import org.nl.wms.database.eas.dao.mapper.ReceiptBillMapper;
|
||||
import org.nl.wms.database.eas.dto.*;
|
||||
import org.nl.wms.database.eas.service.IeasOutInBillService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -61,8 +64,13 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
|
||||
@Resource
|
||||
private EasOutInBillDetailMapper easOutInBillDetailMapper;
|
||||
@Resource
|
||||
private AllocationBillMapper allocationBillMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private ReceiptBillMapper receiptBillMapper;
|
||||
|
||||
@Resource
|
||||
private WmsToSrmService wmsToSrmService;
|
||||
|
||||
@@ -78,7 +86,22 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
*/
|
||||
@Override
|
||||
public List<HomeBillCounts> getBillsCount() {
|
||||
return easOutInBillMapper.getBillsCount();
|
||||
List<HomeBillCounts> allCounts =easOutInBillMapper.getBillsCount();
|
||||
HomeBillCounts allocations =new HomeBillCounts();
|
||||
Long allocation =allocationBillMapper.getAllocationCount("");
|
||||
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 = receiptBillMapper.receiptCounts();
|
||||
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 +137,8 @@ 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(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "1".equals(params.getDjzt()) ? "提交" : "审核")
|
||||
.eq(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "提交")
|
||||
.nested(ObjectUtil.isNotEmpty(params.getFuzzy()),
|
||||
i -> i.like(EasOutInBill::getDjid, params.getFuzzy())
|
||||
.or()
|
||||
@@ -540,7 +564,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
} else {
|
||||
SrmMsgDto srmMsgDto;
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson);
|
||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson,1);
|
||||
if (srmMsgDto != null) {
|
||||
if ("false".equals(srmMsgDto.getSuccess())) {
|
||||
throw new BadRequestException(srmMsgDto.getMessage());
|
||||
@@ -581,7 +605,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,1);
|
||||
updateBills(bill);
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
|
||||
@@ -43,6 +43,8 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
@Resource
|
||||
private ReceiptBillMapper receiptBillMapper;
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private WmsToSrmService wmsToSrmService;
|
||||
|
||||
@@ -53,9 +55,9 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
*/
|
||||
@Override
|
||||
@SaIgnore
|
||||
public CommonPage<ReceiptBill> receiptPage(ReceiptBillQuery params) {
|
||||
Page<ReceiptBill> pageObject = new Page<>(params.getPage(), params.getSize());
|
||||
Page<ReceiptBill> receiptBills = receiptBillMapper.receiptPage(pageObject, params.getFuzzy());
|
||||
public CommonPage<AllocationBillQuery> receiptPage(ReceiptBillQuery params) {
|
||||
Page<AllocationBillQuery> pageObject = new Page<>(params.getPage(), params.getSize());
|
||||
Page<AllocationBillQuery> receiptBills = receiptBillMapper.receiptPage(pageObject, params.getFuzzy());
|
||||
return CommonPage.getPage(receiptBills);
|
||||
}
|
||||
|
||||
@@ -67,17 +69,18 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
*/
|
||||
@Override
|
||||
public CommonPage<ReceiptBillQuery> page(ReceiptBillVO params) {
|
||||
if (StringUtils.isBlank(params.getDjbh())) {
|
||||
if (StringUtils.isBlank(params.getDjid())) {
|
||||
throw new BadRequestException("单据编号不能为空");
|
||||
}
|
||||
Page<ReceiptBillQuery> pageObject = new Page<>(params.getPage(), params.getSize());
|
||||
Page<ReceiptBillQuery> receiptBills = receiptBillMapper.receiptDetailPage(pageObject, params.getDjbh(), params.getFuzzy());
|
||||
Page<ReceiptBillQuery> receiptBills = receiptBillMapper.receiptDetailPage(pageObject, params.getDjid(), params.getFuzzy());
|
||||
List<ReceiptBillQuery> receiptBillList = receiptBills.getRecords();
|
||||
if (!receiptBillList.isEmpty()) {
|
||||
List<ReceiptBill> updateList = receiptBillMapper.selectList(
|
||||
new LambdaQueryWrapper<ReceiptBill>().eq(ReceiptBill::getDjid, receiptBillList.get(0).getDjid()));
|
||||
if (!updateList.isEmpty()) {
|
||||
Map<String, ReceiptBill> updateMap = updateList.stream()
|
||||
Map<String, ReceiptBill> updateMap =
|
||||
updateList.stream()
|
||||
.collect(Collectors.toMap(ReceiptBill::getFlid, updateBill -> updateBill));
|
||||
//替换修改记录
|
||||
receiptBillList = receiptBillList.stream()
|
||||
@@ -125,24 +128,24 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
receiptBillDto.setBillId(params.get(0).getDjid());
|
||||
receiptBillDto.setBillNo(params.get(0).getDjbh());
|
||||
receiptBillDto.setBillType("SHDJ");
|
||||
receiptBillDto.setInWhUser(SecurityUtils.getCurrentNickName() == null ? "admin" : SecurityUtils.getCurrentNickName());
|
||||
receiptBillDto.setRecUser("A110813006");
|
||||
receiptBillDto.setDescription(params.get(0).getBtbz());
|
||||
receiptBillDto.setBizDate(params.get(0).getYwrq());
|
||||
List<ReceiptBillDetailDto> entrys = new ArrayList<>();
|
||||
List<ReceiptBillDetailDto> details = new ArrayList<>();
|
||||
params.forEach(r -> {
|
||||
ReceiptBillDetailDto dto = new ReceiptBillDetailDto();
|
||||
dto.setCkbm(r.getCkbm());
|
||||
dto.setKwbm(r.getKwbm());
|
||||
dto.setEntryId(r.getFlid());
|
||||
dto.setEntryId(r.getFlid());
|
||||
dto.setWarehouseNo(r.getCkbm());
|
||||
dto.setLocationNo(r.getKwmc());
|
||||
dto.setShsl(r.getShsl());
|
||||
entrys.add(dto);
|
||||
dto.setRemark(r.getBz());
|
||||
details.add(dto);
|
||||
}
|
||||
);
|
||||
receiptBillDto.setEntrys(entrys);
|
||||
receiptBillDto.setDetails(details);
|
||||
try {
|
||||
SrmMsgDto srmMsgDto;
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(receiptBillDto, SerializerFeature.WriteMapNullValue);
|
||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson);
|
||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson,2);
|
||||
if (srmMsgDto != null) {
|
||||
if ("false".equals(srmMsgDto.getSuccess())) {
|
||||
throw new BadRequestException(srmMsgDto.getMessage());
|
||||
@@ -171,7 +174,7 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
||||
*/
|
||||
@Override
|
||||
public void update(ReceiptBillVO entity) {
|
||||
ReceiptBill receiptBill = this.getById(entity.getDjbh());
|
||||
ReceiptBill receiptBill = this.getById(entity.getFlid());
|
||||
if (receiptBill == null) {
|
||||
// 如果不存在该记录,则插入数据
|
||||
ReceiptBill receiptBillNew = new ReceiptBill();
|
||||
|
||||
@@ -27,6 +27,9 @@ import java.rmi.RemoteException;
|
||||
@Component
|
||||
public class WmsToEasService {
|
||||
|
||||
|
||||
|
||||
|
||||
@Value("${easConfig.host}")
|
||||
private String host;
|
||||
|
||||
|
||||
@@ -28,14 +28,17 @@ import java.rmi.RemoteException;
|
||||
@Component
|
||||
public class WmsToSrmService {
|
||||
|
||||
@Value("${srmConfig.inOutHost}")
|
||||
private String inOutHost;
|
||||
@Value("${srmConfig.host}")
|
||||
private String host;
|
||||
|
||||
public SrmMsgDto sendWebPostData(String json) throws ServiceException, RemoteException {
|
||||
public SrmMsgDto sendWebPostData(String json,Integer type) throws ServiceException, RemoteException {
|
||||
log.error("Srm同步接口开始请求,请求json为:"+json);
|
||||
SrmMsgDto srmMsgDto;
|
||||
String url =type==1?inOutHost:host;
|
||||
com.alibaba.fastjson.JSONObject result;
|
||||
String resultMsg = HttpRequest.post(host)
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(json)
|
||||
.execute().body();
|
||||
log.error("Srm同步接口请求成功,输出参数为:-------------------" +resultMsg);
|
||||
|
||||
Reference in New Issue
Block a user