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

This commit is contained in:
zhou-hongcheng
2026-03-17 09:17:03 +08:00
32 changed files with 339 additions and 52 deletions
@@ -222,4 +222,11 @@ public class BusinessDocumentDTO extends BaseVOEntity{
@ApiModelProperty(value = "合单主单单号(单据类型为2 不能为空)")
private String mainOrderNumber;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
}
@@ -33,4 +33,9 @@ public interface BillManageMapper extends BaseMapper<BillManage>
String getNcUrl(@Param("interfaceType") String interfaceType,@Param("organizationName") String organizationName,@Param("organizationId") Long organizationId);
String getCustomerUserDept(@Param("userId") String userId);
String getDeptValue(@Param("dictCode") String dictCode);
String getDeptName(@Param("dictCode") String dictCode);
}
@@ -201,6 +201,9 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
throw new ServiceException("未找到该组织的推送地址!");
}
String salesmanId = reconciliation.getSalesmanId();
String customerUserDept = billManageMapper.getCustomerUserDept(salesmanId);
String deptValue = billManageMapper.getDeptValue(customerUserDept);
String deptName = billManageMapper.getDeptName(customerUserDept);
String salespersonNcCode = billManageMapper.getsalespersonNcCode(salesmanId);
String salesmanCodeNc=salespersonNcCode;
String appointShipper=make.getActualInvoiceCustomerName();
@@ -218,7 +221,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
if(item1.getInvoiceValue().compareTo(BigDecimal.ZERO)>0){
Ysitem item=new Ysitem();
item.setSo_deptid("NG0408");
if (deptValue != null && !deptValue.isEmpty()) {
item.setPk_deptid(deptValue);
} else {
item.setPk_deptid("NG0408");
}
//业务员nc
item.setPk_psndoc(salesmanCodeNc);
//客户nc
@@ -236,7 +243,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
}
String invoiceItemName = String.join(",", names);
//item.setDef29(invoiceItemName);
if (deptName != null && !deptName.isEmpty()) {
item.setScomment(deptName+":应收"+appointShipper+invoiceItemName+invoiceNumber);
} else {
item.setScomment("业务部:应收"+appointShipper+invoiceItemName+invoiceNumber);
}
// item.setPk_currtype("CNY");
item.setPk_currtype(settlementCurrencyNcCode);
item.setPurchaseorder("");
@@ -454,6 +465,9 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
.filter(java.util.Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add);
String salesmanId = reconciliation.getSalesmanId();
String customerUserDept = billManageMapper.getCustomerUserDept(salesmanId);
String deptValue = billManageMapper.getDeptValue(customerUserDept);
String deptName = billManageMapper.getDeptName(customerUserDept);
String salespersonNcCode = billManageMapper.getsalespersonNcCode(salesmanId);
String salesmanCodeNc=salespersonNcCode;
String appointShipper=make.getActualInvoiceCustomerName();
@@ -465,14 +479,22 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
makerCodeNc=documentPreparerNcCode;
SKitem item=new SKitem();
item.setSo_deptid("NG0408");
if (deptValue != null && !deptValue.isEmpty()) {
item.setPk_deptid(deptValue);
} else {
item.setPk_deptid("NG0408");
}
item.setCheckdirection("ar");
item.setPk_psndoc(salesmanCodeNc);
item.setCustomer(customerCodeNc);
item.setPurchaseorder("");
item.setObjtype("0");
item.setDirection("1");
if (deptName != null && !deptName.isEmpty()) {
item.setScomment(deptName+""+appointShipper+"物流费");
} else {
item.setScomment("业务部:"+appointShipper+"物流费");
}
item.setPk_currtype(settlementCurrencyNcCode);
item.setMoney_cr(String.valueOf(totalInvoiceValue));
item.setMoney_bal(String.valueOf(totalInvoiceValue));
@@ -14,6 +14,8 @@ import java.util.List;
import com.mhd.common.core.web.domain.BaseVOEntity;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
/**
* 账单管理对象 bill_manage
@@ -78,6 +80,10 @@ public class BillManagePO extends BaseVOEntity{
@Excel(name = "结算对象")
private String settlementEntity;
@ApiModelProperty("结算主体id")
@NotNull(message = "结算主体不能为空")
private Long settlementEntityId;
@ApiModelProperty("账单总金额")
@Excel(name = "账单总金额")
private BigDecimal billTotalAmount;
@@ -178,6 +178,7 @@ public class BillManageDomainService {
billManage.setBillAmount(billManage.getBillTotalAmount());
billManage.setBillAmountUnsettled(billManage.getBillTotalAmount());
boolean flag = billManageService.save(billManage);
billingStatementDTO.setBillManageId(billManage.getBillManageId());
List<BillDetail> billDetailList = new ArrayList<>();
for (BillingStatementPO billingStatementPO : billingStatementPOS) {
//生成对账单详情
@@ -203,4 +203,6 @@ public class BillingStatement extends BaseVOEntity{
@ApiModelProperty("业务员ID")
private String salesmanName;
@ApiModelProperty("账单管理id")
private Long billManageId;
}
@@ -215,5 +215,7 @@ public class BillingStatementPO extends BaseVOEntity{
@ApiModelProperty(value = "费用类别")
private String feeType;
private String billingStatementIdStr;
@ApiModelProperty("账单管理id")
private Long billManageId;
}
@@ -264,7 +264,7 @@ public class BillingStatementDomainService {
updateWrapper.set(BillingStatement::getUpdateBy,loginUser.getUserPo().getUserId());
updateWrapper.set(BillingStatement::getUpdateTime,new Date());
updateWrapper.set(BillingStatement::getUpdateByName,loginUser.getUserPo().getUserName());
updateWrapper.set(BillingStatement::getBillManageId,billingStatementDTO.getBillManageId());
return billingStatementService.update(updateWrapper);
}
@@ -32,6 +32,8 @@ public interface IBmsInvoiceListService extends IService<BmsInvoiceList> {
BmsInvoiceListDetailsVO details(String id);
BmsInvoiceListDetailsVO detailsByApplyNumber(String id);
void invoice(BmsInvoiceListInvoiceStateDTO tmsInvoiceListInvoiceStateDTO);
Integer reject(BmsInvoiceListInvoiceStateDTO tmsInvoiceListInvoiceStateDTO);
@@ -34,6 +34,8 @@ public interface BmsInvoiceListMapper extends BaseMapper<BmsInvoiceList> {
/* 根据id 查询 */
public BmsInvoiceListDetailsVO getById(String id);
public BmsInvoiceListDetailsVO getByApplyNumber(@Param("applyNumber") String applyNumber);
/* 根据id 查询 */
@Select("SELECT * FROM bms_invoice_list WHERE id=#{id} and is_delete = 0")
BmsInvoiceList selectById(String id);
@@ -308,6 +308,30 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
return bmsInvoiceListDetailsVO;
}
/**
* 发票详情
*
* @param id
* @return
*/
@Override
public BmsInvoiceListDetailsVO detailsByApplyNumber(String applyNumber) {
BmsInvoiceListDetailsVO bmsInvoiceListDetailsVO = bmsInvoiceListMapper.getByApplyNumber(applyNumber);
if (null == bmsInvoiceListDetailsVO) {
throw new ServiceException("未查询到该发票信息!");
}
List<BmsMakeOutInvoice> bmsMakeOutInvoiceList=bmsMakeOutInvoiceMapper.selectList(new QueryWrapper<BmsMakeOutInvoice>().lambda()
.eq(BmsMakeOutInvoice::getInvoiceId,bmsInvoiceListDetailsVO.getId())
.eq(BmsMakeOutInvoice::getIsDelete,0));
for (BmsMakeOutInvoice bmsMakeOutInvoice : bmsMakeOutInvoiceList) {
Long makeid = bmsMakeOutInvoice.getId();
List<BmsMakeOutInvoiceItem> bmsMakeOutInvoiceItemList = bmsMakeOutInvoiceItemMapper.selectList(new QueryWrapper<BmsMakeOutInvoiceItem>().lambda().eq(BmsMakeOutInvoiceItem::getMakeId, makeid));
bmsMakeOutInvoice.setBmsMakeOutInvoiceItems(bmsMakeOutInvoiceItemList);
}
bmsInvoiceListDetailsVO.setBmsMakeOutInvoices(bmsMakeOutInvoiceList);
return bmsInvoiceListDetailsVO;
}
/**
* 开票
*
@@ -832,7 +856,7 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
bmsInvoiceList.setApplicantId(sysUser.getId());
bmsInvoiceList.setRealCreateBy(sysUser.getId());
bmsInvoiceList.setRealCreateName(sysUser.getRealname());
bmsInvoiceList.setCompanyName(bmsInvoiceListAddDTO.getSettlementEntity());
// 设置组织相关字段从当前登录用户获取组织信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null && loginUser.getUserPo() != null) {
@@ -73,6 +73,8 @@ public class BmsInvoiceListAddDTO implements Serializable {
@ApiModelProperty("结算币种")
private String settlementCurrency;
private String settlementEntity;
private List<BmsMakeOutInvoice> bmsMakeOutInvoices;
}
@@ -185,6 +185,12 @@ public class BmsInvoiceListVO implements Serializable {
@ApiModelProperty(value = "一级组织ID")
private Long topOrganizationId;
@ApiModelProperty(value = "账单管理编号")
private String billNumber;
@ApiModelProperty(value = "账单管理id")
private String billManageId;
public void setTransportationIds(String transportationIds) {
this.transportationIds = transportationIds;
@@ -170,4 +170,11 @@ public class BusinessDocument extends BaseVOEntity{
@ApiModelProperty("结算方式(1-现金,2-油卡)")
private Integer settlementWay;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
}
@@ -174,4 +174,11 @@ public class BusinessDocumentPO extends BaseVOEntity{
@ApiModelProperty("重算失败原因")
private String recalculateCostFailRemark;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
}
@@ -194,4 +194,11 @@ public class BusinessDocumentDO extends BaseVOEntity{
@ApiModelProperty("结算主体id")
private Long settlementEntityId;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
}
@@ -110,6 +110,13 @@ public class ReceiptDetailPO extends BaseVOEntity{
@Excel(name = "收款卡号")
private String paymentCard;
//打印户名
private String mainName;
//打印开户银行
private String bankDeposi;
//打印账号
private String phone;
@ApiModelProperty("交易流水")
@Excel(name = "交易流水")
private String transactionFlow;
@@ -1,5 +1,7 @@
package com.mhd.bms.interfaces.dto.billingStatement;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementADDVO;
import com.mhd.common.core.annotation.Excel;
import lombok.Data;
@@ -200,4 +200,11 @@ public class BusinessDocumentDTO extends BaseVOEntity{
@ApiModelProperty("结算主体id")
private Long settlementEntityId;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
}
@@ -136,6 +136,32 @@ public class BmsInvoiceListApi extends BaseController {
}
return result;
}
/**
* 发票详情
*
* @param id
* @return
*/
@ApiOperation(value = "销项发票表-发票详情", notes = "销项发票表-发票详情")
@GetMapping(value = "/detailsByApplyNumber")
public Result<BmsInvoiceListDetailsVO> detailsByApplyNumber(@RequestParam(name="applyNumber",required=true) String applyNumber) {
Result<BmsInvoiceListDetailsVO> result = new Result<BmsInvoiceListDetailsVO>();
try {
BmsInvoiceListDetailsVO bmsInvoiceListDetailsVO = bmsInvoiceListService.detailsByApplyNumber(applyNumber);
result.setResult(bmsInvoiceListDetailsVO);
result.setSuccess(true);
result.setCode(CommonConstant.SC_OK_200);
} catch (ServiceException e) {
log.error(e.getErrorMessage());
result.error500(e.getErrorMessage());
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
/**
* 编辑
*
@@ -8,70 +8,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryList" parameterType="com.mhd.bms.domain.billManage.repository.todo.BillManageDO" resultType="com.mhd.bms.domain.billManage.repository.po.BillManagePO">
select
*
from bill_manage
where del_flag = 1
a.*,b.SETTLEMENT_ENTITY_ID as settlementEntityId
from bill_manage a LEFT JOIN SETTLEMENT_CUSTOMERS b on a.SETTLEMENT_CUSTOMERS_ID = b.SETTLEMENT_CUSTOMERS_ID
where a.del_flag = 1
<include refid="common_where"/>
ORDER BY create_time DESC
ORDER BY a.create_time DESC
</select>
<sql id="common_where">
<if test="billManageDO.createTimeStart != null and billManageDO.createTimeStart != ''">
AND date_format(create_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.createTimeStart}
AND date_format(a.create_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.createTimeStart}
</if>
<if test="billManageDO.createTimeEnd != null and billManageDO.createTimeEnd != ''">
AND date_format(create_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.createTimeEnd}
AND date_format(a.create_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.createTimeEnd}
</if>
<if test="billManageDO.createByName != null and billManageDO.createByName != ''">
AND create_by_name like concat('%', #{billManageDO.createByName}, '%')
AND a.create_by_name like concat('%', #{billManageDO.createByName}, '%')
</if>
<if test="billManageDO.organizationId != null">
AND organization_id = #{billManageDO.organizationId}
AND a.organization_id = #{billManageDO.organizationId}
</if>
<if test="billManageDO.topOrganizationId != null and billManageDO.topOrganizationId != ''">
AND top_organization_id = #{billManageDO.topOrganizationId}
AND a.top_organization_id = #{billManageDO.topOrganizationId}
</if>
<if test="billManageDO.updateTimeStart != null and billManageDO.updateTimeStart != ''">
AND date_format(update_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.updateTimeStart}
AND date_format(a.update_time,'%Y-%m-%d') <![CDATA[>=]]> #{billManageDO.updateTimeStart}
</if>
<if test="billManageDO.updateTimeEnd != null and billManageDO.updateTimeEnd != ''">
AND date_format(update_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.updateTimeEnd}
AND date_format(a.update_time,'%Y-%m-%d') <![CDATA[<=]]> #{billManageDO.updateTimeEnd}
</if>
<if test="billManageDO.updateByName != null and billManageDO.updateByName != ''">
AND update_by_name like concat('%', #{billManageDO.updateByName}, '%')
AND a.update_by_name like concat('%', #{billManageDO.updateByName}, '%')
</if>
<if test="billManageDO.billNumber != null and billManageDO.billNumber != ''">
AND bill_number like concat('%', #{billManageDO.billNumber}, '%')
AND a.bill_number like concat('%', #{billManageDO.billNumber}, '%')
</if>
<if test="billManageDO.belongModule != null and billManageDO.belongModule != ''">
AND belong_module like concat('%', #{billManageDO.belongModule}, '%')
AND a.belong_module like concat('%', #{billManageDO.belongModule}, '%')
</if>
<if test="billManageDO.settlementEntity != null and billManageDO.settlementEntity != ''">
AND settlement_entity like concat('%', #{billManageDO.settlementEntity}, '%')
AND a.settlement_entity like concat('%', #{billManageDO.settlementEntity}, '%')
</if>
<if test="billManageDO.billState != null">
AND bill_state = #{billManageDO.billState}
AND a.bill_state = #{billManageDO.billState}
</if>
<if test="billManageDO.isInvoice != null">
AND IS_INVOICE = #{billManageDO.isInvoice}
AND a.IS_INVOICE = #{billManageDO.isInvoice}
</if>
<if test="billManageDO.reconciliationStatus != null">
AND reconciliation_status = #{billManageDO.reconciliationStatus}
AND a.reconciliation_status = #{billManageDO.reconciliationStatus}
</if>
<if test="billManageDO.billType != null">
AND bill_type = #{billManageDO.billType}
AND a.bill_type = #{billManageDO.billType}
</if>
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 1">
AND bill_state <![CDATA[<]]> 5
AND a.bill_state <![CDATA[<]]> 5
</if>
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 2">
AND bill_state = 5
AND a.bill_state = 5
</if>
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 3">
AND bill_state = 6
AND a.bill_state = 6
</if>
<if test="billManageDO.billManageIdSet != null and billManageDO.billManageIdSet.size() > 0">
and bill_manage_id in
and a.bill_manage_id in
<foreach item="id" collection="billManageDO.billManageIdSet" open="(" separator="," close=")">
#{id}
</foreach>
@@ -112,4 +112,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and interface_type = #{interfaceType} limit 1
</select>
<select id="getCustomerUserDept" parameterType="java.lang.String" resultType="java.lang.String">
SELECT DEPARTMENT_ID FROM NGWL_TEST_USER."USER" where DEL_FLAG = '1' and user_id = #{userId} limit 1
</select>
<select id="getDeptValue" parameterType="java.lang.String" resultType="java.lang.String">
SELECT dict_value FROM NGWL_TEST_SYSTEM."SYS_DICT_DATA" where status = '0' and dict_type = 'department' and dict_code = #{dictCode} limit 1
</select>
<select id="getDeptName" parameterType="java.lang.String" resultType="java.lang.String">
SELECT dict_label FROM NGWL_TEST_SYSTEM."SYS_DICT_DATA" where status = '0' and dict_type = 'department' and dict_code = #{dictCode} limit 1
</select>
</mapper>
@@ -78,16 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getDetailsByManageId" resultType="com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO" parameterType="java.lang.Long">
SELECT
a.*,
b.billing_amount AS billingAmount,
b.billing_total_amount,
b.billing_discount_amount
a.BILLING_AMOUNT AS billingAmount
FROM
billing_statement a
LEFT JOIN bill_detail b ON a.billing_statement_id = b.billing_statement_id
LEFT JOIN bill_manage c ON b.bill_manage_id = c.bill_manage_id
WHERE
a.del_flag = 1
AND c.bill_manage_id = #{billManageId}
AND a.bill_manage_id = #{billManageId}
GROUP BY
a.billing_statement_id
</select>
@@ -5,7 +5,7 @@
select
<include refid="field_where"></include>
FROM
bms_invoice_list a
bms_invoice_list a left join BILL_MANAGE b on a.apply_number = b.apply_number
where a.is_delete = 0
<include refid="common_where"></include>
@@ -22,6 +22,17 @@
where a.id = #{id} and a.is_delete = 0
group by a.id
</select>
<select id="getByApplyNumber" parameterType="java.lang.String" resultType="com.mhd.bms.domain.bmsInvoiceList.repository.vo.BmsInvoiceListDetailsVO">
select
<include refid="field_where2"></include>
from
bms_invoice_list a
LEFT JOIN bms_invoice_info b
ON a.invoice_title = b.invoice_title
where a.apply_number = #{applyNumber} and a.is_delete = 0
group by a.id
</select>
<sql id="common_where">
<if test="bmsInvoiceListQueryDTO.id !=null and bmsInvoiceListQueryDTO.id != ''"> and a.id = #{bmsInvoiceListQueryDTO.id} </if>
<if test="bmsInvoiceListQueryDTO.id!=null and bmsInvoiceListQueryDTO.id!=''"> and instr(a.id ,#{bmsInvoiceListQueryDTO.id}) > 0 </if>
@@ -124,6 +135,9 @@
a.invoice_code,
a.tracking_number,
a.apply_number,
a.company_name as companyName,
b.bill_number as billNumber,
b.bill_manage_id as billManageId,
a.SETTLEMENT_CURRENCY as settlementCurrency,
a.organization_id AS organizationId,
a.organization_name AS organizationName,
@@ -82,6 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.payment_method_code,
b.payment_method,
b.payment_card_id,
c.main_name as mainName,
c.phone,
c.bank_deposi as bankDeposi,
b.payment_card,
b.transaction_flow,
b.receipt_number,
@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
receipt_detail a
LEFT JOIN receipt_manage b ON a.receipt_manage_id = b.receipt_manage_id
left join PAYMENT_WALLET c on b.payment_card_id = c.PAYMENT_WALLET_ID
WHERE
a.bill_manage_id = #{billManageId}
</select>
@@ -44,4 +44,10 @@ public interface ReconciliationMapper extends BaseMapper<Reconciliation>
String getSettlementCurrencyNcCode(@Param("settlementCurrency") String settlementCurrency);
String getServiceItemsCodeNc(@Param("name") String name);
String getCustomerUserDept(@Param("userId") String userId);
String getDeptValue(@Param("dictCode") String dictCode);
String getDeptName(@Param("dictCode") String dictCode);
}
@@ -693,6 +693,9 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String settlementCurrency=order.getSettlementCurrency();
String salesmanId = order.getSalesmanId();
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
String deptValue = reconciliationMapper.getDeptValue(customerUserDept);
String deptName = reconciliationMapper.getDeptName(customerUserDept);
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
makerCodeNc= documentPreparerNcCode;
String settlementCurrencyNcCode = settlementCurrency;
@@ -704,7 +707,11 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
if(item1.getInvoiceValue().compareTo(BigDecimal.ZERO)>0){
Ysitem item=new Ysitem();
item.setSo_deptid("NG0408");
if (deptValue != null && !deptValue.isEmpty()) {
item.setPk_deptid(deptValue);
} else {
item.setPk_deptid("NG0408");
}
//业务员nc
item.setPk_psndoc(salesmanCodeNc);
//客户nc
@@ -722,7 +729,11 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
}
String invoiceItemName = String.join(",", names);
//item.setDef29(invoiceItemName);
if (deptName != null && !deptName.isEmpty()) {
item.setScomment(deptName+":应收"+appointShipper+invoiceItemName+invoiceNumber);
} else {
item.setScomment("业务部:应收"+appointShipper+invoiceItemName+invoiceNumber);
}
// item.setPk_currtype("CNY");
item.setPk_currtype(settlementCurrencyNcCode);
item.setPurchaseorder("");
@@ -1138,6 +1149,9 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
.reduce(BigDecimal.ZERO, BigDecimal::add);
String salesmanCodeNc=order.getSalesmanCodeNc();
String salesmanId = order.getSalesmanId();
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
String deptValue = reconciliationMapper.getDeptValue(customerUserDept);
String deptName = reconciliationMapper.getDeptName(customerUserDept);
//String customerCodeNc=order.getCustomerCodeNc();
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
@@ -1148,7 +1162,11 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
makerCodeNc=documentPreparerNcCode;
SKitem item=new SKitem();
item.setSo_deptid("NG0408");
if (deptValue != null && !deptValue.isEmpty()) {
item.setPk_deptid(deptValue);
} else {
item.setPk_deptid("NG0408");
}
item.setCheckdirection("ar");
item.setPk_psndoc(salesmanCodeNc);
item.setCustomer(customerCodeNc);
@@ -384,4 +384,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getServiceItemsCodeNc" parameterType="java.lang.String" resultType="java.lang.String">
SELECT SERVICE_ITEMS_CODE_NC FROM NGWL_TEST_SYSTEM."SERVICE_ITEMS_MANAGE" where DEL_FLAG = '0' and SERVICE_ITEMS_NAME = #{name} limit 1
</select>
<select id="getCustomerUserDept" parameterType="java.lang.String" resultType="java.lang.String">
SELECT DEPARTMENT_ID FROM NGWL_TEST_USER."USER" where DEL_FLAG = '1' and user_id = #{userId} limit 1
</select>
<select id="getDeptValue" parameterType="java.lang.String" resultType="java.lang.String">
SELECT dict_value FROM NGWL_TEST_SYSTEM."SYS_DICT_DATA" where status = '0' and dict_type = 'department' and dict_code = #{dictCode} limit 1
</select>
<select id="getDeptName" parameterType="java.lang.String" resultType="java.lang.String">
SELECT dict_label FROM NGWL_TEST_SYSTEM."SYS_DICT_DATA" where status = '0' and dict_type = 'department' and dict_code = #{dictCode} limit 1
</select>
</mapper>
@@ -47,7 +47,8 @@ public class DeliveTaskApplicationService {
if (topOrganizationId != null && topOrganizationId != 1){
deliveTaskDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
}
// operatorsBy 仅由 DeliveTaskImpl 根据 tabType 设置此处不覆盖保证条件查询生效
// 只查询下发给当前登录用户的任务
deliveTaskDO.setOperatorsBy(loginUser.getUserid());
}
return deliveTaskDomainService.queryListApp(deliveTaskDO);
}
@@ -394,7 +394,7 @@ public class HandoverTaskOrderDomainService {
inventoryAdjustmentRecord.setMaterialCode(outMaterialDetail.getMaterialNo());
inventoryAdjustmentRecord.setMaterialName(outMaterialDetail.getCommodityName());
inventoryAdjustmentRecord.setBarCode(outMaterialDetail.getBarCode());
if (inventoryAdjustmentRecord.getBarCode().equals("")){
if (inventoryAdjustmentRecord.getBarCode() == null || inventoryAdjustmentRecord.getBarCode().isEmpty()){
getBarCode(materialInventoryPO, inventoryAdjustmentRecord);
}
inventoryAdjustmentRecord.setMaterialBaseInfoId(outMaterialDetail.getMaterialBaseInfoId());
@@ -738,18 +738,32 @@ public class ShiftManageDomainService {
shiftQuantity = shiftMaterialDetailPOChildrenList.stream()
.map(c -> c.getShiftQuantity() != null ? c.getShiftQuantity() : BigDecimal.ZERO)
.reduce(BigDecimal.ZERO, BigDecimal::add);
shiftMaterialDetailPO.setMaterialMoreDetailList(materialMoreDetailMap.get(shiftMaterialDetailPO.getUniqueId()));
List<MaterialMoreDetailPO> parentMoreDetail = materialMoreDetailMap.get(shiftMaterialDetailPO.getUniqueId());
// 若前端未传批次属性则从原库存补充
if (CollectionUtils.isEmpty(parentMoreDetail)) {
parentMoreDetail = buildMaterialMoreDetailFromInventory(materialInventoryOldDb);
}
shiftMaterialDetailPO.setMaterialMoreDetailList(parentMoreDetail);
for (ShiftMaterialDetailPO shiftMaterialDetailPOChildren : shiftMaterialDetailPOChildrenList) {
List<MaterialMoreDetailPO> childMoreDetail = materialMoreDetailMap.get(shiftMaterialDetailPOChildren.getUniqueId());
if (childMoreDetail == null) {
if (CollectionUtils.isEmpty(childMoreDetail)) {
childMoreDetail = materialMoreDetailMap.get(shiftMaterialDetailPO.getUniqueId());
}
// 若仍为空则从原库存补充
if (CollectionUtils.isEmpty(childMoreDetail)) {
childMoreDetail = buildMaterialMoreDetailFromInventory(materialInventoryOldDb);
}
shiftMaterialDetailPOChildren.setMaterialMoreDetailList(childMoreDetail);
materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPOChildren));
}
} else {
shiftQuantity = shiftMaterialDetailPO.getShiftQuantity() != null ? shiftMaterialDetailPO.getShiftQuantity() : BigDecimal.ZERO;
shiftMaterialDetailPO.setMaterialMoreDetailList(materialMoreDetailMap.get(shiftMaterialDetailPO.getUniqueId()));
List<MaterialMoreDetailPO> moreDetail = materialMoreDetailMap.get(shiftMaterialDetailPO.getUniqueId());
// 若前端未传批次属性则从原库存补充
if (CollectionUtils.isEmpty(moreDetail)) {
moreDetail = buildMaterialMoreDetailFromInventory(materialInventoryOldDb);
}
shiftMaterialDetailPO.setMaterialMoreDetailList(moreDetail);
materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPO));
}
if (materialInventoryOldDb.getInventoryQuantity().compareTo(shiftQuantity) < 0){
@@ -881,10 +895,69 @@ public class ShiftManageDomainService {
BeanUtils.copyProperties(materialInventoryDb, materialInventoryDONow);
materialInventoryDONow.setInventoryQuantity(shiftMaterialDetailPO.getShiftQuantity());
materialInventoryDONow.setAllocationQuantity(shiftMaterialDetailPO.getShiftQuantity());
// 目标库位已存在时 materialMoreDetailList 覆盖批次属性保证批次属性随移位写入
BatchAttributeAssignment(materialMoreDetailList, materialInventoryDONow);
return materialInventoryDONow;
}
}
/**
* 从库存对象构建 MaterialMoreDetailList供前端未传批次属性时兜底使用
*/
private List<MaterialMoreDetailPO> buildMaterialMoreDetailFromInventory(MaterialInventory inv) {
List<MaterialMoreDetailPO> list = new ArrayList<>();
if (inv == null) return list;
if (inv.getProductionDate() != null) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("生产日期");
m.setAttributeValue(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inv.getProductionDate()));
list.add(m);
}
if (inv.getExpiryDate() != null) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("过期日期");
m.setAttributeValue(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inv.getExpiryDate()));
list.add(m);
}
if (inv.getInventoryDate() != null) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("存货日期");
m.setAttributeValue(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inv.getInventoryDate()));
list.add(m);
}
if (inv.getBatchRefNo() != null && !inv.getBatchRefNo().isEmpty()) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("Batch Ref NO's");
m.setAttributeValue(inv.getBatchRefNo());
list.add(m);
}
if (inv.getSheetRefNo() != null && !inv.getSheetRefNo().isEmpty()) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("Sheet Ref NO's");
m.setAttributeValue(inv.getSheetRefNo());
list.add(m);
}
if (inv.getBoxPalletNo() != null && !inv.getBoxPalletNo().isEmpty()) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("箱号/卡板号");
m.setAttributeValue(inv.getBoxPalletNo());
list.add(m);
}
if (inv.getExtAttr1() != null && !inv.getExtAttr1().isEmpty()) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("扩展属性1");
m.setAttributeValue(inv.getExtAttr1());
list.add(m);
}
if (inv.getExtAttr2() != null && !inv.getExtAttr2().isEmpty()) {
MaterialMoreDetailPO m = new MaterialMoreDetailPO();
m.setBatchLabels("扩展属性2");
m.setAttributeValue(inv.getExtAttr2());
list.add(m);
}
return list;
}
private void BatchAttributeAssignment(List<MaterialMoreDetailPO> materialMoreDetailList, MaterialInventoryDO materialInventoryDONow) {
if (CollectionUtils.isEmpty(materialMoreDetailList)) {
return;
@@ -119,6 +119,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tabType != null and tabType==2">
and operators_by IS NULL
</if>
<if test="tabType == null and operatorsBy != null">
and operators_by = #{operatorsBy}
</if>
<if test="operatorsName != null and operatorsName != ''">
and operators_name like concat('%', #{operatorsName}, '%')
@@ -124,6 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="pickingOrderNumber != null and pickingOrderNumber != ''">
and a.picking_order_number = #{pickingOrderNumber}
</if>
<if test="operatorsBy != null">
and a.operators_by = #{operatorsBy}
</if>
<if test="createByName != null and createByName != ''">
and a.create_by_name like concat('%', #{createByName}, '%')
</if>