生成账单费用合并;
This commit is contained in:
+5
@@ -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);
|
||||
}
|
||||
+26
-4
@@ -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");
|
||||
item.setPk_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);
|
||||
item.setScomment("业务部:应收"+appointShipper+invoiceItemName+invoiceNumber);
|
||||
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");
|
||||
item.setPk_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");
|
||||
item.setScomment("业务部:"+appointShipper+"物流费");
|
||||
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;
|
||||
|
||||
+1
@@ -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;
|
||||
}
|
||||
+2
@@ -215,5 +215,7 @@ public class BillingStatementPO extends BaseVOEntity{
|
||||
@ApiModelProperty(value = "费用类别")
|
||||
private String feeType;
|
||||
private String billingStatementIdStr;
|
||||
@ApiModelProperty("账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
}
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -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);
|
||||
|
||||
+2
@@ -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);
|
||||
|
||||
+25
-1
@@ -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) {
|
||||
|
||||
+2
@@ -73,6 +73,8 @@ public class BmsInvoiceListAddDTO implements Serializable {
|
||||
@ApiModelProperty("结算币种")
|
||||
private String settlementCurrency;
|
||||
|
||||
private String settlementEntity;
|
||||
|
||||
private List<BmsMakeOutInvoice> bmsMakeOutInvoices;
|
||||
|
||||
}
|
||||
+6
@@ -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;
|
||||
|
||||
+8
-1
@@ -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;
|
||||
|
||||
}
|
||||
+8
-1
@@ -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;
|
||||
}
|
||||
+8
-1
@@ -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;
|
||||
}
|
||||
+8
-1
@@ -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;
|
||||
@@ -139,4 +146,4 @@ public class ReceiptDetailPO extends BaseVOEntity{
|
||||
@ApiModelProperty("收款来源(1-人工付款,2-线上支付)")
|
||||
private Integer collectionSource;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user