Merge branch 'dev' into dev-ty1.2
# Conflicts: # mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java # mhd_wms/src/main/java/com/mhd/wms/domain/stockInOrder/repository/todo/StockInOrderDO.java # mhd_wms/src/main/java/com/mhd/wms/domain/stockOutOrder/repository/todo/StockOutOrderDO.java # mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockInOrder/StockInOrderDTO.java # mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockOutOrder/StockOutOrderDTO.java
This commit is contained in:
+41
@@ -7,6 +7,7 @@ import com.mhd.bms.application.server.receiptManage.ReceiptManageApplicationServ
|
||||
import com.mhd.bms.domain.billManage.entity.BillDetail;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillDetailService;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
||||
import com.mhd.bms.domain.billManage.repository.mapper.BillDetailMapper;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillDetailPO;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
@@ -78,6 +79,8 @@ public class BillManageApplicationService {
|
||||
private BillDetailMapper billDetailMapper;
|
||||
@Autowired
|
||||
private NcLogMapper ncLogMapper;
|
||||
@Autowired
|
||||
private IBillManageService billManageService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -445,6 +448,7 @@ public class BillManageApplicationService {
|
||||
billManageDO.setReconciliationStatus(1);
|
||||
billManageDO.setCreateTime(new Date());
|
||||
billManageDO.setCreateBy(loginUser.getUserid());
|
||||
billManageDO.setSalesmanId(String.valueOf(loginUser.getUserid()));
|
||||
billManageDO.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billManageDO.setUpdateTime(new Date());
|
||||
billManageDO.setUpdateBy(loginUser.getUserid());
|
||||
@@ -466,6 +470,16 @@ public class BillManageApplicationService {
|
||||
for (BillDetailDTO billDetailDTO : billDetailDTOListNoBillingStatementId) {
|
||||
BillingStatementDTO billingStatementDTO = new BillingStatementDTO();
|
||||
BeanUtils.copyProperties(billDetailDTO, billingStatementDTO);
|
||||
|
||||
String firstSubjectCode = billDetailDTO.getFirstSubjectCode();
|
||||
Double taxRate = billDetailMapper.getTaxRate(firstSubjectCode);
|
||||
BigDecimal amount = billingStatementDTO.getBillingAmount();
|
||||
BigDecimal taxAmount = amount.divide(BigDecimal.ONE.add(new BigDecimal(taxRate).divide(BigDecimal.valueOf(100))),10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(taxRate).divide(BigDecimal.valueOf(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal taxFreeFee = amount.subtract(taxAmount);
|
||||
billingStatementDTO.setTaxAmount(taxAmount);
|
||||
billingStatementDTO.setTaxFreeFee(taxFreeFee);
|
||||
billingStatementDTO.setTaxRate(taxRate);
|
||||
billingStatementDTO.setBillingAmount(amount);
|
||||
billingStatementDTO.setAccountExpenseType(billDetailDTO.getBillType());
|
||||
billingStatementDTO.setBillManageId(billManageDO.getBillManageId());
|
||||
billingStatementDTO.setBillingState(3);
|
||||
@@ -495,6 +509,33 @@ public class BillManageApplicationService {
|
||||
billingStatementApplicationService.update(billingStatementDO);
|
||||
}
|
||||
//保存账单明细
|
||||
double allTaxRate = 0.0d;
|
||||
BigDecimal allTaxAmount = BigDecimal.ZERO;
|
||||
BigDecimal allTaxFreeFee = BigDecimal.ZERO;
|
||||
for (BillDetailDTO item : billDetailDTOList) {
|
||||
String firstSubjectCode = item.getFirstSubjectCode();
|
||||
Double taxRate = billDetailMapper.getTaxRate(firstSubjectCode);
|
||||
BigDecimal amount = item.getBillingAmount();
|
||||
BigDecimal taxAmount = amount.divide(BigDecimal.ONE.add(new BigDecimal(taxRate).divide(BigDecimal.valueOf(100))),10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(taxRate).divide(BigDecimal.valueOf(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal taxFreeFee = amount.subtract(taxAmount);
|
||||
item.setTaxAmount(taxAmount);
|
||||
item.setTaxFreeFee(taxFreeFee);
|
||||
item.setTaxRate(taxRate);
|
||||
item.setBillManageId(billManageDO.getBillManageId());
|
||||
item.setBillNumber(billManageDO.getBillNumber());
|
||||
allTaxRate += taxRate;
|
||||
allTaxAmount = allTaxAmount.add(taxAmount);
|
||||
allTaxFreeFee = allTaxFreeFee.add(taxFreeFee);
|
||||
}
|
||||
|
||||
BillManage billManage = billManageService.getById(billManageDO.getBillManageId());
|
||||
if (billManage != null) {
|
||||
billManage.setTaxRate(allTaxRate);
|
||||
billManage.setTaxAmount(allTaxAmount);
|
||||
billManage.setTaxFreeFee(allTaxFreeFee);
|
||||
billManage.setSalesmanId(String.valueOf(loginUser.getUserid()));
|
||||
billManageService.updateById(billManage);
|
||||
}
|
||||
Boolean flagTwo = billDetailDomainService.saveBatch(billDetailDTOList);
|
||||
//保存操作记录
|
||||
BillOperationLogDO billOperationLogDO = new BillOperationLogDO();
|
||||
|
||||
+2
@@ -585,6 +585,8 @@ public class BillingStatementApplicationService {
|
||||
此方法只进行实体返回,并不进行数据保存
|
||||
*/
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
|
||||
billingStatementDO.setAccountExpenseType(billingStatementDO.getAccountExpenseType());
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ public class SettlementCustomersApplicationService {
|
||||
SyncDictCache dictCache,
|
||||
List<SettlementCustomers> toInsert,
|
||||
List<SettlementCustomers> toUpdate) {
|
||||
AjaxResult ajaxResult = userServiceFeign.userShipperListAll();
|
||||
AjaxResult ajaxResult = userServiceFeign.userShipperListAllByOrg(loginUser.getUserPo().getOrganizationId());
|
||||
List<UserShipperPo> userShipperPoList = parseFeignList(ajaxResult, UserShipperPo.class);
|
||||
if (userShipperPoList.isEmpty()) {
|
||||
return;
|
||||
|
||||
+3
-1
@@ -38,4 +38,6 @@ public interface IBillDetailService extends IService<BillDetail>
|
||||
public BillDetailPO getInfo(Long billDetailId);
|
||||
|
||||
List<BillDetailPO> getDetailsByBillManageId(Long billManageId);
|
||||
}
|
||||
|
||||
List<BillDetail> getDetailsByBillManageIdAndGroup(Long billManageId);
|
||||
}
|
||||
+6
-1
@@ -5,6 +5,7 @@ import com.mhd.bms.domain.billManage.entity.BillDetail;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillDetailPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -17,4 +18,8 @@ public interface BillDetailMapper extends BaseMapper<BillDetail>
|
||||
{
|
||||
|
||||
List<BillDetailPO> getDetailsByBillManageId(@Param("billManageId") Long billManageId);
|
||||
}
|
||||
|
||||
List<BillDetail> getDetailsByBillManageIdAndGroup(@Param("billManageId") Long billManageId);
|
||||
|
||||
Double getTaxRate(@Param("code") String code);
|
||||
}
|
||||
+2
@@ -44,4 +44,6 @@ public interface BillManageMapper extends BaseMapper<BillManage>
|
||||
String getDeptName(@Param("dictCode") String dictCode);
|
||||
|
||||
String getOrgCodeNc(@Param("organizationId") Long organizationId);
|
||||
|
||||
Long getShipperId(@Param("userId") Long userId, @Param("organizationId") Long organizationId);
|
||||
}
|
||||
+6
-1
@@ -75,4 +75,9 @@ public class BillDetailImpl extends ServiceImpl<BillDetailMapper, BillDetail> im
|
||||
public List<BillDetailPO> getDetailsByBillManageId(Long billManageId) {
|
||||
return billDetailMapper.getDetailsByBillManageId(billManageId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillDetail> getDetailsByBillManageIdAndGroup(Long billManageId) {
|
||||
return billDetailMapper.getDetailsByBillManageIdAndGroup(billManageId);
|
||||
}
|
||||
}
|
||||
+1196
-522
File diff suppressed because it is too large
Load Diff
@@ -264,4 +264,6 @@ public class BillManageDO extends BaseVOEntity{
|
||||
private String paymentAccountId;
|
||||
@ApiModelProperty("收款帐户名称")
|
||||
private String paymentAccountName;
|
||||
@ApiModelProperty("业务员ID")
|
||||
private String salesmanId;
|
||||
}
|
||||
+4
@@ -100,6 +100,10 @@ public class BillingStatementPO extends BaseVOEntity{
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("收支类型(1-应收,2-应付)")
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("流水备注")
|
||||
@Excel(name = "流水备注")
|
||||
private String billingRemark;
|
||||
|
||||
+4
@@ -101,6 +101,10 @@ public class BillingStatementDO extends BaseVOEntity{
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("收支类型(1-应收,2-应付)")
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("流水备注")
|
||||
@Excel(name = "流水备注")
|
||||
private String billingRemark;
|
||||
|
||||
+4
@@ -102,6 +102,10 @@ public class BillingStatementDTO extends BaseVOEntity{
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("收支类型(1-应收,2-应付)")
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("流水备注")
|
||||
@Excel(name = "流水备注")
|
||||
private String billingRemark;
|
||||
|
||||
@@ -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
|
||||
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
|
||||
|
||||
@@ -27,5 +27,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND bd.bill_manage_id = #{billManageId}
|
||||
</select>
|
||||
|
||||
<select id="getDetailsByBillManageIdAndGroup" resultType="com.mhd.bms.domain.billManage.entity.BillDetail" parameterType="java.lang.Long">
|
||||
SELECT
|
||||
SUM(BILLING_AMOUNT) as BILLING_AMOUNT,
|
||||
SUM(TAX_AMOUNT) as TAX_AMOUNT,
|
||||
SUM(TAX_FREE_FEE) as TAX_FREE_FEE,
|
||||
AVG(TAX_RATE) as TAX_RATE,
|
||||
BILL_MANAGE_ID as BILL_MANAGE_ID,
|
||||
TOP_ORGANIZATION_ID as TOP_ORGANIZATION_ID,
|
||||
ORGANIZATION_NAME,
|
||||
INVOICE_ITEM,
|
||||
INVOICE_ITEM_NAME,
|
||||
FEE_TYPE,
|
||||
BILL_NUMBER
|
||||
FROM
|
||||
bill_detail
|
||||
WHERE
|
||||
del_flag = 1
|
||||
AND bill_manage_id = #{billManageId} GROUP BY INVOICE_ITEM,INVOICE_ITEM_NAME,FEE_TYPE
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<select id="getTaxRate" resultType="java.lang.Double" parameterType="java.lang.String">
|
||||
SELECT
|
||||
rate
|
||||
FROM
|
||||
NGWL_TEST_SYSTEM.EXPENSE_ACCOUNT
|
||||
WHERE
|
||||
del_flag = 1
|
||||
AND SUBJECT_CODE = #{code}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -169,4 +169,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT NC_CODE FROM NGWL_TEST_PRODUCT."SYS_ORGANIZATION" where DEL_FLAG = 1 and organization_id = #{organizationId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getShipperId" resultType="java.lang.Long">
|
||||
SELECT SHIPPER_ID FROM NGWL_TEST_USER."USER_SHIPPER" where DEL_FLAG = '1' and user_id = #{userId} and organization_id = #{organizationId} limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -200,10 +200,6 @@
|
||||
<if test="settlementCustomersDO.organizationId != null">
|
||||
AND (
|
||||
a.organization_id = #{settlementCustomersDO.organizationId}
|
||||
OR b.org_code LIKE concat('%"code":"', #{settlementCustomersDO.organizationId}, '"%')
|
||||
OR b.org_code LIKE concat('%code:', #{settlementCustomersDO.organizationId}, '%')
|
||||
OR b.org_code LIKE concat('%code: ', #{settlementCustomersDO.organizationId}, '%')
|
||||
OR b.org_code LIKE concat('%"code":', #{settlementCustomersDO.organizationId}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="settlementCustomersDO.topOrganizationId != null and settlementCustomersDO.topOrganizationId != ''">
|
||||
@@ -216,4 +212,4 @@
|
||||
and a.customer_type_code = #{settlementCustomersDO.customerTypeCode}
|
||||
</if>
|
||||
</sql>
|
||||
</mapper>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user