Author SHA1 Message Date
秦鸿展 f91a2248af 调整账单时间为保存修改 2026-07-21 16:49:53 +08:00
秦鸿展 65fd1e6a19 31 2026-07-20 16:18:19 +08:00
秦鸿展 bab7f048eb 31 2026-07-20 16:18:12 +08:00
秦鸿展 f543c4a00f 新增费用科目BUG修改 2026-07-20 16:16:33 +08:00
秦鸿展 98004ba989 30 2026-07-20 15:40:18 +08:00
秦鸿展 76c8b1f5aa 备注字段修改 2026-07-20 15:38:34 +08:00
秦鸿展 8542a25238 31 2026-07-20 14:43:33 +08:00
秦鸿展 22590abbb8 调整账单报错 2026-07-20 14:40:11 +08:00
秦鸿展 bb68e118fa 30 2026-07-20 12:51:19 +08:00
秦鸿展 1d28170d46 新增账单金额不一致报错 2026-07-20 12:47:00 +08:00
秦鸿展 1b85098063 发31 2026-07-17 22:18:59 +08:00
秦鸿展 d6d9ee1d5e 发30 2026-07-17 22:14:14 +08:00
秦鸿展 2d9a4eaad2 发30 2026-07-17 21:44:52 +08:00
秦鸿展 1423d5d140 发30 2026-07-17 21:39:53 +08:00
秦鸿展 80e1639b83 发测试 2026-07-17 20:37:17 +08:00
秦鸿展 07862301e6 应收账单新增报错 2026-07-17 20:31:35 +08:00
秦鸿展 d6fae412cd 应收账单新增报错 2026-07-17 20:17:04 +08:00
秦鸿展 7ee70dd06c 应收账单新增报错 2026-07-17 20:11:34 +08:00
秦鸿展 6f33fc3b64 应收账单添加明细报错 2026-07-17 19:40:49 +08:00
王奎兴 a9e3d6cb6b Merge branch 'dev' into dev_jinji 2026-07-17 18:06:41 +08:00
王奎兴 5fe5ce7e82 复核添加货主id查询; 2026-07-17 18:04:56 +08:00
秦鸿展 5cc987c2c4 应收账单明细修改 2026-07-17 16:14:21 +08:00
秦鸿展 9ed1797b59 紧急任务修改 2026-07-17 15:32:11 +08:00
秦鸿展 2373be59e6 紧急任务修改 2026-07-17 15:27:17 +08:00
王奎兴 587550025d 发30 2026-07-17 14:29:43 +08:00
王奎兴 9dfcf4ef5a 发31 2026-07-17 14:22:38 +08:00
秦鸿展 914957e683 新增账单 2026-07-17 11:41:39 +08:00
20 changed files with 319 additions and 34 deletions
@@ -18,7 +18,7 @@ import java.util.Set;
/**
* bms财务结算系统feign调用接口
*/
@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.33.0.109:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.102.192.32:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface BmsServiceFeign {
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.33.0.99:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.102.192.33:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface OmsServiceFeign {
@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.33.0.129:8014",configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.102.192.31:8014",configuration = FeignAutoConfiguration.class)
public interface WlhyServiceFeign {
/**
@@ -21,7 +21,7 @@ import java.util.Map;
* @description: TODO
* @date 2024/5/10 8:58
**/
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.33.0.109:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.102.192.32:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface WmsServiceFeign {
/**
@@ -9,7 +9,7 @@ import com.mhd.system.api.feign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.33.0.99:8018", configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.102.192.33:8018", configuration = FeignAutoConfiguration.class)
public interface YmsServiceFeign {
/**
+8 -8
View File
@@ -13,24 +13,24 @@ spring:
cloud:
nacos:
discovery:
# server-addr: 127.0.0.1:8848
server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
# server-addr: 10.102.192.31:6848
server-addr: 10.33.0.129:6010
# server-addr: 10.33.0.129:6010
#线上正式环境
# server-addr: 127.0.0.1:8848
# server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
# username: nacos
# password: manhuoda@2023
config:
# server-addr: 127.0.0.1:8848
server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
server-addr: 10.33.0.129:6010
# server-addr: 10.33.0.129:6010
#线上正式环境
# server-addr: 127.0.0.1:8848
# server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
# username: nacos
# password: manhuoda@2023
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
file-extension: yml #默认properties
# 共享配置
@@ -16,7 +16,7 @@ spring:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.30:6848
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
#线上正式环境
@@ -25,7 +25,7 @@ spring:
# server-addr: 127.0.0.1:8848
# server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
server-addr: 10.102.192.30:6848
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
#线上正式环境
@@ -107,7 +107,10 @@
<select id="selectCostSubject" parameterType="com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO"
resultType="com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO">
select
a.*
a.* ,
b.tax_rate,
b.service_items_name,
b.service_items_code
from expense_account a left join service_items_manage b ON a.service_items_manage_id = b.service_items_manage_id
where
a.del_flag = 1
@@ -118,13 +121,17 @@
<select id="selectAllCostSubject"
resultType="com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO">
select
*
from expense_account
a.* ,
b.tax_rate,
b.service_items_name,
b.service_items_code
from expense_account a
left join service_items_manage b ON a.service_items_manage_id = b.service_items_manage_id
where
del_flag = 1
and status = 1
and first_subject_flag = 2
and upper_subject_code = #{subjectCode}
a.del_flag = 1
and a.status = 1
and a.first_subject_flag = 2
and a.upper_subject_code = #{subjectCode}
</select>
<select id="getInfoByCode" resultType="com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO" parameterType="com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO">
@@ -18,6 +18,7 @@ import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO;
import com.mhd.bms.domain.billOperationLog.service.BillOperationLogDomainService;
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService;
import com.mhd.bms.domain.ncLog.entity.NcLog;
import com.mhd.bms.domain.ncLog.repository.mapper.NcLogMapper;
@@ -333,7 +334,10 @@ public class BillManageApplicationService {
BigDecimal billingDiscountAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingDiscountAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
//比较传来的账单总额、账单金额、账单优惠金额与计算的是否一致,不一致则报错
if(billingTotalAmount.compareTo(billManageDTO.getBillTotalAmount())!=0 || billingAmount.compareTo(billManageDTO.getBillAmount())!=0 || billingDiscountAmount.compareTo(billManageDTO.getBillDiscountAmount())!=0){
throw new ServiceException("账单金额不一致,调整失败,请重试");
// 金额不一致时,用明细累加值覆盖前端传值,不再抛异常
billManageDTO.setBillTotalAmount(billingTotalAmount);
billManageDTO.setBillAmount(billingAmount);
billManageDTO.setBillDiscountAmount(billingDiscountAmount);
}
//将集合中没有计费流水id的过滤到另一个集合,将添加费用的集合保存到计费流水并返回计费流水id
List<BillDetailDTO> billDetailDTOListNoBillingStatementId = billDetailDTOList.stream().filter(billDetailDTO -> billDetailDTO.getBillingStatementId()==null).collect(Collectors.toList());
@@ -369,7 +373,10 @@ public class BillManageApplicationService {
billManageDO.setTailCalculationCode(billManageDTO.getTailCalculationCode());
billManageDO.setAmountAccuracyCode(billManageDTO.getAmountAccuracyCode());
billManageDO.setBillDiscount(billManageDTO.getBillDiscount());
billManageDO.setBillRemark(billManageDTO.getBillRemark());
billManageDO.setBillDiscountLimit(billManageDTO.getBillDiscountLimit());
billManageDO.setCycleBeginTime(billManageDTO.getCycleBeginTime());
billManageDO.setCycleEndTime(billManageDTO.getCycleEndTime());
billManageDO.setCreateTime(billManageDTO.getCreateTime());
billManageDO.setUpdateTime(new Date());
billManageDO.setUpdateBy(loginUser.getUserid());
@@ -385,6 +392,89 @@ public class BillManageApplicationService {
return flag && flagTwo && three;
}
/**
* 新增账单
*/
@Transactional
public Boolean addBill(BillManageDTO billManageDTO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
if (billManageDTO.getBillDetailDTOList() == null || billManageDTO.getBillDetailDTOList().size() == 0) {
throw new ServiceException("账单明细不能为空");
}
List<BillDetailDTO> billDetailDTOList = billManageDTO.getBillDetailDTOList();
//计算集合中所有账单总额、账单金额、账单优惠金额
BigDecimal billingTotalAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal billingAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal billingDiscountAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingDiscountAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
//生成账单编号
String billNumber = OrderSequence.getOrderCode("ZD");
//创建账单主记录
BillManageDO billManageDO = new BillManageDO();
BeanUtils.copyProperties(billManageDTO, billManageDO);
billManageDO.setBillNumber(billNumber);
billManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
billManageDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
billManageDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
billManageDO.setBillAmount(billingAmount);
billManageDO.setBillAmountUnsettled(billingAmount);
billManageDO.setBillAmountSettlement(BigDecimal.ZERO);
billManageDO.setBillDiscountAmount(billingDiscountAmount);
billManageDO.setBillTotalAmount(billingTotalAmount);
billManageDO.setBillState(1);
billManageDO.setBillStep(1);
billManageDO.setReconciliationStatus(1);
billManageDO.setCreateTime(new Date());
billManageDO.setCreateBy(loginUser.getUserid());
billManageDO.setCreateByName(loginUser.getUserPo().getUserName());
billManageDO.setUpdateTime(new Date());
billManageDO.setUpdateBy(loginUser.getUserid());
billManageDO.setUpdateByName(loginUser.getUserPo().getUserName());
billManageDomainService.handlData(billManageDO);
Boolean flag = billManageDomainService.insert(billManageDO);
if (!flag) {
throw new ServiceException("新增账单失败");
}
// insert后按账单编号重新查一次拿自增ID
List<BillManage> insertedList = billManageDomainService.queryListLambda(
new LambdaQueryWrapper<BillManage>().eq(BillManage::getBillNumber, billNumber));
if (insertedList != null && !insertedList.isEmpty()) {
billManageDO.setBillManageId(insertedList.get(0).getBillManageId());
}
//将集合中没有计费流水id的过滤到另一个集合,将添加费用的集合保存到计费流水并返回计费流水id
List<BillDetailDTO> billDetailDTOListNoBillingStatementId = billDetailDTOList.stream().filter(item -> item.getBillingStatementId() == null).collect(Collectors.toList());
//遍历集合并保存流水
for (BillDetailDTO billDetailDTO : billDetailDTOListNoBillingStatementId) {
BillingStatementDTO billingStatementDTO = new BillingStatementDTO();
BeanUtils.copyProperties(billDetailDTO, billingStatementDTO);
billingStatementDTO.setAccountExpenseType(billDetailDTO.getBillType());
billingStatementDTO.setBillManageId(billManageDO.getBillManageId());
billingStatementDTO.setBillingState(3);
Long billingStatementId = billingStatementApplicationService.insertAndReturnId(billingStatementDTO);
//遍历billDetailDTOList集合,将计费流水号相同的,赋值计费流水id
billDetailDTOList.stream().filter(item -> item.getBillingFlow().equals(billDetailDTO.getBillingFlow())).forEach(item -> {
item.setBillingStatementId(billingStatementId);
item.setBillType(billManageDTO.getBillType());
item.setBillManageId(billManageDO.getBillManageId());
item.setBillNumber(billNumber);
item.setInvoiceItem(item.getFirstSubjectCode());
item.setInvoiceItemName(item.getFirstSubjectName());
item.setFeeType(item.getServiceItemsName());
});
}
//保存账单明细
Boolean flagTwo = billDetailDomainService.saveBatch(billDetailDTOList);
//保存操作记录
BillOperationLogDO billOperationLogDO = new BillOperationLogDO();
billOperationLogDO.setBillManageId(billManageDO.getBillManageId());
billOperationLogDO.setOperationInfo(StringUtils.format(BillLogsConstants.create_bill_text, billNumber, billingAmount));
billOperationLogDO.setOperationType(1);
boolean flagThree = billOperationLogDomainService.saveBillOperationLog(billOperationLogDO);
return flag && flagTwo && flagThree;
}
/**
* 复制账单
*/
@@ -666,6 +756,76 @@ public class BillManageApplicationService {
return billManageDomainService.synchronousNcSK(businessDocumentDetaliIds);
}
/**
* 修改账单明细
*/
@Transactional
public Boolean updateBillDetail(BillManageDTO billManageDTO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
BillDetailDTO detailDTO = billManageDTO.getBillDetailDTOList() != null && !billManageDTO.getBillDetailDTOList().isEmpty()
? billManageDTO.getBillDetailDTOList().get(0) : null;
if (detailDTO == null || detailDTO.getBillDetailId() == null) {
throw new ServiceException("明细id不能为空");
}
BillDetailPO billDetailPO = billDetailDomainService.getInfo(detailDTO.getBillDetailId());
if (billDetailPO == null) {
throw new ServiceException("明细不存在");
}
BillManagePO billManagePO = billManageDomainService.getInfo(billDetailPO.getBillManageId());
if (billManagePO == null || billManagePO.getBillState() != 1) {
throw new ServiceException("账单状态不为未确认,不可修改明细");
}
BillDetailDO billDetailDO = new BillDetailDO();
BeanUtils.copyProperties(detailDTO, billDetailDO);
billDetailDO.setBillDetailId(detailDTO.getBillDetailId());
billDetailDO.setInvoiceItem(detailDTO.getFirstSubjectCode());
billDetailDO.setInvoiceItemName(detailDTO.getFirstSubjectName());
billDetailDO.setFeeType(detailDTO.getServiceItemsName());
billDetailDO.setUpdateBy(loginUser.getUserid());
billDetailDO.setUpdateByName(loginUser.getUserPo().getUserName());
billDetailDO.setUpdateTime(new Date());
// 同步更新计费流水的费用科目、服务项(因为这些字段在 billing_statement 表,不在 bill_detail 表)
if (billDetailPO.getBillingStatementId() != null) {
BillingStatementDO billingStatementDO = new BillingStatementDO();
billingStatementDO.setBillingStatementId(billDetailPO.getBillingStatementId());
billingStatementDO.setFirstSubjectCode(detailDTO.getFirstSubjectCode());
billingStatementDO.setFirstSubjectName(detailDTO.getFirstSubjectName());
billingStatementDO.setServiceItemsCode(detailDTO.getServiceItemsCode());
billingStatementDO.setServiceItemsName(detailDTO.getServiceItemsName());
billingStatementDO.setUpdateBy(loginUser.getUserid());
billingStatementDO.setUpdateByName(loginUser.getUserPo().getUserName());
billingStatementDO.setUpdateTime(new Date());
billingStatementApplicationService.update(billingStatementDO);
}
Boolean flag = billDetailDomainService.update(billDetailDO);
// 重新计算账单总金额并更新主表
List<BillDetailPO> allDetails = billDetailDomainService.getDetailsByBillManageId(billManagePO.getBillManageId());
allDetails = allDetails.stream().map(item -> {
if (item.getBillDetailId().equals(detailDTO.getBillDetailId())) {
item.setBillingTotalAmount(detailDTO.getBillingTotalAmount());
item.setBillingAmount(detailDTO.getBillingAmount());
item.setBillingDiscountAmount(detailDTO.getBillingDiscountAmount());
}
return item;
}).collect(Collectors.toList());
BigDecimal totalAmount = allDetails.stream().map(BillDetailPO::getBillingTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal amount = allDetails.stream().map(BillDetailPO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal discountAmount = allDetails.stream().map(BillDetailPO::getBillingDiscountAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
BillManageDO billManageDO = new BillManageDO();
billManageDO.setBillManageId(billManagePO.getBillManageId());
billManageDO.setBillTotalAmount(totalAmount);
billManageDO.setBillAmount(amount);
billManageDO.setBillAmountUnsettled(amount);
billManageDO.setBillDiscountAmount(discountAmount);
billManageDO.setUpdateBy(loginUser.getUserid());
billManageDO.setUpdateByName(loginUser.getUserPo().getUserName());
billManageDO.setUpdateTime(new Date());
Boolean flagTwo = billManageDomainService.update(billManageDO);
return flag && flagTwo;
}
}
@@ -598,6 +598,9 @@ public class BillingStatementApplicationService {
billingStatementPO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
billingStatementPO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
billingStatementPO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
// 默认填充当前登录人为业务员
billingStatementPO.setSalesmanId(String.valueOf(loginUser.getUserid()));
billingStatementPO.setSalesmanName(loginUser.getUserPo().getUserName());
return billingStatementPO;
}
@@ -675,6 +675,9 @@ public class BillingStatementDomainService {
*/
public List<BillingStatementPO> getBillDetailsList(BillingStatementDO billingStatementDO) {
//查询当前账单的五大信息:组织信息、结算对象、来源系统、收支类型、账单周期
if (billingStatementDO.getBillManageId() == null || billingStatementDO.getBillManageId() <= 0) {
return new ArrayList<>();
}
BillManagePO billManagePO = billManageDomainService.getInfo(billingStatementDO.getBillManageId());
if(null == billManagePO){
throw new ServiceException("账单信息未找到");
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.bms.domain.billManage.entity.BillManage;
import com.mhd.bms.domain.billManage.repository.mapper.BillManageMapper;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.bms.domain.bmsInvoiceList.entity.BmsInvoiceList;
import com.mhd.bms.domain.bmsInvoiceList.entity.BmsSettlementPartyInvoice;
import com.mhd.bms.domain.bmsInvoiceList.repository.facade.IBmsInvoiceListService;
@@ -56,6 +57,8 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
private BmsMakeOutInvoiceItemMapper bmsMakeOutInvoiceItemMapper;
@Resource
private BillManageMapper billManageMapper;
@Resource
private com.mhd.system.api.SystemServiceFeign systemServiceFeign;
/*@Resource
private BmsSettlementPartyInvoiceMapper bmsSettlementPartyInvoiceMapper;*/
@@ -327,7 +330,7 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
/**
* 发票详情
*
* @param id
* @param
* @return
*/
@Override
@@ -415,6 +418,23 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
bmsMakeOutInvoiceItem.setMakeId(bmsMakeOutInvoice.getId());
//bmsMakeOutInvoiceItem.setCreateBy(sysUser.getId());
bmsMakeOutInvoiceItem.setCreateTime(date);
// 如果前端没传 invoiceItemName,按 invoiceItem(编码)从费用科目反查名称补齐
if (StringUtils.isEmpty(bmsMakeOutInvoiceItem.getInvoiceItemName())
&& StringUtils.isNotEmpty(bmsMakeOutInvoiceItem.getInvoiceItem())) {
try {
AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode(bmsMakeOutInvoiceItem.getInvoiceItem());
if ("200".equals(String.valueOf(ajaxResult.get("code"))) && ajaxResult.get("data") != null) {
com.alibaba.fastjson.JSONObject dataObj = com.alibaba.fastjson.JSON.parseObject(
com.alibaba.fastjson.JSON.toJSONString(ajaxResult.get("data")));
String subjectName = dataObj.getString("subjectName");
if (StringUtils.isNotEmpty(subjectName)) {
bmsMakeOutInvoiceItem.setInvoiceItemName(subjectName);
}
}
} catch (Exception e) {
log.warn("开票项目名称反查失败 invoiceItem=" + bmsMakeOutInvoiceItem.getInvoiceItem() + " " + e.getMessage());
}
}
bmsMakeOutInvoiceItemMapper.insert(bmsMakeOutInvoiceItem);
}
}
@@ -229,6 +229,35 @@ public class BillManageApi extends BaseController{
}
@ApiOperation("修改账单明细")
@PostMapping("/updateBillDetail")
public AjaxResult updateBillDetail(@RequestBody BillManageDTO billManageDTO)
{
try {
billManageApplicationService.updateBillDetail(billManageDTO);
return AjaxResult.success("操作成功");
}catch (Exception e){
return AjaxResult.error("修改明细失败:"+e.getMessage());
}
}
@ApiOperation("新增账单")
@PostMapping("/addBill")
public AjaxResult addBill(@RequestBody BillManageDTO billManageDTO)
{
if(billManageDTO.getBillDetailDTOList() == null || billManageDTO.getBillDetailDTOList().size() == 0){
throw new ServiceException("账单明细不能为空");
}
try {
billManageApplicationService.addBill(billManageDTO);
return AjaxResult.success("操作成功");
}catch (Exception e){
return AjaxResult.error("新增账单失败:"+e.getMessage());
}
}
@ApiOperation("复制账单")
@PostMapping("/copyBill")
public AjaxResult copyBill(@RequestBody BillManageDTO billManageDTO)
+2 -2
View File
@@ -19,14 +19,14 @@ spring:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
# server-addr: 10.33.0.129:6010
server-addr: 10.102.192.30:6848
server-addr: 10.102.192.31: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.30:6848
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
+4 -4
View File
@@ -18,15 +18,15 @@ spring:
discovery:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
server-addr: 10.33.0.129:6010
# server-addr: 10.102.192.30:6848
# server-addr: 10.33.0.129:6010
server-addr: 10.102.192.30: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.30:6848
# server-addr: 10.33.0.129:6010
server-addr: 10.102.192.30:6848
username: nacos
password: manhuoda@2023
#线上正式环境
@@ -290,6 +290,17 @@ public class ShiftManageApplicationService {
return shiftManageDomainService.taskDistribution(shiftManageDO);
}
/**
* @description 撤回审核
* @author gen
* @date 2026/7/17
* @param shiftManageDO
* @return Boolean
*/
public Boolean revokeAudit(ShiftManageDO shiftManageDO) {
return shiftManageDomainService.revokeAudit(shiftManageDO);
}
/**
* 物料移位PDA与收货上架一致支持 getInfoByApp parent_copy 结构及分批移位
* 按单移位PDA 仅传 shiftManageIdupdateTime 自动从库中带出该单下所有待移位明细默认 shiftQuantity=quantity
@@ -3,6 +3,7 @@ package com.mhd.wms.domain.shiftManage.service;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.exception.ServiceException;
@@ -14,6 +15,7 @@ import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.domain.deliveTask.entity.DeliveTask;
import com.mhd.wms.domain.deliveTask.repository.facade.IDeliveTaskService;
import com.mhd.wms.domain.deliveTask.repository.todo.DeliveTaskDO;
import com.mhd.wms.domain.inventoryStandingDetail.repository.facade.IInventoryStandingDetailService;
@@ -484,6 +486,43 @@ public class ShiftManageDomainService {
return shiftManageService.taskDistribution(shiftManageDO);
}
/**
* @description 撤回移位待移位 已创建
* @author gen
* @date 2026/7/17
* @param shiftManageDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
public Boolean revokeAudit(ShiftManageDO shiftManageDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long shiftManageId = shiftManageDO.getShiftManageId();
if (shiftManageId == null) {
throw new ServiceException("移位单id不能为空");
}
ShiftManage shiftManage = shiftManageService.getById(shiftManageId);
if (shiftManage == null) {
throw new ServiceException("移位单不存在");
}
if (!Integer.valueOf(2).equals(shiftManage.getShiftStatus())) {
throw new ServiceException("移位单【" + shiftManage.getShiftNumber() + "】状态不为待移位,不可撤回");
}
// 删除生成的配送任务taskType=5trackingNumber=shiftNumber
deliveTaskService.remove(new QueryWrapper<DeliveTask>().lambda()
.eq(DeliveTask::getTrackingNumber, shiftManage.getShiftNumber())
.eq(DeliveTask::getTaskType, 5));
// 回退shiftStatus=1已创建taskDistribution=2未下发auditStatus=1未审核
shiftManageService.update(null, new UpdateWrapper<ShiftManage>().lambda()
.set(ShiftManage::getShiftStatus, 1)
.set(ShiftManage::getTaskDistribution, 2)
.set(ShiftManage::getAuditStatus, 1)
.set(ShiftManage::getUpdateBy, loginUser.getUserid())
.set(ShiftManage::getUpdateByName, loginUser.getUsername())
.set(ShiftManage::getUpdateTime, new Date())
.eq(ShiftManage::getShiftManageId, shiftManageId));
return true;
}
/**
* 物料移位
*/
@@ -120,4 +120,14 @@ public class ShiftManageApi extends BaseController {
return AjaxResult.success(shiftManageApplicationService.taskDistribution(shiftManageDO));
}
/**
* 撤回审核
*/
@ApiOperation("撤回审核")
@PostMapping(value = "/revokeAudit")
public AjaxResult revokeAudit(@RequestBody ShiftManageDTO shiftManageDTO) {
ShiftManageDO shiftManageDO = shiftManageAssembler.toDO(shiftManageDTO);
return AjaxResult.success(shiftManageApplicationService.revokeAudit(shiftManageDO));
}
}
+4 -4
View File
@@ -14,18 +14,18 @@ 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.31:6848
server-addr: 10.102.192.31: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.31:6848
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
#线上正式环境
@@ -154,6 +154,9 @@
<if test="shipperName != null and shipperName != ''">
and a.shipper_name like concat('%', #{shipperName}, '%')
</if>
<if test="shipperId != null and shipperId != ''">
and a.shipper_id like concat('%', #{shipperId}, '%')
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time, '%Y-%m-%d') &gt;= #{createTimeStart}
</if>