Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
+8
-1
@@ -222,4 +222,11 @@ public class BusinessDocumentDTO extends BaseVOEntity{
|
|||||||
|
|
||||||
@ApiModelProperty(value = "合单主单单号(单据类型为2 不能为空)")
|
@ApiModelProperty(value = "合单主单单号(单据类型为2 不能为空)")
|
||||||
private String mainOrderNumber;
|
private String mainOrderNumber;
|
||||||
}
|
|
||||||
|
@ApiModelProperty("结算币种")
|
||||||
|
private String settlementCurrency;
|
||||||
|
@ApiModelProperty("业务员ID")
|
||||||
|
private String salesmanId;
|
||||||
|
@ApiModelProperty("业务员名称")
|
||||||
|
private String salesmanName;
|
||||||
|
}
|
||||||
+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 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("未找到该组织的推送地址!");
|
throw new ServiceException("未找到该组织的推送地址!");
|
||||||
}
|
}
|
||||||
String salesmanId = reconciliation.getSalesmanId();
|
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 salespersonNcCode = billManageMapper.getsalespersonNcCode(salesmanId);
|
||||||
String salesmanCodeNc=salespersonNcCode;
|
String salesmanCodeNc=salespersonNcCode;
|
||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
@@ -218,7 +221,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
if(item1.getInvoiceValue().compareTo(BigDecimal.ZERO)>0){
|
if(item1.getInvoiceValue().compareTo(BigDecimal.ZERO)>0){
|
||||||
Ysitem item=new Ysitem();
|
Ysitem item=new Ysitem();
|
||||||
item.setSo_deptid("NG0408");
|
item.setSo_deptid("NG0408");
|
||||||
item.setPk_deptid("NG0408");
|
if (deptValue != null && !deptValue.isEmpty()) {
|
||||||
|
item.setPk_deptid(deptValue);
|
||||||
|
} else {
|
||||||
|
item.setPk_deptid("NG0408");
|
||||||
|
}
|
||||||
//业务员nc
|
//业务员nc
|
||||||
item.setPk_psndoc(salesmanCodeNc);
|
item.setPk_psndoc(salesmanCodeNc);
|
||||||
//客户nc
|
//客户nc
|
||||||
@@ -236,7 +243,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
}
|
}
|
||||||
String invoiceItemName = String.join(",", names);
|
String invoiceItemName = String.join(",", names);
|
||||||
//item.setDef29(invoiceItemName);
|
//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("CNY");
|
||||||
item.setPk_currtype(settlementCurrencyNcCode);
|
item.setPk_currtype(settlementCurrencyNcCode);
|
||||||
item.setPurchaseorder("");
|
item.setPurchaseorder("");
|
||||||
@@ -454,6 +465,9 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
.filter(java.util.Objects::nonNull)
|
.filter(java.util.Objects::nonNull)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
String salesmanId = reconciliation.getSalesmanId();
|
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 salespersonNcCode = billManageMapper.getsalespersonNcCode(salesmanId);
|
||||||
String salesmanCodeNc=salespersonNcCode;
|
String salesmanCodeNc=salespersonNcCode;
|
||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
@@ -465,14 +479,22 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
|||||||
makerCodeNc=documentPreparerNcCode;
|
makerCodeNc=documentPreparerNcCode;
|
||||||
SKitem item=new SKitem();
|
SKitem item=new SKitem();
|
||||||
item.setSo_deptid("NG0408");
|
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.setCheckdirection("ar");
|
||||||
item.setPk_psndoc(salesmanCodeNc);
|
item.setPk_psndoc(salesmanCodeNc);
|
||||||
item.setCustomer(customerCodeNc);
|
item.setCustomer(customerCodeNc);
|
||||||
item.setPurchaseorder("");
|
item.setPurchaseorder("");
|
||||||
item.setObjtype("0");
|
item.setObjtype("0");
|
||||||
item.setDirection("1");
|
item.setDirection("1");
|
||||||
item.setScomment("业务部:"+appointShipper+"物流费");
|
if (deptName != null && !deptName.isEmpty()) {
|
||||||
|
item.setScomment(deptName+":"+appointShipper+"物流费");
|
||||||
|
} else {
|
||||||
|
item.setScomment("业务部:"+appointShipper+"物流费");
|
||||||
|
}
|
||||||
item.setPk_currtype(settlementCurrencyNcCode);
|
item.setPk_currtype(settlementCurrencyNcCode);
|
||||||
item.setMoney_cr(String.valueOf(totalInvoiceValue));
|
item.setMoney_cr(String.valueOf(totalInvoiceValue));
|
||||||
item.setMoney_bal(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 com.mhd.common.core.web.domain.BaseVOEntity;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账单管理对象 bill_manage
|
* 账单管理对象 bill_manage
|
||||||
@@ -78,6 +80,10 @@ public class BillManagePO extends BaseVOEntity{
|
|||||||
@Excel(name = "结算对象")
|
@Excel(name = "结算对象")
|
||||||
private String settlementEntity;
|
private String settlementEntity;
|
||||||
|
|
||||||
|
@ApiModelProperty("结算主体id")
|
||||||
|
@NotNull(message = "结算主体不能为空")
|
||||||
|
private Long settlementEntityId;
|
||||||
|
|
||||||
@ApiModelProperty("账单总金额")
|
@ApiModelProperty("账单总金额")
|
||||||
@Excel(name = "账单总金额")
|
@Excel(name = "账单总金额")
|
||||||
private BigDecimal billTotalAmount;
|
private BigDecimal billTotalAmount;
|
||||||
|
|||||||
+1
@@ -178,6 +178,7 @@ public class BillManageDomainService {
|
|||||||
billManage.setBillAmount(billManage.getBillTotalAmount());
|
billManage.setBillAmount(billManage.getBillTotalAmount());
|
||||||
billManage.setBillAmountUnsettled(billManage.getBillTotalAmount());
|
billManage.setBillAmountUnsettled(billManage.getBillTotalAmount());
|
||||||
boolean flag = billManageService.save(billManage);
|
boolean flag = billManageService.save(billManage);
|
||||||
|
billingStatementDTO.setBillManageId(billManage.getBillManageId());
|
||||||
List<BillDetail> billDetailList = new ArrayList<>();
|
List<BillDetail> billDetailList = new ArrayList<>();
|
||||||
for (BillingStatementPO billingStatementPO : billingStatementPOS) {
|
for (BillingStatementPO billingStatementPO : billingStatementPOS) {
|
||||||
//生成对账单详情
|
//生成对账单详情
|
||||||
|
|||||||
@@ -203,4 +203,6 @@ public class BillingStatement extends BaseVOEntity{
|
|||||||
|
|
||||||
@ApiModelProperty("业务员ID")
|
@ApiModelProperty("业务员ID")
|
||||||
private String salesmanName;
|
private String salesmanName;
|
||||||
|
@ApiModelProperty("账单管理id")
|
||||||
|
private Long billManageId;
|
||||||
}
|
}
|
||||||
+2
@@ -215,5 +215,7 @@ public class BillingStatementPO extends BaseVOEntity{
|
|||||||
@ApiModelProperty(value = "费用类别")
|
@ApiModelProperty(value = "费用类别")
|
||||||
private String feeType;
|
private String feeType;
|
||||||
private String billingStatementIdStr;
|
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::getUpdateBy,loginUser.getUserPo().getUserId());
|
||||||
updateWrapper.set(BillingStatement::getUpdateTime,new Date());
|
updateWrapper.set(BillingStatement::getUpdateTime,new Date());
|
||||||
updateWrapper.set(BillingStatement::getUpdateByName,loginUser.getUserPo().getUserName());
|
updateWrapper.set(BillingStatement::getUpdateByName,loginUser.getUserPo().getUserName());
|
||||||
|
updateWrapper.set(BillingStatement::getBillManageId,billingStatementDTO.getBillManageId());
|
||||||
return billingStatementService.update(updateWrapper);
|
return billingStatementService.update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
@@ -32,6 +32,8 @@ public interface IBmsInvoiceListService extends IService<BmsInvoiceList> {
|
|||||||
|
|
||||||
BmsInvoiceListDetailsVO details(String id);
|
BmsInvoiceListDetailsVO details(String id);
|
||||||
|
|
||||||
|
BmsInvoiceListDetailsVO detailsByApplyNumber(String id);
|
||||||
|
|
||||||
void invoice(BmsInvoiceListInvoiceStateDTO tmsInvoiceListInvoiceStateDTO);
|
void invoice(BmsInvoiceListInvoiceStateDTO tmsInvoiceListInvoiceStateDTO);
|
||||||
|
|
||||||
Integer reject(BmsInvoiceListInvoiceStateDTO tmsInvoiceListInvoiceStateDTO);
|
Integer reject(BmsInvoiceListInvoiceStateDTO tmsInvoiceListInvoiceStateDTO);
|
||||||
|
|||||||
+2
@@ -34,6 +34,8 @@ public interface BmsInvoiceListMapper extends BaseMapper<BmsInvoiceList> {
|
|||||||
/* 根据id 查询 */
|
/* 根据id 查询 */
|
||||||
public BmsInvoiceListDetailsVO getById(String id);
|
public BmsInvoiceListDetailsVO getById(String id);
|
||||||
|
|
||||||
|
public BmsInvoiceListDetailsVO getByApplyNumber(@Param("applyNumber") String applyNumber);
|
||||||
|
|
||||||
/* 根据id 查询 */
|
/* 根据id 查询 */
|
||||||
@Select("SELECT * FROM bms_invoice_list WHERE id=#{id} and is_delete = 0")
|
@Select("SELECT * FROM bms_invoice_list WHERE id=#{id} and is_delete = 0")
|
||||||
BmsInvoiceList selectById(String id);
|
BmsInvoiceList selectById(String id);
|
||||||
|
|||||||
+25
-1
@@ -308,6 +308,30 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
|
|||||||
return bmsInvoiceListDetailsVO;
|
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.setApplicantId(sysUser.getId());
|
||||||
bmsInvoiceList.setRealCreateBy(sysUser.getId());
|
bmsInvoiceList.setRealCreateBy(sysUser.getId());
|
||||||
bmsInvoiceList.setRealCreateName(sysUser.getRealname());
|
bmsInvoiceList.setRealCreateName(sysUser.getRealname());
|
||||||
|
bmsInvoiceList.setCompanyName(bmsInvoiceListAddDTO.getSettlementEntity());
|
||||||
// 设置组织相关字段:从当前登录用户获取组织信息
|
// 设置组织相关字段:从当前登录用户获取组织信息
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||||
|
|||||||
+2
@@ -73,6 +73,8 @@ public class BmsInvoiceListAddDTO implements Serializable {
|
|||||||
@ApiModelProperty("结算币种")
|
@ApiModelProperty("结算币种")
|
||||||
private String settlementCurrency;
|
private String settlementCurrency;
|
||||||
|
|
||||||
|
private String settlementEntity;
|
||||||
|
|
||||||
private List<BmsMakeOutInvoice> bmsMakeOutInvoices;
|
private List<BmsMakeOutInvoice> bmsMakeOutInvoices;
|
||||||
|
|
||||||
}
|
}
|
||||||
+6
@@ -185,6 +185,12 @@ public class BmsInvoiceListVO implements Serializable {
|
|||||||
@ApiModelProperty(value = "一级组织ID")
|
@ApiModelProperty(value = "一级组织ID")
|
||||||
private Long topOrganizationId;
|
private Long topOrganizationId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "账单管理编号")
|
||||||
|
private String billNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "账单管理id")
|
||||||
|
private String billManageId;
|
||||||
|
|
||||||
|
|
||||||
public void setTransportationIds(String transportationIds) {
|
public void setTransportationIds(String transportationIds) {
|
||||||
this.transportationIds = transportationIds;
|
this.transportationIds = transportationIds;
|
||||||
|
|||||||
+8
-1
@@ -170,4 +170,11 @@ public class BusinessDocument extends BaseVOEntity{
|
|||||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||||
private Integer settlementWay;
|
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("重算失败原因")
|
@ApiModelProperty("重算失败原因")
|
||||||
private String recalculateCostFailRemark;
|
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")
|
@ApiModelProperty("结算主体id")
|
||||||
private Long settlementEntityId;
|
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 = "收款卡号")
|
@Excel(name = "收款卡号")
|
||||||
private String paymentCard;
|
private String paymentCard;
|
||||||
|
|
||||||
|
//打印户名
|
||||||
|
private String mainName;
|
||||||
|
//打印开户银行
|
||||||
|
private String bankDeposi;
|
||||||
|
//打印账号
|
||||||
|
private String phone;
|
||||||
|
|
||||||
@ApiModelProperty("交易流水")
|
@ApiModelProperty("交易流水")
|
||||||
@Excel(name = "交易流水")
|
@Excel(name = "交易流水")
|
||||||
private String transactionFlow;
|
private String transactionFlow;
|
||||||
@@ -139,4 +146,4 @@ public class ReceiptDetailPO extends BaseVOEntity{
|
|||||||
@ApiModelProperty("收款来源(1-人工付款,2-线上支付)")
|
@ApiModelProperty("收款来源(1-人工付款,2-线上支付)")
|
||||||
private Integer collectionSource;
|
private Integer collectionSource;
|
||||||
|
|
||||||
}
|
}
|
||||||
+2
@@ -1,5 +1,7 @@
|
|||||||
package com.mhd.bms.interfaces.dto.billingStatement;
|
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.bms.domain.billingStatement.repository.po.BillingStatementADDVO;
|
||||||
import com.mhd.common.core.annotation.Excel;
|
import com.mhd.common.core.annotation.Excel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
+8
-1
@@ -200,4 +200,11 @@ public class BusinessDocumentDTO extends BaseVOEntity{
|
|||||||
|
|
||||||
@ApiModelProperty("结算主体id")
|
@ApiModelProperty("结算主体id")
|
||||||
private Long settlementEntityId;
|
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;
|
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 id="queryList" parameterType="com.mhd.bms.domain.billManage.repository.todo.BillManageDO" resultType="com.mhd.bms.domain.billManage.repository.po.BillManagePO">
|
||||||
select
|
select
|
||||||
*
|
a.*,b.SETTLEMENT_ENTITY_ID as settlementEntityId
|
||||||
from bill_manage
|
from bill_manage a LEFT JOIN SETTLEMENT_CUSTOMERS b on a.SETTLEMENT_CUSTOMERS_ID = b.SETTLEMENT_CUSTOMERS_ID
|
||||||
where del_flag = 1
|
where a.del_flag = 1
|
||||||
<include refid="common_where"/>
|
<include refid="common_where"/>
|
||||||
ORDER BY create_time DESC
|
ORDER BY a.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="common_where">
|
<sql id="common_where">
|
||||||
<if test="billManageDO.createTimeStart != null and billManageDO.createTimeStart != ''">
|
<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>
|
||||||
<if test="billManageDO.createTimeEnd != null and billManageDO.createTimeEnd != ''">
|
<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>
|
||||||
<if test="billManageDO.createByName != null and billManageDO.createByName != ''">
|
<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>
|
||||||
<if test="billManageDO.organizationId != null">
|
<if test="billManageDO.organizationId != null">
|
||||||
AND organization_id = #{billManageDO.organizationId}
|
AND a.organization_id = #{billManageDO.organizationId}
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.topOrganizationId != null and billManageDO.topOrganizationId != ''">
|
<if test="billManageDO.topOrganizationId != null and billManageDO.topOrganizationId != ''">
|
||||||
AND top_organization_id = #{billManageDO.topOrganizationId}
|
AND a.top_organization_id = #{billManageDO.topOrganizationId}
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.updateTimeStart != null and billManageDO.updateTimeStart != ''">
|
<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>
|
||||||
<if test="billManageDO.updateTimeEnd != null and billManageDO.updateTimeEnd != ''">
|
<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>
|
||||||
<if test="billManageDO.updateByName != null and billManageDO.updateByName != ''">
|
<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>
|
||||||
<if test="billManageDO.billNumber != null and billManageDO.billNumber != ''">
|
<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>
|
||||||
<if test="billManageDO.belongModule != null and billManageDO.belongModule != ''">
|
<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>
|
||||||
<if test="billManageDO.settlementEntity != null and billManageDO.settlementEntity != ''">
|
<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>
|
||||||
<if test="billManageDO.billState != null">
|
<if test="billManageDO.billState != null">
|
||||||
AND bill_state = #{billManageDO.billState}
|
AND a.bill_state = #{billManageDO.billState}
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.isInvoice != null">
|
<if test="billManageDO.isInvoice != null">
|
||||||
AND IS_INVOICE = #{billManageDO.isInvoice}
|
AND a.IS_INVOICE = #{billManageDO.isInvoice}
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.reconciliationStatus != null">
|
<if test="billManageDO.reconciliationStatus != null">
|
||||||
AND reconciliation_status = #{billManageDO.reconciliationStatus}
|
AND a.reconciliation_status = #{billManageDO.reconciliationStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.billType != null">
|
<if test="billManageDO.billType != null">
|
||||||
AND bill_type = #{billManageDO.billType}
|
AND a.bill_type = #{billManageDO.billType}
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 1">
|
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 1">
|
||||||
AND bill_state <![CDATA[<]]> 5
|
AND a.bill_state <![CDATA[<]]> 5
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 2">
|
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 2">
|
||||||
AND bill_state = 5
|
AND a.bill_state = 5
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 3">
|
<if test="billManageDO.queryParam != null and billManageDO.queryParam == 3">
|
||||||
AND bill_state = 6
|
AND a.bill_state = 6
|
||||||
</if>
|
</if>
|
||||||
<if test="billManageDO.billManageIdSet != null and billManageDO.billManageIdSet.size() > 0">
|
<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=")">
|
<foreach item="id" collection="billManageDO.billManageIdSet" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
@@ -112,4 +112,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and interface_type = #{interfaceType} limit 1
|
and interface_type = #{interfaceType} limit 1
|
||||||
</select>
|
</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>
|
</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 id="getDetailsByManageId" resultType="com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO" parameterType="java.lang.Long">
|
||||||
SELECT
|
SELECT
|
||||||
a.*,
|
a.*,
|
||||||
b.billing_amount AS billingAmount,
|
a.BILLING_AMOUNT AS billingAmount
|
||||||
b.billing_total_amount,
|
|
||||||
b.billing_discount_amount
|
|
||||||
FROM
|
FROM
|
||||||
billing_statement a
|
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
|
WHERE
|
||||||
a.del_flag = 1
|
a.del_flag = 1
|
||||||
AND c.bill_manage_id = #{billManageId}
|
AND a.bill_manage_id = #{billManageId}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
a.billing_statement_id
|
a.billing_statement_id
|
||||||
</select>
|
</select>
|
||||||
@@ -263,4 +259,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
select
|
select
|
||||||
<include refid="field_where"></include>
|
<include refid="field_where"></include>
|
||||||
FROM
|
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
|
where a.is_delete = 0
|
||||||
<include refid="common_where"></include>
|
<include refid="common_where"></include>
|
||||||
@@ -22,6 +22,17 @@
|
|||||||
where a.id = #{id} and a.is_delete = 0
|
where a.id = #{id} and a.is_delete = 0
|
||||||
group by a.id
|
group by a.id
|
||||||
</select>
|
</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">
|
<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 a.id = #{bmsInvoiceListQueryDTO.id} </if>
|
||||||
<if test="bmsInvoiceListQueryDTO.id!=null and bmsInvoiceListQueryDTO.id!=''"> and instr(a.id ,#{bmsInvoiceListQueryDTO.id}) > 0 </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.invoice_code,
|
||||||
a.tracking_number,
|
a.tracking_number,
|
||||||
a.apply_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.SETTLEMENT_CURRENCY as settlementCurrency,
|
||||||
a.organization_id AS organizationId,
|
a.organization_id AS organizationId,
|
||||||
a.organization_name AS organizationName,
|
a.organization_name AS organizationName,
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
b.payment_method_code,
|
b.payment_method_code,
|
||||||
b.payment_method,
|
b.payment_method,
|
||||||
b.payment_card_id,
|
b.payment_card_id,
|
||||||
|
c.main_name as mainName,
|
||||||
|
c.phone,
|
||||||
|
c.bank_deposi as bankDeposi,
|
||||||
b.payment_card,
|
b.payment_card,
|
||||||
b.transaction_flow,
|
b.transaction_flow,
|
||||||
b.receipt_number,
|
b.receipt_number,
|
||||||
@@ -95,8 +98,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM
|
FROM
|
||||||
receipt_detail a
|
receipt_detail a
|
||||||
LEFT JOIN receipt_manage b ON a.receipt_manage_id = b.receipt_manage_id
|
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
|
WHERE
|
||||||
a.bill_manage_id = #{billManageId}
|
a.bill_manage_id = #{billManageId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
+6
@@ -44,4 +44,10 @@ public interface ReconciliationMapper extends BaseMapper<Reconciliation>
|
|||||||
String getSettlementCurrencyNcCode(@Param("settlementCurrency") String settlementCurrency);
|
String getSettlementCurrencyNcCode(@Param("settlementCurrency") String settlementCurrency);
|
||||||
|
|
||||||
String getServiceItemsCodeNc(@Param("name") String name);
|
String getServiceItemsCodeNc(@Param("name") String name);
|
||||||
|
|
||||||
|
String getCustomerUserDept(@Param("userId") String userId);
|
||||||
|
|
||||||
|
String getDeptValue(@Param("dictCode") String dictCode);
|
||||||
|
|
||||||
|
String getDeptName(@Param("dictCode") String dictCode);
|
||||||
}
|
}
|
||||||
+21
-3
@@ -693,6 +693,9 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||||
String settlementCurrency=order.getSettlementCurrency();
|
String settlementCurrency=order.getSettlementCurrency();
|
||||||
String salesmanId = order.getSalesmanId();
|
String salesmanId = order.getSalesmanId();
|
||||||
|
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
|
||||||
|
String deptValue = reconciliationMapper.getDeptValue(customerUserDept);
|
||||||
|
String deptName = reconciliationMapper.getDeptName(customerUserDept);
|
||||||
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
|
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
|
||||||
makerCodeNc= documentPreparerNcCode;
|
makerCodeNc= documentPreparerNcCode;
|
||||||
String settlementCurrencyNcCode = settlementCurrency;
|
String settlementCurrencyNcCode = settlementCurrency;
|
||||||
@@ -704,7 +707,11 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
if(item1.getInvoiceValue().compareTo(BigDecimal.ZERO)>0){
|
if(item1.getInvoiceValue().compareTo(BigDecimal.ZERO)>0){
|
||||||
Ysitem item=new Ysitem();
|
Ysitem item=new Ysitem();
|
||||||
item.setSo_deptid("NG0408");
|
item.setSo_deptid("NG0408");
|
||||||
item.setPk_deptid("NG0408");
|
if (deptValue != null && !deptValue.isEmpty()) {
|
||||||
|
item.setPk_deptid(deptValue);
|
||||||
|
} else {
|
||||||
|
item.setPk_deptid("NG0408");
|
||||||
|
}
|
||||||
//业务员nc
|
//业务员nc
|
||||||
item.setPk_psndoc(salesmanCodeNc);
|
item.setPk_psndoc(salesmanCodeNc);
|
||||||
//客户nc
|
//客户nc
|
||||||
@@ -722,7 +729,11 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
}
|
}
|
||||||
String invoiceItemName = String.join(",", names);
|
String invoiceItemName = String.join(",", names);
|
||||||
//item.setDef29(invoiceItemName);
|
//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("CNY");
|
||||||
item.setPk_currtype(settlementCurrencyNcCode);
|
item.setPk_currtype(settlementCurrencyNcCode);
|
||||||
item.setPurchaseorder("");
|
item.setPurchaseorder("");
|
||||||
@@ -1138,6 +1149,9 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
String salesmanCodeNc=order.getSalesmanCodeNc();
|
String salesmanCodeNc=order.getSalesmanCodeNc();
|
||||||
String salesmanId = order.getSalesmanId();
|
String salesmanId = order.getSalesmanId();
|
||||||
|
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
|
||||||
|
String deptValue = reconciliationMapper.getDeptValue(customerUserDept);
|
||||||
|
String deptName = reconciliationMapper.getDeptName(customerUserDept);
|
||||||
//String customerCodeNc=order.getCustomerCodeNc();
|
//String customerCodeNc=order.getCustomerCodeNc();
|
||||||
String appointShipper=make.getActualInvoiceCustomerName();
|
String appointShipper=make.getActualInvoiceCustomerName();
|
||||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||||
@@ -1148,7 +1162,11 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
|||||||
makerCodeNc=documentPreparerNcCode;
|
makerCodeNc=documentPreparerNcCode;
|
||||||
SKitem item=new SKitem();
|
SKitem item=new SKitem();
|
||||||
item.setSo_deptid("NG0408");
|
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.setCheckdirection("ar");
|
||||||
item.setPk_psndoc(salesmanCodeNc);
|
item.setPk_psndoc(salesmanCodeNc);
|
||||||
item.setCustomer(customerCodeNc);
|
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 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 SERVICE_ITEMS_CODE_NC FROM NGWL_TEST_SYSTEM."SERVICE_ITEMS_MANAGE" where DEL_FLAG = '0' and SERVICE_ITEMS_NAME = #{name} limit 1
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
+2
-1
@@ -47,7 +47,8 @@ public class DeliveTaskApplicationService {
|
|||||||
if (topOrganizationId != null && topOrganizationId != 1){
|
if (topOrganizationId != null && topOrganizationId != 1){
|
||||||
deliveTaskDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
deliveTaskDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||||
}
|
}
|
||||||
// operatorsBy 仅由 DeliveTaskImpl 根据 tabType 设置,此处不覆盖,保证条件查询生效
|
// 只查询下发给当前登录用户的任务
|
||||||
|
deliveTaskDO.setOperatorsBy(loginUser.getUserid());
|
||||||
}
|
}
|
||||||
return deliveTaskDomainService.queryListApp(deliveTaskDO);
|
return deliveTaskDomainService.queryListApp(deliveTaskDO);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -394,7 +394,7 @@ public class HandoverTaskOrderDomainService {
|
|||||||
inventoryAdjustmentRecord.setMaterialCode(outMaterialDetail.getMaterialNo());
|
inventoryAdjustmentRecord.setMaterialCode(outMaterialDetail.getMaterialNo());
|
||||||
inventoryAdjustmentRecord.setMaterialName(outMaterialDetail.getCommodityName());
|
inventoryAdjustmentRecord.setMaterialName(outMaterialDetail.getCommodityName());
|
||||||
inventoryAdjustmentRecord.setBarCode(outMaterialDetail.getBarCode());
|
inventoryAdjustmentRecord.setBarCode(outMaterialDetail.getBarCode());
|
||||||
if (inventoryAdjustmentRecord.getBarCode().equals("")){
|
if (inventoryAdjustmentRecord.getBarCode() == null || inventoryAdjustmentRecord.getBarCode().isEmpty()){
|
||||||
getBarCode(materialInventoryPO, inventoryAdjustmentRecord);
|
getBarCode(materialInventoryPO, inventoryAdjustmentRecord);
|
||||||
}
|
}
|
||||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(outMaterialDetail.getMaterialBaseInfoId());
|
inventoryAdjustmentRecord.setMaterialBaseInfoId(outMaterialDetail.getMaterialBaseInfoId());
|
||||||
|
|||||||
+76
-3
@@ -738,18 +738,32 @@ public class ShiftManageDomainService {
|
|||||||
shiftQuantity = shiftMaterialDetailPOChildrenList.stream()
|
shiftQuantity = shiftMaterialDetailPOChildrenList.stream()
|
||||||
.map(c -> c.getShiftQuantity() != null ? c.getShiftQuantity() : BigDecimal.ZERO)
|
.map(c -> c.getShiftQuantity() != null ? c.getShiftQuantity() : BigDecimal.ZERO)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.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) {
|
for (ShiftMaterialDetailPO shiftMaterialDetailPOChildren : shiftMaterialDetailPOChildrenList) {
|
||||||
List<MaterialMoreDetailPO> childMoreDetail = materialMoreDetailMap.get(shiftMaterialDetailPOChildren.getUniqueId());
|
List<MaterialMoreDetailPO> childMoreDetail = materialMoreDetailMap.get(shiftMaterialDetailPOChildren.getUniqueId());
|
||||||
if (childMoreDetail == null) {
|
if (CollectionUtils.isEmpty(childMoreDetail)) {
|
||||||
childMoreDetail = materialMoreDetailMap.get(shiftMaterialDetailPO.getUniqueId());
|
childMoreDetail = materialMoreDetailMap.get(shiftMaterialDetailPO.getUniqueId());
|
||||||
}
|
}
|
||||||
|
// 若仍为空,则从原库存补充
|
||||||
|
if (CollectionUtils.isEmpty(childMoreDetail)) {
|
||||||
|
childMoreDetail = buildMaterialMoreDetailFromInventory(materialInventoryOldDb);
|
||||||
|
}
|
||||||
shiftMaterialDetailPOChildren.setMaterialMoreDetailList(childMoreDetail);
|
shiftMaterialDetailPOChildren.setMaterialMoreDetailList(childMoreDetail);
|
||||||
materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPOChildren));
|
materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPOChildren));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
shiftQuantity = shiftMaterialDetailPO.getShiftQuantity() != null ? shiftMaterialDetailPO.getShiftQuantity() : BigDecimal.ZERO;
|
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));
|
materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPO));
|
||||||
}
|
}
|
||||||
if (materialInventoryOldDb.getInventoryQuantity().compareTo(shiftQuantity) < 0){
|
if (materialInventoryOldDb.getInventoryQuantity().compareTo(shiftQuantity) < 0){
|
||||||
@@ -881,10 +895,69 @@ public class ShiftManageDomainService {
|
|||||||
BeanUtils.copyProperties(materialInventoryDb, materialInventoryDONow);
|
BeanUtils.copyProperties(materialInventoryDb, materialInventoryDONow);
|
||||||
materialInventoryDONow.setInventoryQuantity(shiftMaterialDetailPO.getShiftQuantity());
|
materialInventoryDONow.setInventoryQuantity(shiftMaterialDetailPO.getShiftQuantity());
|
||||||
materialInventoryDONow.setAllocationQuantity(shiftMaterialDetailPO.getShiftQuantity());
|
materialInventoryDONow.setAllocationQuantity(shiftMaterialDetailPO.getShiftQuantity());
|
||||||
|
// 目标库位已存在时,用 materialMoreDetailList 覆盖批次属性(保证批次属性随移位写入)
|
||||||
|
BatchAttributeAssignment(materialMoreDetailList, materialInventoryDONow);
|
||||||
return 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) {
|
private void BatchAttributeAssignment(List<MaterialMoreDetailPO> materialMoreDetailList, MaterialInventoryDO materialInventoryDONow) {
|
||||||
if (CollectionUtils.isEmpty(materialMoreDetailList)) {
|
if (CollectionUtils.isEmpty(materialMoreDetailList)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="tabType != null and tabType==2">
|
<if test="tabType != null and tabType==2">
|
||||||
and operators_by IS NULL
|
and operators_by IS NULL
|
||||||
</if>
|
</if>
|
||||||
|
<if test="tabType == null and operatorsBy != null">
|
||||||
|
and operators_by = #{operatorsBy}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="operatorsName != null and operatorsName != ''">
|
<if test="operatorsName != null and operatorsName != ''">
|
||||||
and operators_name like concat('%', #{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 != ''">
|
<if test="pickingOrderNumber != null and pickingOrderNumber != ''">
|
||||||
and a.picking_order_number = #{pickingOrderNumber}
|
and a.picking_order_number = #{pickingOrderNumber}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="operatorsBy != null">
|
||||||
|
and a.operators_by = #{operatorsBy}
|
||||||
|
</if>
|
||||||
<if test="createByName != null and createByName != ''">
|
<if test="createByName != null and createByName != ''">
|
||||||
and a.create_by_name like concat('%', #{createByName}, '%')
|
and a.create_by_name like concat('%', #{createByName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user