Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
zhou-hongcheng
2026-02-27 15:57:29 +08:00
11 changed files with 71 additions and 24 deletions
@@ -164,11 +164,25 @@ public class ContractManageApplicationService {
* 处理数据
*/
private void handleData(ContractManageDO contractManageDO) {
//根据合同生效时间判断合同是否生效
if (DateUtil.compare(contractManageDO.getEffectiveDate(), new Date()) > 0) {
contractManageDO.setContractState(2);
} else {
// 如果前端未传合同状态,则根据生效/到期时间自动计算;
// 如果前端已经传了 contractState,则尊重前端值
if (contractManageDO.getContractState() == null) {
// 合同状态(1-未生效,2-使用中,3-已过期,4-已作废)
Date now = DateUtil.beginOfDay(new Date());
Date effectiveDate = contractManageDO.getEffectiveDate();
Date expirationDate = contractManageDO.getExpirationDate();
if (effectiveDate != null && expirationDate != null) {
if (DateUtil.compare(now, effectiveDate) < 0) {
// 当前时间早于生效日期:未生效
contractManageDO.setContractState(1);
} else if (DateUtil.compare(now, expirationDate) > 0) {
// 当前时间晚于到期日期:已过期
contractManageDO.setContractState(3);
} else {
// 生效日期 <= 当前时间 <= 到期日期:使用中
contractManageDO.setContractState(2);
}
}
}
if(StringUtils.isNotEmpty(contractManageDO.getSettlementCustomersCode())){
AjaxResult ajaxResult = bmsServiceFeign.getCustomersInfoByCode(contractManageDO.getSettlementCustomersCode());
@@ -190,11 +204,19 @@ public class ContractManageApplicationService {
* @param contractManageDO
*/
private void checkContract(ContractManageDO contractManageDO) {
// 通用/特殊合同的唯一性应在“同一组织”内生效,不同组织之间互不影响
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser) || loginUser.getUserPo() == null) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
ContractManageDO commonQueryParam = new ContractManageDO();
commonQueryParam.setContractType(contractManageDO.getContractType());
commonQueryParam.setSettlementCustomersCode(contractManageDO.getSettlementCustomersCode());
commonQueryParam.setEffectiveDateString(DateUtil.format(contractManageDO.getEffectiveDate(),"yyyy-MM-dd"));
commonQueryParam.setExpirationDateString(DateUtil.format(contractManageDO.getExpirationDate(),"yyyy-MM-dd"));
// 按当前登录人的组织维度进行唯一性校验:不同组织下的通用/特殊合同互不影响
commonQueryParam.setOrganizationId(loginUser.getUserPo().getOrganizationId());
commonQueryParam.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
//通用合同
if(contractManageDO.getCommonContractFlag()==1){
commonQueryParam.setCommonContractFlag(1);
@@ -178,11 +178,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contractManageDO.expirationDateEnd != null and contractManageDO.expirationDateEnd != ''">
AND date_format(expiration_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateEnd}
</if>
<!-- 时间段重叠判断:只有当已有合同与传入的有效期真正有交集时才算冲突
条件:已有合同开始日期 <= 新合同结束日期 且 已有合同结束日期 >= 新合同开始日期 -->
<if test="contractManageDO.effectiveDateString != null and contractManageDO.effectiveDateString != ''
and contractManageDO.expirationDateString != null and contractManageDO.expirationDateString != ''">
AND (
date_format(effective_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateString}
OR date_format(expiration_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateString}
date_format(effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateString}
AND date_format(expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateString}
)
</if>
<if test="contractManageDO.nowDateString != null and contractManageDO.nowDateString != ''">
@@ -162,6 +162,7 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
if (billManage != null) {
billManage.setIsInvoice(1);
billManage.setInvoiceId(bmsInvoiceList.getId().toString());
billManage.setApplyNumber(bmsInvoiceList.getApplyNumber());
billManageMapper.updateById(billManage);
}
/*AjaxResult ajaxResult = financeServiceFeign.editIsInvoice(transportationId,1,bmsInvoiceList.getId(),"",bmsInvoiceList.getApplyNumber());
@@ -343,6 +344,8 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
if (ObjectUtil.isNotNull(billManages) && billManages.size() > 0) {
for (BillManage billManage : billManages) {
billManage.setIsInvoice(2);
billManage.setInvoiceId(bmsInvoiceList.getId().toString());
billManage.setApplyNumber(bmsInvoiceList.getApplyNumber());
billManageMapper.updateById(billManage);
}
}
@@ -14,13 +14,13 @@
<if test="tmsInvoiceInfoDTO.id !=null and tmsInvoiceInfoDTO.id != ''"> and a.id = #{tmsInvoiceInfoDTO.id} </if>
<if test="tmsInvoiceInfoDTO.id!=null and tmsInvoiceInfoDTO.id!=''"> and instr(a.id ,#{tmsInvoiceInfoDTO.id}) > 0 </if>
<if test="tmsInvoiceInfoDTO.createBy !=null and tmsInvoiceInfoDTO.createBy != ''"> and a.create_by = #{tmsInvoiceInfoDTO.createBy} </if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(tmsInvoiceInfoDTO.invoiceTitle)">
<if test="tmsInvoiceInfoDTO.invoiceTitle !=null and tmsInvoiceInfoDTO.invoiceTitle != ''">
and a.invoice_title LIKE CONCAT('%',#{tmsInvoiceInfoDTO.invoiceTitle},'%')
</if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(tmsInvoiceInfoDTO.taxRegAccount)">
<if test="tmsInvoiceInfoDTO.taxRegAccount !=null and tmsInvoiceInfoDTO.taxRegAccount != ''">
and a.tax_reg_account LIKE CONCAT('%',#{tmsInvoiceInfoDTO.taxRegAccount},'%')
</if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(tmsInvoiceInfoDTO.createByName)">
<if test="tmsInvoiceInfoDTO.createByName !=null and tmsInvoiceInfoDTO.createByName != ''">
and a.create_by_name LIKE CONCAT('%',#{tmsInvoiceInfoDTO.createByName},'%')
</if>
<if test="tmsInvoiceInfoDTO.createTime!=null and tmsInvoiceInfoDTO.createTime!=''">
@@ -6,7 +6,7 @@
<include refid="field_where"></include>
FROM
bms_invoice_list a
LEFT JOIN bms_waybill_invoiced b ON a.id = b.invoice_list_id
where a.is_delete = 0
<include refid="common_where"></include>
group by a.id
@@ -48,19 +48,19 @@
<if test="bmsInvoiceListQueryDTO.sysOrgCode!=null and bmsInvoiceListQueryDTO.sysOrgCode!=''">
and a.sys_org_code = #{bmsInvoiceListQueryDTO.sysOrgCode}
</if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.applyNumber)">
<if test="bmsInvoiceListQueryDTO.applyNumber != null and bmsInvoiceListQueryDTO.applyNumber != ''">
and a.apply_number LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.applyNumber},'%')
</if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.shipperName)">
<if test="bmsInvoiceListQueryDTO.shipperName != null and bmsInvoiceListQueryDTO.shipperName != ''">
and a.shipper_name LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.shipperName},'%')
</if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.shipperId)">
<if test="bmsInvoiceListQueryDTO.shipperId != null and bmsInvoiceListQueryDTO.shipperId != ''">
and a.shipper_id = #{bmsInvoiceListQueryDTO.shipperId}
</if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.companyName)">
<if test="bmsInvoiceListQueryDTO.companyName != null and bmsInvoiceListQueryDTO.companyName != ''">
and a.company_name LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.companyName},'%')
</if>
<if test="@org.jeecg.common.util.oConvertUtils@isNotEmpty(bmsInvoiceListQueryDTO.invoiceTitle)">
<if test="bmsInvoiceListQueryDTO.invoiceTitle != null and bmsInvoiceListQueryDTO.invoiceTitle != ''">
and a.invoice_title LIKE CONCAT('%',#{bmsInvoiceListQueryDTO.invoiceTitle},'%')
</if>
<if test="bmsInvoiceListQueryDTO.organizationId != null ">
@@ -80,7 +80,7 @@
<if test="query.codeManaged != null and query.codeManaged != ''">
AND m.code_managed = #{query.codeManaged}
</if>
<if test="query.createdAtStart != null and query.createdAtEnd != null and @org.jeecg.common.util.oConvertUtils@isNotEmpty(query.createdAtStart) and @org.jeecg.common.util.oConvertUtils@isNotEmpty(query.createdAtEnd)">
<if test="query.createdAtStart != null and query.createdAtEnd != null and query.createdAtStart != '' and query.createdAtEnd != ''">
and DATE_FORMAT(i.created_at,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(#{query.createdAtStart},'%Y-%m-%d')
and DATE_FORMAT(i.created_at,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{query.createdAtEnd},'%Y-%m-%d')
</if>
@@ -815,6 +815,10 @@ public class StockOutOrderApplicationService {
//未进行分配直接跳过
continue;
}
BigDecimal alreadyAllocationQuantity = outMaterialDetailDO.getAlreadyAllocationQuantity();
BigDecimal allocationQuantity = outMaterialDetailDO.getAllocationQuantity();
BigDecimal nowAllocationQuantity = allocationQuantity.subtract(alreadyAllocationQuantity);
outMaterialDetailDO.setNowAllocationQuantity(nowAllocationQuantity);
BigDecimal totalAllocationQuantity = BigDecimal.ZERO;//当前作业分配数量
//判断收否分配 第一次分配 修改分配数量
// if (outMaterialDetailPO.getAllocationQuantity().compareTo(BigDecimal.ZERO) == 0){
@@ -73,6 +73,11 @@ public class OutMaterialDetail extends BaseVOEntity {
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@@ -418,15 +418,14 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
public synchronized void xgkc(List<OutMaterialDetail> outMaterialDetailList,String outOrderNumber,LoginUser loginUser) {
StockOutOrder stockOutOrder = stockOutOrderMapper.selectOne(new QueryWrapper<StockOutOrder>().lambda().eq(StockOutOrder::getOutOrderNumber, outOrderNumber));
for (OutMaterialDetail outMaterialDetail : outMaterialDetailList) {
Long materialDetailId = outMaterialDetail.getMaterialDetailId();
OutMaterialDetail isAllocatedDetail = outMaterialDetailMapper.selectById(materialDetailId);
String isAllocated = isAllocatedDetail.getIsAllocated();
// 如果已经分配过,则跳过本次循环(该明细已分配过,不再重复处理)
if (isAllocated != null && "1".equals(isAllocated)) {
BigDecimal nowAllocationQuantity = outMaterialDetail.getNowAllocationQuantity();
if (nowAllocationQuantity == null && nowAllocationQuantity.compareTo(BigDecimal.ZERO) <= 0) {
continue;
}
Long materialInventoryId = outMaterialDetail.getMaterialInventoryId();
BigDecimal allocationQuantity = outMaterialDetail.getAllocationQuantity();
//分配数量为本次分配数量
BigDecimal allocationQuantity = outMaterialDetail.getNowAllocationQuantity();
if (ObjectUtils.isEmpty(allocationQuantity)) {
allocationQuantity = BigDecimal.ZERO;
}
@@ -80,6 +80,11 @@ public class OutMaterialDetailPO extends StockOutOrderBaseDO {
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@@ -1,5 +1,6 @@
package com.mhd.wms.domain.outMaterialDetail.repository.todo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
@@ -70,6 +71,12 @@ public class OutMaterialDetailDO extends BaseVOEntity {
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;