## 乐学去掉进销存;去掉企业相关维护;添加支付特殊账号;

This commit is contained in:
cabbage 2025-07-11 09:27:31 +08:00
parent 3a2464aa5c
commit 16539ae0fb
491 changed files with 16 additions and 39821 deletions

View File

@ -6,7 +6,6 @@
bd-api-bonus -- 奖金服务接口以及RPC传输数据DTO实体
bd-api-member -- 会员服务接口以及RPC传输数据DTO实体
bd-api-report -- 报表服务接口以及RPC传输数据DTO实体
bd-api-sale -- 销售、供应链服务接口以及RPC传输数据DTO实体
bd-api-system -- 系统基础服务接口以及RPC传输数据DTO实体
bd-api-third -- 三方服务接口以及RPC传输数据DTO实体
@ -17,7 +16,6 @@
bd-business-report -- 报表服务(统计分析、仪表盘等) 8097
bd-business-sale -- 销售服务(订单、商品、邮费、仓库进销存等) 8093
bd-business-system -- 系统基础服务(基础配置、自定义配置等) 8091
bd-business-scm -- 进销存服务(进销存功能等) 8099
### bd-common基础公用组件
bd-common-core -- 核心公用组件、缓存操作等

View File

@ -21,11 +21,4 @@ public interface IMemberJobServiceApi {
*/
R<?> deleteAccountDetailByMonth();
/**
* 自动提现
*
* @return
*/
R<?> automaticWithdrawal();
}

View File

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.bd</groupId>
<artifactId>bd-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>bd-api-scm</artifactId>
<description>
bd-api-scm进销存服务
</description>
<dependencies>
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-api-system</artifactId>
</dependency>
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-common-domain</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,17 +0,0 @@
package com.hzs.scm.product;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.sale.product.BdProductBas;
import com.hzs.scm.product.dto.ProductBasDTO;
import java.util.List;
public interface IProductBasServiceApi {
/**
* 根据id 查询
* @return
*/
R<ProductBasDTO> getProductBasById(Integer pkId);
}

View File

@ -1,90 +0,0 @@
package com.hzs.scm.product.dto;/**
* @Description:
* @Author: yuhui
* @Time: 2023/11/23 18:04
* @Classname: ProductDTO
* @PackageName: com.hzs.scm.product.provider.dto
*/
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.provider.dto
*@Author: yh
*@CreateTime: 2023-11-23 18:04
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ProductBasDTO implements Serializable {
/**
* 主键
*/
private Integer pkId;
/**
* 产品编号
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 规格分类
*/
private Integer pkClassify;
/**
* 单位 来源于枚举单位
*/
private Integer unit;
/**
* 重量 以千克作为单位
*/
private BigDecimal weight;
/**
* 以厘米作为单位
*/
private BigDecimal length;
/**
* 以厘米作为单位
*/
private BigDecimal width;
/**
* 以厘米作为单位
*/
private BigDecimal height;
/**
* 封面图
*/
private String cover;
/**
* 保质期
*/
private Integer shelfLife;
}

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

@ -1,25 +0,0 @@
package com.hzs.system.config;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import java.util.List;
/**
* @description: 根据国家查询自动提现明细api
* @author: zhang jing
* @date: 2022/9/27 15:15
* @param:
* @return:
**/
public interface IWithdrawalAutoServiceApi {
/**
* @description:根据国家查询自动提现明细列表
* @author: zhang jing
* @date: 2022/9/27 15:20
* @param: [pkCountry]
* @return: com.hzs.common.core.domain.R<java.util.List<com.hzs.common.domain.system.config.BdWithdrawalAuto>>
**/
R<List<BdWithdrawalAuto>> queryWithdrawalAuto(Integer pkCountry);
}

View File

@ -3,8 +3,6 @@ package com.hzs.system.config;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdWithdrawal;
import java.util.List;
/**
* 根据国家查询提现配置明细列表api
**/
@ -15,8 +13,4 @@ public interface IWithdrawalServiceApi {
**/
R<BdWithdrawal> queryWithdrawal(Integer pkCountry, Integer pkAccount);
/**
* 查询所有自动提现的配置
**/
R<List<BdWithdrawal>> queryWithdrawalByIsAuto();
}

View File

@ -34,7 +34,6 @@
<module>bd-api-sale</module>
<module>bd-api-system</module>
<module>bd-api-third</module>
<module>bd-api-scm</module>
</modules>
</project>

View File

@ -292,12 +292,6 @@ public class ApiCuMemberWithdrawController extends BaseController {
return balance;
}
@PostMapping("/auto")
public AjaxResult autoWithdrawInfo() {
iCuMemberWithdrawService.autoWithdraw();
return AjaxResult.success();
}
/**
* 是否为整数值
*

View File

@ -3,7 +3,6 @@ package com.hzs.member.account.provider;
import com.hzs.common.core.domain.R;
import com.hzs.member.account.IMemberJobServiceApi;
import com.hzs.member.account.service.ICuMemberAccountDetailService;
import com.hzs.member.account.service.ICuMemberWithdrawService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,8 +16,6 @@ public class IMemberJobServiceProvider implements IMemberJobServiceApi {
@Autowired
private ICuMemberAccountDetailService iCuMemberAccountDetailService;
@Autowired
private ICuMemberWithdrawService iCuMemberWithdrawService;
@Override
public R<?> insertAccountDetail() {
@ -42,15 +39,4 @@ public class IMemberJobServiceProvider implements IMemberJobServiceApi {
return R.ok();
}
@Override
public R<?> automaticWithdrawal() {
try {
iCuMemberWithdrawService.autoWithdraw();
} catch (Exception e) {
log.info("自动提现报错:", e);
return R.fail(e.getMessage());
}
return R.ok();
}
}

View File

@ -119,11 +119,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/
BigDecimal computeRounding(BdWithdrawal bdWithdrawal, BigDecimal cashAmount);
/**
* 自动提现
*/
void autoWithdraw();
/**
* 获取账户余额
*

View File

@ -17,8 +17,6 @@ import com.hzs.common.domain.member.account.CuMemberAccount;
import com.hzs.common.domain.member.account.CuMemberTrade;
import com.hzs.common.domain.member.account.CuMemberWithdraw;
import com.hzs.common.domain.member.account.CuMemberWithdrawExt;
import com.hzs.common.domain.member.base.CuMember;
import com.hzs.common.domain.member.ext.CuMemberAccountExt;
import com.hzs.common.domain.system.config.*;
import com.hzs.common.domain.system.config.ext.BdWithdrawalTaxExt;
import com.hzs.common.security.utils.SecurityUtils;
@ -28,15 +26,11 @@ import com.hzs.member.account.dto.MemberAccountAudit;
import com.hzs.member.account.mapper.CuMemberWithdrawMapper;
import com.hzs.member.account.param.CuMemberWithdrawRejectParam;
import com.hzs.member.account.service.*;
import com.hzs.member.account.vo.CuMemberBankVO;
import com.hzs.member.account.vo.CuMemberPetitionVO;
import com.hzs.member.account.vo.CuMemberTradeVO;
import com.hzs.member.account.vo.CuMemberWithdrawVO;
import com.hzs.member.base.service.ICuMemberService;
import com.hzs.system.base.dto.CurrencyDTO;
import com.hzs.system.config.IWithdrawalAutoServiceApi;
import com.hzs.system.config.IWithdrawalProcessServiceApi;
import com.hzs.system.config.IWithdrawalServiceApi;
import com.hzs.system.config.IWithdrawalTaxServiceApi;
import com.hzs.system.sys.IApprovalServiceApi;
import com.hzs.system.sys.dto.ApprovalSubmitDTO;
@ -50,9 +44,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@ -70,19 +61,11 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@Autowired
private ICuMemberBaseService iCuMemberBaseService;
@Autowired
private ICuMemberBankService iCuMemberBankService;
@Autowired
private ICuMemberService iCuMemberService;
@Autowired
private ICuMemberTradeService cuMemberTradeService;
@DubboReference
IWithdrawalTaxServiceApi iWithdrawalTaxServiceApi;
@DubboReference
IWithdrawalAutoServiceApi iWithdrawalAutoServiceApi;
@DubboReference
IWithdrawalServiceApi iWithdrawalServiceApi;
@DubboReference
IWithdrawalProcessServiceApi iWithdrawalProcessServiceApi;
@DubboReference
IApprovalServiceApi iApprovalServiceApi;
@ -310,116 +293,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return row;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void autoWithdraw() {
//查询自动配置的信息
List<BdWithdrawal> withdrawalConfigs = iWithdrawalServiceApi.queryWithdrawalByIsAuto().getData();
if (CollUtil.isNotEmpty(withdrawalConfigs)) {
for (BdWithdrawal withdrawal : withdrawalConfigs) {
Integer pkCountry = withdrawal.getPkCountry();
if (Boolean.TRUE.equals(isWithdrawalCycle(pkCountry))) {
//查询提现到的币种
List<BdAccount> bdAccounts = iCuMemberBaseService.getAccountByCountry(EAccountProperty.IS_WITHDRAWAL.getValue(), pkCountry);
Integer accountsType = bdAccounts.get(0).getFieldValue();
//查询会员币种余额锁定金额
List<CuMemberAccountExt> cuMemberAccountExts = iCuMemberAccountService.queryMemberAccountByPkcountry(pkCountry);
memberWithDrawal(withdrawal, cuMemberAccountExts, bdAccounts, accountsType, pkCountry);
}
}
}
}
/**
* 会员提现
*
* @param withdrawal 提现配置信息
* @param cuMemberAccountExts 会员币种表
* @param bdAccounts 币种信息
* @param accountsType 配置的提现币种
* @param pkCountry 国家ID
*/
public void memberWithDrawal(BdWithdrawal withdrawal, List<CuMemberAccountExt> cuMemberAccountExts, List<BdAccount> bdAccounts, Integer accountsType, Integer pkCountry) {
//会员ID 银行卡ID
Long pkMember;
Long pkBank;
//余额 锁定金额
BigDecimal balance;
//最高自动提现金额
BigDecimal upperBound = withdrawal.getUpperBound();
//最低自动提现金额
BigDecimal lowerBound = withdrawal.getLowerBound();
//配置文件中的提现次数
Integer withdrawalNumber = withdrawal.getWithdrawalNumber();
if (CollUtil.isNotEmpty(cuMemberAccountExts)) {
//查询每个会员正在参与审核的次数
List<CuMemberWithdrawExt> withdrawTimesByPkCountry = baseMapper.getWithdrawTimesByPkCountry(pkCountry);
Map<Long, Integer> withdrawTimes = withdrawTimesByPkCountry.stream().collect(Collectors.toMap(CuMemberWithdrawExt::getPkMember, CuMemberWithdrawExt::getTimes));
//汇率
CurrencyDTO currencyDTO = iCuMemberBaseService.getCurrency(pkCountry);
for (CuMemberAccountExt cuMemberAccountExt : cuMemberAccountExts) {
pkBank = cuMemberAccountExt.getPkBank();
//是否绑定银行卡
CuMemberBankVO memberBank = iCuMemberBankService.selectCuMemberBankById(pkBank);
if (null != memberBank) {
pkMember = cuMemberAccountExt.getPkMember();
//获取余额
balance = getAvailableBalance(accountsType, cuMemberAccountExt);
//是否取整
balance = computeRounding(withdrawal, balance);
// 提现金额在配置金额之间
if (balance.compareTo(lowerBound) > 0 && balance.compareTo(upperBound) < 0) {
int times = withdrawTimes.get(pkMember) == null ? 0 : withdrawTimes.get(pkMember);
//比较正在提现次数与配置的最大提现次数
if (times <= withdrawalNumber) {
//本次应缴个税
BigDecimal payIncomeTax = computeIncomeTaxValue(pkMember, balance, pkCountry, lowerBound);
//手续费金额
BigDecimal serviceChargeAmount = computeServiceCharge(pkCountry, balance);
BigDecimal issuedAmount = balance.subtract(payIncomeTax).subtract(serviceChargeAmount);
String code = CommonUtil.createSerialNumber(EOrderPrefix.WITHDRAWAL_CODE.getValue());
CuMember member = iCuMemberService.getMember(pkMember);
String remarks = member.getMemberCode() + "自动申请提现" + balance;
CuMemberWithdraw cuMemberWithdraw = CuMemberWithdraw.builder().pkMember(pkMember)
.pkAccount(bdAccounts.get(0).getPkId()).pkBank(pkBank)
.pkRate(currencyDTO.getPkId()).cashAmount(balance)
.serviceCharge(serviceChargeAmount).incomeTax(payIncomeTax)
.issuedAmount(issuedAmount).withdrawCode(code).remarks(remarks).build();
cuMemberWithdraw.setApproveState(EApproveStatus.WAIT_SUBMIT.getValue());
cuMemberWithdraw.setDelFlag(EDelFlag.UN_DELETE.getValue());
cuMemberWithdraw.setPkCountry(pkCountry);
cuMemberWithdraw.setPkCreator(pkMember);
//保存提现交易流水余额信息
baseMapper.insert(cuMemberWithdraw);
this.updateTradeAndBalancd(cuMemberWithdraw, EOperationMethod.INSERT);
}
}
}
}
}
}
/**
* 获取余额
*
* @param accountsType 账户值
* @param cuMemberAccount 账户信息
* @return BigDecimal
*/
private BigDecimal getAvailableBalance(Integer accountsType, CuMemberAccount cuMemberAccount) {
//账户余额
BigDecimal accountBalance = getAccountBalance(accountsType, cuMemberAccount);
//可提现账户余额
BigDecimal withdrawBalance = ReflectUtils.invokeGetter(cuMemberAccount, MemberFieldConstants.WITHDRAW_ACCOUNT + accountsType);
withdrawBalance = withdrawBalance == null ? BigDecimal.ZERO : withdrawBalance;
BigDecimal lockAccount = ReflectUtils.invokeGetter(cuMemberAccount, MemberFieldConstants.LOCK_WITHDRAW_ACCOUNT + accountsType);
if (null != lockAccount && lockAccount.compareTo(BigDecimal.ZERO) > 0) {
withdrawBalance = withdrawBalance.subtract(lockAccount);
}
//取最小余额
return accountBalance.compareTo(withdrawBalance) < 0 ? accountBalance : withdrawBalance;
}
/**
* 获取账户余额
*
@ -441,28 +314,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return account.subtract(lockConsume).subtract(lockTransfer);
}
/**
* 查询自动提现的时间
*
* @param pkCountry 国家
* @return Boolean
*/
public Boolean isWithdrawalCycle(Integer pkCountry) {
//当前时间位于星期的第几天
LocalDate localDate = LocalDate.now();
DayOfWeek dayOfWeek = localDate.getDayOfWeek();
Integer dayOfWeekNum = dayOfWeek.getValue();
//自动提现配置的提现周期
List<BdWithdrawalAuto> listR = iWithdrawalAutoServiceApi.queryWithdrawalAuto(pkCountry).getData();
for (BdWithdrawalAuto withdrawalAuto : listR) {
Integer withdrawalCycle = withdrawalAuto.getWithdrawalCycle();
if (dayOfWeekNum.equals(withdrawalCycle)) {
return true;
}
}
return false;
}
@Override
public BigDecimal getBalance(Long pkMember, Integer pkCountry, Integer accountsType) {
//提现账户
@ -733,13 +584,13 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@Override
public void withdrawReject(CuMemberWithdrawRejectParam param) {
if(ObjectUtil.isEmpty(param)){
if (ObjectUtil.isEmpty(param)) {
throw new ServiceException("参数异常!");
}
if(CollUtil.isEmpty(param.getIdList())){
if (CollUtil.isEmpty(param.getIdList())) {
throw new ServiceException("请选择需要驳回的数据!");
}
if(StrUtil.isEmpty(param.getRejectRemark())){
if (StrUtil.isEmpty(param.getRejectRemark())) {
throw new ServiceException("请录入驳回原因!");
}
LambdaQueryWrapper<CuMemberWithdraw> wrapper = new LambdaQueryWrapper<>();
@ -752,7 +603,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
baseMapper.update(withdraw, wrapper);
List<CuMemberWithdraw> cuMemberWithdrawList = baseMapper.selectList(wrapper);
Integer pkCountry = SecurityUtils.getPkCountry();
if(CollUtil.isNotEmpty(cuMemberWithdrawList)){
if (CollUtil.isNotEmpty(cuMemberWithdrawList)) {
for (CuMemberWithdraw cuMemberWithdraw : cuMemberWithdrawList) {
BusinessCommissionDTO businessCommissionDTO = BusinessCommissionDTO.builder()
.tradeCode(cuMemberWithdraw.getWithdrawCode()).pkCountry(pkCountry)

View File

@ -315,16 +315,6 @@ public interface ICuMemberService extends IService<CuMember> {
**/
boolean upExpireStopProcess(ApprovalBusinessResultDTO approvalBusinessResultDTO);
/**
* @description: 零元撤单业务
**/
ZeroElementRevokeVO zeroRevokeBusiness(ZeroElementRevokeVO zeroElementRevokeVO);
/**
* @description: 发起签呈-零元撤单
**/
ZeroElementRevokeVO zeroPetition(ZeroElementRevokeVO zeroElementRevokeVO);
/**
* @description: 发起签呈-修改会员编号
**/

View File

@ -50,7 +50,6 @@ import com.hzs.member.marketnews.param.MarketNewsParam;
import com.hzs.member.marketnews.vo.UserInvestmentVo;
import com.hzs.system.base.ICountryServiceApi;
import com.hzs.system.base.ICurrencyServiceApi;
import com.hzs.system.base.ISystemConfigServiceApi;
import com.hzs.system.base.dto.CountryDTO;
import com.hzs.system.base.dto.CurrencyDTO;
import com.hzs.system.config.IAwardsServiceApi;
@ -600,154 +599,6 @@ public class CuMemberServiceImpl extends ServiceImpl<CuMemberMapper, CuMember> i
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public ZeroElementRevokeVO zeroRevokeBusiness(ZeroElementRevokeVO zero) {
//业务单号
String code = CommonUtil.createSerialNumber(EOrderPrefix.HANDLE_BUSINESS.getValue());
zero.setApprovalBusiness(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue());
// 封装修改结算国业务日志
List<BusinessLogDTO> dtoList = new ArrayList<>();
for (ZeroElementRevokeVO zo : zero.getZeroVOList()) {
//添加修改记录表数据
CuMemberServiceLog memberLog = new CuMemberServiceLog();
memberLog.setPkMember(zo.getPkId());
memberLog.setEditType(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue());
memberLog.setEditTypePay(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue());
memberLog.setOldValue(JSONObject.toJSONString(zo));
memberLog.setNewValue(JSONObject.toJSONString(zo));
memberLog.setPkCreator(zero.getPkCreator());
memberLog.setCreationTime(zero.getCreationTime());
memberLog.setBusinessNo(code);
memberLog.setPkCountry(zero.getPkCountry());
memberLog.setProcessType(zero.getProcessType());
memberLog.setApproveNumber(zo.getChangeNumber());
//免签呈;免签呈免支付
if (zero.getProcessType() == EProcessType.AVOIDSIGNING.getValue()
|| zero.getProcessType() == EProcessType.DOUBLEAVOID.getValue()) {
//添加修改记录表数据
memberLog.setApproveStatus(EApproveStatus.FINISH.getValue());
iCuMemberServiceLogService.save(memberLog);
//校验会员是否存在推荐或安置
CuMember member = new CuMember();
member.setPkId(zo.getPkId());
member.setPkModified(zero.getPkCreator());
member.setModifiedTime(zero.getCreationTime());
if (this.checkLowerMember(zo.getPkId())) {
//设为死点
member.setCategory(ECategory.DEAD_POINT.getValue());
baseMapper.updateById(member);
} else {
//删除
LambdaUpdateWrapper<CuMember> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(CuMember::getMemberCode, CommonUtil.deleteMemberCode(zo.getMemberCode()));
updateWrapper.set(CuMember::getDelFlag, EDelFlag.DELETE.getValue());
updateWrapper.set(CuMember::getModifiedTime, zero.getCreationTime());
updateWrapper.set(CuMember::getPkModified, zero.getPkCreator());
updateWrapper.eq(CuMember::getPkId, zo.getPkId());
baseMapper.update(null, updateWrapper);
}
}
//组装日志数据
BusinessLogDTO businessLog = BusinessLogDTO.builder()
.businessType(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue())
.businessCode(code)
.pkMember(zo.getPkId())
.content(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getLabel() + ":撤单后会员编号 " + CommonUtil.deleteMemberCode(zo.getMemberCode()))
.pkCreator(zero.getPkCreator())
.pkCountry(zero.getPkCountry())
.freeSignFlag(true).build();
dtoList.add(businessLog);
}
//扣钱
if (zero.getProcessType().equals(EProcessType.AVOIDSIGNING.getValue())) {
BusinessCommissionDTO businessCommissionDTO = new BusinessCommissionDTO();
businessCommissionDTO.setPkCountry(zero.getPkCountry());
businessCommissionDTO.setMemberAmountDTOList(zero.getMemberAmountDTOList());
businessCommissionDTO.setTradeType(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue());
businessCommissionDTO.setPkAccount(zero.getZeroVOList().get(0).getPkAccount());
Boolean b = iCuMemberTradeService.businessCommissionSubmit(businessCommissionDTO);
if (!b) {
throw new ServiceException(TransactionUtils.getContent(ConfigMsgConstants.ZERO_ELEMENT_REVOKE_MONEY));
}
}
//发送MQ到操作日志
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY,
dtoList);
return zero;
}
@Override
@Transactional(rollbackFor = Exception.class)
public ZeroElementRevokeVO zeroPetition(ZeroElementRevokeVO zeroElementRevokeVO) {
//业务单号
String code = CommonUtil.createSerialNumber(EOrderPrefix.HANDLE_BUSINESS.getValue());
// 封装修改结算国业务日志
List<BusinessLogDTO> dtoList = new ArrayList<>();
LoginUser loginUser = userTokenService.getLoginUser();
for (ZeroElementRevokeVO zero : zeroElementRevokeVO.getZeroVOList()) {
//审核通过 修改审核状态,累加修改次数
CuMemberServiceLog memberLog = new CuMemberServiceLog();
memberLog.setPkMember(zero.getPkId());
memberLog.setPkCreator(zeroElementRevokeVO.getPkCreator());
memberLog.setCreationTime(zeroElementRevokeVO.getCreationTime());
memberLog.setPkCountry(zeroElementRevokeVO.getPkCountry());
memberLog.setApproveStatus(EApproveStatus.ALREADY_SUBMIT.getValue());
memberLog.setBusinessNo(code);
memberLog.setEditType(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue());
memberLog.setEditTypePay(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue());
memberLog.setOldValue(JSONObject.toJSONString(zero));
memberLog.setNewValue(JSONObject.toJSONString(zero));
memberLog.setApproveNumber(zero.getChangeNumber());
memberLog.setSingleAmount(zero.getCost());
memberLog.setProcessType(zero.getProcessType());
iCuMemberServiceLogService.save(memberLog);
//组装日志数据
BusinessLogDTO businessLog = BusinessLogDTO.builder()
.businessType(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue())
.businessCode(code)
.pkMember(zero.getPkId())
.content(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getLabel() + ":撤单后会员编号 " + CommonUtil.deleteMemberCode(zero.getMemberCode()))
.pkCreator(zeroElementRevokeVO.getPkCreator())
.pkCountry(zeroElementRevokeVO.getPkCountry())
.freeSignFlag(false).build();
dtoList.add(businessLog);
}
//生成签呈
ApprovalSubmitDTO approvalSubmitDTO = ApprovalSubmitDTO.builder().eApprovalBusiness(EApprovalBusiness.ZERO_ELEMENT_REVOKE)
.businessCode(code)
.signType(ESignType.getEnumByValue(zeroElementRevokeVO.getSignType()))
.remark(zeroElementRevokeVO.getRemark())
.pkMemberList(zeroElementRevokeVO.getPkMemberList())
.userIdList(zeroElementRevokeVO.getUserIdList())
.sendIdList(zeroElementRevokeVO.getSendIdList())
.fileList(zeroElementRevokeVO.getFileList())
.build();
R<String> submit = iApprovalServiceApi.submit(approvalSubmitDTO, loginUser);
if (!submit.isSuccess()) {
log.error("====" + submit.getData());
throw new RuntimeException(ConfigMsgConstants.ZERO_ELEMENT_REVOKE_PETITION);
}
//扣钱
if (zeroElementRevokeVO.getProcessType() == EProcessType.DOUBLEPAY.getValue()) {
BusinessCommissionDTO businessCommissionDTO = new BusinessCommissionDTO();
businessCommissionDTO.setTradeCode(code);
businessCommissionDTO.setPkCountry(zeroElementRevokeVO.getPkCountry());
businessCommissionDTO.setPkAccount(zeroElementRevokeVO.getZeroVOList().get(0).getPkAccount());
businessCommissionDTO.setMemberAmountDTOList(zeroElementRevokeVO.getMemberAmountDTOList());
businessCommissionDTO.setTradeType(EApprovalBusiness.ZERO_ELEMENT_REVOKE.getValue());
Boolean b = iCuMemberTradeService.businessCommissionSubmit(businessCommissionDTO);
if (!b) {
throw new ServiceException(TransactionUtils.getContent(ConfigMsgConstants.ZERO_ELEMENT_REVOKE_MONEY));
}
}
//发送MQ到操作日志
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY,
dtoList);
return zeroElementRevokeVO;
}
/**
* @description: 发起签呈-修改会员编号
**/

View File

@ -46,11 +46,6 @@
<groupId>com.bd</groupId>
<artifactId>bd-api-bonus</artifactId>
</dependency>
<!-- scm 服务 -->
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-api-scm</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.hzs.common.core.constant.MemberFieldConstants;
import com.hzs.common.core.constant.RabbitMqConstants;
import com.hzs.common.core.constant.msg.CommonMsgConstants;
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
import com.hzs.common.core.constant.msg.DocumentMsgConstants;
@ -43,7 +42,6 @@ import com.hzs.sale.order.service.*;
import com.hzs.sale.pub.dto.SecondAccountDTO;
import com.hzs.sale.pub.dto.SecondDTO;
import com.hzs.sale.pub.dto.SecondProductDTO;
import com.hzs.scm.pub.dto.DeliverDTO;
import com.hzs.system.base.IBarCodeServiceApi;
import com.hzs.system.base.ICurrencyServiceApi;
import com.hzs.system.base.dto.BarCodeUseDTO;
@ -55,7 +53,6 @@ import com.hzs.system.sys.dto.ApprovalSubmitDTO;
import com.hzs.system.sys.dto.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -66,11 +63,7 @@ import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: 发货单业务服务
* @Author: jiang chao
* @Time: 2023/3/24 17:32
* @Classname: SaDeliverBusinessServiceImpl
* @PackageName: com.hzs.sale.deliver.service.impl
* 发货单业务服务
*/
@Slf4j
@Service

View File

@ -2,7 +2,6 @@ package com.hzs.sale.order.param;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hzs.common.core.constant.msg.MemberMsgConstants;
import com.hzs.common.domain.scm.ic.ext.IcAvailableNumExt;
import com.hzs.sale.shopping.vo.ShoppingCartRedis;
import com.hzs.sale.ticket.param.BuyTicketParam;
import jdk.nashorn.internal.ir.annotations.Ignore;
@ -290,11 +289,6 @@ public class OrderParam implements Serializable {
*/
private List<OrderItemsParam> orderItemsParams;
/**
* 用于下单时更新可用量
*/
private List<IcAvailableNumExt> availableNumList;
/**
* 是否首单
*/

View File

@ -32,8 +32,6 @@ import com.hzs.sale.product.vo.ProductSpecsVo;
import com.hzs.sale.product.vo.ProductVo;
import com.hzs.sale.product.vo.SupplierProductCensusVo;
import com.hzs.sale.wares.service.IBdWaresDetailService;
import com.hzs.scm.product.IProductBasServiceApi;
import com.hzs.scm.product.dto.ProductBasDTO;
import com.hzs.system.base.ISystemConfigServiceApi;
import com.hzs.system.base.dto.BdCubasdocDTO;
import com.hzs.system.sys.dto.LoginUser;
@ -71,8 +69,6 @@ public class BdProductController extends BaseController {
@DubboReference
ISystemConfigServiceApi iSystemConfigServiceApi;
@DubboReference
IProductBasServiceApi iProductBasServiceApi;
/**
* 查询商品列表
@ -514,42 +510,6 @@ public class BdProductController extends BaseController {
return AjaxResult.success(productParams);
}
/**
* 查询产品详情 根据产品基本信息主键
*
* @return
*/
@GetMapping("/product-bas-detail")
public AjaxResult productBasDetail(Integer pkProductBas) {
R<ProductBasDTO> productBas = iProductBasServiceApi.getProductBasById(pkProductBas);
BdProduct product = iBdProductService.getOne(new LambdaQueryWrapper<BdProduct>().eq(BdProduct::getPkProductBas, pkProductBas).eq(BdProduct::getPkCountry, SecurityUtils.getPkCountry()));
if (productBas.getData() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_NOT_REQUIRED));
}
ProductParams productParams = BeanUtil.copyProperties(productBas.getData(), ProductParams.class);
BdProductExtend productExtend = iBdProductExtendService.getProductExtend(product.getPkId());
productParams.setIsPickUp(productExtend.getIsPickUp());
productParams.setIsPrize(productExtend.getIsPrize());
productParams.setIsBarCode(productExtend.getIsBarCode());
productParams.setRepurchaseType(productExtend.getRepurchaseType());
productParams.setIsMerge(productExtend.getIsMerge());
productParams.setIsGift(productExtend.getIsGift());
productParams.setIsLandTrans(productExtend.getIsLandTrans());
productParams.setIsAirTrans(productExtend.getIsAirTrans());
productParams.setIsOceanTrans(productExtend.getIsOceanTrans());
productParams.setSort(productExtend.getSort());
LambdaQueryWrapper<BdProductSpecs> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdProductSpecs::getPkProduct, product.getPkId());
List<Integer> pkSpecsType = new ArrayList<>();
List<BdProductSpecs> productSpecList = iBdProductSpecsService.list(queryWrapper);
for (BdProductSpecs bdProductSpecs : productSpecList) {
pkSpecsType.add(bdProductSpecs.getPkSpecsType());
}
productParams.setPkSpecsType(pkSpecsType);
return AjaxResult.success(productParams);
}
/**
* @return
*/

View File

@ -68,7 +68,7 @@ dubbo:
payload: 10485760
cloud:
# 订阅服务
subscribed-services: bd-system, bd-member, bd-third, bd-bonus, bd-scm
subscribed-services: bd-system, bd-member, bd-third, bd-bonus
scan:
# dubbo 服务扫描包(开启之后才会对外提供服务)
base-packages: com.hzs

View File

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.bd</groupId>
<artifactId>bd-business</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>bd-business-scm</artifactId>
<description>
bd-business-scm进销存服务
</description>
<dependencies>
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-business-common</artifactId>
</dependency>
<!-- 订单服务接口 -->
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-api-sale</artifactId>
</dependency>
<!-- 进销存服务接口 -->
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-api-scm</artifactId>
</dependency>
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-common-aop</artifactId>
</dependency>
<dependency>
<groupId>com.bd</groupId>
<artifactId>bd-common-domain</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.12.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,25 +0,0 @@
package com.hzs;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.hzs.common.security.annotation.EnableCustomConfig;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 进销存服务
*
* @author hzs
*/
@EnableDiscoveryClient
@EnableCustomConfig
@SpringBootApplication
@EnableScheduling
public class ScmApplication {
public static void main(String[] args) {
SpringApplication.run(ScmApplication.class, args);
System.out.println("ScmApplication 进销存服务启动成功");
}
}

View File

@ -1,143 +0,0 @@
package com.hzs.ground.margin.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.ScmMsgConstants;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.StringUtils;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.ground.margin.ThMargin;
import com.hzs.common.security.service.UserTokenService;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.ground.margin.service.IThMarginService;
import com.hzs.ground.margin.vo.ThMarginVO;
import com.hzs.ground.product.service.IThApprovalLogService;
import com.hzs.ground.supplier.service.IThSupplierApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* 保证金缴纳 前端控制器
*
* @author hzs
* @since 2024-03-21
*/
@RestController
@RequestMapping("/manage/th-margin")
public class ThMarginController extends BaseController {
@Autowired
private IThMarginService iThMarginService;
@Autowired
private IThSupplierApplyService iThSupplierApplyService;
/**
* @description: 保证金缴纳列表
* @author: zhang jing
* @date: 2024/3/22 11:35
* @param: [thMarginVO]
* @return: com.hzs.common.core.web.page.TableDataInfo
**/
@GetMapping("/list")
@Log(module = EOperationModule.TH_SUPPLIER_APPLY, business = EOperationBusiness.TH_SUPPLIER_APPLY, method = EOperationMethod.SELECT)
public TableDataInfo listGeneralIn(ThMarginVO thMarginVO) {
Long userId = SecurityUtils.getUserId();
thMarginVO.setPkCountry(SecurityUtils.getPkCountry());
Integer checkUser = iThSupplierApplyService.queryThSupplierApplyUserList(userId);
if (checkUser > 0) {
thMarginVO.setPkCreator(userId);
}
startPage();
List<ThMarginVO> thSupplierApplyList = iThMarginService.queryThMarginList(thMarginVO);
return getDataTable(thSupplierApplyList);
}
/**
* @description: 添加保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 11:53
* @param: [thMarginVO]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@PostMapping("/save")
public AjaxResult save(@RequestBody ThMarginVO thMarginVO) {
int pkCountry = SecurityUtils.getPkCountry();
// 验证必填信息
if (StringUtils.isNull(thMarginVO.getMargin())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_MARGIN_MARGIN));
}
thMarginVO.setPkCountry(pkCountry);
thMarginVO.setPkCreator(SecurityUtils.getUserId());
thMarginVO.setCreationTime(new Date());
QueryWrapper<ThMargin> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_SUPPLIER", thMarginVO.getPkSupplier());
List thList = iThMarginService.list(queryWrapper);
if (CollectionUtil.isNotEmpty(thList)) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_MARGIN_REPEAT));
}
iThMarginService.saveThMargin(thMarginVO);
return AjaxResult.success();
}
/**
* @description: 修改保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 11:55
* @param: [thMarginVO]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@PostMapping("/update")
public AjaxResult update(@RequestBody ThMarginVO thMarginVO) {
int pkCountry = SecurityUtils.getPkCountry();
// 验证必填信息
if (StringUtils.isNull(thMarginVO.getMargin())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_MARGIN_MARGIN));
}
QueryWrapper<ThMargin> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_SUPPLIER", thMarginVO.getPkSupplier());
queryWrapper.ne("PK_ID", thMarginVO.getPkId());
List thList = iThMarginService.list(queryWrapper);
if (CollectionUtil.isNotEmpty(thList)) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_MARGIN_REPEAT));
}
thMarginVO.setPkCountry(pkCountry);
thMarginVO.setPkCreator(SecurityUtils.getUserId());
thMarginVO.setCreationTime(new Date());
iThMarginService.updateThMargin(thMarginVO);
return AjaxResult.success();
}
/**
* @description: 查询保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 13:50
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Long pkId) {
ThMargin tsa = iThMarginService.getById(pkId);
return AjaxResult.success(tsa);
}
/**
* @description: 删除保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 13:49
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) {
return AjaxResult.success(iThMarginService.delThMargin(pkId));
}
}

View File

@ -1,38 +0,0 @@
package com.hzs.ground.margin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.ground.margin.ThMargin;
import com.hzs.ground.margin.vo.ThMarginVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 保证金缴纳 Mapper 接口
* </p>
*
* @author hzs
* @since 2024-03-21
*/
public interface ThMarginMapper extends BaseMapper<ThMargin> {
/**
* @description: 保证金缴纳列表
* @author: zhang jing
* @date: 2024/3/26 11:28
* @param: [thMarginVO]
* @return: java.util.List<com.hzs.ground.margin.vo.ThMarginVO>
**/
List<ThMarginVO> queryThMarginList (ThMarginVO thMarginVO);
/**
* @description: 保证金缴纳审批查看
* @author: zhang jing
* @date: 2024/3/27 10:11
* @param: [businessCode, pkCountry]
* @return: java.util.List<com.hzs.ground.margin.vo.ThMarginVO>
**/
List<ThMarginVO> queryThMarginByCode(@Param("businessCode") String businessCode,
@Param("pkCountry") Integer pkCountry);
}

View File

@ -1,53 +0,0 @@
package com.hzs.ground.margin.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.ground.margin.ThMargin;
import com.hzs.ground.margin.vo.ThMarginVO;
import java.util.List;
/**
* 保证金缴纳 服务类
*
* @author hzs
* @since 2024-03-21
*/
public interface IThMarginService extends IService<ThMargin> {
/**
* @description: 保证金缴纳列表
* @author: zhang jing
* @date: 2024/3/22 14:51
* @param: [thMarginVO]
* @return: java.util.List<com.hzs.ground.margin.vo.ThMarginVO>
**/
List<ThMarginVO> queryThMarginList(ThMarginVO thMarginVO);
/**
* @description: 添加保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 14:46
* @param: [thMarginVO]
* @return: boolean
**/
boolean saveThMargin(ThMarginVO thMarginVO);
/**
* @description: 修改保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 14:46
* @param: [thMarginVO]
* @return: boolean
**/
boolean updateThMargin(ThMarginVO thMarginVO);
/**
* @description: 删除保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 14:46
* @param: [pkId]
* @return: boolean
**/
boolean delThMargin(Long pkId);
}

View File

@ -1,86 +0,0 @@
package com.hzs.ground.margin.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.enums.*;
import com.hzs.common.domain.ground.margin.ThMargin;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.ground.margin.mapper.ThMarginMapper;
import com.hzs.ground.margin.service.IThMarginService;
import com.hzs.ground.margin.vo.ThMarginVO;
import com.hzs.ground.product.service.IThApprovalLogService;
import com.hzs.system.sys.IApprovalServiceApi;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* 保证金缴纳 服务实现类
*
* @author hzs
* @since 2024-03-21
*/
@Service
public class ThMarginServiceImpl extends ServiceImpl<ThMarginMapper, ThMargin> implements IThMarginService {
/**
* @description: 保证金缴纳列表
* @author: zhang jing
* @date: 2024/3/22 14:47
* @param: [thMarginVO]
* @return: java.util.List<com.hzs.ground.margin.vo.ThMarginVO>
**/
@Override
public List<ThMarginVO> queryThMarginList(ThMarginVO thMarginVO) {
return baseMapper.queryThMarginList(thMarginVO);
}
/**
* @description: 添加保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 14:46
* @param: [thMarginVO]
* @return: boolean
**/
@Override
public boolean saveThMargin(ThMarginVO thMarginVO) {
ThMargin tm = BeanUtil.copyProperties(thMarginVO, ThMargin.class);
baseMapper.insert(tm);
return true;
}
/**
* @description: 修改保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 14:45
* @param: [thMarginVO]
* @return: boolean
**/
@Override
public boolean updateThMargin(ThMarginVO thMarginVO) {
ThMargin tm = BeanUtil.copyProperties(thMarginVO, ThMargin.class);
baseMapper.updateById(tm);
return true;
}
/**
* @description: 删除保证金缴纳
* @author: zhang jing
* @date: 2024/3/22 14:45
* @param: [pkId]
* @return: boolean
**/
@Override
public boolean delThMargin(Long pkId) {
UpdateWrapper<ThMargin> updateWrapper = new UpdateWrapper();
updateWrapper.eq("PK_ID", pkId);
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date());
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
baseMapper.update(null, updateWrapper);
return true;
}
}

View File

@ -1,205 +0,0 @@
package com.hzs.ground.margin.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzs.common.core.annotation.Excel;
import com.hzs.common.core.annotation.Transaction;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import com.hzs.common.core.web.domain.BaseApprovalEntity;
import com.hzs.system.sys.dto.LoginUser;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* <p>
* 保证金缴纳VO
* </p>
*
* @author hzs
* @since 2024-03-21
*/
@Data
public class ThMarginVO extends BaseApprovalEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Integer pkId;
private String pkIdListStr;
private List<Integer> pkIdList;
/**
* 会员编号
*/
private String memberCode;
/**
* 会员名称
*/
private String memberName;
/**
* 客商编号
*/
private String custCode;
/**
* 客商名称
*/
private String custName;
/**
* 供应商类型
*/
private Integer custType;
/**
* 供应商简称
*/
private String shortName;
/**
* 法人
*/
private String legalBody;
/**
* 联系人
*/
private String linkMan;
/**
* 纳税人登记号
*/
private String taxpayerid;
/**
*
*/
private Integer province;
/**
*
*/
private String provinceName;
/**
*
*/
private Integer city;
/**
*
*/
private String cityName;
/**
*
*/
private Integer county;
/**
*
*/
private String countyName;
/**
* 地址
*/
private String address;
/**
* 经营范围
*/
private String tradeScope;
/**
* 会员id
*/
private Long pkMember;
/**
* 缴纳供应商
*/
private Integer pkSupplier;
/**
* 缴纳日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date billDate;
/**
* 销售类型 引用现在销售大类 来源枚举 ESaleType
*/
@Transaction(transactionKey = EnumsPrefixConstants.E_SALE_TYPE)
private Integer saleType;
/**
* 销售类型 引用现在销售大类 来源枚举 ESaleType
*/
private String saleTypeVal;
/**
* 销售范围
*/
private Integer saleScope;
/**
* 联系电话
*/
private String phone;
/**
* 保证金金额
*/
private BigDecimal margin;
/**
* 创建人ID
*/
private Long pkCreator;
/**
* 创建时间
*/
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
/**
* 逻辑删除 (0=未删除1已删除)
*/
private Integer delFlag;
/**
* 国家
*/
private Integer pkCountry;
/**
* 登录用户信息
*/
private LoginUser loginUser;
/**
* 审批业务类型 来源枚举 EApprovalBusiness
*/
private Integer editType;
/**
* 审核状态 来源枚举 EApproveStatus
*/
@Transaction(transactionKey = EnumsPrefixConstants.APPROVE_STATUS)
private Integer approveStatus;
/**
* 审核状态 来源枚举 EApproveStatus
*/
private String approveStatusVal;
/**
* 修改记录单号
*/
private String thBusinessCode;
/**
* 保证金缴纳集合
*/
private List<ThMarginVO> thMarginVOList;
}

View File

@ -1,221 +0,0 @@
package com.hzs.ground.order.controller.manage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.hzs.common.core.annotation.Log;
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.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.ground.order.ext.SaOrderSettleExt;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.ground.order.param.OrderItemsParam;
import com.hzs.ground.order.param.OrderQueryParam;
import com.hzs.ground.order.service.ISaOrderSettleService;
import com.hzs.ground.order.service.ISupplierOrderService;
import com.hzs.ground.order.vo.SaOrderSettleVo;
import com.hzs.system.base.ISystemConfigServiceApi;
import com.hzs.system.base.dto.BdCubasdocDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* 订单控制类
*
* @author: sui q
* @time: 2022/8/27 16:20
* @description:
* @classname: OrderController
* @package_name: com.hzs.sale.order.controller
*/
@RestController
@RequestMapping("/manage/order")
@Slf4j
public class SupplierOrderController extends BaseController {
@DubboReference
private ISystemConfigServiceApi systemConfigServiceApi;
@Autowired
private ISupplierOrderService supplierOrderService;
@Autowired
private ISaOrderSettleService saOrderSettleService;
/**
* 查询列表
*
* @return cubasdocParam 入参
*/
@PostMapping("/list")
public TableDataInfo listSupplierOrder(@RequestBody OrderQueryParam orderQueryParam) {
// 根据登录人获取供应商根据登录账号查找绑定的供应商查询供应商表
R<BdCubasdocDTO> bdCubasdocDate = systemConfigServiceApi.queryBdCubasdocByUser(SecurityUtils.getUserId());
if (!bdCubasdocDate.isSuccess() || bdCubasdocDate.getData() == null) {
return getDataTable(Collections.emptyList());
}
orderQueryParam.setPkSupplier(bdCubasdocDate.getData().getPkSupplier());
// 根据供应商查询可以查询到的订单
startPage();
orderQueryParam.setPkCountry(SecurityUtils.getPkCountry());
List<SaOrderExt> orderList = supplierOrderService.querySaOrderByCondition(orderQueryParam);
for (SaOrderExt saOrderExt : orderList) {
for (EOrderStatus value : EOrderStatus.values()) {
if (value.getValue() == saOrderExt.getOrderStatus()) {
saOrderExt.setOrderStatusVal(value.getLabel());
break;
}
}
}
return getDataTable(orderList);
}
@PostMapping("/send")
public AjaxResult sendGood(@RequestBody List<OrderItemsParam> orderItemsParamList) {
// 验证是否有该产品的权限验证订单是否已经发货
R<BdCubasdocDTO> bdCubasdocDate = systemConfigServiceApi.queryBdCubasdocByUser(SecurityUtils.getUserId());
if (!bdCubasdocDate.isSuccess() || bdCubasdocDate.getData() == null) {
return AjaxResult.error("该账号没有绑定供应商");
}
for (OrderItemsParam orderItemsParam : orderItemsParamList) {
if (orderItemsParam.getLogisticsCode() == null || orderItemsParam.getLogisticsCompany() == null) {
return AjaxResult.error("请输入物流单号,物流公司");
}
}
OrderQueryParam orderQueryParam = new OrderQueryParam();
orderQueryParam.setPkSupplier(bdCubasdocDate.getData().getPkSupplier());
orderQueryParam.setOrderItemsParamList(orderItemsParamList);
orderQueryParam.setPkCountry(SecurityUtils.getPkCountry());
orderQueryParam.setPkCreator(SecurityUtils.getUserId());
List<SaOrderExt> orderList = supplierOrderService.querySaOrderByCondition(orderQueryParam);
if (orderList == null) {
return AjaxResult.error("存在不属于该用户的产品,不能发货");
}
int size = 0;
for (SaOrderExt saOrderExt : orderList) {
size += saOrderExt.getOrderItemsExtList().size();
}
if (size < orderItemsParamList.size()) {
return AjaxResult.error("存在不属于该用户的产品,不能发货");
}
supplierOrderService.sendGood(orderQueryParam, orderItemsParamList, orderList);
return AjaxResult.success();
}
/**
* 查询列表
*
* @return cubasdocParam 入参
*/
@PostMapping("/list-settle")
@Log(module = EOperationModule.SUPPLIER_SETTLE_ORDER, business = EOperationBusiness.SUPPLIER_SETTLE_ORDER, method = EOperationMethod.SELECT)
public TableDataInfo listSettleOrder(@RequestBody OrderQueryParam orderQueryParam) {
// 根据登录人获取供应商根据登录账号查找绑定的供应商查询供应商表
R<BdCubasdocDTO> bdCubasdocDate = systemConfigServiceApi.queryBdCubasdocByUser(SecurityUtils.getUserId());
if (bdCubasdocDate != null && bdCubasdocDate.getData() != null) {
orderQueryParam.setPkSupplier(bdCubasdocDate.getData().getPkSupplier());
}
// 根据供应商查询可以查询到的订单
startPage();
orderQueryParam.setPkCountry(SecurityUtils.getPkCountry());
List<SaOrderSettleExt> orderSettleExtList = saOrderSettleService.querySaOrderSettle(orderQueryParam);
return getDataTable(orderSettleExtList);
}
/**
* 分页查询会员某个时间段内的奖金汇总
*/
@PostMapping("/export-list")
@Log(module = EOperationModule.SUPPLIER_SETTLE_ORDER, business = EOperationBusiness.SUPPLIER_SETTLE_ORDER, method = EOperationMethod.EXPORT)
public void exportSettleOrder(HttpServletResponse response, OrderQueryParam orderQueryParam){
// 根据登录人获取供应商根据登录账号查找绑定的供应商查询供应商表
R<BdCubasdocDTO> bdCubasdocDate = systemConfigServiceApi.queryBdCubasdocByUser(SecurityUtils.getUserId());
if (bdCubasdocDate != null && bdCubasdocDate.getData() != null) {
orderQueryParam.setPkSupplier(bdCubasdocDate.getData().getPkSupplier());
}
// 根据供应商查询可以查询到的订单
orderQueryParam.setPkCountry(SecurityUtils.getPkCountry());
List<SaOrderSettleExt> orderSettleExtList = saOrderSettleService.querySaOrderSettle(orderQueryParam);
List<SaOrderSettleVo> saOrderSettleVoList = packageScmExportVo(orderSettleExtList);
ExcelUtil<SaOrderSettleVo> util = new ExcelUtil<>(SaOrderSettleVo.class);
util.exportExcel(response, saOrderSettleVoList, "订单结算导出");
}
private List<SaOrderSettleVo> packageScmExportVo(List<SaOrderSettleExt> orderSettleExtList) {
List<SaOrderSettleVo> saOrderSettleVoList = new ArrayList<>();
for (SaOrderSettleExt saOrderSettleExt : orderSettleExtList) {
SaOrderSettleVo saOrderSettleVo = BeanUtil.copyProperties(saOrderSettleExt, SaOrderSettleVo.class);
if(EDealerYesNo.YES.getValue() == saOrderSettleExt.getSettleStatus()){
saOrderSettleVo.setSettleStatusVal(EDealerYesNo.YES.getLabel());
}else{
saOrderSettleVo.setSettleStatusVal(EDealerYesNo.NO.getLabel());
}
saOrderSettleVoList.add(saOrderSettleVo);
}
return saOrderSettleVoList;
}
/**
* 结算订单
*
* @return cubasdocParam 入参
*/
@PostMapping("/settle-order")
@Log(module = EOperationModule.SUPPLIER_SETTLE_ORDER, business = EOperationBusiness.SUPPLIER_SETTLE_ORDER, method = EOperationMethod.SETTLE)
public AjaxResult settleOrder(@RequestBody OrderQueryParam orderQueryParam) {
orderQueryParam.setPkCountry(SecurityUtils.getPkCountry());
List<SaOrderSettleExt> orderSettleExtList = saOrderSettleService.querySaOrderSettle(orderQueryParam);
if (CollectionUtil.isEmpty(orderSettleExtList)) {
return AjaxResult.error(ScmMsgConstants.SETTLE_ORDER_NOT_EXISTS);
}
// 分为线上线下2部分
for (SaOrderSettleExt saOrderSettleExt : orderSettleExtList) {
// 验证状态
if (EYesNo.YES.getIntValue() == saOrderSettleExt.getSettleStatus()) {
return AjaxResult.error(ScmMsgConstants.SETTLE_ORDER_HAS_SETTLE);
}
}
saOrderSettleService.updateSaOrderSettle(orderSettleExtList);
return AjaxResult.success();
}
// /**
// * 撤销订单并入库走签呈签呈页面点击确定按钮
// *
// * @param scmApproveParam 参数
// */
// @PostMapping("/submit")
// @Log(module = EOperationModule.SUPPLIER_SETTLE_ORDER, business = EOperationBusiness.SUPPLIER_SETTLE_ORDER, method = EOperationMethod.UPDATE)
// public AjaxResult submitSettleOrder(@RequestBody ScmApproveParam scmApproveParam) {
// scmApproveParam.setPkCountry(SecurityUtils.getPkCountry());
// if(scmApproveParam.getPkId() == null){
// return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_IN_NOT_EXIST));
// }
// IcGeneralInHExt generalInhExt = generalInhService.queryGeneralInById(scmApproveParam.getPkId(), EScmOrderStatus.SAVE.getValue());
// if (generalInhExt == null) {
// return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_IN_NOT_EXIST));
// }
// // 验证该订单是否存在签呈存在待审核的签呈不能再次发起
// List<ScmOrderApproveLog> scmOrderApproveLogs = scmOrderApproveLogService.queryScmOrderApproveLogByCondition(scmApproveParam.getPkId(), EApprovalBusiness.IC_GENERAL_IN_APPROVE.getValue(), null);
// if(CollectionUtil.isNotEmpty(scmOrderApproveLogs)){
// return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.PURCHASE_EXISTS_AGENT));
// }
// generalInhService.auditGeneralInByApproveParamSubmit(scmApproveParam, userTokenService.getLoginUser());
// return AjaxResult.success();
// }
}

View File

@ -1,36 +0,0 @@
package com.hzs.ground.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.ground.order.SaOrderSettle;
import com.hzs.common.domain.ground.order.ext.SaOrderSettleExt;
import com.hzs.ground.order.param.OrderQueryParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 销售订单-三方结算表 Mapper 接口
* </p>
*
* @author hzs
* @since 2024-04-15
*/
public interface SaOrderSettleMapper extends BaseMapper<SaOrderSettle> {
/*
* @description:
* @author: sui q
* @date: 2024/4/15 15:37
* @param: null null
**/
List<SaOrderSettleExt> querySaOrderSettle(@Param("queryParam") OrderQueryParam queryParam);
/*
* @description: 结算操作
* @author: sui q
* @date: 2024/4/16 10:23
* @param: null null
**/
void updateSaOrderSettle(@Param("orderSettleExtList") List<SaOrderSettleExt> orderSettleExtList);
}

View File

@ -1,28 +0,0 @@
package com.hzs.ground.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.domain.sale.order.SaOrderItems;
import com.hzs.ground.order.param.OrderQueryParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description: 供应商查询顶顶那
* @author: sui q
* @time: 2024/3/23 14:01
* @classname: SupplierOrdeMapper
* @package_name: com.hzs.ground.order.mapper
* version 1.0.0
*/
public interface SupplierOrderMapper extends BaseMapper<SaOrderItems> {
/*
* @description: 供应商查询订单
* @author: sui q
* @date: 2024/3/23 14:32
* @param: null null
**/
List<SaOrderExt> querySaOrderByCondition(@Param("orderQueryParam") OrderQueryParam orderQueryParam);
}

View File

@ -1,35 +0,0 @@
package com.hzs.ground.order.param;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import java.io.Serializable;
/**
* @description: 发货信息
* @author: sui q
* @time: 2024/3/23 15:18
* @classname: OrderItemsParam
* @package_name: com.hzs.ground.order.param
* version 1.0.0
*/
@Data
public class OrderItemsParam implements Serializable {
/**
* 子表主键
*/
private Long pkId;
/**
* 物流单号
*/
private String logisticsCode;
/**
* 物流公司
*/
private String logisticsCompany;
}

View File

@ -1,87 +0,0 @@
package com.hzs.ground.order.param;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description: 订单查询参数
* @Author: sui q
* @Time: 2022/10/19 16:49
* @Classname: OrderQueryParam
* @PackageName: com.hzs.sale.order.param
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class OrderQueryParam implements Serializable {
/**
* 收货人
*/
private String recName;
/**
* 收货电话
*/
private String recPhone;
/**
* 开始支付时间
*/
private Date startTime;
/**
* 结束支付时间
*/
private Date endTime;
/**
* 订单编号
*/
private String orderCode;
/**
* 国家
*/
private Integer pkCountry;
private Long pkCreator;
/**
* 供应商
*/
private Integer pkSupplier;
/**
* 产品编号
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 发货渠道 1 总仓发货 2 一件代发
*/
private Integer shippingChannel;
/**
* 订单状态 (0=待支付,1=已支付)
*/
private Integer orderStatus;
private List<Long> idList;
private List<OrderItemsParam> orderItemsParamList;
}

View File

@ -1,44 +0,0 @@
package com.hzs.ground.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.ground.order.SaOrderSettle;
import com.hzs.common.domain.ground.order.ext.SaOrderSettleExt;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.ground.order.param.OrderQueryParam;
import java.util.List;
/**
* <p>
* 销售订单-三方结算表 服务类
* </p>
*
* @author hzs
* @since 2024-04-15
*/
public interface ISaOrderSettleService extends IService<SaOrderSettle> {
/*
* @description: 保存结算单发货完成后生成订单结算单
* @author: sui q
* @date: 2024/4/15 14:12
* @param: null null
**/
void saveOrderSettleByOrder(OrderQueryParam orderQueryParam, List<SaOrderExt> orderList);
/*
* @description:
* @author: sui q
* @date: 2024/4/15 15:37
* @param: null null
**/
List<SaOrderSettleExt> querySaOrderSettle(OrderQueryParam queryParam);
/*
* @description: 结算操作
* @author: sui q
* @date: 2024/4/16 10:23
* @param: null null
**/
void updateSaOrderSettle(List<SaOrderSettleExt> orderSettleExtList);
}

View File

@ -1,37 +0,0 @@
package com.hzs.ground.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.domain.sale.order.SaOrder;
import com.hzs.common.domain.sale.order.SaOrderItems;
import com.hzs.ground.order.param.OrderItemsParam;
import com.hzs.ground.order.param.OrderQueryParam;
import java.util.List;
/**
* @description: 用于查询供应商订单发货
* @author: sui q
* @time: 2024/3/23 13:59
* @classname: SupplierOrderService
* @package_name: com.hzs.ground.order.service
* version 1.0.0
*/
public interface ISupplierOrderService extends IService<SaOrderItems> {
/*
* @description: 供应商查询订单
* @author: sui q
* @date: 2024/3/23 14:32
* @param: null null
**/
List<SaOrderExt> querySaOrderByCondition(OrderQueryParam orderQueryParam);
/*
* @description: 发货
* @author: sui q
* @date: 2024/3/23 15:36
* @param: null null
**/
void sendGood(OrderQueryParam orderQueryParam, List<OrderItemsParam> orderItemsParamList, List<SaOrderExt> orderList);
}

View File

@ -1,105 +0,0 @@
package com.hzs.ground.order.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.enums.ESettleType;
import com.hzs.common.core.enums.EYesNo;
import com.hzs.common.core.utils.ComputeUtil;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.ground.order.SaOrderSettle;
import com.hzs.common.domain.ground.order.ext.SaOrderSettleExt;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.scm.postage.ext.ThSupplierPostageExt;
import com.hzs.ground.order.mapper.SaOrderSettleMapper;
import com.hzs.ground.order.param.OrderQueryParam;
import com.hzs.ground.order.service.ISaOrderSettleService;
import com.hzs.ground.postage.service.IThSupplierPostageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* 销售订单-三方结算表 服务实现类
* </p>
*
* @author hzs
* @since 2024-04-15
*/
@Service
public class SaOrderSettleServiceImpl extends ServiceImpl<SaOrderSettleMapper, SaOrderSettle> implements ISaOrderSettleService {
@Autowired
private IThSupplierPostageService supplierPostageService;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveOrderSettleByOrder(OrderQueryParam orderQueryParam, List<SaOrderExt> orderList) {
List<SaOrderSettle> saOrderSettleList = new ArrayList<>();
List<SaOrderItemsExt> orderItemsExtList = new ArrayList<>();
for (SaOrderExt saOrderExt : orderList) {
for (SaOrderItemsExt saOrderItems : saOrderExt.getOrderItemsExtList()) {
SaOrderSettle saOrderSettle = SaOrderSettle.builder()
.pkOrder(saOrderExt.getPkId())
.pkOrderItems(saOrderItems.getPkId())
.settleStatus(EYesNo.NO.getIntValue())
.price(saOrderItems.getSupplyPrice())
.quantity(saOrderItems.getQuantity())
.pkSupplier(orderQueryParam.getPkSupplier())
.postage(BigDecimal.ZERO)
.totalPrice(ComputeUtil.computeMultiply(saOrderItems.getSupplyPrice(), saOrderItems.getQuantity()))
.build();
saOrderSettle.setPkCountry(orderQueryParam.getPkCountry());
saOrderSettle.setPkCreator(orderQueryParam.getPkCreator());
saOrderSettleList.add(saOrderSettle);
saOrderItems.setPkSupplier(orderQueryParam.getPkSupplier());
orderItemsExtList.add(saOrderItems);
}
}
List<ThSupplierPostageExt> thSupplierPostageExtList = supplierPostageService.querySupplierPostageByOrder(orderItemsExtList);
if (saOrderSettleList.size() > 0) {
Map<Long, ThSupplierPostageExt> supplierPostageExtMap = new HashMap<>();
if(thSupplierPostageExtList.size()>0){
thSupplierPostageExtList.forEach(thSupplierPostageExt -> supplierPostageExtMap.put(thSupplierPostageExt.getPkOrder(), thSupplierPostageExt));
}
for (SaOrderSettle saOrderSettle : saOrderSettleList) {
if(supplierPostageExtMap.containsKey(saOrderSettle.getPkOrder())){
saOrderSettle.setPostage(supplierPostageExtMap.get(saOrderSettle.getPkOrder()).getPostage());
saOrderSettle.setTotalPrice(ComputeUtil.computeAdd(saOrderSettle.getTotalPrice(), saOrderSettle.getPostage()));
supplierPostageExtMap.remove(saOrderSettle.getPkOrder());
}
}
saveBatch(saOrderSettleList);
}
}
@Override
public List<SaOrderSettleExt> querySaOrderSettle(OrderQueryParam queryParam) {
if (queryParam.getEndTime() != null) {
queryParam.setEndTime(DateUtils.afterDate(1, ChronoUnit.DAYS, queryParam.getEndTime()));
}
return baseMapper.querySaOrderSettle(queryParam);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateSaOrderSettle(List<SaOrderSettleExt> orderSettleExtList) {
// 分为线上线下2部分
List<SaOrderSettleExt> onlineSaOrderSettleList = new ArrayList<>();
for (SaOrderSettleExt saOrderSettleExt : orderSettleExtList) {
if(ESettleType.ONLINE.getValue() == saOrderSettleExt.getSettleType()){
onlineSaOrderSettleList.add(saOrderSettleExt);
}
}
// 批量更新结算状态
baseMapper.updateSaOrderSettle(orderSettleExtList);
// 为账号发放结算金额这个可能会发2份待确认
}
}

View File

@ -1,61 +0,0 @@
package com.hzs.ground.order.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.SaOrderFieldConstants;
import com.hzs.common.core.constant.SystemFieldConstants;
import com.hzs.common.core.enums.EOrderStatus;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.domain.sale.order.SaOrder;
import com.hzs.common.domain.sale.order.SaOrderItems;
import com.hzs.ground.order.mapper.SupplierOrderMapper;
import com.hzs.ground.order.param.OrderItemsParam;
import com.hzs.ground.order.param.OrderQueryParam;
import com.hzs.ground.order.service.ISaOrderSettleService;
import com.hzs.ground.order.service.ISupplierOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.temporal.ChronoUnit;
import java.util.List;
/**
* @description: 供应商查询订单
* @author: sui q
* @time: 2024/3/23 13:59
* @classname: SupplierOrderServiceImpl
* @package_name: com.hzs.ground.order.service.impl
* version 1.0.0
*/
@Service
public class SupplierOrderServiceImpl extends ServiceImpl<SupplierOrderMapper, SaOrderItems> implements ISupplierOrderService {
@Autowired
private ISaOrderSettleService saOrderSettleService;
@Override
public List<SaOrderExt> querySaOrderByCondition(OrderQueryParam orderQueryParam) {
if (orderQueryParam.getEndTime() != null) {
orderQueryParam.setEndTime(DateUtils.afterDate(1, ChronoUnit.DAYS, orderQueryParam.getEndTime()));
}
return baseMapper.querySaOrderByCondition(orderQueryParam);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void sendGood(OrderQueryParam orderQueryParam , List<OrderItemsParam> orderItemsParamList, List<SaOrderExt> orderList) {
for (OrderItemsParam orderItemsParam : orderItemsParamList) {
UpdateWrapper<SaOrderItems> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq(SystemFieldConstants.PK_ID, orderItemsParam.getPkId());
updateWrapper.eq(SaOrderFieldConstants.ORDER_STATUS, EOrderStatus.PAY.getValue());
updateWrapper.set("LOGISTICS_CODE", orderItemsParam.getLogisticsCode());
updateWrapper.set("LOGISTICS_COMPANY", orderItemsParam.getLogisticsCompany());
updateWrapper.set(SaOrderFieldConstants.ORDER_STATUS, EOrderStatus.DELIVERED.getValue());
update(updateWrapper);
}
// 发货完成自动生成待结算单据
saOrderSettleService.saveOrderSettleByOrder(orderQueryParam, orderList);
}
}

View File

@ -1,69 +0,0 @@
package com.hzs.ground.order.vo;
import com.hzs.common.core.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @description: 订单结算vo
* @author: sui q
* @time: 2024/5/8 11:04
* @classname: SaOrderSettleVo
* @package_name: com.hzs.ground.order.vo
* version 1.0.0
*/
@Data
public class SaOrderSettleVo implements Serializable {
@Excel(name = "订单编号")
private String orderCode;
/**
* 产品编号
*/
@Excel(name = "产品编号")
private String productCode;
/**
* 产品名称
*/
@Excel(name = "产品名称")
private String productName;
/**
* 数量
*/
@Excel(name = "数量")
private Integer quantity;
/**
* 价格
*/
@Excel(name = "结算单价",scale = 2)
private BigDecimal price;
@Excel(name = "结算状态")
private String settleStatusVal;
/**
* 供应商名称
*/
@Excel(name = "供应商")
private String supplyName;
/**
* 创建时间
*/
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
/**
* 支付时间
*/
@Excel(name = "支付时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date payTime;
}

View File

@ -1,124 +0,0 @@
package com.hzs.ground.postage.controller.manage;
import cn.hutool.core.bean.BeanUtil;
import com.hzs.common.core.constant.HttpStatus;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.scm.postage.ThSupplierPostage;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.ground.postage.param.SupplierPostageParam;
import com.hzs.ground.postage.service.IThSupplierPostageService;
import com.hzs.ground.postage.vo.SupplierPostageVo;
import com.hzs.system.base.ISystemConfigServiceApi;
import com.hzs.system.base.dto.BdCubasdocDTO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@RestController
@RequestMapping("/manage/supplier-postage")
public class SupplierPostageController extends BaseController {
@Autowired
private IThSupplierPostageService supplierPostageService;
@DubboReference
private ISystemConfigServiceApi systemConfigServiceApi;
/**
* 查询列表
* @return
*/
@GetMapping("list")
public TableDataInfo list(SupplierPostageParam supplierPostageParam){
startPage();
// 下面代码需要使用 坐等随工提交此方法 取消注释
R<BdCubasdocDTO> bdCubasdocDate = systemConfigServiceApi.queryBdCubasdocByUser(SecurityUtils.getUserId());
Integer pkSupplier = null;
if(bdCubasdocDate.getCode() == HttpStatus.SUCCESS){
BdCubasdocDTO bdCubasdoc = bdCubasdocDate.getData();
if(bdCubasdoc == null){
pkSupplier = 1;
}else {
pkSupplier = bdCubasdoc.getPkSupplier();
}
}
supplierPostageParam.setPkCubasdoc(pkSupplier);
List<SupplierPostageVo> list = supplierPostageService.selectByQueryList(supplierPostageParam);
return getDataTable(list);
}
/**
* 查询列表
* @return
*/
@PostMapping("export")
public void export(SupplierPostageParam supplierPostageParam,HttpServletResponse response){
// 下面代码需要使用 坐等随工提交此方法 取消注释
R<BdCubasdocDTO> bdCubasdocDate = systemConfigServiceApi.queryBdCubasdocByUser(SecurityUtils.getUserId());
Integer pkSupplier = null;
if(bdCubasdocDate.getCode() == HttpStatus.SUCCESS){
BdCubasdocDTO bdCubasdoc = bdCubasdocDate.getData();
if(bdCubasdoc == null){
pkSupplier = 1;
}else {
pkSupplier = bdCubasdoc.getPkSupplier();
}
}
supplierPostageParam.setPkCubasdoc(pkSupplier);
List<SupplierPostageVo> list = supplierPostageService.selectByQueryList(supplierPostageParam);
ExcelUtil<SupplierPostageVo> util = new ExcelUtil<>(SupplierPostageVo.class);
util.exportExcel(response, list, "商品信息导出");
}
/**
* 新增
* @return
*/
@PostMapping("save")
public AjaxResult save(@RequestBody ThSupplierPostage supplierPostage){
supplierPostage.setCreationTime(DateUtils.currentDateTime());
supplierPostage.setPkCreator(SecurityUtils.getUserId());
supplierPostage.setPkCountry(SecurityUtils.getPkCountry());
supplierPostageService.save(supplierPostage);
return AjaxResult.success();
}
/**
* 修改
*/
@PostMapping("update")
public AjaxResult update(@RequestBody ThSupplierPostage supplierPostage){
supplierPostageService.updateById(supplierPostage);
return AjaxResult.success();
}
/**
* 查询详情
*/
@GetMapping("detail")
public AjaxResult detail(Integer pkSupplierPostage){
SupplierPostageVo supplierPostageVo = supplierPostageService.selectByPkId(pkSupplierPostage);
return AjaxResult.success(supplierPostageVo);
}
/**
* 删除
* @param pkSupplierPostage
* @return
*/
@GetMapping("remove")
public AjaxResult remove(Integer pkSupplierPostage){
supplierPostageService.removeById(pkSupplierPostage);
return AjaxResult.success();
}
}

View File

@ -1,45 +0,0 @@
package com.hzs.ground.postage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.scm.postage.ThSupplierPostage;
import com.hzs.common.domain.scm.postage.ext.ThSupplierPostageExt;
import com.hzs.ground.postage.param.SupplierPostageParam;
import com.hzs.ground.postage.vo.SupplierPostageVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hzs
* @since 2024-04-19
*/
public interface ThSupplierPostageMapper extends BaseMapper<ThSupplierPostage> {
/*
* @description: 根据订单批量查询供应商邮费
* @author: sui q
* @date: 2024/4/19 16:29
* @param: null null
**/
List<ThSupplierPostageExt> querySupplierPostageByOrder(@Param("orderItemsExtList") List<SaOrderItemsExt> orderItemsExtList);
/**
* 查询列表
* @return
*/
List<SupplierPostageVo> selectByQueryList(SupplierPostageParam supplierPostageParam);
/**
* 根据id 查询
* @param pkSupplierPostage
* @return
*/
SupplierPostageVo selectByPkId(@Param("pkSupplierPostage") Integer pkSupplierPostage);
}

View File

@ -1,50 +0,0 @@
package com.hzs.ground.postage.param;/**
* @Description:
* @Author: yuhui
* @Time: 2024/4/28 11:09
* @Classname: SupplierPostageParam
* @PackageName: com.hzs.ground.postage.param
*/
import lombok.Data;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.ground.postage.param
*@Author: yh
*@CreateTime: 2024-04-28 11:09
*@Description: TODO
*@Version: 1.0
*/
@Data
public class SupplierPostageParam {
/**
* 商品名称
*/
private String waresName;
/**
* 供应商名称
*/
private String custName;
/**
* 省名称
*/
private String areaName;
/**
* 省主键
*/
private Integer pkArea;
/**
* 供应商主键
*/
private Integer pkCubasdoc;
}

View File

@ -1,44 +0,0 @@
package com.hzs.ground.postage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.scm.postage.ThSupplierPostage;
import com.hzs.common.domain.scm.postage.ext.ThSupplierPostageExt;
import com.hzs.ground.postage.param.SupplierPostageParam;
import com.hzs.ground.postage.vo.SupplierPostageVo;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author hzs
* @since 2024-04-19
*/
public interface IThSupplierPostageService extends IService<ThSupplierPostage> {
/*
* @description: 根据订单批量查询供应商邮费
* @author: sui q
* @date: 2024/4/19 16:29
* @param: null null
**/
List<ThSupplierPostageExt> querySupplierPostageByOrder(List<SaOrderItemsExt> orderItemsExtList);
/**
* 查询列表
* @return
*/
List<SupplierPostageVo> selectByQueryList(SupplierPostageParam supplierPostageParam);
/**
* 根据id 查询
* @param pkSupplierPostage
* @return
*/
SupplierPostageVo selectByPkId(Integer pkSupplierPostage);
}

View File

@ -1,46 +0,0 @@
package com.hzs.ground.postage.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.scm.postage.ThSupplierPostage;
import com.hzs.common.domain.scm.postage.ext.ThSupplierPostageExt;
import com.hzs.ground.postage.mapper.ThSupplierPostageMapper;
import com.hzs.ground.postage.param.SupplierPostageParam;
import com.hzs.ground.postage.service.IThSupplierPostageService;
import com.hzs.ground.postage.vo.SupplierPostageVo;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author hzs
* @since 2024-04-19
*/
@Service
public class ThSupplierPostageServiceImpl extends ServiceImpl<ThSupplierPostageMapper, ThSupplierPostage> implements IThSupplierPostageService {
@Override
public List<ThSupplierPostageExt> querySupplierPostageByOrder(List<SaOrderItemsExt> orderItemsExtList){
return baseMapper.querySupplierPostageByOrder(orderItemsExtList);
}
/**
* 查询列表
* @return
*/
@Override
public List<SupplierPostageVo> selectByQueryList(SupplierPostageParam supplierPostageParam ) {
return baseMapper.selectByQueryList(supplierPostageParam);
}
@Override
public SupplierPostageVo selectByPkId(Integer pkSupplierPostage) {
return baseMapper.selectByPkId(pkSupplierPostage);
}
}

View File

@ -1,62 +0,0 @@
package com.hzs.ground.postage.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.hzs.common.core.annotation.Excel;
import com.hzs.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class SupplierPostageVo {
private Integer pkId;
/**
* 商品主键
*/
private Integer pkWares;
/**
* 商品名称
*/
@Excel(name = "商品名称")
private String waresName;
/**
* 供应商主键
*/
private Integer pkCubasdoc;
/**
* 供应商名称
*/
@Excel(name = "供应商名称")
private String custName;
/**
* 邮费主键
*/
private Integer pkPostage;
/**
* 邮费
*/
@Excel(name = "邮费")
private BigDecimal postage;
/**
* 省主键
*/
private Integer pkArea;
/**
* 名称
*/
@Excel(name = "")
private String areaName;
}

View File

@ -1,35 +0,0 @@
package com.hzs.ground.product.controller.api;/**
* @Description:
* @Author: yuhui
* @Time: 2024/4/17 16:15
* @Classname: ApiProductController
* @PackageName: com.hzs.ground.product.controller.api
*/
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.ground.product.service.IThProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.ground.product.controller.api
*@Author: yh
*@CreateTime: 2024-04-17 16:15
*@Description: TODO
*@Version: 1.0
*/
@Slf4j
@RestController
@RequestMapping("/api/th-product")
public class ApiProductController extends BaseController {
@Autowired
private IThProductService productService;
}

View File

@ -1,465 +0,0 @@
package com.hzs.ground.product.controller.manage;/**
* @Description:
* @Author: yuhui
* @Time: 2023/11/27 9:29
* @Classname: BdProductBasController
* @PackageName: com.hzs.scm.product.controller
*/
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.ProductMsgConstants;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.core.utils.StringUtils;
import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.sale.product.BdProductBas;
import com.hzs.common.domain.sale.product.BdProductBasSpecs;
import com.hzs.common.domain.sale.product.ext.BdProductBasExt;
import com.hzs.common.domain.scm.th.ThProduct;
import com.hzs.common.domain.scm.th.ThProductExtend;
import com.hzs.common.domain.scm.th.ThProductSpecs;
import com.hzs.common.security.service.UserTokenService;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.ground.product.param.ProductBasParams;
import com.hzs.ground.product.service.*;
import com.hzs.ground.product.vo.ProductBasVo;
import com.hzs.sale.product.IProductServiceApi;
import com.hzs.sale.product.dto.ProductParamDTO;
import com.hzs.system.sys.dto.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.controller
*@Author: yh
*@CreateTime: 2023-11-27 09:29
*@Description: TODO
*@Version: 1.0
*/
@Slf4j
@RestController
@RequestMapping("/manage/product-bas")
public class BdProductBasController extends BaseController{
@Autowired
private UserTokenService userTokenService;
@Autowired
private IThProductExtendService productExtendService;
@Autowired
private IThProductService thProductService;
@Autowired
private IThProductSpecsService productSpecsService;
@Autowired
private IBdProductBasService productBasService;
@Autowired
private IBdProductBasSpecsService productBasSpecsService;
@DubboReference
private IProductServiceApi productServiceApi;
/**
* 查询列表 (分页)
* @return
*/
@GetMapping("list")
public TableDataInfo list(ProductBasParams productBasParams){
// QueryWrapper<BdProductBas> qw = new QueryWrapper<>();
// // qw.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
// if (StringUtils.isNotBlank(productBasParams.getProductCode())){
// qw.like("PRODUCT_CODE", productBasParams.getProductCode());
// }
// if (StringUtils.isNotBlank(productBasParams.getProductName())){
// qw.like("PRODUCT_NAME", productBasParams.getProductName());
// }
// if (productBasParams.getStartCreateDate() != null && productBasParams.getEndCreateDate() != null){
// qw.between("CREATION_TIME", DateUtils.getStartTime(productBasParams.getStartCreateDate()),DateUtils.getEndTime(productBasParams.getEndCreateDate()));
// }
// qw.orderByDesc("CREATION_TIME");
startPage();
// List<BdProductBas> list = productBasService.list(qw);
if (productBasParams.getStartCreateDate() != null){
productBasParams.setStartCreateDate(DateUtils.getStartTime(productBasParams.getStartCreateDate()));
}
if (productBasParams.getEndCreateDate() != null){
productBasParams.setEndCreateDate(DateUtils.getEndTime(productBasParams.getEndCreateDate()));
}
List<BdProductBasExt> list = productBasService.selectByList(productBasParams);
for (BdProductBasExt productBas : list) {
Integer pkProduct = productBas.getPkProduct();
if (pkProduct == null){
productBas.setIsShowCreateButton(EYesNo.YES.getIntValue());
}else {
productBas.setIsShowCreateButton(EYesNo.NO.getIntValue());
}
}
return getDataTable(list);
}
/**
* 导出
* @param productBasParams
* @return
*/
@PostMapping("/export")
public void export(@RequestBody ProductBasParams productBasParams, HttpServletResponse response){
QueryWrapper<BdProductBas> qw = new QueryWrapper<>();
qw.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
if (StringUtils.isNotBlank(productBasParams.getProductCode())){
qw.like("PRODUCT_CODE", productBasParams.getProductCode());
}
if (StringUtils.isNotBlank(productBasParams.getProductName())){
qw.like("PRODUCT_NAME", productBasParams.getProductName());
}
if (productBasParams.getStartCreateDate() != null && productBasParams.getEndCreateDate() != null){
qw.between("CREATION_TIME", DateUtils.getStartTime(productBasParams.getStartCreateDate()),DateUtils.getEndTime(productBasParams.getEndCreateDate()));
}
qw.orderByDesc("CREATION_TIME");
List<BdProductBas> list = productBasService.list(qw);
List<ProductBasVo> resultList = list.stream().map(a -> {
return BeanUtil.copyProperties(a, ProductBasVo.class);
}).collect(Collectors.toList());
ExcelUtil<ProductBasVo> util = new ExcelUtil<>(ProductBasVo.class);
util.exportExcel(response, resultList, "产品基本信息导出");
}
/**
* 查询全部
* @return
*/
@GetMapping("find-all")
public TableDataInfo findAll(String query,Integer pkCubasdoc){
startPage();
// List<BdProductBas> list = productBasService.lfindist(qw);
List<ProductBasVo> resultList = productBasService.queryProductBasList(query,SecurityUtils.getPkCountry(),pkCubasdoc);
// List<ProductBasVo> resultList = list.stream().map(a -> {
// ProductBasVo productBasVo = BeanUtil.copyProperties(a, ProductBasVo.class);
// productBasVo.setUnitStr(EUnit.getEnumByValue(a.getUnit()).getLabel());
// return productBasVo;
// }).collect(Collectors.toList());
return getDataTable(resultList);
}
/**
* 查询全部
* @return
*/
@GetMapping("find-by-bas-all")
public TableDataInfo findByBasAll(String query){
startPage();
// List<BdProductBas> list = productBasService.lfindist(qw);
QueryWrapper<BdProductBas> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotBlank(query)){
queryWrapper.like("PRODUCT_CODE",query).or().like("PRODUCT_NAME",query);
}
// List<BdProductBas> resultList = productBasService.list(queryWrapper);
List<ProductBasVo> resultList = productBasService.queryProductBasAllList(query,SecurityUtils.getPkCountry());
// List<ProductBasVo> resultList = list.stream().map(a -> {
// ProductBasVo productBasVo = BeanUtil.copyProperties(a, ProductBasVo.class);
// productBasVo.setUnitStr(EUnit.getEnumByValue(a.getUnit()).getLabel());
// return productBasVo;
// }).collect(Collectors.toList());
return getDataTable(resultList);
}
/**
* 查询全部关联商品
* @param
* @return
*/
@GetMapping("query-product-bas-relevance")
public TableDataInfo queryProductBasRelevance(String query){
startPage();
Integer pkCountry = SecurityUtils.getPkCountry();
List<ProductBasVo> resultList = productBasService.queryProductBasRelevanceList(query,pkCountry);
return getDataTable(resultList);
}
/**
* 新增
* @param productBasParams
* @return
*/
@PostMapping("save")
public AjaxResult save(@RequestBody ProductBasParams productBasParams){
if (StringUtils.isBlank(productBasParams.getProductName())) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_NAME_REQUIRED));
}
// 发货渠道
// if (productBasParams.getShippingChannel() == null) {
// return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_SHIPPING_CHANNEL_REQUIRED));
// }
// 保质期
if (productBasParams.getShelfLife() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_SHELFLIFE_REQUIRED));
}
// 单位
if (productBasParams.getUnit() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_UNIT_REQUIRED));
}
// 重量
if (productBasParams.getWeight() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_WEIGHT_REQUIRED));
}
// 产品分类
if (productBasParams.getPkClassify() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_CLASSIFY_REQUIRED));
}
// 排序序号
// if (productBasParams.getSort() == null) {
// return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_SORT_REQUIRED));
// }
//
if (productBasParams.getLength() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_LENGTH_REQUIRED));
}
//
if (productBasParams.getWidth() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_WIDTH_REQUIRED));
}
//
if (productBasParams.getHeight() == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_HEIGHT_REQUIRED));
}
// 产品主图
if (StringUtils.isBlank(productBasParams.getCover())) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_COVER_REQUIRED));
}
// 产品相关规格
if (productBasParams.getPkSpecsType().size() == 0) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_SPECSTYPE_REQUIRED));
}
// 新增商品信息
LoginUser loginUser = userTokenService.getLoginUser();
// 校验编号重复
QueryWrapper<BdProductBas> qw = new QueryWrapper<BdProductBas>();
qw.eq("PRODUCT_CODE",productBasParams.getProductCode());
int productCount = productBasService.count(qw);
if (productCount > 0){
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_NUMBER_ALREADY_EXISTS));
}
return AjaxResult.success(productBasService.saveProductBas(productBasParams,loginUser));
}
/**
* 查询产品详情
*
* @return
*/
@GetMapping("detail")
public AjaxResult detail(Integer productBasId) {
BdProductBas productBas = productBasService.getById(productBasId);
if (productBas == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_NOT_REQUIRED));
}
ProductBasParams productParams = BeanUtil.copyProperties(productBas, ProductBasParams.class);
QueryWrapper<BdProductBasSpecs> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_PRODUCT_BAS", productBasId);
List<Integer> pkSpecsType = new ArrayList<>();
List<BdProductBasSpecs> productSpecList = productBasSpecsService.list(queryWrapper);
for (BdProductBasSpecs productBasSpecs : productSpecList) {
pkSpecsType.add(productBasSpecs.getPkSpecsType());
}
productParams.setPkSpecsType(pkSpecsType);
return AjaxResult.success(productParams);
}
/**
* 修改
* @param productBasParams
* @return
*/
@PostMapping("update")
public AjaxResult update(@RequestBody ProductBasParams productBasParams){
// 查询订单编号是否重复
BdProductBas productBas = productBasService.getById(productBasParams.getPkId());
if (!productBas.getProductCode().equals(productBasParams.getProductCode())) {
QueryWrapper<BdProductBas> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PRODUCT_CODE", productBasParams.getProductCode());
int count = productBasService.count(queryWrapper);
if (count > 0) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_NUMBER_ALREADY_EXISTS));
}
}
LoginUser loginUser = userTokenService.getLoginUser();
// 校验编号重复
QueryWrapper<BdProductBas> qe = new QueryWrapper<>();
qe.eq("PRODUCT_CODE",productBasParams.getProductCode());
qe.notIn("PK_ID",productBasParams.getPkId());
int productCount = productBasService.count(qe);
if (productCount > 0){
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_NUMBER_ALREADY_EXISTS));
}
// 修改商品基本信息
productBasService.updateProductBas(productBasParams, loginUser);
// productService.saveProductModifyRecord(productParams, loginUser,EModifyRecordType.PRODUCT_ADD.getValue());
return AjaxResult.success(productBasParams.getProductCode());
}
/**
* 根据商品id 删除数据
*
* @param pkId
* @return
*/
@Log(module = EOperationModule.PRODUCT_DELETE, method = EOperationMethod.DELETE)
@DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Integer pkId) {
productBasService.removeProductBas(pkId);
return AjaxResult.success();
}
/**
* 根据产品编号查询产品信息
* @param productCode
* @return
*/
@GetMapping("get-product-info")
public AjaxResult getProductInfo(String productCode){
return AjaxResult.success(productBasService.getByProductCodeInfo(productCode));
}
/**
* 生成产品
*/
@GetMapping("generate-product")
public AjaxResult generateProduct(Integer pkProductBas){
// 生成产品基本信息
LoginUser loginUser = userTokenService.getLoginUser();
BdProductBas productBas = productBasService.getById(pkProductBas);
String productCode = productBas.getProductCode();
ThProduct product = thProductService.getOne(new QueryWrapper<ThProduct>().eq("PRODUCT_CODE", productCode));
if (product != null){
// 商品拓展表
ThProductExtend productExtend = productExtendService.getOne(new QueryWrapper<ThProductExtend>().eq("PK_PRODUCT", product.getPkId()));
// 商品规格表
List<ThProductSpecs> productSpecsList = productSpecsService.list(new QueryWrapper<ThProductSpecs>().eq("PK_PRODUCT", product.getPkId()));
// 创建产品
ProductParamDTO productDTO = new ProductParamDTO();
productDTO.setProductCode(product.getProductCode());
productDTO.setProductName(product.getProductName());
productDTO.setPkClassify(product.getPkClassify());
productDTO.setShippingChannel(product.getShippingChannel());
productDTO.setUnit(product.getUnit());
productDTO.setWeight(product.getWeight());
productDTO.setWidth(product.getWidth());
productDTO.setPostageWeight(BigDecimal.ZERO);
productDTO.setHeight(product.getHeight());
productDTO.setLength(product.getLength());
productDTO.setRetailPrice(product.getRetailPrice());
productDTO.setCover(product.getCover());
productDTO.setShelfLife(product.getShelfLife());
productDTO.setCreationTime(DateUtils.currentDateTime());
productDTO.setPkCreator(SecurityUtils.getUserId());
productDTO.setPkCountry(SecurityUtils.getPkCountry());
productDTO.setPkProductBas(productBas.getPkId());
productDTO.setPkSupplier(product.getPkSupplier());
List<Integer> pkSpecsType = new ArrayList<>();
for (ThProductSpecs productSpecs : productSpecsList) {
pkSpecsType.add(productSpecs.getPkSpecsType());
}
productDTO.setPkSpecsType(pkSpecsType);
productDTO.setIsPickUp(productExtend.getIsPickUp());
productDTO.setIsBarCode(productExtend.getIsBarCode());
productDTO.setIsMerge(productExtend.getIsMerge());
productDTO.setIsGift(productExtend.getIsGift());
productDTO.setIsLandTrans(productExtend.getIsLandTrans());
productDTO.setIsAirTrans(productExtend.getIsAirTrans());
productDTO.setIsOceanTrans(productExtend.getIsOceanTrans());
productDTO.setSort(productExtend.getSort());
productDTO.setRepurchaseType(productExtend.getRepurchaseType());
productDTO.setIsFresh(EYesNo.NO.getIntValue());
productDTO.setPkCubasdoc(product.getPkCubasdoc());
productServiceApi.saveProduct(productDTO,loginUser);
}else {
//return AjaxResult.error();
// 商品拓展表
// ThProductExtend productExtend = productExtendService.getOne(new QueryWrapper<ThProductExtend>().eq("PK_PRODUCT", product.getPkId()));
// 商品规格表
// List<ThProductSpecs> productSpecsList = productSpecsService.list(new QueryWrapper<ThProductSpecs>().eq("PK_PRODUCT", product.getPkId()));
List<BdProductBasSpecs> productSpecsList = productBasSpecsService.list(new QueryWrapper<BdProductBasSpecs>().eq("PK_PRODUCT_BAS", productBas.getPkId()));
// 创建产品
ProductParamDTO productDTO = new ProductParamDTO();
productDTO.setProductCode(productBas.getProductCode());
productDTO.setProductName(productBas.getProductName());
productDTO.setPkClassify(productBas.getPkClassify());
productDTO.setShippingChannel(EShippingChannel.A_PIECE.getValue());
productDTO.setUnit(productBas.getUnit());
productDTO.setWeight(productBas.getWeight());
productDTO.setWidth(productBas.getWidth());
productDTO.setPostageWeight(BigDecimal.ZERO);
productDTO.setHeight(productBas.getHeight());
productDTO.setLength(productBas.getLength());
productDTO.setRetailPrice(BigDecimal.ZERO);
productDTO.setCover(productBas.getCover());
productDTO.setShelfLife(productBas.getShelfLife());
productDTO.setCreationTime(DateUtils.currentDateTime());
productDTO.setPkCreator(SecurityUtils.getUserId());
productDTO.setPkCountry(SecurityUtils.getPkCountry());
productDTO.setPkProductBas(productBas.getPkId());
// productDTO.setPkSupplier(productBas.getPkSupplier());
List<Integer> pkSpecsType = new ArrayList<>();
for (BdProductBasSpecs productBasSpecs : productSpecsList) {
pkSpecsType.add(productBasSpecs.getPkSpecsType());
}
productDTO.setPkSpecsType(pkSpecsType);
productDTO.setIsPickUp(EYesNo.NO.getIntValue());
productDTO.setIsBarCode(EYesNo.NO.getIntValue());
productDTO.setIsMerge(EYesNo.NO.getIntValue());
productDTO.setIsGift(EYesNo.NO.getIntValue());
productDTO.setIsLandTrans(EYesNo.NO.getIntValue());
productDTO.setIsAirTrans(EYesNo.NO.getIntValue());
productDTO.setIsOceanTrans(EYesNo.NO.getIntValue());
productDTO.setSort(EYesNo.NO.getIntValue());
productDTO.setRepurchaseType(EYesNo.NO.getIntValue());
productDTO.setIsFresh(EYesNo.NO.getIntValue());
// productDTO.setPkCubasdoc(product.getPkCubasdoc());
productServiceApi.saveProduct(productDTO,loginUser);
}
return AjaxResult.success();
}
/**
* 查询供应商产品
*/
@GetMapping("get-supplier-product")
public AjaxResult getSupplierProduct(Integer pkSupplier){
List<ProductBasVo> productBasList = null;
if (pkSupplier != null){
productBasList = productBasService.selectbypkSupplierList(pkSupplier);
}else {
productBasList = productBasService.selectbyNotSupplierList();
}
for (ProductBasVo productBasVo : productBasList) {
productBasVo.setUnitStr(EUnit.getEnumByValue(productBasVo.getUnit()).getLabel());
}
return AjaxResult.success(productBasList);
}
}

View File

@ -1,150 +0,0 @@
package com.hzs.ground.product.controller.manage;/**
* @Description:
* @Author: yuhui
* @Time: 2024/3/22 14:28
* @Classname: ThProductController
* @PackageName: com.hzs.scm.product.controller.manage
*/
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.ProductMsgConstants;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.enums.EOperationBusiness;
import com.hzs.common.core.enums.EOperationMethod;
import com.hzs.common.core.enums.EOperationModule;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.scm.th.ThProduct;
import com.hzs.common.domain.scm.th.ThProductExtend;
import com.hzs.common.domain.scm.th.ThProductSpecs;
import com.hzs.common.security.service.UserTokenService;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.ground.product.param.ProductInfoParam;
import com.hzs.ground.product.param.ThProductParam;
import com.hzs.ground.product.service.IThProductExtendService;
import com.hzs.ground.product.service.IThProductService;
import com.hzs.ground.product.service.IThProductSpecsService;
import com.hzs.ground.product.vo.ProductVo;
import com.hzs.system.base.ISystemConfigServiceApi;
import com.hzs.system.base.dto.BdCubasdocDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.controller.manage
*@Author: yh
*@CreateTime: 2024-03-22 14:28
*@Description: TODO
*@Version: 1.0
*/
@Slf4j
@RestController
@RequestMapping("/manage/th-product")
public class ThProductController extends BaseController {
@Autowired
private UserTokenService userTokenService;
@Autowired
private IThProductService thProductService;
@Autowired
private IThProductSpecsService productSpecsService;
@Autowired
private IThProductExtendService productExtendService;
@DubboReference
private ISystemConfigServiceApi systemConfigServiceApi;
/**
* 供应商 数据
*/
@GetMapping("list")
public TableDataInfo list(ProductInfoParam productInfoParam){
startPage();
if (productInfoParam.getStartCreateDate() != null){
productInfoParam.setStartCreateDate(DateUtils.getStartTime(productInfoParam.getStartCreateDate()));
}
if (productInfoParam.getEndCreateDate() != null){
productInfoParam.setEndCreateDate(DateUtils.getEndTime(productInfoParam.getEndCreateDate()));
}
// 根据登录人获取供应商根据登录账号查找绑定的供应商查询供应商表
R<BdCubasdocDTO> bdCubasdocDate = systemConfigServiceApi.queryBdCubasdocByUser(SecurityUtils.getUserId());
if(!bdCubasdocDate.isSuccess() || bdCubasdocDate.getData() == null){
return getDataTable(new ArrayList<>());
}
productInfoParam.setPkSupplier(bdCubasdocDate.getData().getPkSupplier());
List<ProductVo> list = thProductService.queryByList(productInfoParam);
return getDataTable(list);
}
/**
* 导出
*/
@PostMapping("export")
public void export(HttpServletResponse response , ProductInfoParam productInfoParam){
if (productInfoParam.getStartCreateDate() != null){
productInfoParam.setStartCreateDate(DateUtils.getStartTime(productInfoParam.getStartCreateDate()));
}
if (productInfoParam.getEndCreateDate() != null){
productInfoParam.setEndCreateDate(DateUtils.getEndTime(productInfoParam.getEndCreateDate()));
}
List<ProductVo> list = thProductService.queryByList(productInfoParam);
ExcelUtil<ProductVo> util = new ExcelUtil<>(ProductVo.class);
util.exportExcel(response, list, "供应商产品导出");
}
/**
* 查询产品详情
*
* @return
*/
@GetMapping("detail")
public AjaxResult detail(Integer productId) {
ProductVo product = thProductService.getProductInfoById(productId);
if (product == null) {
return AjaxResult.error(TransactionUtils.getContent(ProductMsgConstants.PRODUCT_NOT_REQUIRED));
}
ProductInfoParam productParams = BeanUtil.copyProperties(product, ProductInfoParam.class);
ThProductExtend productExtend = productExtendService.getOne(new QueryWrapper<ThProductExtend>().eq("PK_PRODUCT", productId));
productParams.setIsPickUp(productExtend.getIsPickUp());
productParams.setIsPrize(productExtend.getIsPrize());
productParams.setIsBarCode(productExtend.getIsBarCode());
productParams.setRepurchaseType(productExtend.getRepurchaseType());
productParams.setIsMerge(productExtend.getIsMerge());
productParams.setIsGift(productExtend.getIsGift());
productParams.setIsLandTrans(productExtend.getIsLandTrans());
productParams.setIsAirTrans(productExtend.getIsAirTrans());
productParams.setIsOceanTrans(productExtend.getIsOceanTrans());
productParams.setSort(productExtend.getSort());
QueryWrapper<ThProductSpecs> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_PRODUCT", productId);
List<Integer> pkSpecsType = new ArrayList<>();
List<ThProductSpecs> productSpecList = productSpecsService.list(queryWrapper);
for (ThProductSpecs productSpecs : productSpecList) {
pkSpecsType.add(productSpecs.getPkSpecsType());
}
productParams.setPkSpecsType(pkSpecsType);
productParams.setSupplierName(product.getSupplierName());
// productParams.setPkProductBas(productExtend.getPkProductBas());
return AjaxResult.success(productParams);
}
}

View File

@ -1,88 +0,0 @@
package com.hzs.ground.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.sale.product.BdProductBas;
import com.hzs.common.domain.sale.product.BdProductSpecs;
import com.hzs.common.domain.sale.product.ext.BdProductBasExt;
import com.hzs.ground.product.param.ProductBasParams;
import com.hzs.ground.product.vo.ProductBasVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* <p>
* 产品基本设置 Mapper 接口
* </p>
*
* @author hzs
* @since 2023-11-21
*/
public interface BdProductBasMapper extends BaseMapper<BdProductBas> {
/*
* @description: 查询产品id顺道查询出国家对应的产品id
* @author: sui q
* @date: 2023/11/24 11:41
* @param: null null
**/
List<BdProductBasExt> queryProductBasByIds(@Param("idList") Set<Integer> idList, @Param("pkCountry") Integer pkCountry);
/**
* 查询列表
* @param query
* @param pkCubasdoc
* @return
*/
List<ProductBasVo> queryProductBasList(@Param("query") String query, @Param("pkCountry") Integer pkCountry,@Param("pkCubasdoc") Integer pkCubasdoc);
/**
* 根据产品编号查询
* @param productCode
* @return
*/
ProductBasVo findByProductCode(@Param("productCode") String productCode);
/*
* @description: 根据规格主键查询产品
* @author: sui q
* @date: 2023/11/27 15:52
* @param: null null
**/
List<BdProductBasExt> queryProductExtBySpecsId(@Param("productSpecsList") List<BdProductSpecs> productSpecsList, @Param("pkCountry") Integer pkCountry);
/**
* 查询全部已关联产品
* @param query
* @return
*/
List<ProductBasVo> queryProductBasRelevanceList(@Param("query") String query, @Param("pkCountry") Integer pkCountry);
/**
* 查询列表
* @param productBasParams
* @return
*/
List<BdProductBasExt> selectByList(ProductBasParams productBasParams);
/**
* 根据供应商查询产品基本信息
* @param pkSupplier
* @return
*/
List<ProductBasVo> selectbypkSupplierList(@Param("pkSupplier") Integer pkSupplier);
/**
* 查询无供应商的产品基本信息
* @return
*/
List<ProductBasVo> selectbyNotSupplierList();
/**
* 查询全部
* @param query
* @param pkCountry
* @return
*/
List<ProductBasVo> queryProductBasAllList(@Param("query") String query,@Param("pkCountry") Integer pkCountry);
}

View File

@ -1,33 +0,0 @@
package com.hzs.ground.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.sale.product.BdProductBasSpecs;
import com.hzs.ground.product.vo.BdProductBasSpecsVo;
import com.hzs.ground.product.vo.SpecsVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 规格明细表 Mapper 接口
* </p>
*
* @author hzs
* @since 2023-11-21
*/
public interface BdProductBasSpecsMapper extends BaseMapper<BdProductBasSpecs> {
/**
* 根据主键查询 产品规格信息
* @param pkProductBas
* @return
*/
List<BdProductBasSpecsVo> queryListByProductBasCode(@Param("pkProductBas") Integer pkProductBas);
/**
* 查询规格规格类型条件
* @param pkSpecsType
* @return
*/
List<SpecsVo> findByPkSpecsType(@Param("pkSpecsType") Integer pkSpecsType);
}

View File

@ -1,17 +0,0 @@
package com.hzs.ground.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.th.ThApprovalLog;
/**
* <p>
* 供应商产品日志 Mapper 接口
* </p>
*
* @author hzs
* @since 2024-03-28
*/
public interface ThApprovalLogMapper extends BaseMapper<ThApprovalLog> {
}

View File

@ -1,17 +0,0 @@
package com.hzs.ground.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.th.ThProductExtend;
/**
* <p>
* thProduct商品拓展表 Mapper 接口
* </p>
*
* @author hzs
* @since 2024-03-23
*/
public interface ThProductExtendMapper extends BaseMapper<ThProductExtend> {
}

View File

@ -1,39 +0,0 @@
package com.hzs.ground.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.th.ThProduct;
import com.hzs.ground.product.param.ProductInfoParam;
import com.hzs.ground.product.vo.ProductVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
*
* @author hzs
* @since 2024-03-22
*/
public interface ThProductMapper extends BaseMapper<ThProduct> {
/**
* 查询列表
*
* @param productInfoParam
* @return
*/
List<ProductVo> queryByList(ProductInfoParam productInfoParam);
/*
* @description: 根据产品id查询产品申请
**/
List<ThProduct> queryProductApplyByProduct(List<Integer> productId);
/**
* 根据id 查询详情
*
* @param productId
* @return
*/
ProductVo getProductInfoById(@Param("productId") Integer productId);
}

View File

@ -1,17 +0,0 @@
package com.hzs.ground.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.th.ThProductSpecs;
/**
* <p>
* thPorduct规格明细表 Mapper 接口
* </p>
*
* @author hzs
* @since 2024-03-23
*/
public interface ThProductSpecsMapper extends BaseMapper<ThProductSpecs> {
}

View File

@ -1,150 +0,0 @@
package com.hzs.ground.product.param;/**
* @Description:
* @Author: yuhui
* @Time: 2023/11/28 15:04
* @Classname: ProductBasParams
* @PackageName: com.hzs.scm.product.param
*/
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.param
*@Author: yh
*@CreateTime: 2023-11-28 15:04
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ProductBasParams implements Serializable {
/**
* 商品主键
*/
private Integer pkId;
/**
* 产品编号
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 规格分类
*/
private Integer pkClassify;
/**
* 单位 来源于枚举单位
*/
private Integer unit;
/**
* 重量 以千克作为单位
*/
private BigDecimal weight;
/**
* 以厘米作为单位
*/
private BigDecimal length;
/**
* 以厘米作为单位
*/
private BigDecimal width;
/**
* 以厘米作为单位
*/
private BigDecimal height;
/**
* 封面图
*/
private String cover;
/**
* 保质期
*/
private Integer shelfLife;
/**
* 产品规格类型列表
*/
private List<Integer> pkSpecsType;
/**
* 排序值
*/
private Integer sort;
/**
* 发货渠道 1 总仓发货 2 一件代发
*/
private Integer shippingChannel;
/**
* 产品主键id列表
*/
List<Integer> productIds;
/**
* 海陆空运输方式筛选
*/
private Integer shippingType;
/**
* 开始创建时间
*/
private Date startCreateDate;
/**
* 结束创建时间
*/
private Date endCreateDate;
/**
* 产品编号
*/
List<String> productCodes;
private Integer pkCountry;
/**
* 复购类型
*/
private Integer repurchaseType;
/**
* 是否存在规格
*/
private Integer isExistSpecs;
/**
* 查询产品信息
*/
private String queryInfo;
/**
* 产品基础档案主键
*/
private Integer pkProductBas;
}

View File

@ -1,268 +0,0 @@
package com.hzs.ground.product.param;/**
* @Description:
* @Author: yuhui
* @Time: 2024/3/25 11:12
* @Classname: ProductInfoParam
* @PackageName: com.hzs.scm.product.param
*/
import com.hzs.system.sys.dto.LoginUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.param
*@Author: yh
*@CreateTime: 2024-03-25 11:12
*@Description: TODO
*@Version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductInfoParam implements Serializable {
/**
* 登录用户信息
*/
private LoginUser loginUser;
/**
* 商品主键
*/
private Integer pkId;
/**
* 产品编号
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 翻译key
*/
private Integer transactionKey;
/**
* 规格分类
*/
private Integer pkClassify;
/**
* 单位 来源于枚举单位
*/
private Integer unit;
/**
* 重量 以千克作为单位
*/
private BigDecimal weight;
/**
* 以厘米作为单位
*/
private BigDecimal length;
/**
* 以厘米作为单位
*/
private BigDecimal width;
/**
* 以厘米作为单位
*/
private BigDecimal height;
/**
* 邮费重量 以千克作为单位
*/
private BigDecimal postageWeight;
/**
* 建议零售价
*/
private BigDecimal retailPrice;
/**
* 启用状态 来源于枚举是否默认是
*/
private Integer enableState;
/**
* 封面图
*/
private String cover;
/**
* 保质期
*/
private Integer shelfLife;
/**
* 是否冷链
*/
private Integer isFresh;
/**
* 是否提货 来源于枚举是否默认否
*/
private Integer isPickUp;
/**
* 是否抽奖奖品 来源于枚举是否默认否
*/
private Integer isPrize;
/**
* 是否条码管理 来源于枚举是否默认否
*/
private Integer isBarCode;
/**
* 能否合并发货 来源于枚举是否默认是
*/
private Integer isMerge;
/**
* 来源于枚举是否默认是
*/
private Integer isGift;
/**
* 库存预警数量
*/
// private Long warningQuantity;
/**
* 是否陆运
*/
private Integer isLandTrans;
/**
* 是否空运
*/
private Integer isAirTrans;
/**
* 是否海运
*/
private Integer isOceanTrans;
/**
* 产品属性 枚举商品属性,1=实物商品2=虚拟商品
*/
private Integer productAttr;
/**
* 产品规格类型列表
*/
private List<Integer> pkSpecsType;
/**
* 排序值
*/
private Integer sort;
/**
* 发货渠道 1 总仓发货 2 一件代发
*/
private Integer shippingChannel;
/**
* 产品主键id列表
*/
List<Integer> productIds;
/**
* 海陆空运输方式筛选
*/
private Integer shippingType;
/**
* 开始创建时间
*/
private Date startCreateDate;
/**
* 结束创建时间
*/
private Date endCreateDate;
/**
* 产品编号
*/
List<String> productCodes;
private Integer pkCountry;
/**
* 复购类型
*/
private Integer repurchaseType;
/**
* 是否存在规格
*/
private Integer isExistSpecs;
/**
* 查询产品信息
*/
private String queryInfo;
/**
* 产品基础档案主键
*/
private Integer pkProductBas;
/**
* 数量
*/
private Integer quantity;
/**
* 供货价格
*/
private BigDecimal supplyPrice;
/**
* 供货数量
*/
private Integer supplyQuantity;
/**
* 销售模式
*/
private Integer saleModel;
/**
* 供应商
*/
private Integer pkSupplier;
/**
* 供应商名称
*/
private String supplierName;
/**
* 供应商主键
*/
private Integer pkCubasdoc;
}

View File

@ -1,64 +0,0 @@
package com.hzs.ground.product.param;/**
* @Description:
* @Author: yuhui
* @Time: 2024/3/22 15:14
* @Classname: ProductParam
* @PackageName: com.hzs.scm.product.param
*/
import com.hzs.common.core.web.domain.BaseApprovalEntity;
import com.hzs.common.domain.scm.th.ThProduct;
import com.hzs.system.sys.dto.LoginUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.param
*@Author: yh
*@CreateTime: 2024-03-22 15:14
*@Description: TODO
*@Version: 1.0
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class ThProductParam extends BaseApprovalEntity implements Serializable {
/**
* 操作类型1=新增,2=修改,3=删除
*/
private Integer controlType;
/**
* 国家
*/
private Integer pkCountry;
/**
* 会员ID
*/
private Long pkMember;
/**
* 登录用户信息
*/
private LoginUser loginUser;
/**
* 供应商产品信息
*/
private ThProduct product;
/**
* 供应商产品信息
*/
private ProductInfoParam productInfoParam;
}

View File

@ -1,31 +0,0 @@
package com.hzs.ground.product.provider;
import cn.hutool.core.bean.BeanUtil;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.sale.product.BdProductBas;
import com.hzs.ground.product.service.IBdProductBasService;
import com.hzs.scm.product.IProductBasServiceApi;
import com.hzs.scm.product.dto.ProductBasDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@DubboService
public class IProductBasServiceProvider implements IProductBasServiceApi {
@Autowired
private IBdProductBasService productBasService;
/**
* 根据id 查询
*
* @return
*/
@Override
public R<ProductBasDTO> getProductBasById(Integer pkId) {
BdProductBas productBas = productBasService.getProductBasById(pkId);
return R.ok(BeanUtil.copyProperties(productBas, ProductBasDTO.class));
}
}

View File

@ -1,126 +0,0 @@
package com.hzs.ground.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.sale.product.BdProductBas;
import com.hzs.common.domain.sale.product.BdProductSpecs;
import com.hzs.common.domain.sale.product.ext.BdProductBasExt;
import com.hzs.ground.product.param.ProductBasParams;
import com.hzs.ground.product.vo.ProductBasVo;
import com.hzs.ground.product.vo.ProductInfoVo;
import com.hzs.system.sys.dto.LoginUser;
import java.util.List;
import java.util.Set;
/**
* 产品基本设置 服务类
*
* @author hzs
* @since 2023-11-21
*/
public interface IBdProductBasService extends IService<BdProductBas> {
/**
* 根据id查询
*
* @param productBasId
* @return
*/
BdProductBas getProductBasById(Integer productBasId);
/*
* @description: 查询产品id顺道查询出国家对应的产品id
**/
List<BdProductBasExt> queryProductBasByIds(Set<Integer> idList, Integer pkCountry);
/**
* 新增
*
* @param productBasParams
* @return
*/
String saveProductBas(ProductBasParams productBasParams, LoginUser loginUser);
/**
* 修改
*
* @param productBasParams
* @param loginUser
*/
void updateProductBas(ProductBasParams productBasParams, LoginUser loginUser);
/**
* 删除
*
* @param productBasId
*/
void removeProductBas(Integer productBasId);
/**
* 根据产品编号查询信息
*
* @param productCode
*/
ProductInfoVo getByProductCodeInfo(String productCode);
/**
* 查询列表
*
* @param query
* @return
*/
List<ProductBasVo> queryProductBasList(String query, Integer pkCountry, Integer pkCubasdoc);
/**
* 根据产品编号查询
*
* @param productCode
* @return
*/
ProductBasVo findByProductCode(String productCode);
/*
* @description: 根据规格主键查询产品
**/
List<BdProductBasExt> queryProductExtBySpecsId(List<BdProductSpecs> productSpecsList, Integer pkCountry);
/**
* 查询全部已关联查询
*
* @param query
* @return
*/
List<ProductBasVo> queryProductBasRelevanceList(String query, Integer pkCountry);
/**
* 查询列表
*
* @param productBasParams
* @return
*/
List<BdProductBasExt> selectByList(ProductBasParams productBasParams);
/**
* 根据供应商查询产品基本信息
*
* @param pkSupplier
* @return
*/
List<ProductBasVo> selectbypkSupplierList(Integer pkSupplier);
/**
* 查询无供应商的产品基本信息
*
* @return
*/
List<ProductBasVo> selectbyNotSupplierList();
/**
* 查询全部
*
* @param query
* @param pkCountry
* @return
*/
List<ProductBasVo> queryProductBasAllList(String query, Integer pkCountry);
}

View File

@ -1,34 +0,0 @@
package com.hzs.ground.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.sale.product.BdProductBasSpecs;
import com.hzs.ground.product.vo.BdProductBasSpecsVo;
import com.hzs.ground.product.vo.SpecsVo;
import java.util.List;
/**
* <p>
* 规格明细表 服务类
* </p>
*
* @author hzs
* @since 2023-11-21
*/
public interface IBdProductBasSpecsService extends IService<BdProductBasSpecs> {
/**
* 根据主键查询 产品规格信息
* @param pkProductBas
* @return
*/
List<BdProductBasSpecsVo> queryListByProductBasCode(Integer pkProductBas);
/**
* 查询规格规格类型条件
* @param pkSpecsType
* @return
*/
List<SpecsVo> findByPkSpecsType(Integer pkSpecsType);
}

View File

@ -1,14 +0,0 @@
package com.hzs.ground.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.th.ThApprovalLog;
/**
* 供应商产品日志 服务类
*
* @author hzs
* @since 2024-03-28
*/
public interface IThApprovalLogService extends IService<ThApprovalLog> {
}

View File

@ -1,16 +0,0 @@
package com.hzs.ground.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.th.ThProductExtend;
/**
* <p>
* thProduct商品拓展表 服务类
* </p>
*
* @author hzs
* @since 2024-03-23
*/
public interface IThProductExtendService extends IService<ThProductExtend> {
}

View File

@ -1,36 +0,0 @@
package com.hzs.ground.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.th.ThProduct;
import com.hzs.ground.product.param.ProductInfoParam;
import com.hzs.ground.product.param.ThProductParam;
import com.hzs.ground.product.vo.ProductVo;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
import java.util.List;
/**
* 服务类
*
* @author hzs
* @since 2024-03-22
*/
public interface IThProductService extends IService<ThProduct> {
/**
* 查询列表
*
* @param productInfoParam
* @return
*/
List<ProductVo> queryByList(ProductInfoParam productInfoParam);
/**
* 根据id 查询详情
*
* @param productId
* @return
*/
ProductVo getProductInfoById(Integer productId);
}

View File

@ -1,17 +0,0 @@
package com.hzs.ground.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.th.ThProductSpecs;
/**
* <p>
* thPorduct规格明细表 服务类
* </p>
*
* @author hzs
* @since 2024-03-23
*/
public interface IThProductSpecsService extends IService<ThProductSpecs> {
}

View File

@ -1,252 +0,0 @@
package com.hzs.ground.product.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.enums.EDelFlag;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.sale.product.BdProductBas;
import com.hzs.common.domain.sale.product.BdProductBasSpecs;
import com.hzs.common.domain.sale.product.BdProductSpecs;
import com.hzs.common.domain.sale.product.ext.BdProductBasExt;
import com.hzs.ground.product.mapper.BdProductBasMapper;
import com.hzs.ground.product.param.ProductBasParams;
import com.hzs.ground.product.service.IBdProductBasService;
import com.hzs.ground.product.service.IBdProductBasSpecsService;
import com.hzs.ground.product.vo.BdProductBasSpecsVo;
import com.hzs.ground.product.vo.ProductBasVo;
import com.hzs.ground.product.vo.ProductInfoVo;
import com.hzs.ground.product.vo.SpecsVo;
import com.hzs.system.sys.dto.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* 产品基本设置 服务实现类
*
* @author hzsf
* @since 2023-11-21
*/
@Service
public class BdProductBasServiceImpl extends ServiceImpl<BdProductBasMapper, BdProductBas> implements IBdProductBasService {
@Autowired
private IBdProductBasService productBasService;
@Autowired
private IBdProductBasSpecsService productBasSpecsService;
@Autowired
private RedisService redisService;
/**
* 根据id查询
*
* @param productBasId
* @return
*/
@Override
public BdProductBas getProductBasById(Integer productBasId) {
BdProductBas bdProductBas = redisService.getCacheObject(CacheConstants.BD_PRODUCT_BAS + productBasId);
if (bdProductBas == null) {
bdProductBas = baseMapper.selectById(productBasId);
if (bdProductBas != null) {
redisService.setCacheObject(CacheConstants.BD_PRODUCT_BAS + bdProductBas.getPkId(), bdProductBas);
}
}
return bdProductBas;
}
@Override
public List<BdProductBasExt> queryProductBasByIds(Set<Integer> idList, Integer pkCountry) {
return baseMapper.queryProductBasByIds(idList, pkCountry);
}
/**
* 新增
*
* @param productBasParams
* @return
*/
@Override
public String saveProductBas(ProductBasParams productBasParams, LoginUser loginUser) {
String productCode = productBasParams.getProductCode();
BdProductBas productBas = BeanUtil.copyProperties(productBasParams, BdProductBas.class);
productBas.setProductCode(productCode);
productBas.setPkCreator(loginUser.getUserId());
productBas.setCreationTime(DateUtils.currentDateTime());
productBas.setPkCreator(loginUser.getUserId());
productBas.setPkCountry(loginUser.getDataCountry());
// 删除状态 审核完毕 修改为未删除状态
productBas.setDelFlag(EDelFlag.UN_DELETE.getValue());
productBasService.save(productBas);
// 生成规格明细
if (productBasParams.getPkSpecsType() != null) {
// List<BdProductSpecs> productSpecsList = new ArrayList<>();
for (Integer id : productBasParams.getPkSpecsType()) {
BdProductBasSpecs productBasSpecs = new BdProductBasSpecs();
productBasSpecs.setPkProductBas(productBas.getPkId());
productBasSpecs.setPkSpecsType(id);
productBasSpecs.setPkCountry(loginUser.getDataCountry());
productBasSpecs.setPkCreator(loginUser.getUserId());
productBasSpecs.setCreationTime(DateUtils.currentDateTime());
productBasSpecsService.save(productBasSpecs);
}
}
return productCode;
}
/**
* 修改
*
* @param productBasParams
* @param loginUser
*/
@Override
public void updateProductBas(ProductBasParams productBasParams, LoginUser loginUser) {
BdProductBas productBas = BeanUtil.copyProperties(productBasParams, BdProductBas.class);
productBas.setPkId(productBasParams.getPkId());
productBas.setPkModified(loginUser.getUserId());
productBas.setModifiedTime(new Date());
productBasService.updateById(productBas);
// 生成规格明细
if (productBasParams.getPkSpecsType() != null) {
QueryWrapper<BdProductBasSpecs> removeWrapper = new QueryWrapper<>();
removeWrapper.eq("PK_PRODUCT_BAS", productBasParams.getPkId());
productBasSpecsService.remove(removeWrapper);
for (Integer id : productBasParams.getPkSpecsType()) {
BdProductBasSpecs productBasSpecs = new BdProductBasSpecs();
productBasSpecs.setPkProductBas(productBasParams.getPkId());
productBasSpecs.setPkSpecsType(id);
productBasSpecs.setPkCountry(loginUser.getDataCountry());
productBasSpecs.setPkCreator(loginUser.getUserId());
productBasSpecs.setCreationTime(new Date());
productBasSpecsService.save(productBasSpecs);
}
}
}
/**
* 删除
*
* @param productBasId
*/
@Override
public void removeProductBas(Integer productBasId) {
productBasService.removeById(productBasId);
productBasSpecsService.remove(new QueryWrapper<BdProductBasSpecs>().eq("PK_PRODUCT_BAS", productBasId));
}
/**
* 根据产品编号查询信息
*
* @param productCode
*/
@Override
public ProductInfoVo getByProductCodeInfo(String productCode) {
// BdProductBas productBas = productBasService.getOne(new QueryWrapper<BdProductBas>().eq("PRODUCT_CODE", productCode));
ProductBasVo productBas = productBasService.findByProductCode(productCode);
ProductInfoVo productInfoVo = new ProductInfoVo();
if (productBas != null) {
List<BdProductBasSpecsVo> bdProductBasSpecsVos = productBasSpecsService.queryListByProductBasCode(productBas.getPkId());
for (BdProductBasSpecsVo bdProductBasSpecsVo : bdProductBasSpecsVos) {
List<SpecsVo> specsList = productBasSpecsService.findByPkSpecsType(bdProductBasSpecsVo.getPkSpecsType());
bdProductBasSpecsVo.setSpecsList(specsList);
}
productInfoVo.setProductBasSpecsList(bdProductBasSpecsVos);
productInfoVo.setPkId(productBas.getPkId());
productInfoVo.setProductCode(productBas.getProductCode());
productInfoVo.setProductName(productBas.getProductName());
// 单位
productInfoVo.setUnit(productBas.getUnit());
productInfoVo.setUnitStr(productBas.getUnitStr());
}
return productInfoVo;
}
/**
* 查询列表
*
* @param query
* @return
*/
@Override
public List<ProductBasVo> queryProductBasList(String query, Integer pkCountry, Integer pkCubasdoc) {
return baseMapper.queryProductBasList(query, pkCountry, pkCubasdoc);
}
/**
* 根据产品编号查询
*
* @param productCode
* @return
*/
@Override
public ProductBasVo findByProductCode(String productCode) {
return baseMapper.findByProductCode(productCode);
}
@Override
public List<BdProductBasExt> queryProductExtBySpecsId(List<BdProductSpecs> productSpecsList, Integer pkCountry) {
return baseMapper.queryProductExtBySpecsId(productSpecsList, pkCountry);
}
/**
* 查询全部关联商品
*
* @param
* @return
*/
@Override
public List<ProductBasVo> queryProductBasRelevanceList(String query, Integer pkCountry) {
return baseMapper.queryProductBasRelevanceList(query, pkCountry);
}
/**
* 查询列表
*
* @param productBasParams
* @return
*/
@Override
public List<BdProductBasExt> selectByList(ProductBasParams productBasParams) {
return baseMapper.selectByList(productBasParams);
}
/**
* 根据供应商查询产品基本信息
*
* @param pkSupplier
* @return
*/
@Override
public List<ProductBasVo> selectbypkSupplierList(Integer pkSupplier) {
return baseMapper.selectbypkSupplierList(pkSupplier);
}
/**
* 查询无供应商的产品基本信息
*
* @return
*/
@Override
public List<ProductBasVo> selectbyNotSupplierList() {
return baseMapper.selectbyNotSupplierList();
}
/**
* 查询全部
*
* @param query
* @param pkCountry
* @return
*/
@Override
public List<ProductBasVo> queryProductBasAllList(String query, Integer pkCountry) {
return baseMapper.queryProductBasAllList(query, pkCountry);
}
}

View File

@ -1,42 +0,0 @@
package com.hzs.ground.product.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.sale.product.BdProductBasSpecs;
import com.hzs.ground.product.mapper.BdProductBasSpecsMapper;
import com.hzs.ground.product.service.IBdProductBasSpecsService;
import com.hzs.ground.product.vo.BdProductBasSpecsVo;
import com.hzs.ground.product.vo.SpecsVo;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 规格明细表 服务实现类
* </p>
*
* @author hzs
* @since 2023-11-21
*/
@Service
public class BdProductBasSpecsServiceImpl extends ServiceImpl<BdProductBasSpecsMapper, BdProductBasSpecs> implements IBdProductBasSpecsService {
/**
* 根据主键查询 产品规格信息
* @param pkProductBas
* @return
*/
@Override
public List<BdProductBasSpecsVo> queryListByProductBasCode(Integer pkProductBas) {
return baseMapper.queryListByProductBasCode(pkProductBas);
}
/**
* 查询规格规格类型条件
* @param pkSpecsType
* @return
*/
@Override
public List<SpecsVo> findByPkSpecsType(Integer pkSpecsType) {
return baseMapper.findByPkSpecsType(pkSpecsType);
}
}

View File

@ -1,18 +0,0 @@
package com.hzs.ground.product.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.scm.th.ThApprovalLog;
import com.hzs.ground.product.mapper.ThApprovalLogMapper;
import com.hzs.ground.product.service.IThApprovalLogService;
import org.springframework.stereotype.Service;
/**
* 供应商产品日志 服务实现类
*
* @author hzs
* @since 2024-03-28
*/
@Service
public class ThApprovalLogServiceImpl extends ServiceImpl<ThApprovalLogMapper, ThApprovalLog> implements IThApprovalLogService {
}

View File

@ -1,21 +0,0 @@
package com.hzs.ground.product.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.scm.th.ThProductExtend;
import com.hzs.ground.product.mapper.ThProductExtendMapper;
import com.hzs.ground.product.service.IThProductExtendService;
import org.springframework.stereotype.Service;
/**
* <p>
* thProduct商品拓展表 服务实现类
* </p>
*
* @author hzs
* @since 2024-03-23
*/
@Service
public class ThProductExtendServiceImpl extends ServiceImpl<ThProductExtendMapper, ThProductExtend> implements IThProductExtendService {
}

View File

@ -1,106 +0,0 @@
package com.hzs.ground.product.service.impl;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.CommonUtil;
import com.hzs.common.domain.scm.th.ThApprovalLog;
import com.hzs.common.domain.scm.th.ThProduct;
import com.hzs.ground.product.mapper.ThProductMapper;
import com.hzs.ground.product.param.ProductInfoParam;
import com.hzs.ground.product.param.ThProductParam;
import com.hzs.ground.product.service.*;
import com.hzs.ground.product.vo.ProductVo;
import com.hzs.system.sys.IApprovalServiceApi;
import com.hzs.system.sys.dto.ApprovalSubmitDTO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 服务实现类
*/
@Service
public class ThProductServiceImpl extends ServiceImpl<ThProductMapper, ThProduct> implements IThProductService {
@DubboReference
IApprovalServiceApi approvalServiceApi;
@Autowired
private IThApprovalLogService approvalLogService;
/**
* 查询列表
*
* @param productInfoParam
* @return
*/
@Override
public List<ProductVo> queryByList(ProductInfoParam productInfoParam) {
return baseMapper.queryByList(productInfoParam);
}
/**
* 根据id 查询详情
*
* @param productId
* @return
*/
@Override
public ProductVo getProductInfoById(Integer productId) {
return baseMapper.getProductInfoById(productId);
}
/**
* 提交审批
*
* @param productParam 抽奖参数
*/
public Boolean submitApproval(ThProductParam productParam, EApprovalBusiness approvalBusiness) {
//保存审批日志
ThApprovalLog approvalLog = saveApprovalLog(productParam, approvalBusiness);
ProductInfoParam productInfoParam = productParam.getProductInfoParam();
ApprovalSubmitDTO approvalSubmitDTO = ApprovalSubmitDTO.builder().eApprovalBusiness(approvalBusiness)
.businessCode(approvalLog.getBusinessCode())
.businessData(JSONUtil.toJsonStr(productInfoParam))
.signType(ESignType.getEnumByValue(productParam.getSignType())).userIdList(productParam.getUserIdList())
.sendIdList(productParam.getSendIdList()).remark(productParam.getRemark()).fileList(productParam.getFileList()).build();
R<String> submit = approvalServiceApi.submit(approvalSubmitDTO, productParam.getLoginUser());
if (!submit.isSuccess()) {
throw new RuntimeException("供应商商品参数提交审批失败!");
}
return submit.isSuccess();
}
/**
* 保存活动审批日志信息
*
* @param recommendParam 直推赠送参数
* @param approvalBusiness 审批业务
* @return boolean
*/
public ThApprovalLog saveApprovalLog(ThProductParam recommendParam, EApprovalBusiness approvalBusiness) {
Integer controlType = recommendParam.getControlType();
String afterData = JSONUtil.toJsonStr(recommendParam.getProductInfoParam());
String beforeData = controlType.equals(EControlType.SAVE.getValue()) ? JSONUtil.toJsonStr(recommendParam.getProductInfoParam()) : null;
//业务单号
String businessCode = CommonUtil.createSerialNumber(EOrderPrefix.SUPPLIER.getValue());
ThApprovalLog approvalLog = ThApprovalLog.builder().approvalType(approvalBusiness.getValue())
.beforeData(beforeData).businessCode(businessCode).controltype(controlType)
.approvalStatus(EApproveRechargeStatus.WAIT.getValue()).afterData(afterData)
.build();
approvalLog.setPkCreator(recommendParam.getPkMember());
approvalLog.setPkCountry(recommendParam.getPkCountry());
approvalLogService.save(approvalLog);
return approvalLog;
}
}

View File

@ -1,21 +0,0 @@
package com.hzs.ground.product.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.scm.th.ThProductSpecs;
import com.hzs.ground.product.mapper.ThProductSpecsMapper;
import com.hzs.ground.product.service.IThProductSpecsService;
import org.springframework.stereotype.Service;
/**
* <p>
* thPorduct规格明细表 服务实现类
* </p>
*
* @author hzs
* @since 2024-03-23
*/
@Service
public class ThProductSpecsServiceImpl extends ServiceImpl<ThProductSpecsMapper, ThProductSpecs> implements IThProductSpecsService {
}

View File

@ -1,50 +0,0 @@
package com.hzs.ground.product.vo;/**
* @Description:
* @Author: yuhui
* @Time: 2023/12/5 17:18
* @Classname: BdProductBasSpecsVo
* @PackageName: com.hzs.scm.product.vo
*/
import lombok.Data;
import java.util.List;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.vo
*@Author: yh
*@CreateTime: 2023-12-05 17:18
*@Description: TODO
*@Version: 1.0
*/
@Data
public class BdProductBasSpecsVo {
/**
* 主键
*/
private Integer pkId;
/**
* 产品主键
*/
private Integer pkProductBas;
/**
* 规格类型
*/
private Integer pkSpecsType;
/**
* 规格类型名称
*/
private String specsTypeName;
/**
* 产品规格表
*/
private List<SpecsVo> specsList;
}

View File

@ -1,121 +0,0 @@
package com.hzs.ground.product.vo;/**
* @Description:
* @Author: yuhui
* @Time: 2023/11/29 11:33
* @Classname: ProductBasVo
* @PackageName: com.hzs.scm.product.vo
*/
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzs.common.core.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.vo
*@Author: yh
*@CreateTime: 2023-11-29 11:33
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ProductBasVo {
private Integer pkProduct;
/**
* 主键
*/
private Integer pkId;
/**
* 产品编号
*/
@Excel(name = "产品编号")
private String productCode;
/**
* 产品名称
*/
@Excel(name = "产品名称")
private String productName;
/**
* 规格分类
*/
private Integer pkClassify;
/**
* 单位 来源于枚举单位
*/
private Integer unit;
/**
* 单位 来源于枚举单位
*/
private String unitStr;
/**
* 以厘米作为单位
*/
@Excel(name = "长(CM)")
private BigDecimal length;
/**
* 以厘米作为单位
*/
@Excel(name = "宽(CM)")
private BigDecimal width;
/**
* 以厘米作为单位
*/
@Excel(name = "高(CM)")
private BigDecimal height;
/**
* 重量 以千克作为单位
*/
@Excel(name = "重量(KG)")
private BigDecimal weight;
/**
* 封面图
*/
private String cover;
/**
* 保质期
*/
@Excel(name = "保质期(天)")
private Integer shelfLife;
/**
* 创建时间
*/
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
/**
* 供应商主键
*/
private Integer pkCubasdoc;
}

View File

@ -1,56 +0,0 @@
package com.hzs.ground.product.vo;/**
* @Description:
* @Author: yuhui
* @Time: 2023/12/5 17:13
* @Classname: ProductInfoVo
* @PackageName: com.hzs.scm.product.vo
*/
import lombok.Data;
import java.util.List;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.vo
*@Author: yh
*@CreateTime: 2023-12-05 17:13
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ProductInfoVo {
/**
* 主键
*/
private Integer pkId;
/**
* 产品编号
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 单位
*/
private Integer unit;
/**
* 单位字符
*/
private String unitStr;
/**
* 产品规格明细
*/
private List<BdProductBasSpecsVo> productBasSpecsList;
}

View File

@ -1,192 +0,0 @@
package com.hzs.ground.product.vo;/**
* @Description:
* @Author: yuhui
* @Time: 2024/4/19 11:25
* @Classname: ProductVo
* @PackageName: com.hzs.ground.product.vo
*/
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hzs.common.core.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.ground.product.vo
*@Author: yh
*@CreateTime: 2024-04-19 11:25
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ProductVo {
/**
* 创建人ID
*/
private Long pkCreator;
/**
* 修改人ID
*/
private Long pkModified;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifiedTime;
/**
* 逻辑删除 (0=未删除1已删除)
*/
@JsonIgnore
@TableLogic
private Integer delFlag;
/**
* 国家
*/
private Integer pkCountry;
private Integer pkId;
/**
* 产品名称
*/
@Excel(name = "产品名称")
private String productName;
/**
* 产品编号
*/
@Excel(name = "产品编号")
private String productCode;
/**
* 规格分类
*/
private Integer pkClassify;
/**
* 以厘米作为单位
*/
@Excel(name = "长(CM)")
private BigDecimal length;
/**
* 以厘米作为单位
*/
@Excel(name = "宽(CM)")
private BigDecimal width;
/**
* 以厘米作为单位
*/
@Excel(name = "高(CM)")
private BigDecimal height;
/**
* 重量 以千克作为单位
*/
@Excel(name = "重量")
private BigDecimal weight;
/**
* 单位名
*/
@Excel(name = "单位")
private String unitVal;
/**
* 单位 来源于枚举单位
*/
private Integer unit;
/**
* 零售价格
*/
@Excel(name = "零售价")
private BigDecimal retailPrice;
/**
* 保质期
*/
@Excel(name = "保质期(天)")
private Integer shelfLife;
/**
* 产品规格
*/
@Excel(name = "产品规格")
private String productSpecType;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
/**
* 封面图
*/
private String cover;
/**
* 供应商
*/
private Integer pkSupplier;
/**
* 供货价格
*/
private BigDecimal supplyPrice;
/**
* 供货数量
*/
private Integer supplyQuantity;
/**
* 销售模式
*/
private Integer saleModel;
/**
* 供应商名称
*/
private String supplierName;
}

View File

@ -1,31 +0,0 @@
package com.hzs.ground.product.vo;/**
* @Description:
* @Author: yuhui
* @Time: 2023/12/6 14:42
* @Classname: SpecsVo
* @PackageName: com.hzs.scm.product.vo
*/
import lombok.Data;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.scm.product.vo
*@Author: yh
*@CreateTime: 2023-12-06 14:42
*@Description: TODO
*@Version: 1.0
*/
@Data
public class SpecsVo {
/**
* 规格主键
*/
private String pkSpecs;
/**
* 规格名称
*/
private String name;
}

View File

@ -1,163 +0,0 @@
package com.hzs.ground.supplier.controller;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
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.utils.StringUtils;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.ground.supplier.ThSupplierApply;
import com.hzs.common.domain.member.ext.CuMemberExt;
import com.hzs.common.security.service.UserTokenService;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.ground.product.service.IThApprovalLogService;
import com.hzs.ground.supplier.service.IThSupplierApplyService;
import com.hzs.ground.supplier.vo.ThSupplierApplyVO;
import com.hzs.member.base.IMemberServiceApi;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* 供应商申请申请 前端控制器
*
* @author hzs
* @since 2024-03-21
*/
@RestController
@RequestMapping("/manage/th-supplier-apply")
public class ThSupplierApplyController extends BaseController {
@Autowired
private IThSupplierApplyService iThSupplierApplyService;
@DubboReference
IMemberServiceApi iMemberServiceApi;
/**
* @description: 供应商申请列表
* @author: zhang jing
* @date: 2024/3/22 11:35
* @param: [thSupplierApplyVO]
* @return: com.hzs.common.core.web.page.TableDataInfo
**/
@GetMapping("/list")
@Log(module = EOperationModule.TH_SUPPLIER_APPLY, business = EOperationBusiness.TH_SUPPLIER_APPLY, method = EOperationMethod.SELECT)
public TableDataInfo listGeneralIn(ThSupplierApplyVO thSupplierApplyVO) {
Long userId = SecurityUtils.getUserId();
thSupplierApplyVO.setPkCountry(SecurityUtils.getPkCountry());
Integer checkUser = iThSupplierApplyService.queryThSupplierApplyUserList(userId);
if (checkUser > 0) {
thSupplierApplyVO.setPkCreator(userId);
}
startPage();
List<ThSupplierApplyVO> thSupplierApplyList = iThSupplierApplyService.queryThSupplierApplyList(thSupplierApplyVO);
return getDataTable(thSupplierApplyList);
}
/**
* @description: 添加供应商申请信息
* @author: zhang jing
* @date: 2024/3/22 11:53
* @param: [thSupplierApplyVO]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@PostMapping("/save")
public AjaxResult save(@RequestBody ThSupplierApplyVO thSupplierApplyVO) {
int pkCountry = SecurityUtils.getPkCountry();
// 验证必填信息
if (StringUtils.isEmpty(thSupplierApplyVO.getName())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_SUPPLIER_APPLY_NAME));
}
if (StringUtils.isEmpty(thSupplierApplyVO.getShortName())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_SUPPLIER_APPLY_SHORT_NAME));
}
if (StringUtils.isEmpty(thSupplierApplyVO.getLegalBody())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_SUPPLIER_APPLY_LEGAL_BODY));
}
if (thSupplierApplyVO.getSettleType() == ESettleType.ONLINE.getValue()) {
if (StringUtils.isEmpty(thSupplierApplyVO.getMemberCode())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MEMBER_CODE_NOT_NULL));
}
R<CuMemberExt> member = iMemberServiceApi.getMemberByCode(thSupplierApplyVO.getMemberCode());
thSupplierApplyVO.setPkMember(member.getData().getPkId());
}
//默认线下
thSupplierApplyVO.setSettleType(ESettleType.OFFLINE.getValue());
thSupplierApplyVO.setPkCountry(pkCountry);
thSupplierApplyVO.setPkCreator(SecurityUtils.getUserId());
thSupplierApplyVO.setCreationTime(new Date());
iThSupplierApplyService.saveThSupplierApply(thSupplierApplyVO);
return AjaxResult.success();
}
/**
* @description: 修改供应商申请信息
* @author: zhang jing
* @date: 2024/3/22 11:55
* @param: [thSupplierApplyVO]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@PostMapping("/update")
public AjaxResult update(@RequestBody ThSupplierApplyVO thSupplierApplyVO) {
int pkCountry = SecurityUtils.getPkCountry();
// 验证必填信息
if (StringUtils.isEmpty(thSupplierApplyVO.getName())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_SUPPLIER_APPLY_NAME));
}
if (StringUtils.isEmpty(thSupplierApplyVO.getShortName())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_SUPPLIER_APPLY_SHORT_NAME));
}
if (StringUtils.isEmpty(thSupplierApplyVO.getLegalBody())) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.TH_SUPPLIER_APPLY_LEGAL_BODY));
}
if (thSupplierApplyVO.getSettleType() == ESettleType.ONLINE.getValue()) {
if (StringUtils.isEmpty(thSupplierApplyVO.getMemberCode())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MEMBER_CODE_NOT_NULL));
}
R<CuMemberExt> member = iMemberServiceApi.getMemberByCode(thSupplierApplyVO.getMemberCode());
thSupplierApplyVO.setPkMember(member.getData().getPkId());
}
//默认线下
thSupplierApplyVO.setSettleType(ESettleType.OFFLINE.getValue());
thSupplierApplyVO.setPkCountry(pkCountry);
thSupplierApplyVO.setPkCreator(SecurityUtils.getUserId());
thSupplierApplyVO.setCreationTime(new Date());
iThSupplierApplyService.updateThSupplierApply(thSupplierApplyVO);
return AjaxResult.success();
}
/**
* @description: 查询供应商申请信息
* @author: zhang jing
* @date: 2024/3/22 13:50
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Long pkId) {
ThSupplierApply tsa = iThSupplierApplyService.getById(pkId);
return AjaxResult.success(tsa);
}
/**
* @description: 删除供应商申请信息
* @author: zhang jing
* @date: 2024/3/22 13:49
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
**/
@DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) {
return AjaxResult.success(iThSupplierApplyService.delThSupplierApply(pkId));
}
}

View File

@ -1,50 +0,0 @@
package com.hzs.ground.supplier.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.core.enums.EApprovalBusiness;
import com.hzs.common.domain.ground.supplier.ThSupplierApply;
import com.hzs.ground.supplier.vo.ThSupplierApplyVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 供应商申请申请 Mapper 接口
* </p>
*
* @author hzs
* @since 2024-03-21
*/
public interface ThSupplierApplyMapper extends BaseMapper<ThSupplierApply> {
/**
* @description: 供应商申请列表
* @author: zhang jing
* @date: 2024/3/22 11:30
* @param: [thSupplierApplyVO]
* @return: java.util.List<com.hzs.ground.supplier.vo.ThSupplierApplyVO>
**/
List<ThSupplierApplyVO> queryThSupplierApplyList(ThSupplierApplyVO thSupplierApplyVO);
/**
* @description: 查询登录管理员是否为供应商
* @author: zhang jing
* @date: 2024/4/19 16:41
* @param: [userId]
* @return: java.lang.Integer
**/
Integer queryThSupplierApplyUserList(@Param("useId") Long userId);
/**
* @description: 供应商申请审批查看
* @author: zhang jing
* @date: 2024/3/25 14:45
* @param: [businessCode, pkCountry]
* @return: java.util.List<com.hzs.ground.supplier.vo.ThSupplierApplyVO>
**/
List<ThSupplierApplyVO> queryThSupplierApplyByCode(@Param("businessCode") String businessCode,
@Param("pkCountry") Integer pkCountry);
}

View File

@ -1,71 +0,0 @@
package com.hzs.ground.supplier.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.ground.supplier.ThSupplierApply;
import com.hzs.ground.supplier.vo.ThSupplierApplyVO;
import java.util.List;
/**
* 供应商申请 服务类
*
* @author hzs
* @since 2024-03-21
*/
public interface IThSupplierApplyService extends IService<ThSupplierApply> {
/**
* @description: 供应商列表
* @author: zhang jing
* @date: 2024/3/22 11:31
* @param: [thSupplierApplyVO]
* @return: java.util.List<com.hzs.ground.supplier.vo.ThSupplierApplyVO>
**/
List<ThSupplierApplyVO> queryThSupplierApplyList(ThSupplierApplyVO thSupplierApplyVO);
/**
* @description: 查询登录管理员是否为供应商
* @author: zhang jing
* @date: 2024/4/19 16:40
* @param: [userId]
* @return: java.lang.Integer
**/
Integer queryThSupplierApplyUserList(Long userId);
/**
* @description: 添加供应商申请
* @author: zhang jing
* @date: 2024/3/24 11:49
* @param: [thSupplierApplyVO]
* @return: boolean
**/
boolean saveThSupplierApply(ThSupplierApplyVO thSupplierApplyVO);
/**
* @description: 修改供应商申请
* @author: zhang jing
* @date: 2024/3/24 11:49
* @param: [thSupplierApplyVO]
* @return: boolean
**/
boolean updateThSupplierApply(ThSupplierApplyVO thSupplierApplyVO);
/**
* @description: 删除供应商申请
* @author: zhang jing
* @date: 2024/3/24 11:49
* @param: [pkId]
* @return: boolean
**/
boolean delThSupplierApply(Long pkId);
/**
* @description: 供应商申请审批查看
* @author: zhang jing
* @date: 2024/3/25 14:41
* @param: [eApprovalBusiness, businessCode, pkCountry]
* @return: java.util.List<com.hzs.ground.supplier.vo.ThSupplierApplyVO>
**/
List<ThSupplierApplyVO> queryThSupplierApplyByCode(String businessCode, Integer pkCountry);
}

View File

@ -1,171 +0,0 @@
package com.hzs.ground.supplier.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.enums.*;
import com.hzs.common.domain.ground.supplier.ThSupplierApply;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.ground.supplier.mapper.ThSupplierApplyMapper;
import com.hzs.ground.supplier.service.IThSupplierApplyService;
import com.hzs.ground.supplier.vo.ThSupplierApplyVO;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* 供应商申请 服务实现类
*
* @author hzs
* @since 2024-03-21
*/
@Service
public class ThSupplierApplyServiceImpl extends ServiceImpl<ThSupplierApplyMapper, ThSupplierApply> implements IThSupplierApplyService {
/**
* @description: 供应商列表
* @author: zhang jing
* @date: 2024/3/22 11:31
* @param: [thSupplierApplyVO]
* @return: java.util.List<com.hzs.ground.supplier.vo.ThSupplierApplyVO>
**/
@Override
public List<ThSupplierApplyVO> queryThSupplierApplyList(ThSupplierApplyVO thSupplierApplyVO) {
return baseMapper.queryThSupplierApplyList(thSupplierApplyVO);
}
/**
* @description: 查询登录管理员是否为供应商
* @author: zhang jing
* @date: 2024/4/19 16:40
* @param: [userId]
* @return: java.lang.Integer
**/
@Override
public Integer queryThSupplierApplyUserList(Long userId) {
return baseMapper.queryThSupplierApplyUserList(userId);
}
/**
* @description: 添加供应商申请
* @author: zhang jing
* @date: 2024/3/22 11:52
* @param: [thSupplierApplyVO]
* @return: boolean
**/
@Override
public boolean saveThSupplierApply(ThSupplierApplyVO thSupplierApplyVO) {
ThSupplierApply tsa = BeanUtil.copyProperties(thSupplierApplyVO, ThSupplierApply.class);
List<String> fileList = thSupplierApplyVO.getFileList();
int maxAptitudeCount = Math.min(fileList.size(), 8);
for (int i = 0; i < maxAptitudeCount; i++) {
switch (i) {
case 0:
tsa.setAptitude1(fileList.get(0));
break;
case 1:
tsa.setAptitude2(fileList.get(1));
break;
case 2:
tsa.setAptitude3(fileList.get(2));
break;
case 3:
tsa.setAptitude4(fileList.get(3));
break;
case 4:
tsa.setAptitude5(fileList.get(4));
break;
case 5:
tsa.setAptitude6(fileList.get(5));
break;
case 6:
tsa.setAptitude7(fileList.get(6));
break;
case 7:
tsa.setAptitude8(fileList.get(7));
break;
default:
break;
}
}
baseMapper.insert(tsa);
return true;
}
/**
* @description: 修改供应商申请
* @author: zhang jing
* @date: 2024/3/22 11:54
* @param: [thSupplierApplyVO]
* @return: boolean
**/
@Override
public boolean updateThSupplierApply(ThSupplierApplyVO thSupplierApplyVO) {
ThSupplierApply tsa = BeanUtil.copyProperties(thSupplierApplyVO, ThSupplierApply.class);
List<String> fileList = thSupplierApplyVO.getFileList();
int maxAptitudeCount = Math.min(fileList.size(), 8);
for (int i = 0; i < maxAptitudeCount; i++) {
switch (i) {
case 0:
tsa.setAptitude1(fileList.get(0));
break;
case 1:
tsa.setAptitude2(fileList.get(1));
break;
case 2:
tsa.setAptitude3(fileList.get(2));
break;
case 3:
tsa.setAptitude4(fileList.get(3));
break;
case 4:
tsa.setAptitude5(fileList.get(4));
break;
case 5:
tsa.setAptitude6(fileList.get(5));
break;
case 6:
tsa.setAptitude7(fileList.get(6));
break;
case 7:
tsa.setAptitude8(fileList.get(7));
break;
default:
break;
}
}
baseMapper.updateById(tsa);
return true;
}
/**
* @description: 删除供应商申请
* @author: zhang jing
* @date: 2024/3/22 13:49
* @param: [pkId]
* @return: boolean
**/
@Override
public boolean delThSupplierApply(Long pkId) {
UpdateWrapper<ThSupplierApply> updateWrapper = new UpdateWrapper();
updateWrapper.eq("PK_ID", pkId);
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date());
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
baseMapper.update(null, updateWrapper);
return true;
}
/**
* @description: 供应商申请审批查看
* @author: zhang jing
* @date: 2024/3/25 14:41
* @param: [eApprovalBusiness, businessCode, pkCountry]
* @return: java.util.List<com.hzs.ground.supplier.vo.ThSupplierApplyVO>
**/
@Override
public List<ThSupplierApplyVO> queryThSupplierApplyByCode(String businessCode, Integer pkCountry) {
return baseMapper.queryThSupplierApplyByCode(businessCode, pkCountry);
}
}

View File

@ -1,235 +0,0 @@
package com.hzs.ground.supplier.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzs.common.core.annotation.Excel;
import com.hzs.common.core.annotation.Transaction;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import com.hzs.common.core.web.domain.BaseApprovalEntity;
import com.hzs.system.sys.dto.LoginUser;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* <p>
* 供应商申请VO
* </p>
*
* @author hzs
* @since 2024-03-21
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ThSupplierApplyVO extends BaseApprovalEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Integer pkId;
/**
* 供应商名称
*/
private String name;
/**
* 供应商简称
*/
private String shortName;
/**
* 法人
*/
private String legalBody;
/**
* 联系人
*/
private String linkMan;
/**
* 纳税人登记号
*/
private String taxpayerid;
/**
*
*/
private Integer province;
/**
*
*/
private String provinceName;
/**
*
*/
private Integer city;
/**
*
*/
private String cityName;
/**
*
*/
private Integer county;
/**
*
*/
private String countyName;
/**
* 地址
*/
private String address;
/**
* 资质1
*/
private String aptitude1;
/**
* 资质2
*/
private String aptitude2;
/**
* 资质3
*/
private String aptitude3;
/**
* 资质4
*/
private String aptitude4;
/**
* 资质5
*/
private String aptitude5;
/**
* 资质6
*/
private String aptitude6;
/**
* 资质7
*/
private String aptitude7;
/**
* 资质8
*/
private String aptitude8;
/**
* 错误信息
*/
private String errMsg;
/**
* 有效期
*/
@Excel(name = "有效时间",dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date validPeriod;
/**
* 结算方式 1=线上 2=线下 ESettleType
*/
@Transaction(transactionKey = EnumsPrefixConstants.SETTLE_TYPE)
private Integer settleType;
/**
* 结算方式 1=线上 2=线下 ESettleType
*/
private String settleTypeVal;
/**
* 会员主键
*/
private Long pkMember;
/**
* 会员编号
*/
private String memberCode;
/**
* 证书
*/
private String certificate;
/**
* 经营范围
*/
private String tradeScope;
/**
* 创建人ID
*/
private Long pkCreator;
/**
* 创建时间
*/
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
/**
* 逻辑删除 (0=未删除1已删除)
*/
private Integer delFlag;
/**
* 国家
*/
private Integer pkCountry;
/**
* 登录用户信息
*/
private LoginUser loginUser;
/**
* 审批业务类型 来源枚举 EApprovalBusiness
*/
private Integer editType;
/**
* 审核状态 来源枚举 EApproveStatus
*/
@Transaction(transactionKey = EnumsPrefixConstants.APPROVE_STATUS)
private Integer approveStatus;
/**
* 审核状态 来源枚举 EApproveStatus
*/
private String approveStatusVal;
/**
* 修改记录单号
*/
private String thBusinessCode;
private String pkIdListStr;
/**
* 供应商申请id集合
*/
private List<Integer> pkIdList;
/**
* 供应商申请集合
*/
@Transaction
private List<ThSupplierApplyVO> petitionList;
/**
* 附件集合
*/
private List<String> fileList;
}

View File

@ -1,43 +0,0 @@
package com.hzs.listener;
import com.alibaba.nacos.client.naming.event.InstancesChangeEvent;
import com.alibaba.nacos.common.notify.NotifyCenter;
import com.alibaba.nacos.common.notify.listener.Subscriber;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cloud.loadbalancer.core.CachingServiceInstanceListSupplier;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@Component
@Slf4j
public class NacosInstancesChangeEventListener extends Subscriber<InstancesChangeEvent> {
@Resource
private CacheManager defaultLoadBalancerCacheManager;
@PostConstruct
public void registerToNotifyCenter(){
NotifyCenter.registerSubscriber(this);
}
@Override
public void onEvent(InstancesChangeEvent event) {
log.info("scm 接收微服务刷新事件:{}, 开始刷新本地存储的微服务缓存", event.getServiceName());
Cache cache = defaultLoadBalancerCacheManager.getCache(CachingServiceInstanceListSupplier.SERVICE_INSTANCE_CACHE_NAME);
if (cache != null) {
cache.evict(event.getServiceName());
log.info("{} 微服务刷新", event.getServiceName());
}
log.info("scm 微服务缓存刷新完成");
}
@Override
public Class<? extends com.alibaba.nacos.common.notify.Event> subscribeType() {
return InstancesChangeEvent.class;
}
}

View File

@ -1,68 +0,0 @@
package com.hzs.scm.general.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.hzs.common.core.constant.msg.MemberMsgConstants;
import com.hzs.common.domain.sale.classify.BdSpecs;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.scm.general.param.GeneralBParam;
import com.hzs.scm.general.param.GeneralParam;
import com.hzs.scm.pub.controller.ScmController;
import java.util.*;
/**
* @description: 出入库公共的controller
* @author: sui q
* @time: 2023/11/29 11:05
* @classname: IcGeneralController
* @package_name: com.hzs.scm.general.controller
* version 1.0.0
*/
public abstract class IcGeneralController extends ScmController {
protected String validateGeneralParam(GeneralParam generalParam) {
if (validateGeneralFieldParam(generalParam)) {
return MemberMsgConstants.REQUIRED_NOT_EMPTY;
}
generalParam.setPkCountry(SecurityUtils.getPkCountry());
Map<String, BdSpecs> specsMap = new HashMap<>();
String message = validateProduct(generalParam.getGeneralbParamList(), specsMap);
if(ObjectUtil.isNotEmpty(message)){
return message;
}
// 验证供应商
String msg = validateCuBasDoc(generalParam.getPkCubasdoc(), generalParam.getPkCountry());
if(ObjectUtil.isNotEmpty(msg)){
return msg;
}
// 验证客户
msg = validateCustomer(generalParam.getPkCustomer(), generalParam.getPkCountry());
if(ObjectUtil.isNotEmpty(msg)){
return msg;
}
// 验证采购组织
msg = validateSysCorp(generalParam.getPkCorp(), generalParam.getPkCountry());
if(ObjectUtil.isNotEmpty(msg)){
return msg;
}
// 验证批次号
return validateProductBatchCode(generalParam.getGeneralbParamList(), specsMap);
}
protected Boolean validateGeneralFieldParam(GeneralParam generalParam) {
if (generalParam == null || generalParam.getOrderDate() == null || generalParam.getPkWarehouse() == null ||
generalParam.getPkCorp() == null || CollectionUtil.isEmpty(generalParam.getGeneralbParamList())) {
return Boolean.TRUE;
}
// 验证 采购订单明细字段不能为空
for (GeneralBParam generalbParam : generalParam.getGeneralbParamList()) {
if (generalbParam.getPkUnit() == null || generalbParam.getPkProduct() == null ||
generalbParam.getBizDate() == null || generalbParam.getNnum() == null ||
generalbParam.getPkStorehouse() == null || CollectionUtil.isEmpty(generalbParam.getScmItemSpecsList())) {
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}
}

View File

@ -1,179 +0,0 @@
package com.hzs.scm.general.controller.manage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.ScmMsgConstants;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.scm.general.ext.IcGeneralInBExt;
import com.hzs.common.domain.scm.general.ext.IcGeneralInHExt;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.scm.general.controller.IcGeneralController;
import com.hzs.scm.general.param.GeneralParam;
import com.hzs.scm.general.service.IIcGeneralInBService;
import com.hzs.scm.general.service.IIcGeneralInHService;
import com.hzs.scm.general.vo.IcGeneralInBVO;
import com.hzs.scm.general.vo.IcGeneralInExcelVO;
import com.hzs.scm.general.vo.IcGeneralInVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* 其他入库表头 前端控制器
*
* @author hzs
* @since 2023-11-27
*/
@RestController
@RequestMapping("/manage/general-in")
@Slf4j
public class IcGeneralInHController extends IcGeneralController {
@Autowired
private IIcGeneralInHService generalInhService;
@Autowired
private IIcGeneralInBService generalInBiService;
/**
* 查询列表
*
* @return cubasdocParam 入参
*/
@PostMapping("/list")
@Log(module = EOperationModule.GENERAL_IN, business = EOperationBusiness.GENERAL_IN, method = EOperationMethod.SELECT)
public TableDataInfo listGeneralIn(@RequestBody GeneralParam generalParam) {
startPage();
generalParam.setPkCountry(SecurityUtils.getPkCountry());
List<IcGeneralInHExt> generalInExtList = generalInhService.queryDisGeneralInExtByCondition(generalParam);
return packageTableDataInfo(generalInExtList, packageScmReturnVo(generalInExtList));
}
private List<IcGeneralInVO> packageScmReturnVo(List<IcGeneralInHExt> generalInExtList) {
List<IcGeneralInVO> generalInList = new ArrayList<>();
for (IcGeneralInHExt generalInExt : generalInExtList) {
IcGeneralInVO icGeneralInVO = BeanUtil.copyProperties(generalInExt, IcGeneralInVO.class);
List<IcGeneralInBExt> generalInbExtList = generalInExt.getGeneralInbExtList();
if (CollectionUtil.isNotEmpty(generalInbExtList)) {
List<IcGeneralInBVO> returnbVoList = BeanUtil.copyToList(generalInbExtList, IcGeneralInBVO.class);
icGeneralInVO.setGeneralInbExtList(returnbVoList);
}
generalInList.add(icGeneralInVO);
}
return generalInList;
}
/**
* 查询待入库订单的明细
*
* @return cubasdocParam 入参
*/
@GetMapping("/list-detail/{pkId}")
public TableDataInfo queryGeneralInDetail(@PathVariable Long pkId) {
List<IcGeneralInBExt> generalInBiExtList = generalInBiService.queryGeneralInbByPk(SecurityUtils.getPkCountry(), pkId);
List<IcGeneralInBVO> scmReturnVoList = new ArrayList<>();
for (IcGeneralInBExt generalInExt : generalInBiExtList) {
scmReturnVoList.add(BeanUtil.copyProperties(generalInExt, IcGeneralInBVO.class));
}
return packageTableDataInfo(generalInBiExtList, scmReturnVoList);
}
/**
* 分页查询会员某个时间段内的奖金汇总
*/
@PostMapping("/export-list-total")
@Log(module = EOperationModule.GENERAL_IN, business = EOperationBusiness.GENERAL_IN, method = EOperationMethod.EXPORT)
public void exportListTransInTotal(HttpServletResponse response, GeneralParam generalParam) {
generalParam.setPkCountry(SecurityUtils.getPkCountry());
List<IcGeneralInHExt> generalInExtList = generalInhService.queryDisGeneralInExtByCondition(generalParam);
List<IcGeneralInExcelVO> generalInExcelVoList = packageScmExportVo(generalInExtList);
ExcelUtil<IcGeneralInExcelVO> util = new ExcelUtil<>(IcGeneralInExcelVO.class);
util.exportExcel(response, generalInExcelVoList, "其他入库导出");
}
private List<IcGeneralInExcelVO> packageScmExportVo(List<IcGeneralInHExt> generalInExtList) {
List<IcGeneralInExcelVO> generalInExcelVoList = new ArrayList<>();
for (IcGeneralInHExt generalInExt : generalInExtList) {
List<IcGeneralInBExt> generalInbExtList = generalInExt.getGeneralInbExtList();
for (IcGeneralInBExt generalInBiExt : generalInbExtList) {
IcGeneralInExcelVO generalInExcelVo = BeanUtil.copyProperties(generalInExt, IcGeneralInExcelVO.class);
setScmItemsGeneralExcel(generalInBiExt, generalInExcelVo);
generalInExcelVo.setBizDate(generalInBiExt.getBizDate());
generalInExcelVo.setNcostprice(generalInBiExt.getNcostprice());
generalInExcelVo.setNcostmny(generalInBiExt.getNcostmny());
generalInExcelVoList.add(generalInExcelVo);
}
}
return generalInExcelVoList;
}
/**
* 新增其他入库
*
* @param generalParam 入参
*/
@PostMapping("/insert")
@Log(module = EOperationModule.GENERAL_IN, business = EOperationBusiness.GENERAL_IN, method = EOperationMethod.INSERT)
public AjaxResult saveGeneralIn(@RequestBody GeneralParam generalParam) {
String message = validateGeneralParam(generalParam);
if (ObjectUtil.isNotEmpty(message)) {
return AjaxResult.error(TransactionUtils.getContent(message));
}
generalInhService.insertGeneralInByGeneralParam(generalParam, SecurityUtils.getUserId());
// 审核通过后需要关闭采购订单 回写采购订单累计入库数量
return AjaxResult.success();
}
/**
* 修改其他入库
*
* @param generalParam 入参
*/
@PostMapping("/update")
@Log(module = EOperationModule.GENERAL_IN, business = EOperationBusiness.GENERAL_IN, method = EOperationMethod.UPDATE)
public AjaxResult updatePoOrder(@RequestBody GeneralParam generalParam) {
if (generalParam.getPkId() == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_IN_NOT_EXIST));
}
String message = validateGeneralParam(generalParam);
if (ObjectUtil.isNotEmpty(message)) {
return AjaxResult.error(TransactionUtils.getContent(message));
}
// 查询是否存在其他入库单
IcGeneralInHExt generalInhExt = generalInhService.queryGeneralInById(generalParam.getPkId(), EScmOrderStatus.SAVE.getValue());
if (generalInhExt == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_IN_NOT_EXIST));
}
generalInhService.updateGeneralInByGeneralParam(generalInhExt, generalParam, SecurityUtils.getUserId());
return AjaxResult.success();
}
/**
* 删除其他入库
*
* @param pkId 主键
*/
@DeleteMapping("/{pkId}")
@Log(module = EOperationModule.GENERAL_IN, business = EOperationBusiness.GENERAL_IN, method = EOperationMethod.DELETE)
public AjaxResult delete(@PathVariable Long pkId) {
if (pkId == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_IN_NOT_EXIST));
}
IcGeneralInHExt generalInhExt = generalInhService.queryGeneralInById(pkId, EScmOrderStatus.SAVE.getValue());
if (generalInhExt == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_IN_NOT_EXIST));
}
generalInhService.deleteGeneralIn(pkId, SecurityUtils.getUserId());
return AjaxResult.success();
}
}

View File

@ -1,184 +0,0 @@
package com.hzs.scm.general.controller.manage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.ScmMsgConstants;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutBExt;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutHExt;
import com.hzs.common.security.service.UserTokenService;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.scm.general.controller.IcGeneralController;
import com.hzs.scm.general.param.GeneralParam;
import com.hzs.scm.general.service.IIcGeneralOutBService;
import com.hzs.scm.general.service.IIcGeneralOutHService;
import com.hzs.scm.general.vo.IcGeneralOutBVO;
import com.hzs.scm.general.vo.IcGeneralOutExcelVO;
import com.hzs.scm.general.vo.IcGeneralOutVO;
import com.hzs.scm.pub.service.IScmOrderApproveLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* 其他出库单表头 前端控制器
*
* @author hzs
* @since 2023-11-27
*/
@RestController
@RequestMapping("/manage/general-out")
@Slf4j
public class IcGeneralOutHController extends IcGeneralController {
@Autowired
private IIcGeneralOutHService generalOutService;
@Autowired
private IIcGeneralOutBService generalOutBiService;
/**
* 查询列表
*
* @return cubasdocParam 入参
*/
@PostMapping("/list")
@Log(module = EOperationModule.GENERAL_OUT, business = EOperationBusiness.GENERAL_OUT, method = EOperationMethod.SELECT)
public TableDataInfo listGeneralOut(@RequestBody GeneralParam generalParam) {
startPage();
generalParam.setPkCountry(SecurityUtils.getPkCountry());
List<IcGeneralOutHExt> generalOutExtList = generalOutService.queryDisGeneralOutExtCondition(generalParam);
return packageTableDataInfo(generalOutExtList, packageScmReturnVo(generalOutExtList));
}
/**
* 查询待入库订单的明细
*
* @return cubasdocParam 入参
*/
@GetMapping("/list-detail/{pkId}")
public TableDataInfo queryGeneralOutDetail(@PathVariable Long pkId) {
List<IcGeneralOutBExt> generalOutBiExtList = generalOutBiService.queryGeneralOutBiByPK(SecurityUtils.getPkCountry(), pkId);
List<IcGeneralOutBVO> scmReturnVoList = new ArrayList<>();
for (IcGeneralOutBExt generalOutBiExt : generalOutBiExtList) {
scmReturnVoList.add(BeanUtil.copyProperties(generalOutBiExt, IcGeneralOutBVO.class));
}
return packageTableDataInfo(generalOutBiExtList, scmReturnVoList);
}
private List<IcGeneralOutVO> packageScmReturnVo(List<IcGeneralOutHExt> generalOutExtList) {
List<IcGeneralOutVO> generalOutList = new ArrayList<>();
for (IcGeneralOutHExt generalOutExt : generalOutExtList) {
IcGeneralOutVO generalOutVO = BeanUtil.copyProperties(generalOutExt, IcGeneralOutVO.class);
List<IcGeneralOutBExt> generalOutbExtList = generalOutExt.getGeneralOutbExtList();
if(CollectionUtil.isNotEmpty(generalOutbExtList)) {
List<IcGeneralOutBVO> returnbVoList = BeanUtil.copyToList(generalOutbExtList, IcGeneralOutBVO.class);
generalOutVO.setGeneralOutbExtList(returnbVoList);
}
generalOutList.add(generalOutVO);
}
return generalOutList;
}
/**
* 分页查询会员某个时间段内的奖金汇总
*/
@PostMapping("/export-list-total")
@Log(module = EOperationModule.GENERAL_IN, business = EOperationBusiness.GENERAL_IN, method = EOperationMethod.EXPORT)
public void exportListTransInTotal(HttpServletResponse response, GeneralParam generalParam){
generalParam.setPkCountry(SecurityUtils.getPkCountry());
List<IcGeneralOutHExt> generalOutExtList = generalOutService.queryDisGeneralOutExtCondition(generalParam);
List<IcGeneralOutExcelVO> generalOutExcelVoList = packageScmExportVo(generalOutExtList);
ExcelUtil<IcGeneralOutExcelVO> util = new ExcelUtil<>(IcGeneralOutExcelVO.class);
util.exportExcel(response, generalOutExcelVoList, "其他出库导出");
}
private List<IcGeneralOutExcelVO> packageScmExportVo(List<IcGeneralOutHExt> generalOutExtList) {
List<IcGeneralOutExcelVO> generalOutExcelVoList = new ArrayList<>();
for (IcGeneralOutHExt generalOutExt : generalOutExtList) {
List<IcGeneralOutBExt> generalOutbExtList = generalOutExt.getGeneralOutbExtList();
for (IcGeneralOutBExt generalOutBiExt : generalOutbExtList) {
IcGeneralOutExcelVO generalOutExcelVo = BeanUtil.copyProperties(generalOutExt, IcGeneralOutExcelVO.class);
setScmItemsGeneralExcel(generalOutBiExt, generalOutExcelVo);
generalOutExcelVo.setBizDate(generalOutBiExt.getBizDate());
generalOutExcelVo.setNcostprice(generalOutBiExt.getNcostprice());
generalOutExcelVo.setNcostmny(generalOutBiExt.getNcostmny());
generalOutExcelVoList.add(generalOutExcelVo);
}
}
return generalOutExcelVoList;
}
/**
* 新增其他入库
*
* @param generalParam 入参
*/
@PostMapping("/insert")
@Log(module = EOperationModule.GENERAL_OUT, business = EOperationBusiness.GENERAL_OUT, method = EOperationMethod.INSERT)
public AjaxResult saveGeneralOut(@RequestBody GeneralParam generalParam) {
String message = validateGeneralParam(generalParam);
if (ObjectUtil.isNotEmpty(message)) {
return AjaxResult.error(TransactionUtils.getContent(message));
}
generalOutService.insertGeneralOutByGeneralParam(generalParam, SecurityUtils.getUserId());
return AjaxResult.success();
}
/**
* 修改其他入库
*
* @param generalParam 入参
*/
@PostMapping("/update")
@Log(module = EOperationModule.GENERAL_OUT, business = EOperationBusiness.GENERAL_OUT, method = EOperationMethod.UPDATE)
public AjaxResult updatePoOrder(@RequestBody GeneralParam generalParam) {
if (generalParam.getPkId() == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_OUT_NOT_EXIST));
}
String message = validateGeneralParam(generalParam);
if (ObjectUtil.isNotEmpty(message)) {
return AjaxResult.error(TransactionUtils.getContent(message));
}
if (generalParam.getPkId() == null) {
generalOutService.insertGeneralOutByGeneralParam(generalParam, SecurityUtils.getUserId());
} else {
// 查询是否存在其他入库单
IcGeneralOutHExt generalOutExt = generalOutService.queryGeneralOutById(generalParam.getPkId(), EScmOrderStatus.SAVE.getValue());
if (generalOutExt == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_OUT_NOT_EXIST));
}
generalOutService.updateGeneralOutByGeneralParam(generalOutExt, generalParam, SecurityUtils.getUserId());
}
return AjaxResult.success();
}
/**
* 删除其他入库
*
* @param pkId 主键
*/
@DeleteMapping("/{pkId}")
@Log(module = EOperationModule.GENERAL_OUT, business = EOperationBusiness.GENERAL_OUT, method = EOperationMethod.DELETE)
public AjaxResult delete(@PathVariable Long pkId) {
if (pkId == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_OUT_NOT_EXIST));
}
IcGeneralOutHExt generalOutExt = generalOutService.queryGeneralOutById(pkId, EScmOrderStatus.SAVE.getValue());
if (generalOutExt == null) {
return AjaxResult.error(TransactionUtils.getContent(ScmMsgConstants.IC_GENERAL_OUT_NOT_EXIST));
}
generalOutService.deleteGeneralOut(pkId, SecurityUtils.getUserId());
return AjaxResult.success();
}
}

View File

@ -1,43 +0,0 @@
package com.hzs.scm.general.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.general.IcGeneralInB;
import com.hzs.common.domain.scm.general.ext.IcGeneralInBExt;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 其他入库单明细 Mapper 接口
* </p>
*
* @author hzs
* @since 2023-11-27
*/
public interface IcGeneralInBMapper extends BaseMapper<IcGeneralInB> {
/*
* @description: 根据主表主键查询其他入库单明细
* @author: sui q
* @date: 2023/11/25 15:02
* @param: null null
**/
List<IcGeneralInBExt> queryGeneralInbByList(@Param("orderType") Integer orderType, @Param("icGeneralInbExtList") List<IcGeneralInBExt> icGeneralInbExtList);
/*
* @description: 查询采购订单明细
* @author: sui q
* @date: 2023/11/23 14:17
* @param: null null
**/
List<IcGeneralInBExt> queryGeneralInbByPk(@Param("pkCountry") Integer pkCountry, @Param("pkOrder") Long pkOrder);
/*
* @description: 删除其他入库单明细
* @author: sui q
* @date: 2023/11/21 14:23
* @param: null null
**/
void deleteGeneralItemsByList(@Param("icGeneralInbList") List<IcGeneralInB> icGeneralInbList, @Param("pkMember") Long pkMember);
}

View File

@ -1,37 +0,0 @@
package com.hzs.scm.general.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.general.IcGeneralInH;
import com.hzs.common.domain.scm.general.ext.IcGeneralInHExt;
import com.hzs.common.domain.scm.po.ext.PoOrderExt;
import com.hzs.scm.general.param.GeneralParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 其他入库表头 Mapper 接口
* </p>
*
* @author hzs
* @since 2023-11-27
*/
public interface IcGeneralInHMapper extends BaseMapper<IcGeneralInH> {
/*
* @description: 根据主键查询其他入库其他入库明细
* @author: sui q
* @date: 2023/11/21 10:49
* @param: null null
**/
IcGeneralInHExt queryGeneralInById(@Param("pkId") Long pkId, @Param("orderStatus") Integer orderStatus);
/*
* @description: 查询会员端显示的采购入库单
* @author: sui q
* @date: 2023/11/25 9:55
* @param: null null
**/
List<IcGeneralInHExt> queryDisGeneralInExtByCondition(GeneralParam generalParam);
}

View File

@ -1,43 +0,0 @@
package com.hzs.scm.general.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.general.IcGeneralOutB;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutBExt;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 其他入库单明细 Mapper 接口
* </p>
*
* @author hzs
* @since 2023-11-27
*/
public interface IcGeneralOutBMapper extends BaseMapper<IcGeneralOutB> {
/*
* @description: 根据主表主键查询采购入库单明细
* @author: sui q
* @date: 2023/11/25 15:02
* @param: null null
**/
List<IcGeneralOutBExt> queryGeneralOutBiByPk(@Param("orderType") Integer orderType, @Param("icGeneralOutbExtList") List<IcGeneralOutBExt> icGeneralOutbExtList);
/*
* @description: 根据主表主键查询采购入库单明细
* @author: sui q
* @date: 2023/11/25 15:02
* @param: null null
**/
List<IcGeneralOutBExt> queryGeneralOutBiByPK(@Param("pkCountry") Integer pkCountry, @Param("pkOrder") Long pkOrder);
/*
* @description: 删除其他入库单明细
* @author: sui q
* @date: 2023/11/21 14:23
* @param: null null
**/
void deleteGeneralItemsByList(@Param("icGeneralOutBList") List<IcGeneralOutB> icGeneralOutbList, @Param("pkMember") Long pkMember);
}

View File

@ -1,37 +0,0 @@
package com.hzs.scm.general.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.general.IcGeneralOutH;
import com.hzs.common.domain.scm.general.ext.IcGeneralInHExt;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutHExt;
import com.hzs.scm.general.param.GeneralParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 其他出库单表头 Mapper 接口
* </p>
*
* @author hzs
* @since 2023-11-27
*/
public interface IcGeneralOutHMapper extends BaseMapper<IcGeneralOutH> {
/*
* @description: 根据主键查询其他入库其他入库明细
* @author: sui q
* @date: 2023/11/21 10:49
* @param: null null
**/
IcGeneralOutHExt queryGeneralInById(@Param("pkId") Long pkId, @Param("orderStatus") Integer orderStatus);
/*
* @description: 查询会员端显示的采购入库单
* @author: sui q
* @date: 2023/11/25 9:55
* @param: null null
**/
List<IcGeneralOutHExt> queryDisGeneralOutExtByCondition(GeneralParam generalParam);
}

View File

@ -1,72 +0,0 @@
package com.hzs.scm.general.param;
import com.hzs.scm.pub.param.ItemSpecsParam;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @description: 明细参数
* @author: sui q
* @time: 2023/11/27 15:03
* @classname: GeneralBParam
* @package_name: com.hzs.scm.general.param
* version 1.0.0
*/
@Data
public class GeneralBParam implements Serializable {
/**
* 主键
*/
private Long pkId;
/**
* 单位
*/
private Integer pkUnit;
/**
* 货位
*/
private Integer pkClocation;
/**
* 产品信息主键
*/
private Integer pkProduct;
/**
* 入库日期
*/
private Date bizDate;
/**
* 仓库
*/
private Integer pkStorehouse;
/**
* 数量
*/
private BigDecimal nnum;
/**
* 单价
*/
private BigDecimal ncostprice;
/**
* 批次主键
*/
private Long pkBatchCode;
/**
* 明细表规格明细
*/
private List<ItemSpecsParam> scmItemSpecsList;
}

View File

@ -1,65 +0,0 @@
package com.hzs.scm.general.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.hzs.scm.pub.param.ScmPubParam;
import lombok.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @description: 其他出入库参数
* @author: sui q
* @time: 2023/11/27 15:00
* @classname: GeneralParam
* @package_name: com.hzs.scm.general.param
* version 1.0.0
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GeneralParam extends ScmPubParam {
/**
* 出库公司
*/
private Integer pkOutCorp;
/**
* 入库公司
*/
private Integer pkInCorp;
/**
* 供应商
*/
private Integer pkCubasdoc;
/**
* 客户
*/
private Integer pkCustomer;
/**
* 仓库
*/
private Integer pkWarehouse;
/**
* 出库仓库
*/
private Integer pkOutWarehouse;
/**
* 入库仓库
*/
private Integer pkInWarehouse;
/**
* 明细
*/
private List<GeneralBParam> generalbParamList;
}

View File

@ -1,52 +0,0 @@
package com.hzs.scm.general.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.general.IcGeneralInB;
import com.hzs.common.domain.scm.general.ext.IcGeneralInBExt;
import com.hzs.common.domain.scm.po.ext.PoOrderItemsExt;
import java.util.List;
/**
* <p>
* 其他入库单明细 服务类
* </p>
*
* @author hzs
* @since 2023-11-27
*/
public interface IIcGeneralInBService extends IService<IcGeneralInB> {
/*
* @description: 根据主表主键查询采购入库单明细
* @author: sui q
* @date: 2023/11/25 15:02
* @param: null null
**/
List<IcGeneralInBExt> queryGeneralInbByPk(Integer orderType, List<IcGeneralInBExt> icGeneralInbExtList);
/*
* @description: 查询其他入库单明细
* @author: sui q
* @date: 2023/11/23 14:17
* @param: null null
**/
List<IcGeneralInBExt> queryGeneralInbByPk(Integer pkCountry, Long pkOrder);
/*
* @description: 删除订单明细
* @author: sui q
* @date: 2023/11/21 14:23
* @param: null null
**/
void deleteGeneralItemsByList(List<IcGeneralInB> icGeneralInbList, Long pkMember);
/*
* @description: 删除采购入库单明细根据订单主键
* @author: sui q
* @date: 2023/11/21 14:55
* @param: null null
**/
void deleteGeneralItemsByPkGeneral(Long pkGeneral, Long pkMember);
}

View File

@ -1,57 +0,0 @@
package com.hzs.scm.general.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.general.IcGeneralInH;
import com.hzs.common.domain.scm.general.ext.IcGeneralInHExt;
import com.hzs.scm.general.param.GeneralParam;
import java.util.List;
/**
* 其他入库表头 服务类
*
* @author hzs
* @since 2023-11-27
*/
public interface IIcGeneralInHService extends IService<IcGeneralInH> {
/*
* @description: 保存其他入库
* @author: sui q
* @date: 2023/11/20 15:54
* @param: null null
**/
void insertGeneralInByGeneralParam(GeneralParam generalParam, Long pkMember);
/*
* @description: 修改保存其他入库
* @author: sui q
* @date: 2023/11/21 11:51
* @param: null null
**/
void updateGeneralInByGeneralParam(IcGeneralInHExt generalInhExt, GeneralParam poOrderParam, Long pkMember);
/*
* @description: 根据订单主键查询其他入库
* @author: sui q
* @date: 2023/11/21 10:47
* @param: null null
**/
IcGeneralInHExt queryGeneralInById(Long pkId, Integer orderStatus);
/*
* @description: 查询会员端显示的采购入库单
* @author: sui q
* @date: 2023/11/25 9:55
* @param: null null
**/
List<IcGeneralInHExt> queryDisGeneralInExtByCondition(GeneralParam generalParam);
/*
* @description: 删除采购订单
* @author: sui q
* @date: 2023/11/21 14:54
* @param: null null
**/
void deleteGeneralIn(Long pkId, Long pkMember);
}

View File

@ -1,50 +0,0 @@
package com.hzs.scm.general.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.general.IcGeneralOutB;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutBExt;
import java.util.List;
/**
* <p>
* 其他入库单明细 服务类
* </p>
*
* @author hzs
* @since 2023-11-27
*/
public interface IIcGeneralOutBService extends IService<IcGeneralOutB> {
/*
* @description: 根据主表主键查询采购入库单明细
* @author: sui q
* @date: 2023/11/25 15:02
* @param: null null
**/
List<IcGeneralOutBExt> queryGeneralOutBiByList(Integer orderType, List<IcGeneralOutBExt> icGeneralOutbExtList);
/*
* @description: 根据主表主键查询采购入库单明细
* @author: sui q
* @date: 2023/11/25 15:02
* @param: null null
**/
List<IcGeneralOutBExt> queryGeneralOutBiByPK(Integer pkCountry, Long pkOrder);
/*
* @description: 删除订单明细
* @author: sui q
* @date: 2023/11/21 14:23
* @param: null null
**/
void deleteGeneralItemsByList(List<IcGeneralOutB> icGeneralOutbList, Long pkMember);
/*
* @description: 删除采购入库单明细根据订单主键
* @author: sui q
* @date: 2023/11/21 14:55
* @param: null null
**/
void deleteGeneralItemsByPkGeneral(Long pkGeneral, Long pkMember);
}

View File

@ -1,57 +0,0 @@
package com.hzs.scm.general.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.general.IcGeneralOutH;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutHExt;
import com.hzs.scm.general.param.GeneralParam;
import java.util.List;
/**
* 其他出库单表头 服务类
*
* @author hzs
* @since 2023-11-27
*/
public interface IIcGeneralOutHService extends IService<IcGeneralOutH> {
/*
* @description: 保存其他入库
* @author: sui q
* @date: 2023/11/20 15:54
* @param: null null
**/
void insertGeneralOutByGeneralParam(GeneralParam generalParam, Long pkMember);
/*
* @description: 修改保存其他入库
* @author: sui q
* @date: 2023/11/21 11:51
* @param: null null
**/
void updateGeneralOutByGeneralParam(IcGeneralOutHExt generalOutExt, GeneralParam poOrderParam, Long pkMember);
/*
* @description: 根据订单主键查询其他入库
* @author: sui q
* @date: 2023/11/21 10:47
* @param: null null
**/
IcGeneralOutHExt queryGeneralOutById(Long pkId, Integer orderStatus);
/*
* @description: 查询会员端显示的其他入库
* @author: sui q
* @date: 2023/11/25 9:55
* @param: null null
**/
List<IcGeneralOutHExt> queryDisGeneralOutExtCondition(GeneralParam generalParam);
/*
* @description: 删除采购订单
* @author: sui q
* @date: 2023/11/21 14:54
* @param: null null
**/
void deleteGeneralOut(Long pkId, Long pkMember);
}

View File

@ -1,52 +0,0 @@
package com.hzs.scm.general.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.ScmFieldConstants;
import com.hzs.common.core.constant.SystemFieldConstants;
import com.hzs.common.core.enums.EYesNo;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.scm.general.IcGeneralInB;
import com.hzs.common.domain.scm.general.ext.IcGeneralInBExt;
import com.hzs.scm.general.mapper.IcGeneralInBMapper;
import com.hzs.scm.general.service.IIcGeneralInBService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 其他入库单明细 服务实现类
* </p>
*
* @author hzs
* @since 2023-11-27
*/
@Service
public class IcGeneralInBServiceImpl extends ServiceImpl<IcGeneralInBMapper, IcGeneralInB> implements IIcGeneralInBService {
@Override
public List<IcGeneralInBExt> queryGeneralInbByPk(Integer orderType, List<IcGeneralInBExt> icGeneralInbExtList) {
return baseMapper.queryGeneralInbByList(orderType, icGeneralInbExtList);
}
@Override
public List<IcGeneralInBExt> queryGeneralInbByPk(Integer pkCountry, Long pkOrder) {
return baseMapper.queryGeneralInbByPk(pkCountry, pkOrder);
}
@Override
public void deleteGeneralItemsByList(List<IcGeneralInB> icGeneralInbList, Long pkMember) {
baseMapper.deleteGeneralItemsByList(icGeneralInbList, pkMember);
}
@Override
public void deleteGeneralItemsByPkGeneral(Long pkGeneral, Long pkMember) {
UpdateWrapper<IcGeneralInB> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EYesNo.NO.getIntValue());
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, pkMember);
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, DateUtils.currentDateTime());
updateWrapper.eq(ScmFieldConstants.PK_GENERAL, pkGeneral);
update(updateWrapper);
}
}

View File

@ -1,277 +0,0 @@
package com.hzs.scm.general.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.constant.SaOrderFieldConstants;
import com.hzs.common.core.constant.SystemFieldConstants;
import com.hzs.common.core.constant.msg.DocumentMsgConstants;
import com.hzs.common.core.constant.msg.ScmMsgConstants;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.ComputeUtil;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.scm.general.IcGeneralInB;
import com.hzs.common.domain.scm.general.IcGeneralInH;
import com.hzs.common.domain.scm.general.ext.IcGeneralInBExt;
import com.hzs.common.domain.scm.general.ext.IcGeneralInHExt;
import com.hzs.common.domain.scm.pub.ScmItemSpecs;
import com.hzs.common.domain.scm.pub.ScmOrderApproveLog;
import com.hzs.common.domain.system.sys.SysUser;
import com.hzs.common.util.TransactionUtils;
import com.hzs.scm.general.mapper.IcGeneralInHMapper;
import com.hzs.scm.general.param.GeneralBParam;
import com.hzs.scm.general.param.GeneralParam;
import com.hzs.scm.general.service.IIcGeneralInBService;
import com.hzs.scm.general.service.IIcGeneralInHService;
import com.hzs.scm.ic.service.IIcOnHandNumService;
import com.hzs.scm.no.service.IScmBillNoService;
import com.hzs.scm.pub.param.ItemSpecsParam;
import com.hzs.scm.pub.service.IScmItemSpecsService;
import com.hzs.scm.pub.service.IScmOrderApproveLogService;
import com.hzs.system.base.ICurrencyServiceApi;
import com.hzs.system.base.dto.CurrencyDTO;
import com.hzs.system.sys.IUserServiceApi;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
import com.hzs.system.sys.dto.LoginUser;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
/**
* 其他入库表头 服务实现类
*
* @author hzs
* @since 2023-11-27
*/
@Service
public class IcGeneralInHServiceImpl extends ServiceImpl<IcGeneralInHMapper, IcGeneralInH> implements IIcGeneralInHService {
@DubboReference
ICurrencyServiceApi currencyServiceApi;
@DubboReference
IUserServiceApi userServiceApi;
@Autowired
private IScmBillNoService scmBillNoService;
@Autowired
private IScmItemSpecsService scmItemSpecsService;
@Autowired
private IIcGeneralInBService generalInbService;
@Autowired
private RedisService redisService;
@Autowired
private IScmOrderApproveLogService scmOrderApproveLogService;
@Autowired
private IIcOnHandNumService icOnHandNumService;
@Override
@Transactional(rollbackFor = Exception.class)
public void insertGeneralInByGeneralParam(GeneralParam generalParam, Long pkMember) {
saveGeneralByParam(generalParam, pkMember);
}
@Override
public void updateGeneralInByGeneralParam(IcGeneralInHExt generalInhExt, GeneralParam generalParam, Long pkMember) {
// 更新规格明细表先删除在新增 根据主表主键删除
scmItemSpecsService.deleteItemSpecsById(EScmOrderType.GENERAL_IN.getValue(), generalInhExt.getPkId(), pkMember);
generalInhExt.setPkCorp(generalParam.getPkCorp());
generalInhExt.setPkOutCorp(generalParam.getPkOutCorp());
generalInhExt.setPkCubasdoc(generalParam.getPkCubasdoc());
generalInhExt.setPkWarehouse(generalParam.getPkWarehouse());
generalInhExt.setPkOutWarehouse(generalParam.getPkOutWarehouse());
generalInhExt.setOrderDate(generalParam.getOrderDate());
generalInhExt.setRemark(generalParam.getRemark());
// 更新订单明细表 分为3部分 删除的 新增的 修改的
List<IcGeneralInB> generalInbList = getGeneralItems(generalParam, pkMember, generalInhExt);
// 重新处理订单明细将订单明细分为 删除的新增的修改的
List<IcGeneralInBExt> icGeneralInbExtList = generalInhExt.getGeneralInbExtList();
// 剩余的就是需要删除的
Map<Long, IcGeneralInBExt> generalInbExtMap = icGeneralInbExtList.stream().collect(Collectors.toMap(IcGeneralInBExt::getPkId, generalInb -> generalInb));
List<IcGeneralInB> insertGeneralItems = new ArrayList<>();
List<IcGeneralInB> updateGeneralItems = new ArrayList<>();
List<ScmItemSpecs> saveScmItemSpecsList = new ArrayList<>();
for (IcGeneralInB generalInB : generalInbList) {
if (generalInB.getPkId() != null && generalInbExtMap.containsKey(generalInB.getPkId())) {
// 修改的
generalInB.setPkCreator(generalInbExtMap.get(generalInB.getPkId()).getPkCreator());
updateGeneralItems.add(generalInB);
saveScmItemSpecsList.addAll(generalInB.getScmItemSpecsList());
generalInbExtMap.remove(generalInB.getPkId());
} else {
// 新增的
generalInB.setPkGeneral(generalInhExt.getPkId());
insertGeneralItems.add(generalInB);
}
}
String generalLockKey = CacheConstants.IC_GENERAL_IN_LOCK + generalInhExt.getPkId();
try {
if (!redisService.lockKeyOnce(generalLockKey)) {
throw new RuntimeException(ScmMsgConstants.BILL_NOT_OPERATION);
}
if (insertGeneralItems.size() > 0) {
// 保存订单明细 新增的
generalInbService.saveBatch(insertGeneralItems);
List<ScmItemSpecs> scmItemSpecsList = scmItemSpecsService.packageOrderItemsSpecs(insertGeneralItems, generalInhExt.getPkId());
if (scmItemSpecsList.size() > 0) {
saveScmItemSpecsList.addAll(scmItemSpecsList);
}
}
if (updateGeneralItems.size() > 0) {
// 修改订单明细 修改的
updateGeneralItems.forEach(updateItems ->
generalInbService.updateById(updateItems));
}
if (generalInbExtMap.size() > 0) {
// 删除订单明细 删除的
List<IcGeneralInB> delGeneralItems = new ArrayList<>();
generalInbExtMap.forEach((key, value) -> delGeneralItems.add(value));
generalInbService.deleteGeneralItemsByList(delGeneralItems, pkMember);
}
// 保存订单明细规格
if (saveScmItemSpecsList.size() > 0) {
scmItemSpecsService.saveBatch(saveScmItemSpecsList);
}
// 更新订单表
updateById(generalInhExt);
} finally {
redisService.unlock(generalLockKey);
}
}
@Override
public IcGeneralInHExt queryGeneralInById(Long pkId, Integer orderStatus) {
return baseMapper.queryGeneralInById(pkId, orderStatus);
}
@Override
public List<IcGeneralInHExt> queryDisGeneralInExtByCondition(GeneralParam generalParam) {
if (generalParam.getEndDate() != null) {
generalParam.setEndDate(DateUtils.afterDate(1, ChronoUnit.DAYS, generalParam.getEndDate()));
}
return baseMapper.queryDisGeneralInExtByCondition(generalParam);
}
@Override
public void deleteGeneralIn(Long pkId, Long pkMember) {
String generalInLock = CacheConstants.IC_GENERAL_IN_LOCK + pkId;
if (!redisService.lockKeyOnce(generalInLock)) {
throw new RuntimeException(ScmMsgConstants.BILL_NOT_OPERATION);
}
// 删除规格明细表
scmItemSpecsService.deleteItemSpecsById(EScmOrderType.GENERAL_IN.getValue(), pkId, pkMember);
generalInbService.deleteGeneralItemsByPkGeneral(pkId, pkMember);
UpdateWrapper<IcGeneralInH> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EYesNo.NO.getIntValue());
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, pkMember);
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, DateUtils.currentDateTime());
updateWrapper.eq(SystemFieldConstants.PK_ID, pkId);
update(updateWrapper);
redisService.unlock(generalInLock);
}
/*
* @description: 将采购订单的参数转换为能保存的订单
* @author: sui q
* @date: 2023/11/20 15:53
* @param: null null
**/
private void saveGeneralByParam(GeneralParam generalParam, Long pkMember) {
IcGeneralInH icGeneralInH = BeanUtil.copyProperties(generalParam, IcGeneralInH.class);
List<IcGeneralInB> generalItemList = getGeneralItems(generalParam, pkMember, icGeneralInH);
// 生成单据号
icGeneralInH.setOrderCode(scmBillNoService.createScmBillNoByOrderType(EScmOrderType.GENERAL_IN.getValue()));
// 保存主表
save(icGeneralInH);
for (IcGeneralInB generalInB : generalItemList) {
generalInB.setPkGeneral(icGeneralInH.getPkId());
}
// 保存子表
generalInbService.saveBatch(generalItemList);
List<ScmItemSpecs> saveScmItemSpecsList = scmItemSpecsService.packageOrderItemsSpecs(generalItemList, icGeneralInH.getPkId());
if (saveScmItemSpecsList.size() > 0) {
scmItemSpecsService.saveBatch(saveScmItemSpecsList);
}
}
private List<IcGeneralInB> getGeneralItems(GeneralParam generalParam, Long pkMember, IcGeneralInH icGeneralInH) {
// 根据国家获得汇率
CurrencyDTO currencyDTO = currencyServiceApi.getCurrency(generalParam.getPkCountry()).getData();
SysUser sysUser = userServiceApi.selectUserById(pkMember).getData();
// 根据登录账号获得部门
icGeneralInH.setOrderType(EScmOrderType.GENERAL_IN.getValue());
icGeneralInH.setPkDept(sysUser.getPkDept().intValue());
icGeneralInH.setPkWhsmanager(pkMember);
// 计算累计数量 累计价税合计
// 总数量
BigDecimal totalNum = BigDecimal.ZERO;
List<IcGeneralInB> icGeneralInbList = new ArrayList<>();
Date date = DateUtils.currentDateTime();
for (GeneralBParam generalbParam : generalParam.getGeneralbParamList()) {
IcGeneralInB generalInB = BeanUtil.copyProperties(generalbParam, IcGeneralInB.class);
// 金额
generalInB.setNcostmny(ComputeUtil.computeMultiply(generalInB.getNcostprice(), generalInB.getNnum()));
generalInB.setPkRate(currencyDTO.getPkId());
totalNum = ComputeUtil.computeAdd(totalNum, generalInB.getNnum());
List<ItemSpecsParam> itemSpecsParamList = generalbParam.getScmItemSpecsList();
scmItemSpecsService.packageScmItemByParam(itemSpecsParamList, generalInB, generalParam.getPkCountry(), pkMember,
icGeneralInH.getPkId(), generalInB.getPkId(), EScmOrderType.GENERAL_IN.getValue());
icGeneralInbList.add(generalInB);
}
icGeneralInH.setPkCountry(generalParam.getPkCountry());
if (generalParam.getPkId() == null) {
icGeneralInH.setPkCreator(pkMember);
} else {
icGeneralInH.setPkModified(pkMember);
icGeneralInH.setModifiedTime(date);
}
icGeneralInH.setTotalNum(totalNum);
return icGeneralInbList;
}
private String approveGeneralByStatus(ApprovalBusinessResultDTO approvalBusinessResultDTO, Integer scmOrderStatus, Integer approveStatus) {
// 查询订单日志表
List<ScmOrderApproveLog> scmOrderApproveLogList = scmOrderApproveLogService.queryScmOrderApproveLogByCondition(null, approvalBusinessResultDTO.getEApprovalBusiness().getValue(), approvalBusinessResultDTO.getBusinessCode());
if (scmOrderApproveLogList == null || scmOrderApproveLogList.size() == 0) {
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_NOT_EXISTS);
}
ScmOrderApproveLog scmOrderApproveLog = scmOrderApproveLogList.get(0);
// 查询其他入库单
IcGeneralInHExt generalInhExt = queryGeneralInById(scmOrderApproveLog.getPkOrder(), EScmOrderStatus.SUBMIT.getValue());
if (generalInhExt == null) {
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_HAS_HANDLE);
}
// 更新采购入库单状态
updateGeneralStatus(generalInhExt.getPkId(), approvalBusinessResultDTO.getLoginUser(), scmOrderStatus);
// 更新前程日志表状态
scmOrderApproveLogService.updateScmOrderApproveStatus(scmOrderApproveLog.getPkId(), approvalBusinessResultDTO.getLoginUser().getUserId(), approveStatus);
if (EAgentApprovalStatus.APPROVED.getValue() == approveStatus) {
// 查询其他入库单明细表
List<IcGeneralInBExt> generalInbExtList = generalInbService.queryGeneralInbByPk(EScmOrderType.GENERAL_IN.getValue(), generalInhExt.getGeneralInbExtList());
if (generalInbExtList != null && generalInbExtList.size() > 0) {
generalInhExt.setGeneralInbExtList(generalInbExtList);
}
// 更新现存量 // 更新采购订单累计入库数量
icOnHandNumService.mergeIcOnHandNumByGeneralIn(generalInhExt, generalInhExt.getGeneralInbExtList(), EScmOrderType.GENERAL_IN.getValue(), approvalBusinessResultDTO.getLoginUser().getUserId());
}
return null;
}
private void updateGeneralStatus(Long pkId, LoginUser loginUser, Integer orderStatus) {
UpdateWrapper<IcGeneralInH> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(SaOrderFieldConstants.ORDER_STATUS, orderStatus);
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, loginUser.getUserId());
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, DateUtils.currentDateTime());
updateWrapper.eq(SystemFieldConstants.PK_ID, pkId);
update(updateWrapper);
}
}

View File

@ -1,52 +0,0 @@
package com.hzs.scm.general.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.ScmFieldConstants;
import com.hzs.common.core.constant.SystemFieldConstants;
import com.hzs.common.core.enums.EYesNo;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.scm.general.IcGeneralOutB;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutBExt;
import com.hzs.scm.general.mapper.IcGeneralOutBMapper;
import com.hzs.scm.general.service.IIcGeneralOutBService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 其他入库单明细 服务实现类
* </p>
*
* @author hzs
* @since 2023-11-27
*/
@Service
public class IcGeneralOutBServiceImpl extends ServiceImpl<IcGeneralOutBMapper, IcGeneralOutB> implements IIcGeneralOutBService {
@Override
public List<IcGeneralOutBExt> queryGeneralOutBiByList(Integer orderType, List<IcGeneralOutBExt> icGeneralOutbExtList) {
return baseMapper.queryGeneralOutBiByPk(orderType, icGeneralOutbExtList);
}
@Override
public List<IcGeneralOutBExt> queryGeneralOutBiByPK(Integer pkCountry, Long pkOrder) {
return baseMapper.queryGeneralOutBiByPK(pkCountry, pkOrder);
}
@Override
public void deleteGeneralItemsByList(List<IcGeneralOutB> icGeneralOutbList, Long pkMember) {
baseMapper.deleteGeneralItemsByList(icGeneralOutbList, pkMember);
}
@Override
public void deleteGeneralItemsByPkGeneral(Long pkGeneral, Long pkMember) {
UpdateWrapper<IcGeneralOutB> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EYesNo.NO.getIntValue());
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, pkMember);
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, DateUtils.currentDateTime());
updateWrapper.eq(ScmFieldConstants.PK_GENERAL, pkGeneral);
update(updateWrapper);
}
}

View File

@ -1,280 +0,0 @@
package com.hzs.scm.general.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.constant.SaOrderFieldConstants;
import com.hzs.common.core.constant.SystemFieldConstants;
import com.hzs.common.core.constant.msg.DocumentMsgConstants;
import com.hzs.common.core.constant.msg.ScmMsgConstants;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.ComputeUtil;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.scm.general.IcGeneralOutB;
import com.hzs.common.domain.scm.general.IcGeneralOutH;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutBExt;
import com.hzs.common.domain.scm.general.ext.IcGeneralOutHExt;
import com.hzs.common.domain.scm.pub.ScmItemSpecs;
import com.hzs.common.domain.scm.pub.ScmOrderApproveLog;
import com.hzs.common.domain.system.sys.SysUser;
import com.hzs.common.util.TransactionUtils;
import com.hzs.scm.general.mapper.IcGeneralOutHMapper;
import com.hzs.scm.general.param.GeneralBParam;
import com.hzs.scm.general.param.GeneralParam;
import com.hzs.scm.general.service.IIcGeneralOutBService;
import com.hzs.scm.general.service.IIcGeneralOutHService;
import com.hzs.scm.ic.service.IIcOnHandNumService;
import com.hzs.scm.no.service.IScmBillNoService;
import com.hzs.scm.pub.param.ItemSpecsParam;
import com.hzs.scm.pub.service.IScmItemSpecsService;
import com.hzs.scm.pub.service.IScmOrderApproveLogService;
import com.hzs.system.base.ICurrencyServiceApi;
import com.hzs.system.base.dto.CurrencyDTO;
import com.hzs.system.sys.IUserServiceApi;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
import com.hzs.system.sys.dto.LoginUser;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 其他出库单表头 服务实现类
*
* @author hzs
* @since 2023-11-27
*/
@Service
public class IcGeneralOutHServiceImpl extends ServiceImpl<IcGeneralOutHMapper, IcGeneralOutH> implements IIcGeneralOutHService {
@DubboReference
ICurrencyServiceApi currencyServiceApi;
@DubboReference
IUserServiceApi userServiceApi;
@Autowired
private IScmBillNoService scmBillNoService;
@Autowired
private IScmItemSpecsService scmItemSpecsService;
@Autowired
private IIcGeneralOutBService generalOutBiService;
@Autowired
private RedisService redisService;
@Autowired
private IScmOrderApproveLogService scmOrderApproveLogService;
@Autowired
private IIcOnHandNumService onHandNumService;
@Override
@Transactional(rollbackFor = Exception.class)
public void insertGeneralOutByGeneralParam(GeneralParam generalParam, Long pkMember) {
saveGeneralByParam(generalParam, pkMember);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateGeneralOutByGeneralParam(IcGeneralOutHExt generalOutExt, GeneralParam generalParam, Long pkMember) {
// 更新规格明细表先删除在新增 根据主表主键删除
scmItemSpecsService.deleteItemSpecsById(EScmOrderType.GENERAL_OUT.getValue(), generalOutExt.getPkId(), pkMember);
generalOutExt.setPkCorp(generalParam.getPkCorp());
generalOutExt.setPkInCorp(generalParam.getPkInCorp());
generalOutExt.setPkCustomer(generalParam.getPkCustomer());
generalOutExt.setPkInWarehouse(generalParam.getPkInWarehouse());
generalOutExt.setPkWarehouse(generalParam.getPkWarehouse());
generalOutExt.setOrderDate(generalParam.getOrderDate());
generalOutExt.setRemark(generalParam.getRemark());
// 更新订单明细表 分为3部分 删除的 新增的 修改的
List<IcGeneralOutB> generalOutbList = getGeneralItems(generalParam, pkMember, generalOutExt);
// 重新处理订单明细将订单明细分为 删除的新增的修改的
List<IcGeneralOutBExt> icGeneralOutbExtList = generalOutExt.getGeneralOutbExtList();
// 剩余的就是需要删除的
Map<Long, IcGeneralOutBExt> generalOutbExtMap = icGeneralOutbExtList.stream().collect(Collectors.toMap(IcGeneralOutBExt::getPkId, generalOut -> generalOut));
List<IcGeneralOutB> insertGeneralItems = new ArrayList<>();
List<IcGeneralOutB> updateGeneralItems = new ArrayList<>();
List<ScmItemSpecs> saveScmItemSpecsList = new ArrayList<>();
for (IcGeneralOutB generalOutB : generalOutbList) {
if (generalOutB.getPkId() != null && generalOutbExtMap.containsKey(generalOutB.getPkId())) {
// 修改的
generalOutB.setPkCreator(generalOutbExtMap.get(generalOutB.getPkId()).getPkCreator());
updateGeneralItems.add(generalOutB);
saveScmItemSpecsList.addAll(generalOutB.getScmItemSpecsList());
generalOutbExtMap.remove(generalOutB.getPkId());
} else {
// 新增的
generalOutB.setPkGeneral(generalOutExt.getPkId());
insertGeneralItems.add(generalOutB);
}
}
String generalLockKey = CacheConstants.IC_GENERAL_OUT_LOCK + generalOutExt.getPkId();
try {
if (!redisService.lockKeyOnce(generalLockKey)) {
throw new RuntimeException(ScmMsgConstants.BILL_NOT_OPERATION);
}
if (insertGeneralItems.size() > 0) {
// 保存订单明细 新增的
generalOutBiService.saveBatch(insertGeneralItems);
List<ScmItemSpecs> scmItemSpecsList = scmItemSpecsService.packageOrderItemsSpecs(insertGeneralItems, generalOutExt.getPkId());
if (scmItemSpecsList.size() > 0) {
saveScmItemSpecsList.addAll(scmItemSpecsList);
}
}
if (updateGeneralItems.size() > 0) {
// 修改订单明细 修改的
updateGeneralItems.forEach(updateItems ->
generalOutBiService.updateById(updateItems));
}
if (generalOutbExtMap.size() > 0) {
// 删除订单明细 删除的
List<IcGeneralOutB> delGeneralItems = new ArrayList<>();
generalOutbExtMap.forEach((key, value) -> delGeneralItems.add(value));
generalOutBiService.deleteGeneralItemsByList(delGeneralItems, pkMember);
}
// 保存订单明细规格
if (saveScmItemSpecsList.size() > 0) {
scmItemSpecsService.saveBatch(saveScmItemSpecsList);
}
// 更新订单表
updateById(generalOutExt);
} finally {
redisService.unlock(generalLockKey);
}
}
@Override
public IcGeneralOutHExt queryGeneralOutById(Long pkId, Integer orderStatus) {
return baseMapper.queryGeneralInById(pkId, orderStatus);
}
@Override
public List<IcGeneralOutHExt> queryDisGeneralOutExtCondition(GeneralParam generalParam) {
if (generalParam.getEndDate() != null) {
generalParam.setEndDate(DateUtils.afterDate(1, ChronoUnit.DAYS, generalParam.getEndDate()));
}
return baseMapper.queryDisGeneralOutExtByCondition(generalParam);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteGeneralOut(Long pkId, Long pkMember) {
String generalOutLock = CacheConstants.IC_GENERAL_OUT_LOCK + pkId;
if (!redisService.lockKeyOnce(generalOutLock)) {
throw new RuntimeException(ScmMsgConstants.BILL_NOT_OPERATION);
}
// 删除规格明细表
scmItemSpecsService.deleteItemSpecsById(EScmOrderType.GENERAL_OUT.getValue(), pkId, pkMember);
generalOutBiService.deleteGeneralItemsByPkGeneral(pkId, pkMember);
UpdateWrapper<IcGeneralOutH> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EYesNo.NO.getIntValue());
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, pkMember);
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, DateUtils.currentDateTime());
updateWrapper.eq(SystemFieldConstants.PK_ID, pkId);
update(updateWrapper);
redisService.unlock(generalOutLock);
}
/*
* @description: 将采购订单的参数转换为能保存的订单
* @author: sui q
* @date: 2023/11/20 15:53
* @param: null null
**/
private void saveGeneralByParam(GeneralParam generalParam, Long pkMember) {
IcGeneralOutH icGeneralOutH = BeanUtil.copyProperties(generalParam, IcGeneralOutH.class);
List<IcGeneralOutB> generalItemList = getGeneralItems(generalParam, pkMember, icGeneralOutH);
// 生成单据号
icGeneralOutH.setOrderCode(scmBillNoService.createScmBillNoByOrderType(EScmOrderType.GENERAL_OUT.getValue()));
// 保存主表
save(icGeneralOutH);
for (IcGeneralOutB generalOutB : generalItemList) {
generalOutB.setPkGeneral(icGeneralOutH.getPkId());
}
// 保存子表
generalOutBiService.saveBatch(generalItemList);
List<ScmItemSpecs> saveScmItemSpecsList = scmItemSpecsService.packageOrderItemsSpecs(generalItemList, icGeneralOutH.getPkId());
if (saveScmItemSpecsList.size() > 0) {
scmItemSpecsService.saveBatch(saveScmItemSpecsList);
}
}
private List<IcGeneralOutB> getGeneralItems(GeneralParam generalParam, Long pkMember, IcGeneralOutH icGeneralOutH) {
// 根据国家获得汇率
CurrencyDTO currencyDTO = currencyServiceApi.getCurrency(generalParam.getPkCountry()).getData();
SysUser sysUser = userServiceApi.selectUserById(pkMember).getData();
// 根据登录账号获得部门
icGeneralOutH.setPkDept(sysUser.getPkDept().intValue());
icGeneralOutH.setPkWhsmanager(pkMember);
icGeneralOutH.setOrderType(EScmOrderType.GENERAL_OUT.getValue());
// 计算累计数量 累计价税合计
// 总数量
BigDecimal totalNum = BigDecimal.ZERO;
List<IcGeneralOutB> generalOutbList = new ArrayList<>();
Date date = DateUtils.currentDateTime();
for (GeneralBParam generalbParam : generalParam.getGeneralbParamList()) {
IcGeneralOutB generalOutB = BeanUtil.copyProperties(generalbParam, IcGeneralOutB.class);
// 金额
generalOutB.setNcostmny(ComputeUtil.computeMultiply(generalOutB.getNcostprice(), generalOutB.getNnum()));
generalOutB.setPkRate(currencyDTO.getPkId());
totalNum = ComputeUtil.computeAdd(totalNum, generalOutB.getNnum());
List<ItemSpecsParam> itemSpecsParamList = generalbParam.getScmItemSpecsList();
scmItemSpecsService.packageScmItemByParam(itemSpecsParamList, generalOutB, generalParam.getPkCountry(), pkMember,
icGeneralOutH.getPkId(), generalOutB.getPkId(), EScmOrderType.GENERAL_OUT.getValue());
generalOutbList.add(generalOutB);
}
icGeneralOutH.setPkCountry(generalParam.getPkCountry());
if (generalParam.getPkId() == null) {
icGeneralOutH.setPkCreator(pkMember);
} else {
icGeneralOutH.setPkModified(pkMember);
icGeneralOutH.setModifiedTime(date);
}
icGeneralOutH.setTotalNum(totalNum);
return generalOutbList;
}
private String approveGeneralByStatus(ApprovalBusinessResultDTO approvalBusinessResultDTO, Integer scmOrderStatus, Integer approveStatus) {
// 查询订单日志表
List<ScmOrderApproveLog> scmOrderApproveLogList = scmOrderApproveLogService.queryScmOrderApproveLogByCondition(null, approvalBusinessResultDTO.getEApprovalBusiness().getValue(), approvalBusinessResultDTO.getBusinessCode());
if (scmOrderApproveLogList == null || scmOrderApproveLogList.size() == 0) {
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_NOT_EXISTS);
}
ScmOrderApproveLog scmOrderApproveLog = scmOrderApproveLogList.get(0);
// 查询采购入库
IcGeneralOutHExt generalOutExt = queryGeneralOutById(scmOrderApproveLog.getPkOrder(), EScmOrderStatus.SUBMIT.getValue());
if (generalOutExt == null) {
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_HAS_HANDLE);
}
// 更新采购入库单状态
updateGeneralStatus(generalOutExt.getPkId(), approvalBusinessResultDTO.getLoginUser(), scmOrderStatus);
// 更新前程日志表状态
scmOrderApproveLogService.updateScmOrderApproveStatus(scmOrderApproveLog.getPkId(), approvalBusinessResultDTO.getLoginUser().getUserId(), approveStatus);
// 弃审的时候回退批次数量
if (EAgentApprovalStatus.REFUSE.getValue() == approveStatus) {
List<IcGeneralOutBExt> icGeneralOutbExtList = generalOutBiService.queryGeneralOutBiByList(EScmOrderType.GENERAL_OUT.getValue(), generalOutExt.getGeneralOutbExtList());
if (icGeneralOutbExtList != null && icGeneralOutbExtList.size() > 0) {
generalOutExt.setGeneralOutbExtList(icGeneralOutbExtList);
}
onHandNumService.backIcOnHandNumByGeneralOut(generalOutExt, generalOutExt.getGeneralOutbExtList(), EScmOrderType.GENERAL_OUT.getValue(), approvalBusinessResultDTO.getLoginUser().getUserId());
}
return null;
}
private void updateGeneralStatus(Long pkId, LoginUser loginUser, Integer orderStatus) {
UpdateWrapper<IcGeneralOutH> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(SaOrderFieldConstants.ORDER_STATUS, orderStatus);
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, loginUser.getUserId());
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, DateUtils.currentDateTime());
updateWrapper.eq(SystemFieldConstants.PK_ID, pkId);
update(updateWrapper);
}
}

View File

@ -1,142 +0,0 @@
package com.hzs.scm.general.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzs.scm.pub.vo.ScmSpecsVO;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @description: 其他入库单明细表
* @author: sui q
* @time: 2024/1/5 11:59
* @classname: IcGeneralInBVO
* @package_name: com.hzs.scm.general.vo
* version 1.0.0
*/
@Data
public class IcGeneralInBVO implements Serializable {
/**
* 产品信息主键
*/
private Integer pkProductBas;
/**
* 生产日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date productDate;
/**
* 失效日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date expireDate;
/**
* 单位名称
*/
private String unitName;
/**
* 货位名称
*/
private String clocationName;
/**
* 仓库名称
*/
private String storehouseName;
private String batchCode;
/**
* 产品编号
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 规格名称
*/
private String specsName;
/**
* 主键
*/
private Long pkId;
/**
* 单位
*/
private Integer pkUnit;
/**
* 主表主键
*/
private Long pkGeneral;
/**
* 货位
*/
private Integer pkClocation;
/**
* 产品信息主键
*/
private Integer pkProduct;
/**
* 出入口类型 1=入库 2=出库
*/
private Integer transType;
/**
* 入库日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date bizDate;
/**
* 仓库
*/
private Integer pkStorehouse;
/**
* 汇率
*/
private Integer pkRate;
/**
* 数量
*/
private BigDecimal nnum;
/**
* 单价
*/
private BigDecimal ncostprice;
/**
* 金额
*/
private BigDecimal ncostmny;
/**
* 批次主键
*/
private Long pkBatchCode;
private List<ScmSpecsVO> scmItemSpecsList;
}

View File

@ -1,126 +0,0 @@
package com.hzs.scm.general.vo;
import com.hzs.common.core.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @description: 其他入库单导出数据
* @author: sui q
* @time: 2024/3/8 14:13
* @classname: IcGeneralInExcelVO
* @package_name: com.hzs.scm.general.vo
* version 1.0.0
*/
@Data
public class IcGeneralInExcelVO implements Serializable {
/**
* 订单编号
*/
@Excel(name = "入库编号")
private String orderCode;
/**
* 部门名称
*/
@Excel(name = "部门")
private String deptName;
/**
* 管理员名称
*/
@Excel(name = "库管员")
private String managerName;
/**
* 采购组织名称
*/
@Excel(name = "库存公司")
private String corpName;
// /**
// * 出库公司
// */
// @Excel(name = "出库公司")
// private String outCorpName;
@Excel(name = "订单状态", readConverterExp = "1=已保存,2=已提交,3=已审核,4=已收货,5=已关闭,6=已退货")
private Integer orderStatus;
/**
* 备注
*/
@Excel(name = "备注")
private String remark;
/**
* 订单日期 2023-10
*/
@Excel(name = "入库日期", dateFormat = "yyyy-MM-dd")
private Date orderDate;
/**
* 产品编号
*/
@Excel(name = "产品编号")
private String productCode;
/**
* 产品名称
*/
@Excel(name = "产品名称")
private String productName;
/**
* 规格名称
*/
@Excel(name = "产品规格")
private String specsName;
/**
* 单位名称
*/
@Excel(name = "单位")
private String unitName;
/**
* 仓库名称
*/
@Excel(name = "入库仓库")
private String storehouseName;
/**
* 数量
*/
@Excel(name = "数量")
private BigDecimal nnum;
/**
* 单价
*/
@Excel(name = "单价")
private BigDecimal ncostprice;
/**
* 金额
*/
@Excel(name = "金额")
private BigDecimal ncostmny;
/**
* 批次号
*/
@Excel(name = "批次号")
private String batchCode;
/**
* 入库日期
*/
@Excel(name = "入库日期", dateFormat = "yyyy-MM-dd")
private Date bizDate;
}

View File

@ -1,66 +0,0 @@
package com.hzs.scm.general.vo;
import com.hzs.scm.pub.vo.ScmReturnVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* @description: 其他入库单
* @author: sui q
* @time: 2024/1/5 11:56
* @classname: IcGeneralInVO
* @package_name: com.hzs.scm.general.vo
* version 1.0.0
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class IcGeneralInVO extends ScmReturnVo {
/**
* 出库公司
*/
private String outCorpName;
/**
* 供应商名称
*/
private String cubasdocName;
/**
* 仓库名称
*/
private String storehouseName;
/**
* 出库公司
*/
private Integer pkOutCorp;
/**
* 供应商 取bd_cubasdoc 类型为1 2的
*/
private Integer pkCubasdoc;
/**
* 仓库管理员
*/
private Long pkWhsmanager;
/**
* 仓库
*/
private Integer pkWarehouse;
/**
* 出库仓库
*/
private Integer pkOutWarehouse;
/**
* 明细
*/
private List<IcGeneralInBVO> generalInbExtList;
}

View File

@ -1,123 +0,0 @@
package com.hzs.scm.general.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzs.scm.pub.vo.ScmSpecsVO;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @description: 其他入库单明细表
* @author: sui q
* @time: 2024/1/5 11:59
* @classname: IcGeneralInBVO
* @package_name: com.hzs.scm.general.vo
* version 1.0.0
*/
@Data
public class IcGeneralOutBVO implements Serializable {
/**
* 单位名称
*/
private String unitName;
/**
* 货位名称
*/
private String clocationName;
/**
* 仓库名称
*/
private String storehouseName;
private String batchCode;
/**
* 产品编号
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 规格名称
*/
private String specsName;
/**
* 主键
*/
private Long pkId;
/**
* 单位
*/
private Integer pkUnit;
/**
* 主表主键
*/
private Long pkGeneral;
/**
* 货位
*/
private Integer pkClocation;
/**
* 产品信息主键
*/
private Integer pkProduct;
/**
* 出入库类型 1=入库 2=出库
*/
private Integer transType;
/**
* 入库日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date bizDate;
/**
* 仓库
*/
private Integer pkStorehouse;
/**
* 汇率
*/
private Integer pkRate;
/**
* 数量
*/
private BigDecimal nnum;
/**
* 单价
*/
private BigDecimal ncostprice;
/**
* 金额
*/
private BigDecimal ncostmny;
/**
* 批次主键
*/
private Long pkBatchCode;
private List<ScmSpecsVO> scmItemSpecsList;
}

Some files were not shown because too many files have changed in this diff Show More