## 去掉发货和进销存的依赖;

This commit is contained in:
cabbage 2025-07-07 17:55:03 +08:00
parent 73b4a3393c
commit 949077725a
11 changed files with 3 additions and 287 deletions

View File

@ -1,26 +0,0 @@
package com.hzs.sale.deliver;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.sale.ext.SaDeliverExt;
import java.util.List;
/**
* @Description: 发货单相关dubbo接口
* @Author: jiang chao
* @Time: 2023/12/19 14:27
* @Classname: ISaDeliverServiceApi
* @PackageName: com.hzs.sale.deliver
*/
public interface ISaDeliverServiceApi {
/**
* 查询发货单+明细列表
*
* @param idList 发货单ID列表
* @param pkCountry 所属国家 -- 非必传
* @return
*/
R<List<SaDeliverExt>> queryDeliverList(List<Long> idList, Integer pkCountry);
}

View File

@ -5,11 +5,7 @@ import com.hzs.common.core.enums.EApprovalBusiness;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO; import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
/** /**
* @Description: 统一的销售服务回调审批成功入口 * 统一的销售服务回调审批成功入口
* @Author: sui q
* @Time: 2022/10/25 13:45
* @Classname: ISaleApprovalServiceApi
* @PackageName: com.hzs.sale.pub
*/ */
public interface ISaleApprovalServiceApi { public interface ISaleApprovalServiceApi {
@ -17,9 +13,6 @@ public interface ISaleApprovalServiceApi {
* 提供销售模块统一的审核回调方法 * 提供销售模块统一的审核回调方法
* *
* @param approvalBusinessResultDTO * @param approvalBusinessResultDTO
* @return: void
* @Author: sui q
* @Date: 2022/10/22 14:48
*/ */
R<Boolean> approvalCallback(ApprovalBusinessResultDTO approvalBusinessResultDTO); R<Boolean> approvalCallback(ApprovalBusinessResultDTO approvalBusinessResultDTO);

View File

@ -1,35 +0,0 @@
package com.hzs.scm.pub.dto;
import com.hzs.system.sys.dto.LoginUser;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 发货推送MQ数据
* @Author: jiang chao
* @Time: 2023/12/19 14:16
* @Classname: DeliverDTO
* @PackageName: com.hzs.scm.pub.dto
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class DeliverDTO implements Serializable {
/**
* 发货单ID列表
*/
private List<Long> deliverIdList;
/**
* 登录用户
*/
private LoginUser loginUser;
}

View File

@ -2,7 +2,6 @@ package com.hzs.sale.deliver.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.sale.deliver.SaDeliver; import com.hzs.common.domain.sale.deliver.SaDeliver;
import com.hzs.common.domain.sale.ext.SaDeliverExt;
import com.hzs.sale.deliver.param.DeliverParam; import com.hzs.sale.deliver.param.DeliverParam;
import com.hzs.sale.deliver.vo.DeliverPrintNewVO; import com.hzs.sale.deliver.vo.DeliverPrintNewVO;
import com.hzs.sale.deliver.vo.DeliverPrintVO; import com.hzs.sale.deliver.vo.DeliverPrintVO;
@ -13,21 +12,9 @@ import java.util.List;
/** /**
* 销售订单-发货单 Mapper 接口 * 销售订单-发货单 Mapper 接口
*
* @author hzs
* @since 2022-08-31
*/ */
public interface SaDeliverMapper extends BaseMapper<SaDeliver> { public interface SaDeliverMapper extends BaseMapper<SaDeliver> {
/**
* 出货单打印校验
*
* @param idList 发货单ID列表
* @param pkCountry 国家ID
* @return
*/
List<String> deliverPrintCheck(@Param("idList") List<Long> idList, @Param("pkCountry") Integer pkCountry);
/** /**
* 出货单打印列表 * 出货单打印列表
* *
@ -117,15 +104,6 @@ public interface SaDeliverMapper extends BaseMapper<SaDeliver> {
*/ */
List<SaDeliver> queryListById(@Param("idList") List<Long> idList, @Param("pkCountry") Integer pkCountry); List<SaDeliver> queryListById(@Param("idList") List<Long> idList, @Param("pkCountry") Integer pkCountry);
/**
* 查询发货单+明细列表
*
* @param idList 发货单ID列表
* @param pkCountry 所属国家
* @return
*/
List<SaDeliverExt> queryDeliverAndItemsList(@Param("idList") List<Long> idList, @Param("pkCountry") Integer pkCountry);
/** /**
* 获取指定日期最大批次 * 获取指定日期最大批次
* *

View File

@ -1,37 +0,0 @@
package com.hzs.sale.deliver.provider;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.sale.ext.SaDeliverExt;
import com.hzs.sale.deliver.ISaDeliverServiceApi;
import com.hzs.sale.deliver.service.ISaDeliverService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Description: 发货单相关dubbo服务
* @Author: jiang chao
* @Time: 2023/12/19 14:28
* @Classname: SaDeliverServiceProvider
* @PackageName: com.hzs.sale.deliver.provider
*/
@Slf4j
@DubboService
public class SaDeliverServiceProvider implements ISaDeliverServiceApi {
@Autowired
private ISaDeliverService iSaDeliverService;
@Override
public R<List<SaDeliverExt>> queryDeliverList(List<Long> idList, Integer pkCountry) {
try {
return R.ok(iSaDeliverService.queryDeliverAndItemsList(idList, pkCountry));
} catch (Exception e) {
log.error("查询发货单及明细数据异常:{}", e.getMessage(), e);
return R.fail(e.getMessage());
}
}
}

View File

@ -18,9 +18,6 @@ import java.util.List;
/** /**
* 销售订单-发货单 服务类 * 销售订单-发货单 服务类
*
* @author hzs
* @since 2022-08-31
*/ */
public interface ISaDeliverService extends IService<SaDeliver> { public interface ISaDeliverService extends IService<SaDeliver> {
@ -44,15 +41,6 @@ public interface ISaDeliverService extends IService<SaDeliver> {
*/ */
List<DeliverHandledVO> queryDeliverHandledList(DeliverHandledParam param, Integer pkCountry); List<DeliverHandledVO> queryDeliverHandledList(DeliverHandledParam param, Integer pkCountry);
/**
* 出货单打印校验
*
* @param idList 发货单ID列表
* @param pkCountry 国家ID
* @return
*/
List<String> deliverPrintCheck(List<Long> idList, Integer pkCountry);
/** /**
* 发货单打印 * 发货单打印
* *
@ -159,15 +147,6 @@ public interface ISaDeliverService extends IService<SaDeliver> {
*/ */
List<SaDeliver> queryListById(List<Long> idList, Integer pkCountry); List<SaDeliver> queryListById(List<Long> idList, Integer pkCountry);
/**
* 查询发货单+明细列表
*
* @param idList 发货单ID列表
* @param pkCountry 所属国家
* @return
*/
List<SaDeliverExt> queryDeliverAndItemsList(List<Long> idList, Integer pkCountry);
/** /**
* 获取批量最大数量 * 获取批量最大数量
* *

View File

@ -11,7 +11,6 @@ import com.hzs.common.core.utils.StringUtils;
import com.hzs.common.domain.sale.deliver.SaDeliver; import com.hzs.common.domain.sale.deliver.SaDeliver;
import com.hzs.common.domain.sale.deliver.SaDeliverBarCode; import com.hzs.common.domain.sale.deliver.SaDeliverBarCode;
import com.hzs.common.domain.sale.deliver.SaDeliverItems; import com.hzs.common.domain.sale.deliver.SaDeliverItems;
import com.hzs.common.domain.sale.ext.SaDeliverExt;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt; import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.sale.order.SaOrderItems; import com.hzs.common.domain.sale.order.SaOrderItems;
import com.hzs.common.util.TransactionUtils; import com.hzs.common.util.TransactionUtils;
@ -32,7 +31,6 @@ import com.hzs.system.base.IBarCodeServiceApi;
import com.hzs.system.sys.dto.LoginUser; import com.hzs.system.sys.dto.LoginUser;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference; import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -43,9 +41,6 @@ import java.util.stream.Collectors;
/** /**
* 销售订单-发货单 服务实现类 * 销售订单-发货单 服务实现类
*
* @author hzs
* @since 2022-08-31
*/ */
@Slf4j @Slf4j
@Service @Service
@ -235,11 +230,6 @@ public class SaDeliverServiceImpl extends ServiceImpl<SaDeliverMapper, SaDeliver
return saDeliverItemsMapper.queryDeliverHandledList(param, pkCountry); return saDeliverItemsMapper.queryDeliverHandledList(param, pkCountry);
} }
@Override
public List<String> deliverPrintCheck(List<Long> idList, Integer pkCountry) {
return baseMapper.deliverPrintCheck(idList, pkCountry);
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public List<DeliverPrintVO> deliverPrint(List<Long> idList, Integer pkCountry, Long userId) { public List<DeliverPrintVO> deliverPrint(List<Long> idList, Integer pkCountry, Long userId) {
@ -516,11 +506,6 @@ public class SaDeliverServiceImpl extends ServiceImpl<SaDeliverMapper, SaDeliver
return baseMapper.queryListById(idList, pkCountry); return baseMapper.queryListById(idList, pkCountry);
} }
@Override
public List<SaDeliverExt> queryDeliverAndItemsList(List<Long> idList, Integer pkCountry) {
return baseMapper.queryDeliverAndItemsList(idList, pkCountry);
}
@Override @Override
public int getBatchMaxNumber(Integer dayBatch) { public int getBatchMaxNumber(Integer dayBatch) {
return baseMapper.getBatchMaxNumber(dayBatch); return baseMapper.getBatchMaxNumber(dayBatch);

View File

@ -9,23 +9,12 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description:
* @Author: sui q
* @Time: 2022/10/25 13:47
* @Classname: SaleApprovalBusiness
* @PackageName: com.hzs.sale.pub.provider
*/
@Slf4j @Slf4j
@DubboService @DubboService
public class SaleApprovalBusinessProvider implements ISaleApprovalServiceApi { public class SaleApprovalBusinessProvider implements ISaleApprovalServiceApi {
private ISaleApprovalBusiness saleApprovalBusiness;
@Autowired @Autowired
public void setSaleApprovalBusiness(ISaleApprovalBusiness saleApprovalBusiness) { private ISaleApprovalBusiness saleApprovalBusiness;
this.saleApprovalBusiness = saleApprovalBusiness;
}
@Override @Override
public R<Boolean> approvalCallback(ApprovalBusinessResultDTO approvalBusinessResultDTO) { public R<Boolean> approvalCallback(ApprovalBusinessResultDTO approvalBusinessResultDTO) {

View File

@ -65,29 +65,6 @@
</collection> </collection>
</resultMap> </resultMap>
<!-- 出货单打印校验 -->
<select id="deliverPrintCheck" resultType="string">
select sd.deliver_code
from (select sdi.pk_deliver
from SA_DELIVER_ITEMS sdi
inner join BD_PRODUCT_EXTEND bpe
on bpe.pk_product = sdi.pk_product
and bpe.is_bar_code = 0
left join sa_deliver_bar_code sdbc
on sdbc.pk_deliver_items = sdi.pk_id
and sdbc.del_flag = 0
where sdi.del_flag = 0
and sdi.pk_country = #{pkCountry}
and sdi.pk_deliver in
<foreach collection="idList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
group by sdi.pk_deliver
having sum(sdi.quantity) > count(sdbc.pk_id)) sdi
inner join SA_DELIVER sd
on sd.pk_id = sdi.pk_deliver
</select>
<!-- 出货单打印列表 --> <!-- 出货单打印列表 -->
<select id="deliverPrintList" resultMap="deliverPrintMap"> <select id="deliverPrintList" resultMap="deliverPrintMap">
select sd.deliver_code, select sd.deliver_code,
@ -547,41 +524,6 @@
order by sd.pk_id desc order by sd.pk_id desc
</select> </select>
<!-- 查询发货单+明细列表 -->
<select id="queryDeliverAndItemsList" resultMap="deliverExtMap">
select sd.*,
sdi.pk_id ITEMS_ID,
sdi.pk_order,
sdi.pk_order_items,
sdi.pk_product,
sdi.quantity,
sdi.pk_wares_specs_sku,
sdi.pk_wares_detail,
sdi.exchange_Goods,
sdi.specs_name,
sdi.specs_name_id
from sa_deliver sd
left join sa_deliver_items sdi
on sdi.pk_deliver = sd.pk_id
and sdi.del_flag = 0
where sd.del_flag = 0
<if test="pkCountry != null">
and sd.pk_country = #{pkCountry}
</if>
and (sd.pk_id in
<foreach collection="idList" item="item" index="index" open="(" close=")">
<if test="index != 0">
<choose>
<when test="index % 500 == 0">) or sd.pk_id IN (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{item}
</foreach>
)
order by sd.pk_id
</select>
<!-- 获取指定日期最大批次 --> <!-- 获取指定日期最大批次 -->
<select id="getMaxBatch" resultType="integer"> <select id="getMaxBatch" resultType="integer">
select nvl(max(sd.day_batch), 0) last_day_batch select nvl(max(sd.day_batch), 0) last_day_batch

View File

@ -2,11 +2,9 @@ package com.hzs.scm.sale.controller.manage;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil;
import com.hzs.common.core.annotation.Log; import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.MemberMsgConstants; import com.hzs.common.core.constant.msg.MemberMsgConstants;
import com.hzs.common.core.constant.msg.ScmMsgConstants; import com.hzs.common.core.constant.msg.ScmMsgConstants;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.enums.*; import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.poi.ExcelUtil; import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.domain.AjaxResult; import com.hzs.common.core.web.domain.AjaxResult;
@ -15,13 +13,9 @@ import com.hzs.common.domain.sale.ext.SaDeliverExt;
import com.hzs.common.domain.scm.sale.IcDelSaleLog; import com.hzs.common.domain.scm.sale.IcDelSaleLog;
import com.hzs.common.domain.scm.sale.ext.IcSaleoutBExt; import com.hzs.common.domain.scm.sale.ext.IcSaleoutBExt;
import com.hzs.common.domain.scm.sale.ext.IcSaleoutHExt; import com.hzs.common.domain.scm.sale.ext.IcSaleoutHExt;
import com.hzs.common.security.service.UserTokenService;
import com.hzs.common.security.utils.SecurityUtils; import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils; import com.hzs.common.util.TransactionUtils;
import com.hzs.sale.deliver.ISaDeliverServiceApi;
import com.hzs.scm.pub.controller.ScmController; import com.hzs.scm.pub.controller.ScmController;
import com.hzs.scm.pub.dto.DeliverDTO;
import com.hzs.scm.pub.service.IScmOrderApproveLogService;
import com.hzs.scm.sale.param.SaleOutParam; import com.hzs.scm.sale.param.SaleOutParam;
import com.hzs.scm.sale.service.IIcDelSaleLogService; import com.hzs.scm.sale.service.IIcDelSaleLogService;
import com.hzs.scm.sale.service.IIcSaleoutHService; import com.hzs.scm.sale.service.IIcSaleoutHService;
@ -29,7 +23,6 @@ import com.hzs.scm.sale.vo.SaleOutBVO;
import com.hzs.scm.sale.vo.SaleOutBackExcelVO; import com.hzs.scm.sale.vo.SaleOutBackExcelVO;
import com.hzs.scm.sale.vo.SaleOutExcelVO; import com.hzs.scm.sale.vo.SaleOutExcelVO;
import com.hzs.scm.sale.vo.SaleOutHVO; import com.hzs.scm.sale.vo.SaleOutHVO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -42,17 +35,11 @@ import java.util.List;
/** /**
* 销售出库单表头 前端控制器 * 销售出库单表头 前端控制器
*
* @author hzs
* @since 2023-11-29
*/ */
@RestController @RestController
@RequestMapping("/manage/sale-out") @RequestMapping("/manage/sale-out")
public class IcSaleoutHController extends ScmController { public class IcSaleoutHController extends ScmController {
@DubboReference
ISaDeliverServiceApi iSaDeliverServiceApi;
@Autowired @Autowired
private IIcSaleoutHService saleOutService; private IIcSaleoutHService saleOutService;
@Autowired @Autowired
@ -167,40 +154,6 @@ public class IcSaleoutHController extends ScmController {
return AjaxResult.success(); return AjaxResult.success();
} }
/**
* 发货单生成销售出库单用于重新发货
*
* @param deliverDTO
*/
@PostMapping("/send")
public AjaxResult sendDeliver(@RequestBody DeliverDTO deliverDTO) {
// 查询发货单及明细数据
R<List<SaDeliverExt>> r = iSaDeliverServiceApi.queryDeliverList(deliverDTO.getDeliverIdList(), SecurityUtils.getPkCountry());
if (r.isSuccess()) {
List<SaDeliverExt> saDeliverExtList = r.getData();
for (SaDeliverExt deliverExt : saDeliverExtList) {
IcDelSaleLog icDelSaleLog = IcDelSaleLog.builder()
.acceptParam(JSONUtil.toJsonStr(deliverExt))
.sourceCode(deliverExt.getDeliverCode())
.successStatus(EYesNo.YES.getIntValue())
.build();
icDelSaleLog.setPkCreator(deliverExt.getPkCreator());
icDelSaleLog.setPkCountry(deliverExt.getPkCountry());
try {
saleOutService.executeDeliverTransSaleOutByParam(deliverExt);
} catch (Exception e) {
icDelSaleLog.setErrorMsg(e.getMessage());
icDelSaleLog.setSuccessStatus(EYesNo.NO.getIntValue());
// throw new RuntimeException(e);
} finally {
// 记录日志
delSaleLogService.save(icDelSaleLog);
}
}
}
return AjaxResult.success();
}
/** /**
* 查询列表 * 查询列表
* *

View File

@ -7,12 +7,7 @@ import lombok.EqualsAndHashCode;
import java.util.List; import java.util.List;
/** /**
* @description: 发货单主表扩展类 * 发货单主表扩展类
* @author: sui q
* @time: 2023/11/29 16:56
* @classname: SaDeliverExt
* @package_name: com.hzs.common.domain.sale.ext
* version 1.0.0
*/ */
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data