Merge branch 'refs/heads/dev' into dev_WMS20260401

# Conflicts:
#	mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java
This commit is contained in:
秦鸿展
2026-04-07 10:56:59 +08:00
50 changed files with 1176 additions and 79 deletions
@@ -55,4 +55,10 @@ public interface BmsServiceFeign {
*/
@PostMapping("/businessDocumentApi/wholeRentSynchronization")
public AjaxResult businessDocumentApiSave(@RequestBody BusinessDataPushDTO businessDataPushDTO);
}
/**
* 定时任务整租推送到bms
*/
@PostMapping("/businessDocumentApi/wholeRentSynchronizationZXF")
public AjaxResult wholeRentSynchronizationZXF(@RequestBody BusinessDataPushDTO businessDataPushDTO);
}
@@ -56,6 +56,11 @@ public class RemoteBmsFeignFallbackFactory implements FallbackFactory<BmsService
public AjaxResult businessDocumentApiSave(BusinessDataPushDTO businessDataPushDTO) {
return AjaxResult.error(throwable.getMessage());
}
@Override
public AjaxResult wholeRentSynchronizationZXF(BusinessDataPushDTO businessDataPushDTO) {
return null;
}
};
}
}
@@ -48,6 +48,9 @@ public class BusinessDataPushDTO{
@ApiModelProperty("账单金额")
private BigDecimal billAmount;
@ApiModelProperty("预计费金额")
private BigDecimal estimatedCost;
@ApiModelProperty("费用科目")
@NotBlank(message = "费用科目不能为空")
private String secondSubjectCode;
@@ -81,4 +84,5 @@ public class BusinessDataPushDTO{
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
}
private BigDecimal taxRate;
}
@@ -0,0 +1,88 @@
package com.mhd.common.core.domain.po;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 计费参数对象 billing_params
*
* @author gen
* @date 2024-07-12
*/
@Data
@ApiModel(value = "计费参数对象", description = "计费参数响应对象")
public class BillingParamsPO extends BaseVOEntity{
private static final long serialVersionUID = 1L;
@ApiModelProperty("计费参数id")
private Long billingParamsId;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("计费参数表名称")
@Excel(name = "计费参数表名称")
private String billingParamsName;
@ApiModelProperty("说明")
@Excel(name = "说明")
private String billingIllustrate;
/**
* {
* "fields":"参与字段",
* "chargingId":"计费标识P1、P2",
* "ladderType":"阶梯类型(1-固定参数,2-无阶梯,3-到达阶梯,4-累进阶梯)",
* "ladderRule":"阶梯规则(1-左开右闭,2-左闭右开)",
* "ladderNum":"阶梯值",
* "sort":"排序"
* }
*/
@ApiModelProperty("计费参数json串")
@Excel(name = "计费参数json串")
private String billingParamsJson;
/**
*{
* "outFields":"输出字段",
* "outChargingId":"输出计费标识",
* "fieIdsType":"字段类型(1-整数,2-浮点数,3-时间)",
* "sort":"排序"
* }
*/
@ApiModelProperty("计费参数输出json串")
@Excel(name = "计费参数输出json串")
private String billingOutputJson;
/**
* {
* "fieIds1":"字段1",
* "fieIds2":"字段2",
* "fieIdsn":"字段N",
* "outFieIds1":"输出字段1",
* "outFieIds2":"输出字段2",
* "outFieIdsn":"输出字段n"
* }
*/
@ApiModelProperty("预置规则json串")
@Excel(name = "预置规则json串")
private String preSetRules;
@ApiModelProperty("计费规则id")
private Long billingRulesId;
}
+7 -2
View File
@@ -104,7 +104,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- JEP 动态计算 -->
<dependency>
<groupId>jep</groupId>
<artifactId>jep</artifactId>
<version>2.24</version>
</dependency>
<!-- JPush推送 -->
<!-- jpush极光推送导入start -->
@@ -163,4 +168,4 @@
</profile>
</profiles>
</project>
</project>
@@ -4,8 +4,11 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mhd.basic.domain.contractManage.entity.ContractManage;
import com.mhd.basic.domain.contractManage.repository.mapper.ContractManageMapper;
import com.mhd.basic.domain.contractManage.repository.po.ContractManagePO;
import com.mhd.basic.domain.contractManage.repository.todo.ContractManageDO;
import com.mhd.basic.domain.contractManage.service.ContractManageDomainService;
@@ -16,12 +19,9 @@ import com.mhd.basic.domain.contractManageDetail.repository.todo.ContractManageD
import com.mhd.basic.domain.contractManageDetail.service.ContractManageDetailDomainService;
import com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO;
import com.mhd.basic.domain.expenseAccount.service.ExpenseAccountDomainService;
import com.mhd.basic.interfaces.dto.contractManage.ContractManageDTO;
import com.mhd.basic.interfaces.dto.contractManage.*;
import com.mhd.basic.interfaces.dto.contractManageDetail.ContractManageDetailDTO;
import com.mhd.common.core.domain.po.BillingRulesPO;
import com.mhd.common.core.domain.po.DocumentTypePO;
import com.mhd.common.core.domain.po.SettlementCustomersPO;
import com.mhd.common.core.domain.po.SysDictDataVo;
import com.mhd.common.core.domain.po.*;
import com.mhd.common.core.enums.DictCode;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
@@ -42,6 +42,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -63,8 +65,10 @@ public class ContractManageApplicationService {
private ExpenseAccountDomainService expenseAccountDomainService;
@Autowired
private ContractManageDetailDomainService contractManageDetailDomainService;
@Autowired
@Resource
private ContractManageDetailMapper contractManageDetailMapper;
@Resource
private ContractManageMapper contractManageMapper;
@Autowired
private BmsServiceFeign bmsServiceFeign;
@@ -125,6 +129,182 @@ public class ContractManageApplicationService {
return contractManageDomainService.queryList(contractManageDO);
}
public BigDecimal getAmount(List<SubjectAndPriceReturn> subjectAndPriceReturnList) {
if (subjectAndPriceReturnList == null || subjectAndPriceReturnList.size() == 1) {
SubjectAndPriceReturn subjectAndPriceReturn = subjectAndPriceReturnList.get(0);
Long billingRulesId = subjectAndPriceReturn.getBillingRulesId();
String name = subjectAndPriceReturn.getName();
BillingRulesPO billingRule = contractManageDetailMapper.getBillingRules(billingRulesId);
List<BillingParamsPO> billingParams = contractManageDetailMapper.getBillingParams(billingRulesId);
if (billingParams != null && billingParams.size() > 0) {
BillingParamsPO billingParam = billingParams.get(0);
String billingParamsJson = billingParam.getBillingParamsJson();
String preSetRules = billingParam.getPreSetRules();
List<Map<String, Object>> preSetRulesList = JSON.parseObject(preSetRules, new TypeReference<List<Map<String, Object>>>() {
});
List<Map<String, Object>> billingParamsList = JSON.parseObject(billingParamsJson, new TypeReference<List<Map<String, Object>>>() {
});
if (billingParamsList != null && billingParamsList.size() ==2) {
Map<String, Object> targetMap = billingParamsList.stream()
.filter(map -> name.equals(map.get("fieldsName"))) // 关键匹配条件
.findFirst() // 取第一个
.orElse(null); // 没找到返回null
String chargingId = (String) targetMap.get("chargingId");
Integer sort = (Integer) targetMap.get("sort");
Map<String, Object> reles = preSetRulesList.get(0);
String price = (String) reles.get("fields"+sort);
String billingFormula = billingRule.getBillingFormula();
billingFormula = billingFormula.replace(chargingId, price);
//需要判断阶梯类型进行获取各计费标志的取值,拼接公式
List<BillingParamsDetailDTO> billingParamsEntityList = JSON.parseArray(billingParamsJson, BillingParamsDetailDTO.class);
//将计费参数实体分成两组,即:固定参数和条件参数
List<BillingParamsDetailDTO> fixedParamsEntityList = billingParamsEntityList.stream().filter(item -> ObjectUtil.equal(item.getLadderType(),1)).collect(Collectors.toList());
List<BillingParamsDetailDTO> ladderParamsEntityList = billingParamsEntityList.stream().filter(item -> !ObjectUtil.equal(item.getLadderType(),1)).collect(Collectors.toList());
if (fixedParamsEntityList != null && fixedParamsEntityList.size() > 0) {
if (subjectAndPriceReturn.getNum() != null) {
for (BillingParamsDetailDTO ladderParamsEntity : fixedParamsEntityList) {
String chargingId1 = ladderParamsEntity.getChargingId();
if (chargingId1 != chargingId) {
billingFormula = billingFormula.replace(chargingId1, subjectAndPriceReturn.getNum().toEngineeringString());
}
}
}
}
return DynamicCalculationUtil.calculate(billingFormula);
} else {
}
}
} else {
SubjectAndPriceReturn aReturn = subjectAndPriceReturnList.get(0);
Long id = aReturn.getBillingRulesId();
BillingRulesPO Rule = contractManageDetailMapper.getBillingRules(id);
String billingFormula = Rule.getBillingFormula();
for (SubjectAndPriceReturn subjectAndPriceReturn : subjectAndPriceReturnList) {
Long billingRulesId = subjectAndPriceReturn.getBillingRulesId();
String name = subjectAndPriceReturn.getName();
BillingRulesPO billingRule = contractManageDetailMapper.getBillingRules(billingRulesId);
List<BillingParamsPO> billingParams = contractManageDetailMapper.getBillingParams(billingRulesId);
if (billingParams != null && billingParams.size() > 0) {
BillingParamsPO billingParam = billingParams.get(0);
String billingParamsJson = billingParam.getBillingParamsJson();
String preSetRules = billingParam.getPreSetRules();
List<Map<String, Object>> preSetRulesList = JSON.parseObject(preSetRules, new TypeReference<List<Map<String, Object>>>() {
});
List<Map<String, Object>> billingParamsList = JSON.parseObject(billingParamsJson, new TypeReference<List<Map<String, Object>>>() {
});
if (billingParamsList != null && billingParamsList.size() ==2) {
} else {
Map<String, Object> targetMap = billingParamsList.stream()
.filter(map -> name.equals(map.get("fieldsName"))) // 关键匹配条件
.findFirst() // 取第一个
.orElse(null); // 没找到返回null
String chargingId = (String) targetMap.get("chargingId");
Integer sort = (Integer) targetMap.get("sort");
Map<String, Object> reles = preSetRulesList.get(0);
String price = (String) reles.get("fields"+sort);
//String billingFormula = billingRule.getBillingFormula();
billingFormula = billingFormula.replace(chargingId, price);
//需要判断阶梯类型进行获取各计费标志的取值,拼接公式
List<BillingParamsDetailDTO> billingParamsEntityList = JSON.parseArray(billingParamsJson, BillingParamsDetailDTO.class);
//将计费参数实体分成两组,即:固定参数和条件参数
List<BillingParamsDetailDTO> fixedParamsEntityList = billingParamsEntityList.stream().filter(item -> ObjectUtil.equal(item.getLadderType(),1)).collect(Collectors.toList());
List<BillingParamsDetailDTO> ladderParamsEntityList = billingParamsEntityList.stream().filter(item -> !ObjectUtil.equal(item.getLadderType(),1)).collect(Collectors.toList());
if (fixedParamsEntityList != null && fixedParamsEntityList.size() > 0) {
if (subjectAndPriceReturn.getNum() != null) {
for (Map<String, Object> ladderParamsEntity : billingParamsList) {
String chargingId1 = (String) ladderParamsEntity.get("chargingId");
String fieldsName = (String) ladderParamsEntity.get("fieldsName");
if ("纸箱贴标单价".equals(name)) {
if ("纸箱数量".equals(fieldsName)) {
billingFormula = billingFormula.replace(chargingId1, subjectAndPriceReturn.getNum().toEngineeringString());
}
} else if ("木箱贴标单价".equals(name)){
if ("木箱数量".equals(fieldsName)) {
billingFormula = billingFormula.replace(chargingId1, subjectAndPriceReturn.getNum().toEngineeringString());
}
}
}
}
}
}
}
}
return DynamicCalculationUtil.calculate(billingFormula);
}
return BigDecimal.ZERO;
}
public List<SubjectAndPriceReturn> getSubjectAndPrice(SubjectAndPriceDTO contractManageDTO) {
List<SubjectAndPriceReturn> result = new ArrayList<>();
Long settlementCustomersId = contractManageDTO.getSettlementCustomersId();
Long organizationId = contractManageDTO.getOrganizationId();
String sunjectCode = contractManageDTO.getSubjectCode();
Long topOrganizationId = contractManageDTO.getTopOrganizationId();
List<ContractManage> UserContractManages = contractManageMapper.selectList(new LambdaQueryWrapper<ContractManage>()
.eq(ContractManage::getSettlementCustomersId, settlementCustomersId)
.eq(ContractManage::getDelFlag, 1)
.eq(ContractManage::getOrganizationId, organizationId)
.eq(ContractManage::getTopOrganizationId, topOrganizationId)
.eq(ContractManage::getCommonContractFlag, 2));
if (UserContractManages != null && UserContractManages.size() > 0) {
}else{
List<ContractManage> commonContractManages = contractManageMapper.selectList(new LambdaQueryWrapper<ContractManage>()
.eq(ContractManage::getDelFlag, 1)
.eq(ContractManage::getOrganizationId, organizationId)
.eq(ContractManage::getTopOrganizationId, topOrganizationId)
.eq(ContractManage::getCommonContractFlag, 1));
if (commonContractManages != null && commonContractManages.size() > 0) {
ContractManage contractManage = commonContractManages.get(0);
Long contractManageId = contractManage.getContractManageId();
List<ContractManageDetail> contractManageDetails = contractManageDetailMapper.selectList(new LambdaQueryWrapper<ContractManageDetail>()
.eq(ContractManageDetail::getContractManageId, contractManageId)
.eq(ContractManageDetail::getDelFlag, 1));
if (contractManageDetails != null && contractManageDetails.size() > 0) {
for (ContractManageDetail contractManageDetail : contractManageDetails) {
String code = contractManageDetail.getFirstSubjectCode();
if (sunjectCode.equals(code)) {
Long accountingStrategyId = contractManageDetail.getAccountingStrategyId();
BillingRulesPO billingRule = contractManageDetailMapper.getBillingRules(accountingStrategyId);
if (billingRule != null) {
Long billingRulesId = billingRule.getBillingRulesId();
List<BillingParamsPO> billingParams = contractManageDetailMapper.getBillingParams(billingRulesId);
if (billingParams != null && billingParams.size() > 0) {
BillingParamsPO billingParam = billingParams.get(0);
String billingParamsJson = billingParam.getBillingParamsJson();
String preSetRules = billingParam.getPreSetRules();
List<Map<String, Object>> preSetRulesList = JSON.parseObject(preSetRules, new TypeReference<List<Map<String, Object>>>() {});
List<Map<String, Object>> billingParamsList = JSON.parseObject(billingParamsJson, new TypeReference<List<Map<String, Object>>>() {});
Map<String, Object> stringObjectMap1 = preSetRulesList.get(0);
for (Map<String, Object> stringObjectMap : billingParamsList) {
String fieldsName = (String) stringObjectMap.get("fieldsName");
if (fieldsName != null && ("装卸费单价".equals(fieldsName) ||
"纸箱贴标单价".equals(fieldsName)||"木箱贴标单价".equals(fieldsName)
|| "进出仓操作费单价".equals(fieldsName))) {
Integer sort = (Integer) stringObjectMap.get("sort");
String chargingId = (String) stringObjectMap.get("chargingId");
String fields = (String) stringObjectMap.get("fields");
String price = (String) stringObjectMap1.get("fields" + sort);
SubjectAndPriceReturn subjectAndPriceReturn = new SubjectAndPriceReturn();
subjectAndPriceReturn.setName(fieldsName);
subjectAndPriceReturn.setPrice(new BigDecimal(price));
subjectAndPriceReturn.setChargingId(chargingId);
subjectAndPriceReturn.setFields(fields);
subjectAndPriceReturn.setBillingRulesId(billingRulesId);
result.add(subjectAndPriceReturn);
}
}
}
}
}
}
}
}
}
return result;
}
/**
* 新增合同管理
@@ -408,6 +408,66 @@ public class ExpenseAccountApplicationService {
expenseAccountDO.setUpdateByName(loginUser.getUsername());
return expenseAccountDomainService.update(expenseAccountDO);
}
/**
* 修改创建订单是否固定显示 0-否 1-是
* @param expenseAccountDTO
* @return
*/
public boolean changeInOrderDisplay(ExpenseAccountDTO expenseAccountDTO) {
//获取登录用户信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
//根据id修改启用状态停用状态
if(expenseAccountDTO.getExpenseAccountId() == null){
throw new ServiceException("费用科目id不能为空");
}
if(expenseAccountDTO.getInOrderDisplay() == null){
throw new ServiceException("状态不能为空");
}
if(expenseAccountDTO.getInOrderDisplay() != 0 && expenseAccountDTO.getInOrderDisplay()!=1){
throw new ServiceException("状态错误");
}
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
expenseAccountDO.setExpenseAccountId(expenseAccountDTO.getExpenseAccountId());
expenseAccountDO.setInOrderDisplay(expenseAccountDTO.getInOrderDisplay());
expenseAccountDO.setUpdateBy(loginUser.getUserid());
expenseAccountDO.setUpdateTime(new Date());
expenseAccountDO.setUpdateByName(loginUser.getUsername());
return expenseAccountDomainService.update(expenseAccountDO);
}
/**
* 修改创建订单是否固定显示 0-否 1-是
* @param expenseAccountDTO
* @return
*/
public boolean changeOutOrderDisplay(ExpenseAccountDTO expenseAccountDTO) {
//获取登录用户信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
//根据id修改启用状态停用状态
if(expenseAccountDTO.getExpenseAccountId() == null){
throw new ServiceException("费用科目id不能为空");
}
if(expenseAccountDTO.getOutOrderDisplay() == null){
throw new ServiceException("状态不能为空");
}
if(expenseAccountDTO.getOutOrderDisplay() != 0 && expenseAccountDTO.getOutOrderDisplay()!=1){
throw new ServiceException("状态错误");
}
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
expenseAccountDO.setExpenseAccountId(expenseAccountDTO.getExpenseAccountId());
expenseAccountDO.setOutOrderDisplay(expenseAccountDTO.getOutOrderDisplay());
expenseAccountDO.setUpdateBy(loginUser.getUserid());
expenseAccountDO.setUpdateTime(new Date());
expenseAccountDO.setUpdateByName(loginUser.getUsername());
return expenseAccountDomainService.update(expenseAccountDO);
}
/**
* 根据编码查询费用科目信息
*/
@@ -470,4 +530,4 @@ public class ExpenseAccountApplicationService {
public List<QueryExpenseAccountPO> selectSocialVehicleExpenseAccount(){
return expenseAccountDomainService.selectSocialVehicleExpenseAccount();
}
}
}
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.basic.domain.contractManageDetail.entity.ContractManageDetail;
import com.mhd.basic.domain.contractManageDetail.repository.po.ContractManageDetailPO;
import com.mhd.basic.domain.contractManageDetail.repository.todo.ContractManageDetailDO;
import com.mhd.common.core.domain.po.BillingParamsPO;
import com.mhd.common.core.domain.po.BillingRulesPO;
import org.apache.ibatis.annotations.Param;
/**
* 合同管理详情Mapper接口
@@ -20,4 +22,8 @@ public interface ContractManageDetailMapper extends BaseMapper<ContractManageDet
public List<ContractManageDetailPO> queryList(@Param("contractManageDetailDO") ContractManageDetailDO contractManageDetailDO);
List<ContractManageDetailPO> getListByContractManageId(@Param("contractManageId") Long contractManageId);
}
BillingRulesPO getBillingRules(@Param("id") Long id);
List<BillingParamsPO> getBillingParams(@Param("id") Long id);
}
@@ -104,7 +104,13 @@ public class ExpenseAccount extends BaseVOEntity{
@ApiModelProperty(name = "创建订单是否固定显示 0-否 1-是")
private Integer fixedOrderDisplay;
@ApiModelProperty(name = "入库单是否固定显示 0-否 1-是")
private Integer inOrderDisplay;
@ApiModelProperty(name = "出库单是否固定显示 0-否 1-是")
private Integer outOrderDisplay;
@ApiModelProperty("费率")
private BigDecimal rate;
}
}
@@ -129,4 +129,11 @@ public class ExpenseAccountPO extends BaseVOEntity{
@ApiModelProperty(name = "创建订单是否固定显示 0-否 1-是")
private Integer fixedOrderDisplay;
}
@ApiModelProperty(name = "入库单是否固定显示 0-否 1-是")
private Integer inOrderDisplay;
@ApiModelProperty(name = "出库单是否固定显示 0-否 1-是")
private Integer outOrderDisplay;
}
@@ -133,6 +133,13 @@ public class ExpenseAccountDO extends BaseVOEntity{
@ApiModelProperty(name = "创建订单是否固定显示 0-否 1-是")
private Integer fixedOrderDisplay;
@ApiModelProperty(name = "入库单是否固定显示 0-否 1-是")
private Integer inOrderDisplay;
@ApiModelProperty(name = "出库单是否固定显示 0-否 1-是")
private Integer outOrderDisplay;
@ApiModelProperty(name = "创建者姓名")
private String createByName;
@@ -146,4 +153,4 @@ public class ExpenseAccountDO extends BaseVOEntity{
@ApiModelProperty(name = "创建者姓名")
private String updateByName;
}
}
@@ -0,0 +1,36 @@
package com.mhd.basic.interfaces.dto.contractManage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 计费参数json实体
*/
@Data
public class BillingParamsDetailDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("字段名称")
private String fields;
@ApiModelProperty("计费标识P1、P2")
private String chargingId;
@ApiModelProperty("阶梯类型(1-固定参数,2-无阶梯,3-到达阶梯,4-累进阶梯)")
private Integer ladderType;
@ApiModelProperty("1-左开右闭,2-左闭右开")
private Integer ladderRule;
@ApiModelProperty("阶梯值")
private String ladderNum;
@ApiModelProperty("标志值")
private String flagValue;
@ApiModelProperty("排序")
private Integer sort;
}
@@ -0,0 +1,41 @@
package com.mhd.basic.interfaces.dto.contractManage;
import lombok.extern.slf4j.Slf4j;
import org.nfunk.jep.JEP;
import java.math.BigDecimal;
/**
* JEP动态计算
**/
@Slf4j
public class DynamicCalculationUtil {
/**
* 动态计算
* @param formula 计算公式
* @return 计算结果
*/
public static BigDecimal calculate(String formula) {
try {
// 创建 JEP 实例
JEP jep = new JEP();
// 设置要计算的表达式
jep.parseExpression(formula);
// 计算表达式的结果
double result = jep.getValue();
// 将结果转换为 BigDecimal
return new BigDecimal(result);
} catch (Exception e) {
// 处理可能的异常
log.error("动态计算失败:"+e.getMessage());
}
return BigDecimal.ZERO;
}
}
@@ -0,0 +1,30 @@
package com.mhd.basic.interfaces.dto.contractManage;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class SubjectAndPriceDTO extends BaseVOEntity {
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("结算主体")
@Excel(name = "结算主体")
private Long settlementCustomersId;
@ApiModelProperty("价格")
@Excel(name = "价格")
private String subjectCode;
}
@@ -0,0 +1,15 @@
package com.mhd.basic.interfaces.dto.contractManage;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class SubjectAndPriceReturn {
private String name;
private BigDecimal price;
private String chargingId;
private Long billingRulesId;
private String fields;
private BigDecimal num;
}
@@ -132,4 +132,10 @@ public class ExpenseAccountDTO extends BaseVOEntity{
@ApiModelProperty(name = "创建订单是否固定显示 0-否 1-是")
private Integer fixedOrderDisplay;
}
@ApiModelProperty(name = "入库单是否固定显示 0-否 1-是")
private Integer inOrderDisplay;
@ApiModelProperty(name = "出库单是否固定显示 0-否 1-是")
private Integer outOrderDisplay;
}
@@ -3,6 +3,8 @@ package com.mhd.basic.interfaces.facade.contractManage;
import java.util.List;
import com.mhd.basic.interfaces.assember.contractManage.ContractManageAssembler;
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceDTO;
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceReturn;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +48,28 @@ public class ContractManageApi extends BaseController{
return getDataTable(list);
}
/**
* 获取科目和单价
*/
@ApiOperation("获取科目和单价")
@GetMapping("/getSubjectAndPrice")
public AjaxResult getSubjectAndPrice(SubjectAndPriceDTO subjectAndPriceDTO)
{
//转换实体
return AjaxResult.success(contractManageApplicationService.getSubjectAndPrice(subjectAndPriceDTO));
}
/**
* 获取科目和单价
*/
@ApiOperation("获取科目和单价")
@PostMapping("/getAmount")
public AjaxResult getAmount(@RequestBody List<SubjectAndPriceReturn> subjectAndPriceReturnList)
{
//转换实体
return AjaxResult.success(contractManageApplicationService.getAmount(subjectAndPriceReturnList));
}
/**
* 保存合同管理
*/
@@ -146,4 +170,4 @@ public class ContractManageApi extends BaseController{
}
}
@@ -271,6 +271,28 @@ public class ExpenseAccountApi extends BaseController{
}
}
@ApiOperation("修改创建订单默认显示设置")
@PostMapping("/changeInOrderDisplay")
public AjaxResult changeInOrderDisplay(@RequestBody ExpenseAccountDTO expenseAccountDTO)
{
try {
return toAjax(expenseAccountApplicationService.changeInOrderDisplay(expenseAccountDTO));
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
@ApiOperation("修改创建订单默认显示设置")
@PostMapping("/changeOutOrderDisplay")
public AjaxResult changeOutOrderDisplay(@RequestBody ExpenseAccountDTO expenseAccountDTO)
{
try {
return toAjax(expenseAccountApplicationService.changeOutOrderDisplay(expenseAccountDTO));
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
@ApiOperation("根据code获取费用科目")
@GetMapping(value = "/getInfoByCode")
public AjaxResult getInfoByCode(@RequestParam("subjectCode") String subjectCode)
@@ -288,4 +310,4 @@ public class ExpenseAccountApi extends BaseController{
}
}
}
@@ -14,20 +14,20 @@ spring:
nacos:
discovery:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
#线上正式环境
# server-addr: 10.102.192.105:6848
config:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
#线上正式环境
# server-addr: 10.102.192.105:6848
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
@@ -76,4 +76,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
contract_manage_id = #{contractManageId}
</select>
</mapper>
<select id="getBillingRules" resultType="com.mhd.common.core.domain.po.BillingRulesPO" parameterType="java.lang.Long">
select * from "NGWL_TEST_BMS".billing_rules where billing_rules_id = #{id} and del_flag = 1
</select>
<select id="getBillingParams" resultType="com.mhd.common.core.domain.po.BillingParamsPO" parameterType="java.lang.Long">
select * from "NGWL_TEST_BMS".billing_params where billing_rules_id = #{id} and del_flag = 1
</select>
</mapper>
@@ -223,6 +223,12 @@
<if test="expenseAccountDO.fixedOrderDisplay != null ">
and a.fixed_order_display = #{expenseAccountDO.fixedOrderDisplay}
</if>
<if test="expenseAccountDO.inOrderDisplay != null ">
and a.in_order_display = #{expenseAccountDO.inOrderDisplay}
</if>
<if test="expenseAccountDO.outOrderDisplay != null ">
and a.out_order_display = #{expenseAccountDO.outOrderDisplay}
</if>
</sql>
<select id="selectExpenseAccount" parameterType="com.mhd.basic.domain.expenseAccount.repository.todo.SearchExpenseAccountDO" resultType="com.mhd.basic.domain.expenseAccount.repository.po.QueryExpenseAccountPO">
select
@@ -288,4 +294,4 @@
and a.del_flag=1
order by show_seq
</select>
</mapper>
</mapper>
@@ -997,4 +997,52 @@ public class BusinessDocumentApplicationService {
this.auditByIdsBySystem(businessDocumentDTO);
return true;
}
@Transactional(rollbackFor = Exception.class)
public Boolean wholeRentSynchronizationZXF(BusinessDocumentDO businessDocumentDO) {
log.info("定时任务进入BMS业务单据保存--开始");
//根据结算主题id查询 结算对象编码
Long settlementEntityId = businessDocumentDO.getSettlementEntityId();
List<SettlementCustomers> settlementCustomersList = settlementCustomersService.list(new LambdaQueryWrapper<SettlementCustomers>()
.eq(SettlementCustomers::getSettlementEntityId, settlementEntityId)
.eq(SettlementCustomers::getDelFlag, 1)
);
if (settlementCustomersList != null && settlementCustomersList.size() > 0) {
businessDocumentDO.setSettlementCustomersCode(settlementCustomersList.get(0).getSettlementCustomersCode());
}else {
return false;
}
//校验使用的表单是否必填校验
//checkDoucumentType(businessDocumentDO);
//处理数据
handleDate(businessDocumentDO);
businessDocumentDO.setDataSources(1);
businessDocumentDO.setCreateTime(new Date());
businessDocumentDO.setCreateByName("system");
businessDocumentDO.setBusinessFlow(OrderSequence.getOrderCode("LS"));
businessDocumentDO.setTopOrganizationId(businessDocumentDO.getTopOrganizationId());
businessDocumentDO.setOrganizationId(businessDocumentDO.getOrganizationId());
businessDocumentDO.setOrganizationName(businessDocumentDO.getOrganizationName());
//调用费用计算,计算费用金额进行保存
// CostCalculationDTO costCalculationDTO = new CostCalculationDTO();
// costCalculationDTO.setOriginalBusinessNum(businessDocumentDO.getOriginalBusinessNum());
// costCalculationDTO.setContractNumber(businessDocumentDO.getContractNumber());
// costCalculationDTO.setFormJson(businessDocumentDO.getDocumentFormJson());
// costCalculationDTO.setSubjectCode(StringUtils.isEmpty(businessDocumentDO.getSecondSubjectCode()) ? businessDocumentDO.getFirstSubjectCode():businessDocumentDO.getSecondSubjectCode());
// costCalculationDTO.setDocumentTypeCode(businessDocumentDO.getDocumentTypeCode());
// costCalculationDTO.setTopOrganizationId(businessDocumentDO.getTopOrganizationId());
// costCalculationDTO.setOrganizationId(businessDocumentDO.getOrganizationId());
// costCalculationDTO.setOrganizationName(businessDocumentDO.getOrganizationName());
// BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO);
// businessDocumentDO.setEstimatedCost(billingCostPo.getComputationalCost());
// businessDocumentDO.setBillAmount(billingCostPo.getComputationalCost());//计费金额与计算金额一致
log.info("定时任务进入BMS业务单据保存--结束");
BusinessDocument businessDocument = businessDocumentDomainService.insertRetrun(businessDocumentDO);
BusinessDocumentDTO businessDocumentDTO = new BusinessDocumentDTO();
businessDocumentDTO.setBusinessDocumentIds(String.valueOf(businessDocument.getBusinessDocumentId()));
businessDocumentDTO.setAuditOperation(1);
this.takeEffectByIdsBySystem(businessDocumentDTO);
this.auditByIdsBySystem(businessDocumentDTO);
return true;
}
}
@@ -100,6 +100,25 @@ public class BusinessDocumentApi extends BaseController{
}
/**
* 整租推送
*/
@ApiOperation("装卸费推送")
@PostMapping("/wholeRentSynchronizationZXF")
public AjaxResult wholeRentSynchronizationZXF(@RequestBody BusinessDocumentDTO businessDocumentDTO)
{
try {
//转换实体
BusinessDocumentDO businessDocumentDO = new BusinessDocumentDO();
// 拷贝
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(businessDocumentDTO, businessDocumentDO, IgnoreNullUtil.getNullPropertyNames(businessDocumentDTO));
return toAjax(businessDocumentApplicationService.wholeRentSynchronizationZXF(businessDocumentDO));
}catch (Exception e){
return AjaxResult.error("保存业务单据失败" +e.getMessage());
}
}
/**
* 整租推送
+8 -8
View File
@@ -18,17 +18,17 @@ spring:
discovery:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
# server-addr: 10.33.0.129:6010
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
server-addr: 10.33.0.129:6010
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
config:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
# server-addr: 10.33.0.129:6010
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
server-addr: 10.33.0.129:6010
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
file-extension: yml #默认properties
# 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新
+8 -8
View File
@@ -19,20 +19,20 @@ spring:
nacos:
discovery:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
#线上正式环境
# server-addr: 10.33.0.129:6010
config:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
#线上正式环境
# server-addr: 10.33.0.129:6010
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
@@ -45,6 +45,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -207,6 +208,30 @@ public class MaterialBaseInfoApplicationService {
*/
@Transactional(rollbackFor = Exception.class)
public Boolean insert(MaterialBaseInfoDO materialBaseInfoDO) {
// 新增时如果前端未传 organizationName,则使用当前登录用户的组织名称补齐
if (materialBaseInfoDO != null && StringUtils.isBlank(materialBaseInfoDO.getOrganizationName())) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null && loginUser.getUserPo() != null
&& StringUtils.isNotBlank(loginUser.getUserPo().getOrganizationName())) {
materialBaseInfoDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
}
}
// 新增时如果前端未传创建人/创建时间,则使用当前登录用户补齐
if (materialBaseInfoDO != null
&& (materialBaseInfoDO.getCreateBy() == null || materialBaseInfoDO.getCreateTime() == null)) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null) {
if (materialBaseInfoDO.getCreateBy() == null) {
materialBaseInfoDO.setCreateBy(loginUser.getUserid());
}
if (StringUtils.isBlank(materialBaseInfoDO.getCreateByName())) {
materialBaseInfoDO.setCreateByName(loginUser.getUsername());
}
if (materialBaseInfoDO.getCreateTime() == null) {
materialBaseInfoDO.setCreateTime(new Date());
}
}
}
Long materialBaseInfoId = materialBaseInfoDomainService.insert(materialBaseInfoDO);
materialBaseInfoDO.setMaterialBaseInfoId(materialBaseInfoId);
//商品规则
@@ -619,6 +619,11 @@ public class PickingOrderApplicationService {
PickingMaterialDetailDO returnPickingMaterialDetailDO = new PickingMaterialDetailDO();
BeanUtils.copyProperties(pickingMaterialDetailPO, returnPickingMaterialDetailDO);
returnPickingMaterialDetailDO.setActualQuantity(pickingMaterialDetailDO.getActualQuantity());
// 尺寸:优先使用前端传递的值(允许拣货确认时修改);否则沿用数据库值
if (StringUtils.isNotBlank(pickingMaterialDetailDO.getSize())) {
returnPickingMaterialDetailDO.setSize(pickingMaterialDetailDO.getSize());
}
// 毛重、净重、面积、体积:如果前端传递了值,使用前端传递的值(允许修改);否则从出库单明细中自动带出
Long outUniqueId = pickingMaterialDetailPO.getOutUniqueId();
@@ -125,6 +125,35 @@ public class StockInOrderApplicationService {
}
}
}
// 库管角色过滤:不展示已创建(status=1)的入库单
// 说明:部分场景下角色码可能不在 userPo.roleCode 中,而在 loginUser.roles/roleList 中。
if (loginUser != null) {
String targetRoleCode = "KGY-001";
boolean isKuGuan = false;
String roleCode = loginUser.getUserPo() != null ? loginUser.getUserPo().getRoleCode() : null;
if (StringUtils.isNotBlank(roleCode) && roleCode.contains(targetRoleCode)) {
isKuGuan = true;
}
if (!isKuGuan && loginUser.getRoleList() != null) {
isKuGuan = loginUser.getRoleList().stream()
.anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode));
}
if (!isKuGuan && loginUser.getRoles() != null) {
isKuGuan = loginUser.getRoles().stream()
.anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode));
}
if (isKuGuan) {
Integer currentGtStatus = stockInOrderDO.getGtStatus();
if (currentGtStatus == null || currentGtStatus < 1) {
stockInOrderDO.setGtStatus(1); // status > 1
}
}
}
return stockInOrderDomainService.queryList(stockInOrderDO);
}
@@ -148,6 +148,36 @@ public class StockOutOrderApplicationService {
}
}
}
// 库管角色过滤不展示已创建status=1的出库单
// 出库状态: 1-已创建 ...
if (loginUser != null) {
String targetRoleCode = "KGY-001";
boolean isKuGuan = false;
String roleCode = loginUser.getUserPo() != null ? loginUser.getUserPo().getRoleCode() : null;
if (StringUtils.isNotBlank(roleCode) && roleCode.contains(targetRoleCode)) {
isKuGuan = true;
}
if (!isKuGuan && loginUser.getRoleList() != null) {
isKuGuan = loginUser.getRoleList().stream()
.anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode));
}
if (!isKuGuan && loginUser.getRoles() != null) {
isKuGuan = loginUser.getRoles().stream()
.anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode));
}
if (isKuGuan) {
Integer currentGtStatus = stockOutOrderDO.getGtStatus();
if (currentGtStatus == null || currentGtStatus < 1) {
stockOutOrderDO.setGtStatus(1); // status > 1
}
}
}
List<StockOutOrderPO> stockOutOrderPOS = stockOutOrderDomainService.queryList(stockOutOrderDO);
for (StockOutOrderPO stockOutOrderPO : stockOutOrderPOS) {
StockOutOrderPO stockOutOrderPO1 = stockOutOrderDomainService.getInfoChildren(stockOutOrderPO.getOutOrderId());
@@ -251,7 +251,7 @@ public class StockOutTaskOrderApplicationService {
}
/**
* 为拣货作业单的物料明细填充批次属性净重毛重面积体积
* 为拣货作业单的物料明细填充批次属性净重毛重面积体积尺寸
*/
private void enrichStockOutTaskOrderWithBatchAndWeight(StockOutTaskOrderPO stockOutTaskOrderPO) {
if (stockOutTaskOrderPO == null) {
@@ -331,6 +331,7 @@ public class StockOutTaskOrderApplicationService {
detail.setTotalGrossWeight(pickingDetail.getTotalGrossWeight());
detail.setTotalVolume(pickingDetail.getTotalVolume());
detail.setTotalArea(pickingDetail.getTotalArea());
detail.setSize(pickingDetail.getSize());
}
// 批次属性根据物料绑定且isDisplay=1动态显示无值也可展示
Long materialBaseInfoId = detail.getMaterialBaseInfoId();
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.enums.DictCode;
@@ -36,6 +37,8 @@ import com.mhd.wms.domain.materialMoreDetail.service.MaterialMoreDetailDomainSer
import com.mhd.wms.domain.receiptMaterialDetail.repository.po.ReceiptMaterialDetailPO;
import com.mhd.wms.domain.receiptMaterialDetail.repository.todo.ReceiptMaterialDetailDO;
import com.mhd.wms.domain.receiptMaterialDetail.service.ReceiptMaterialDetailDomainService;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
import com.mhd.wms.domain.receiptOrderAccount.repository.facade.IReceiptOrderAccountService;
import com.mhd.wms.domain.stockInOrder.repository.todo.StockInOrderDO;
import com.mhd.wms.domain.stockReceiptOrder.repository.po.StockReceiptOrderPO;
import com.mhd.wms.domain.stockReceiptOrder.repository.todo.NoReceiptOrderDO;
@@ -91,6 +94,8 @@ public class StockReceiptOrderApplicationService {
private UserServiceFeign userServiceFeign;
@Autowired
private IdGenerator idGenerator;
@Autowired
private IReceiptOrderAccountService receiptOrderAccountService;
/**
@@ -159,7 +164,13 @@ public class StockReceiptOrderApplicationService {
log.warn("获取用户关联仓库信息失败,将查询所有仓库数据,用户ID:{},错误:{}", loginUser.getUserid(), e.getMessage());
}
}
return stockReceiptOrderDomainService.queryList(stockReceiptOrderDO);
List<StockReceiptOrderPO> stockReceiptOrderPOS = stockReceiptOrderDomainService.queryList(stockReceiptOrderDO);
for (StockReceiptOrderPO stockReceiptOrderPO : stockReceiptOrderPOS) {
Long receiptOrderId = stockReceiptOrderPO.getReceiptOrderId();
List<ReceiptOrderAccount> accounts = receiptOrderAccountService.list(new LambdaQueryWrapper<ReceiptOrderAccount>().eq(ReceiptOrderAccount::getOrderId, receiptOrderId));
stockReceiptOrderPO.setReceiptOrderAccountList(accounts);
}
return stockReceiptOrderPOS;
}
/**
@@ -1703,6 +1714,7 @@ public class StockReceiptOrderApplicationService {
throw new ServiceException("收货单已完成收货");
}
StockReceiptOrderDO returnStockReceiptOrderDO = new StockReceiptOrderDO();
returnStockReceiptOrderDO.setReceiptOrderAccountList(stockReceiptOrderDO.getReceiptOrderAccountList());
returnStockReceiptOrderDO.setUpdateTime(stockReceiptOrderDO.getUpdateTime());
returnStockReceiptOrderDO.setReceiptOrderId(stockReceiptOrderPO.getReceiptOrderId());
returnStockReceiptOrderDO.setOrganizationId(stockReceiptOrderPO.getOrganizationId());
@@ -150,7 +150,11 @@ public class InOrderAbnormalImpl extends ServiceImpl<InOrderAbnormalMapper, InOr
List<InOrderAbnormal> inOrderAbnormalList = new ArrayList<>();
for (ShelfMaterialDetail shelfMaterialDetail : shelfMaterialDetailList){
//上架
if (shelfMaterialDetail.getShelvesQuantity().compareTo(shelfMaterialDetail.getQuantity()) != 0&&shelfMaterialDetail.getLevel() == 1){
BigDecimal actualShelvesQty = shelfMaterialDetail.getAlreadyShelvesQuantity() != null
? shelfMaterialDetail.getAlreadyShelvesQuantity()
: (shelfMaterialDetail.getShelvesQuantity() != null ? shelfMaterialDetail.getShelvesQuantity() : BigDecimal.ZERO);
BigDecimal planQty = shelfMaterialDetail.getQuantity() != null ? shelfMaterialDetail.getQuantity() : BigDecimal.ZERO;
if (actualShelvesQty.compareTo(planQty) != 0){
//判断是否存在异常 根据设置的是否允许超收 取值动态赋值 先默认写死 收货异常
InOrderAbnormal inOrderAbnormal = new InOrderAbnormal();
//赋值基础数据
@@ -158,19 +162,19 @@ public class InOrderAbnormalImpl extends ServiceImpl<InOrderAbnormalMapper, InOr
//赋值物料信息
BeanUtils.copyProperties(shelfMaterialDetail, inOrderAbnormal, IgnoreNullUtil.getNullPropertyNames(shelfMaterialDetail));
inOrderAbnormal.setAbnormalNumber(OrderSequence.getOrderCode("SHYC"));
if (shelfMaterialDetail.getAlreadyShelvesQuantity().compareTo(shelfMaterialDetail.getQuantity()) > 0){
if (actualShelvesQty.compareTo(planQty) > 0){
//上架数量大于收货数量
inOrderAbnormal.setAbnormalType(1);
inOrderAbnormal.setActualQuantity(shelfMaterialDetail.getShelvesQuantity());
inOrderAbnormal.setActualQuantity(actualShelvesQty);
inOrderAbnormal.setAbnormalReason("上架数量大于收货数量");
}else if (shelfMaterialDetail.getAlreadyShelvesQuantity().compareTo(shelfMaterialDetail.getQuantity()) < 0){
}else if (actualShelvesQty.compareTo(planQty) < 0){
//上架数量小于收货数量
inOrderAbnormal.setAbnormalType(1);
inOrderAbnormal.setActualQuantity(shelfMaterialDetail.getShelvesQuantity());
inOrderAbnormal.setActualQuantity(actualShelvesQty);
inOrderAbnormal.setAbnormalReason("上架数量小于收货数量");
}
inOrderAbnormal.setAllowActualQuantity(shelfMaterialDetail.getQuantity());
inOrderAbnormal.setAbnormalActualQuantity(shelfMaterialDetail.getShelvesQuantity().subtract(shelfMaterialDetail.getQuantity()));
inOrderAbnormal.setAllowActualQuantity(planQty);
inOrderAbnormal.setAbnormalActualQuantity(actualShelvesQty.subtract(planQty));
inOrderAbnormal.setCreateBy(loginUser.getUserid());
inOrderAbnormal.setCreateByName(userRealName);
inOrderAbnormal.setCreateTime(new Date());
@@ -111,10 +111,12 @@ public class MaterialGoodsRuleDomainService {
* @param materialGoodsRuleDO
*/
private void batchParam(MaterialGoodsRuleDO materialGoodsRuleDO){
if (ObjectUtil.isNull(materialGoodsRuleDO.getBatchId())){
throw new ServiceException("批次信息不能为空");
// 批次信息允许为空batchId 为空时不做封装直接跳过即可
Long batchId = materialGoodsRuleDO.getBatchId();
if (ObjectUtil.isNull(batchId) || batchId <= 0) {
return;
}
AjaxResult ajaxResult = systemServiceFeign.getBatchInfoByBatchId(materialGoodsRuleDO.getBatchId());
AjaxResult ajaxResult = systemServiceFeign.getBatchInfoByBatchId(batchId);
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
throw new ServiceException("获取批次信息失败");
}
@@ -272,9 +272,11 @@ public class PickingMaterialDetail extends BaseVOEntity {
@ApiModelProperty("装卸费")
@Excel(name = "装卸费")
@TableField(exist = false)
private BigDecimal loadUnloadFee;
@ApiModelProperty("贴标费")
@Excel(name = "贴标费")
@TableField(exist = false)
private BigDecimal stickerFee;
}
@@ -165,6 +165,10 @@ public class PickingMaterialDetailImpl extends ServiceImpl<PickingMaterialDetail
pickingMaterialDetail.setTotalGrossWeight(pickingMaterialDetailDO.getTotalGrossWeight());
pickingMaterialDetail.setUnitCode(pickingMaterialDetailDO.getUnitCode());
pickingMaterialDetail.setUnitName(pickingMaterialDetailDO.getUnitName());
// 尺寸字段SIZE拣货确认时允许同步更新
if (pickingMaterialDetailDO.getSize() != null) {
pickingMaterialDetail.setSize(pickingMaterialDetailDO.getSize());
}
pickingMaterialDetail.setLoadUnloadFee(pickingMaterialDetailDO.getLoadUnloadFee());
pickingMaterialDetail.setStickerFee(pickingMaterialDetailDO.getStickerFee());
BigDecimal actualQuantity = pickingMaterialDetailDO.getActualQuantity();
@@ -0,0 +1,115 @@
package com.mhd.wms.domain.receiptOrderAccount.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ReceiptOrderAccount extends BaseVOEntity {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
@Excel(name = "创建人", width = 15)
private Long createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
@Excel(name = "创建日期", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
@Excel(name = "更新人", width = 15)
private Long updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
@Excel(name = "更新日期", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
@Excel(name = "所属部门", width = 15)
private String sysOrgCode;
/**删除标识*/
@ApiModelProperty(value = "删除标识")
@Excel(name = "删除标识", width = 15)
private Integer isDelete;
/**所属组织*/
@ApiModelProperty(value = "所属组织")
@Excel(name = "所属组织", width = 15)
private String orgName;
/**组织ID*/
@ApiModelProperty(value = "组织ID")
@Excel(name = "组织ID", width = 15)
private Long organizationId;
/**一级组织ID*/
@ApiModelProperty(value = "一级组织ID")
@Excel(name = "一级组织ID", width = 15)
private Long topOrganizationId;
/**组织名称*/
@ApiModelProperty(value = "组织名称")
@Excel(name = "组织名称", width = 15)
private String organizationName;
/**订单id*/
@ApiModelProperty(value = "订单id")
@Excel(name = "订单id", width = 15)
private Long orderId;
/**科目id*/
@ApiModelProperty(value = "科目id")
@Excel(name = "科目id", width = 15)
private Long accountId;
/**科目收支类型(1-应收,2-应付*/
@ApiModelProperty(value = "科目收支类型(1-应收,2-应付")
@Excel(name = "科目收支类型(1-应收,2-应付", width = 15)
private Long accountType;
/**科目编码*/
@ApiModelProperty(value = "科目编码")
@Excel(name = "科目编码", width = 15)
private String subjectCode;
/**科目名称*/
@ApiModelProperty(value = "科目名称")
@Excel(name = "科目名称", width = 15)
private String subjectName;
/**费用类别*/
@ApiModelProperty(value = "费用类别")
@Excel(name = "费用类别", width = 15)
private String serviceItemsCode;
/**费用类别*/
@ApiModelProperty(value = "费用类别")
@Excel(name = "费用类别", width = 15)
private String serviceItemsName;
/**科目费率*/
@ApiModelProperty(value = "科目费率")
@Excel(name = "科目费率", width = 15)
private BigDecimal rate;
/**金额*/
@ApiModelProperty(value = "金额")
@Excel(name = "金额", width = 15)
private BigDecimal amount;
@ApiModelProperty(value = "计算金额")
@Excel(name = "计算金额", width = 15)
private BigDecimal settlementAmount;
@ApiModelProperty(value = "数量")
@Excel(name = "数量", width = 15)
private BigDecimal num;
@ApiModelProperty(value = "单价")
@Excel(name = "单价", width = 15)
private BigDecimal price;
}
@@ -0,0 +1,9 @@
package com.mhd.wms.domain.receiptOrderAccount.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
public interface IReceiptOrderAccountService extends IService<ReceiptOrderAccount>
{
}
@@ -0,0 +1,8 @@
package com.mhd.wms.domain.receiptOrderAccount.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
public interface ReceiptOrderAccountMapper extends BaseMapper<ReceiptOrderAccount>
{
}
@@ -0,0 +1,11 @@
package com.mhd.wms.domain.receiptOrderAccount.repository.persistence;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
import com.mhd.wms.domain.receiptOrderAccount.repository.facade.IReceiptOrderAccountService;
import com.mhd.wms.domain.receiptOrderAccount.repository.mapper.ReceiptOrderAccountMapper;
import org.springframework.stereotype.Service;
@Service
public class ReceiptOrderAccountServiceImpl extends ServiceImpl<ReceiptOrderAccountMapper, ReceiptOrderAccount> implements IReceiptOrderAccountService {
}
@@ -3,6 +3,7 @@ package com.mhd.wms.domain.stockReceiptOrder.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.wms.domain.receiptMaterialDetail.repository.po.ReceiptMaterialDetailPO;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
import com.mhd.wms.domain.stockInOrder.repository.po.StockInOrderBasePO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -156,4 +157,6 @@ public class StockReceiptOrderPO extends StockInOrderBasePO {
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
}
@ApiModelProperty("费用")
List<ReceiptOrderAccount> receiptOrderAccountList;
}
@@ -3,6 +3,7 @@ package com.mhd.wms.domain.stockReceiptOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.wms.domain.receiptMaterialDetail.repository.todo.ReceiptMaterialDetailDO;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
import com.mhd.wms.domain.stockInOrder.repository.todo.StockInOrderBaseDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -169,4 +170,6 @@ public class StockReceiptOrderDO extends StockInOrderBaseDO {
@ApiModelProperty("是否来自PDA收货:true-PDA收货完成,false-PC收货完成(用于上架单是否下发:PDA=是,PC=否)")
private Boolean fromPda;
}
@ApiModelProperty("费用")
List<ReceiptOrderAccount> receiptOrderAccountList;
}
@@ -8,6 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.domain.dto.BusinessDataPushDTO;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.OrderSequence;
@@ -16,6 +17,7 @@ import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.core.utils.uuid.IdGenerator;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.BmsServiceFeign;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.domain.BatchDetailFeignPO;
import com.mhd.system.api.domain.ContainerFeignPO;
@@ -47,6 +49,8 @@ import com.mhd.wms.domain.receiptMaterialDetail.entity.ReceiptMaterialDetail;
import com.mhd.wms.domain.receiptMaterialDetail.repository.facade.IReceiptMaterialDetailService;
import com.mhd.wms.domain.receiptMaterialDetail.repository.po.ReceiptMaterialDetailPO;
import com.mhd.wms.domain.receiptMaterialDetail.repository.todo.ReceiptMaterialDetailDO;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
import com.mhd.wms.domain.receiptOrderAccount.repository.facade.IReceiptOrderAccountService;
import com.mhd.wms.domain.shelfMaterialDetail.repository.todo.ShelfMaterialDetailDO;
import com.mhd.wms.domain.stockInOrder.entity.StockInOrder;
import com.mhd.wms.domain.stockInOrder.repository.facade.IStockInOrderService;
@@ -64,6 +68,7 @@ import com.mhd.wms.domain.stockShelfOrder.repository.po.StockShelfOrderPO;
import com.mhd.wms.domain.stockShelfOrder.repository.todo.StockShelfOrderDO;
import com.mhd.wms.domain.stockShelfOrder.service.StockShelfOrderDomainService;
import com.mhd.wms.domain.taskReceiptMaterialDetail.repository.todo.TaskReceiptMaterialDetailDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -121,6 +126,10 @@ public class StockReceiptOrderDomainService {
private IContainerUsageRecordService containerUsageRecordService;
@Resource
private SystemServiceFeign systemServiceFeign;
@Resource
private BmsServiceFeign bmsServiceFeign;
@Resource
private IReceiptOrderAccountService receiptOrderAccountService;
/**
* 分页查询收货单列表
@@ -410,7 +419,7 @@ public class StockReceiptOrderDomainService {
genStockReceiptTaskOrderByReceivingGoods(stockReceiptOrderPO,stockReceiptOrderDO);
//收货后上架前 生成质检
genQualityInspectionByReceivingGoods(stockReceiptOrderDO);
saveAmount(stockReceiptOrderDO);
//更新入库单状态
updateStockInOrder(stockReceiptOrderPO);
//修改收货单 设置收货单收货需要更新的数据数据
@@ -418,6 +427,71 @@ public class StockReceiptOrderDomainService {
}
private void saveAmount(StockReceiptOrderDO stockReceiptOrderDO) {
Long receiptOrderId = stockReceiptOrderDO.getReceiptOrderId();
List<ReceiptOrderAccount> receiptOrderAccountList = stockReceiptOrderDO.getReceiptOrderAccountList();
for (ReceiptOrderAccount receiptOrderAccount : receiptOrderAccountList) {
receiptOrderAccount.setOrderId(receiptOrderId);
}
receiptOrderAccountService.remove(new QueryWrapper<ReceiptOrderAccount>().lambda().eq(ReceiptOrderAccount::getOrderId, receiptOrderId));
receiptOrderAccountService.saveBatch(receiptOrderAccountList);
}
/**
* 定时任务整租推送到bms装卸费
*/
public void wholeRentSynchronizationZXF(Long busId) {
StockReceiptOrder stockReceiptOrder = stockReceiptOrderService.getById(busId);
String inOrderNumber = stockReceiptOrder.getInOrderNumber();
StockInOrder stockInOrder = stockInOrderService.getOne(new QueryWrapper<StockInOrder>().lambda().eq(StockInOrder::getInOrderNumber, inOrderNumber),false);
Long shipperId = stockInOrder.getShipperId();
Long organizationId = stockInOrder.getOrganizationId();
String organizationName = stockInOrder.getOrganizationName();
Long topOrganizationId = stockInOrder.getTopOrganizationId();
List<ReceiptOrderAccount> accounts = receiptOrderAccountService.list(new QueryWrapper<ReceiptOrderAccount>().lambda().eq(ReceiptOrderAccount::getOrderId, busId));
for (ReceiptOrderAccount account : accounts) {
String subjectCode = account.getSubjectCode();
String subjectName = account.getSubjectName();
String serviceItemsCode = account.getServiceItemsCode();
if (shipperId == null) {
continue;
}
log.info("开始执行{}", com.alibaba.fastjson.JSONObject.toJSONString(stockReceiptOrder));
BusinessDataPushDTO businessDataPushDTO = new BusinessDataPushDTO();
businessDataPushDTO.setOrganizationId(organizationId);
businessDataPushDTO.setTopOrganizationId(topOrganizationId);
businessDataPushDTO.setOrganizationName(organizationName);
businessDataPushDTO.setBelongModuleCode("wms");
businessDataPushDTO.setBillAmount(account.getAmount());//计费金额
businessDataPushDTO.setEstimatedCost(account.getSettlementAmount());//计算金额
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
if ("装卸费".equals(subjectName)) {
jsonObject.put("loading_unloading_unit_price", account.getPrice());//装卸货单价
jsonObject.put("cargo_quantity",account.getNum());//货物数量
} else if ("贴标费".equals(subjectName)) {
jsonObject.put("wooden_case_labeling_unit_price", account.getPrice());//木箱单价
jsonObject.put("carton_labeling_unit_price",account.getPrice());//纸箱单价
jsonObject.put("wooden_case_quantity",account.getNum());//木箱数量
jsonObject.put("carton_quantity",account.getNum());//纸箱数量
} else if ("进出仓操作费".equals(subjectName)) {
jsonObject.put("cargo_quantity", account.getNum());//货物数量
jsonObject.put("warehouse_handling_unit_price",account.getPrice());//进出仓操作费单价
}
businessDataPushDTO.setDocumentFormJson(jsonObject.toJSONString());
businessDataPushDTO.setDocumentTypeCode("WMS_ckjccd");
businessDataPushDTO.setSettlementEntityId(shipperId);
businessDataPushDTO.setSecondSubjectCode(subjectCode);
businessDataPushDTO.setServiceItemsCode(serviceItemsCode);
businessDataPushDTO.setDataSources(1);
businessDataPushDTO.setTaxRate(account.getRate());
//businessDataPushDTO.setSettlementCurrency(leasePO.getSettlementCurrency());
//businessDataPushDTO.setSalesmanId(leasePO.getSalesmanId());
bmsServiceFeign.wholeRentSynchronizationZXF(businessDataPushDTO);
}
log.info("定时任务整租推送到bms触发--结束");
}
/**
* 同步更新入库单明细的收货数量总毛重/总净重/总面积/总体积不再写入入库单明细逻辑已注释保留
* 根据收货单明细中填写的数据 materialDetailId 分组汇总后更新到入库单明细
@@ -713,13 +787,16 @@ public class StockReceiptOrderDomainService {
}
// 完成收货同步更新本单全部明细收货状态与整单收货 entireReceipt 一致否则 PDA/列表仍显示收货中
updateReceiptMaterialDetailReceiptStatusWhenOrderCompleted(stockReceiptOrderPO, loginUser, userRealName);
return stockReceiptOrderService.update(null, new UpdateWrapper<StockReceiptOrder>().lambda()
.set(StockReceiptOrder::getStatus, 3)
.set(StockReceiptOrder::getAbnormal, abnormal)
.set(StockReceiptOrder::getUpdateBy, loginUser.getUserid())
.set(StockReceiptOrder::getUpdateByName, loginUser.getUsername())
.set(StockReceiptOrder::getUpdateTime, new Date())
.eq(StockReceiptOrder::getReceiptOrderId, receiptOrderId));
boolean update = stockReceiptOrderService.update(null, new UpdateWrapper<StockReceiptOrder>().lambda()
.set(StockReceiptOrder::getStatus, 3)
.set(StockReceiptOrder::getAbnormal, abnormal)
.set(StockReceiptOrder::getUpdateBy, loginUser.getUserid())
.set(StockReceiptOrder::getUpdateByName, loginUser.getUsername())
.set(StockReceiptOrder::getUpdateTime, new Date())
.eq(StockReceiptOrder::getReceiptOrderId, receiptOrderId));
//推送bms
wholeRentSynchronizationZXF(receiptOrderId);
return update;
}
/**
@@ -223,4 +223,7 @@ public class TaskPickingMaterialDetailPO extends BaseVOEntity {
@ApiModelProperty("总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("尺寸")
private String size;
}
@@ -2,6 +2,7 @@ package com.mhd.wms.interfaces.dto.stockReceiptOrder;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
import com.mhd.wms.interfaces.dto.receiptMaterialDetail.ReceiptMaterialDetailDTO;
import com.mhd.wms.interfaces.dto.stockInOrder.StockInOrderBaseDTO;
import io.swagger.annotations.ApiModelProperty;
@@ -152,4 +153,7 @@ public class StockReceiptOrderDTO extends StockInOrderBaseDTO {
@ApiModelProperty(name = "创建时间查询条件结束日期")
private String createTimeEnd;
}
@ApiModelProperty("费用")
List<ReceiptOrderAccount> receiptOrderAccountList;
}
@@ -1,6 +1,7 @@
package com.mhd.wms.interfaces.facadeApi.materialBaseInfo;
import com.mhd.common.core.domain.entity.R;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.web.controller.BaseController;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.page.TableDataInfo;
@@ -54,11 +55,14 @@ public class MaterialBaseInfoApi extends BaseController {
@PostMapping("/edit")
public AjaxResult edit(@RequestBody MaterialBaseInfoFeign materialBaseInfoDTO)
{
if (materialBaseInfoDTO == null) {
throw new ServiceException("请求参数不能为空");
}
//转换实体
MaterialBaseInfoDO materialBaseInfoDO = materialBaseInfoAssembler.toDO2(materialBaseInfoDTO);
if(1 == materialBaseInfoDTO.getUpdateFeign()){
if (Integer.valueOf(1).equals(materialBaseInfoDTO.getUpdateFeign())) {
return toAjax(materialBaseInfoApplicationService.update(materialBaseInfoDO));
}else {
} else {
return toAjax(materialBaseInfoApplicationService.insert(materialBaseInfoDO));
}
}
@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
@@ -79,6 +80,15 @@ public class MaterialInventoryApi extends BaseController {
startPage();
// 使用带批次属性的查询方法批次属性值从库存表中获取
List<MaterialInventoryPO> list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO);
// 按更新时间倒序排序update_time 为空的数据放最后
list.sort((o1, o2) -> {
Date t1 = o1.getUpdateTime();
Date t2 = o2.getUpdateTime();
if (t1 == null && t2 == null) return 0;
if (t1 == null) return 1;
if (t2 == null) return -1;
return t2.compareTo(t1); // desc
});
TableDataInfo tableDataInfo = getDataTable(list);
// 如果查询结果为空抛出异常提示用户该物料在库存中不存在
// if (tableDataInfo.getTotal() == 0) {
@@ -136,6 +146,11 @@ public class MaterialInventoryApi extends BaseController {
if(materialInventoryDTO.getMaterialInventoryId() != null){
return toAjax(materialInventoryApplicationService.update(materialInventoryDO));
}else {
// 新增时补齐更新时间update_time避免新增数据 update_time 为空
materialInventoryDO.setUpdateTime(new Date());
// update_by/update_by_name create_by/create_by_name 保持一致
materialInventoryDO.setUpdateBy(materialInventoryDO.getCreateBy());
materialInventoryDO.setUpdateByName(materialInventoryDO.getCreateByName());
return toAjax(materialInventoryApplicationService.insert(materialInventoryDO));
}
}
+8 -8
View File
@@ -14,20 +14,20 @@ spring:
nacos:
discovery:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
#线上正式环境
# server-addr: 10.102.192.105:6848
config:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.5:6848
username: nacos
password: manhuoda@2023
# server-addr: 10.102.192.5:6848
# username: nacos
# password: manhuoda@2023
#线上正式环境
# server-addr: 10.102.192.105:6848
# 配置文件格式
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mhd.wms.domain.receiptOrderAccount.repository.mapper.ReceiptOrderAccountMapper">
</mapper>
@@ -200,10 +200,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.status = #{status}
</if>
<if test="ltStatus != null ">
and a.status &lt; #{status}
and a.status &lt; #{ltStatus}
</if>
<if test="gtStatus != null ">
and a.status &gt; #{status}
and a.status &gt; #{gtStatus}
</if>
<if test="auditStatus != null ">
and a.audit_status = #{auditStatus}
+95
View File
@@ -0,0 +1,95 @@
ALTER TABLE "NGWL_TEST_SYSTEM"."EXPENSE_ACCOUNT" ADD COLUMN "IN_ORDER_DISPLAY" INT DEFAULT 0;
ALTER TABLE "NGWL_TEST_SYSTEM"."EXPENSE_ACCOUNT" ADD COLUMN "OUT_ORDER_DISPLAY" INT;
COMMENT ON COLUMN "NGWL_TEST_SYSTEM"."EXPENSE_ACCOUNT"."IN_ORDER_DISPLAY" IS '入库单是否固定显示 0-否 1-是';
COMMENT ON COLUMN "NGWL_TEST_SYSTEM"."EXPENSE_ACCOUNT"."OUT_ORDER_DISPLAY" IS '出库单是否固定显示 0-否 1-是';
/*
Navicat Premium Dump SQL
Source Server : 113.44.106.61
Source Server Type : Dameng
Source Server Version : 8014116 (08.01.4116)
Source Host : 113.44.106.61:5236
Source Schema : NGWL_TEST_WMS
Target Server Type : Dameng
Target Server Version : 8014116 (08.01.4116)
File Encoding : 65001
Date: 03/04/2026 16:20:24
*/
-- ----------------------------
-- Table structure for RECEIPT_ORDER_ACCOUNT
-- ----------------------------
DROP TABLE IF EXISTS "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT";
CREATE TABLE "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT" (
"ID" VARCHAR(36) NOT NULL,
"SYS_ORG_CODE" VARCHAR(64) DEFAULT NULL,
"IS_DELETE" INT DEFAULT '0',
"ORG_NAME" VARCHAR(255) DEFAULT NULL,
"ORGANIZATION_ID" INT DEFAULT '0',
"TOP_ORGANIZATION_ID" INT DEFAULT '0',
"ORGANIZATION_NAME" VARCHAR(255) DEFAULT NULL,
"ORDER_ID" BIGINT DEFAULT NULL,
"ACCOUNT_ID" INT DEFAULT '0',
"ACCOUNT_TYPE" INT DEFAULT '0',
"SUBJECT_CODE" VARCHAR(255) DEFAULT NULL,
"SUBJECT_NAME" VARCHAR(255) DEFAULT NULL,
"RATE" DECIMAL(10,2) DEFAULT '0.00',
"AMOUNT" DECIMAL(10,2) DEFAULT '0.00',
"TAX_AMOUNT" DECIMAL(10,2),
"TAX_FREE_FEE" DECIMAL(10,2),
"RECEIVE_ACCOUNT" VARCHAR2(200),
"SETTLEMENT_AMOUNT" DECIMAL(10,2),
"PRICE" DECIMAL(10,2),
"NUM" DECIMAL(10,2),
"SERVICE_ITEMS_CODE" VARCHAR2(255),
"SERVICE_ITEMS_NAME" VARCHAR2(255),
"CREATE_TIME" TIMESTAMP(6),
"CREATE_BY" BIGINT DEFAULT 0,
"CREATE_BY_NAME" VARCHAR(20 CHAR) DEFAULT '',
"UPDATE_TIME" TIMESTAMP(6),
"UPDATE_BY" BIGINT DEFAULT 0,
"UPDATE_BY_NAME" VARCHAR(20 CHAR) DEFAULT '',
"DEL_FLAG" TINYINT DEFAULT 1
)
;
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."SYS_ORG_CODE" IS '所属部门';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."IS_DELETE" IS '删除标识';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."ORG_NAME" IS '所属组织';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."ORGANIZATION_ID" IS '组织ID';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."TOP_ORGANIZATION_ID" IS '一级组织ID';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."ORGANIZATION_NAME" IS '组织名称';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."ORDER_ID" IS '订单id';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."ACCOUNT_ID" IS '科目id';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."ACCOUNT_TYPE" IS '科目收支类型(1-应收,2-应付)';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."SUBJECT_CODE" IS '科目编码';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."SUBJECT_NAME" IS '科目名称';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."RATE" IS '科目费率';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."AMOUNT" IS '金额';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."TAX_AMOUNT" IS '税额';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."TAX_FREE_FEE" IS '无税费用';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."RECEIVE_ACCOUNT" IS '收款帐户';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."SETTLEMENT_AMOUNT" IS '计算金额';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."PRICE" IS '单价';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."NUM" IS '数量';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."CREATE_BY" IS '创建人用户ID';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."CREATE_BY_NAME" IS '创建人姓名';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."UPDATE_TIME" IS '最后修改时间';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."UPDATE_BY" IS '最后修改人用户ID';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."UPDATE_BY_NAME" IS '修改人姓名';
COMMENT ON COLUMN "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT"."DEL_FLAG" IS '删除标记:0-无状态,1-正常,2-已删除';
-- ----------------------------
-- Primary Key structure for table RECEIPT_ORDER_ACCOUNT
-- ----------------------------
ALTER TABLE "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT" ADD PRIMARY KEY ("ID");