add 到账开票 修改待确收金额
This commit is contained in:
+3
@@ -10,6 +10,7 @@ import com.jero.mail.entity.PayMailBill;
|
||||
import com.jero.mail.vo.PayMailBillVO;
|
||||
import com.jero.member.enums.StandardsTypeEnum;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -44,6 +45,8 @@ public interface IPayMailBillService extends IService<PayMailBill> {
|
||||
*/
|
||||
Result<?> addPayBill(PayMailBillVO payMailBill);
|
||||
|
||||
int getMakeInvoice(BigDecimal amountReceivable, Integer needInvoice, BigDecimal invoiceAmount);
|
||||
|
||||
/**
|
||||
* 编辑开票
|
||||
* @param payMailBillVo
|
||||
|
||||
+37
-68
@@ -16,7 +16,6 @@ import com.jero.common.enums.ManagementMessageEnums;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.AuthenticationUtils;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.company.entity.PayCompanyManagement;
|
||||
import com.jero.company.entity.PayContactsManagement;
|
||||
@@ -25,7 +24,6 @@ import com.jero.company.service.IPayCompanyManagementService;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import com.jero.config.StaticConfig;
|
||||
import com.jero.contract.common.PayIncomeContractCommon;
|
||||
import com.jero.mail.entity.BillingInfo;
|
||||
import com.jero.mail.entity.PayMailBill;
|
||||
import com.jero.mail.entity.PayMailBillProject;
|
||||
import com.jero.mail.mapper.PayMailBillMapper;
|
||||
@@ -40,7 +38,6 @@ import com.jero.meeting.mapper.PayMeetingSituationMapper;
|
||||
import com.jero.meeting.service.IPayMeetingService;
|
||||
import com.jero.meeting.service.IPayMeetingSituationService;
|
||||
import com.jero.member.entity.*;
|
||||
import com.jero.member.enums.StandardsTypeEnum;
|
||||
import com.jero.member.mapper.*;
|
||||
import com.jero.member.service.*;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
@@ -754,28 +751,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
break;
|
||||
}
|
||||
|
||||
if(amountReceivable==null){
|
||||
amountReceivable =new BigDecimal("0");
|
||||
}
|
||||
|
||||
BigDecimal zero =new BigDecimal("0");
|
||||
|
||||
//应收=0 || 不需要开票
|
||||
if(amountReceivable.compareTo(zero)==0 || needInvoice.equals(0)){
|
||||
makeInvoice= 3;
|
||||
}
|
||||
//应收>开票总额 && 开票总额!=0
|
||||
if(amountReceivable.compareTo(invoiceAmount) == 1 && !(invoiceAmount.compareTo(zero) == 0)){
|
||||
makeInvoice= 2;
|
||||
}
|
||||
//开票总额>=应收
|
||||
if(invoiceAmount.compareTo(amountReceivable) > -1){
|
||||
makeInvoice= 1;
|
||||
}
|
||||
//开票总额为0
|
||||
if(invoiceAmount.compareTo(zero)==0){
|
||||
makeInvoice= 0;
|
||||
}
|
||||
makeInvoice = getMakeInvoice(amountReceivable, needInvoice, invoiceAmount);
|
||||
|
||||
//更新项目表开票状态
|
||||
switch (payMailBillProject.getProjectType().toString()) {
|
||||
@@ -844,6 +820,40 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据带确收金额和开票金额获得开票状态
|
||||
* @param amountReceivable
|
||||
* @param needInvoice
|
||||
* @param invoiceAmount
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int getMakeInvoice(BigDecimal amountReceivable, Integer needInvoice, BigDecimal invoiceAmount) {
|
||||
int makeInvoice = 4;
|
||||
if(amountReceivable==null){
|
||||
amountReceivable =new BigDecimal("0");
|
||||
}
|
||||
BigDecimal zero = new BigDecimal("0");
|
||||
|
||||
//应收=0 || 不需要开票
|
||||
if (amountReceivable.compareTo(zero) == 0 || needInvoice.equals(0)) {
|
||||
makeInvoice = 3;
|
||||
}
|
||||
//应收>开票总额 && 开票总额!=0
|
||||
if (amountReceivable.compareTo(invoiceAmount) == 1 && !(invoiceAmount.compareTo(zero) == 0)) {
|
||||
makeInvoice = 2;
|
||||
}
|
||||
//开票总额>=应收
|
||||
if (invoiceAmount.compareTo(amountReceivable) > -1) {
|
||||
makeInvoice = 1;
|
||||
}
|
||||
//开票总额为0
|
||||
if (invoiceAmount.compareTo(zero) == 0) {
|
||||
makeInvoice = 0;
|
||||
}
|
||||
return makeInvoice;
|
||||
}
|
||||
|
||||
|
||||
//校验不同项目是否属于同一个公司,开票金额是否大于当前未开票金额,企业名称是否审核
|
||||
private String checkCompanyProject(List<PayMailBillProject> bmpList) {
|
||||
@@ -1311,28 +1321,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
break;
|
||||
}
|
||||
|
||||
if(amountReceivable==null){
|
||||
amountReceivable =new BigDecimal("0");
|
||||
}
|
||||
|
||||
BigDecimal zero =new BigDecimal("0");
|
||||
|
||||
//应收=0 || 不需要开票
|
||||
if(amountReceivable.compareTo(zero)==0 || needInvoice.equals(0)){
|
||||
makeInvoice= 3;
|
||||
}
|
||||
//应收>开票总额 && 开票总额!=0
|
||||
if(amountReceivable.compareTo(invoiceAmount) == 1 && !(invoiceAmount.compareTo(zero) == 0)){
|
||||
makeInvoice= 2;
|
||||
}
|
||||
//开票总额>=应收
|
||||
if(invoiceAmount.compareTo(amountReceivable) > -1){
|
||||
makeInvoice= 1;
|
||||
}
|
||||
//开票总额为0
|
||||
if(invoiceAmount.compareTo(zero)==0){
|
||||
makeInvoice= 0;
|
||||
}
|
||||
makeInvoice = getMakeInvoice(amountReceivable, needInvoice, invoiceAmount);
|
||||
|
||||
//更新项目表开票状态
|
||||
switch (payMailBillProject.getProjectType().toString()) {
|
||||
@@ -1662,28 +1651,8 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(amountReceivable==null){
|
||||
amountReceivable =new BigDecimal("0");
|
||||
}
|
||||
|
||||
BigDecimal zero =new BigDecimal("0");
|
||||
|
||||
//应收=0 || 不需要开票
|
||||
if(amountReceivable.compareTo(zero)==0 || needInvoice.equals(0)){
|
||||
makeInvoice= 3;
|
||||
}
|
||||
//应收>开票总额 && 开票总额!=0
|
||||
if(amountReceivable.compareTo(invoiceAmount) == 1 && !(invoiceAmount.compareTo(zero) == 0)){
|
||||
makeInvoice= 2;
|
||||
}
|
||||
//开票总额>=应收
|
||||
if(invoiceAmount.compareTo(amountReceivable) > -1){
|
||||
makeInvoice= 1;
|
||||
}
|
||||
//开票总额为0
|
||||
if(invoiceAmount.compareTo(zero)==0){
|
||||
makeInvoice= 0;
|
||||
}
|
||||
makeInvoice = getMakeInvoice(amountReceivable, needInvoice, invoiceAmount);
|
||||
|
||||
//更新项目表开票状态
|
||||
switch (oldBmp.getProjectType().toString()) {
|
||||
|
||||
+18
-1
@@ -15,9 +15,11 @@ import com.jero.member.entity.TbCertificatePayment;
|
||||
import com.jero.member.entity.TbMemberProjectSubitem;
|
||||
import com.jero.member.service.ITbCertificatePaymentService;
|
||||
import com.jero.member.service.ITbMemberProjectSubitemService;
|
||||
import com.jero.payment.entity.PayConfirmPaymentRecord;
|
||||
import com.jero.payment.entity.PayPaymentRecord;
|
||||
import com.jero.payment.service.IPayPaymentRecordService;
|
||||
import com.jero.payment.vo.EditBillTypeParam;
|
||||
import com.jero.payment.vo.EditReceivableAmountParam;
|
||||
import com.jero.project.entity.PayCommonProject;
|
||||
import com.jero.project.vo.PayCommonProjectOutput;
|
||||
import com.jero.standards.memberinfo.entity.MemberInfo;
|
||||
@@ -25,6 +27,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -194,8 +197,22 @@ public class PayPaymentRecordController extends JeroController<PayPaymentRecord,
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加开票
|
||||
* 编辑待确收金额
|
||||
*/
|
||||
@RequiresPermissions({"incomePaymentAndInvoiving:confirmPayment","packProject:confirmPayment"})
|
||||
@AutoLog(value = "编辑待确收金额")
|
||||
@ApiOperation(value="编辑待确收金额", notes="编辑待确收金额")
|
||||
@PostMapping(value = "/editReceivableAmount")
|
||||
public Result<?> editReceivableAmount(@Validated @RequestBody EditReceivableAmountParam editReceivableAmountParam) {
|
||||
ValidUtil.validate(editReceivableAmountParam);
|
||||
payPaymentRecordService.editReceivableAmount(editReceivableAmountParam);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑开票类型
|
||||
*/
|
||||
@ApiOperation(value = "编辑开票类型", notes = "编辑开票类型")
|
||||
@RequiresPermissions("packProject:changeInvoiceInfo")
|
||||
|
||||
+8
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.payment.entity.PayPaymentRecord;
|
||||
import com.jero.payment.vo.EditBillTypeParam;
|
||||
import com.jero.payment.vo.EditReceivableAmountParam;
|
||||
import com.jero.payment.vo.TbCheckVo;
|
||||
import com.jero.project.entity.PayCommonProject;
|
||||
import com.jero.project.vo.PayCommonProjectOutput;
|
||||
@@ -109,6 +110,13 @@ public interface IPayPaymentRecordService extends IService<PayPaymentRecord> {
|
||||
* @param payPaymentRecord
|
||||
*/
|
||||
void editAmountReceived(PayPaymentRecord payPaymentRecord);
|
||||
|
||||
/**
|
||||
* 编辑待确收金额
|
||||
* @param editReceivableAmountParam
|
||||
*/
|
||||
void editReceivableAmount(EditReceivableAmountParam editReceivableAmountParam);
|
||||
|
||||
/**
|
||||
* 标协会员项目来款推送到标协项目
|
||||
* @param typr5List
|
||||
|
||||
+238
-2
@@ -18,7 +18,6 @@ import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.AuthenticationUtils;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.company.entity.PayCompanyManagement;
|
||||
@@ -27,6 +26,7 @@ import com.jero.company.service.IPayCompanyManagementService;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import com.jero.config.StaticConfig;
|
||||
import com.jero.contract.common.PayIncomeContractCommon;
|
||||
import com.jero.mail.service.IPayMailBillService;
|
||||
import com.jero.meeting.common.MeetingSubitemCommon;
|
||||
import com.jero.meeting.entity.PayMeeting;
|
||||
import com.jero.meeting.entity.PayMeetingSituation;
|
||||
@@ -50,6 +50,7 @@ import com.jero.payment.mapper.PayPaymentRecordMapper;
|
||||
import com.jero.payment.service.IPayPaymentCheckService;
|
||||
import com.jero.payment.service.IPayPaymentRecordService;
|
||||
import com.jero.payment.vo.EditBillTypeParam;
|
||||
import com.jero.payment.vo.EditReceivableAmountParam;
|
||||
import com.jero.payment.vo.TbCheckVo;
|
||||
import com.jero.project.common.PayProjectCommon;
|
||||
import com.jero.project.entity.PayCommonProject;
|
||||
@@ -139,7 +140,10 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
|
||||
private IPayWorkingGroupSubItemContactsService payWorkingGroupSubItemContactsService;
|
||||
@Resource
|
||||
private IPayPackCompanyService payPackCompanyService;
|
||||
|
||||
@Resource
|
||||
private IPayMailBillService mailBillService;
|
||||
@Resource
|
||||
private PayConfirmPaymentRecordService confirmPaymentRecordService;
|
||||
@Value("${jero.path.upload}")
|
||||
private String upLoadPath;
|
||||
|
||||
@@ -884,6 +888,31 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断能否修改待确收金额
|
||||
* @param receivableAmount 待确收金额
|
||||
* @param paidAmount 到账金额
|
||||
* @param confirmAmount 确认收入金额
|
||||
* @param invoiceAmount 开票金额
|
||||
*/
|
||||
private void editReceivableAmountFlag(BigDecimal receivableAmount, BigDecimal paidAmount, BigDecimal confirmAmount, BigDecimal invoiceAmount) {
|
||||
if(receivableAmount == null){
|
||||
receivableAmount = new BigDecimal("0");
|
||||
}
|
||||
//待确收金额不能小于到账金额
|
||||
if (paidAmount != null && receivableAmount.compareTo(paidAmount) < 0){
|
||||
throw new JeroBootException("待确收金额不能小于到账金额");
|
||||
}
|
||||
//待确收金额不能小于确认收入金额
|
||||
if (confirmAmount != null && receivableAmount.compareTo(confirmAmount) < 0){
|
||||
throw new JeroBootException("待确收金额不能小于确认收入金额");
|
||||
}
|
||||
//待确收金额不能小于开票金额
|
||||
if (invoiceAmount != null && receivableAmount.compareTo(invoiceAmount) < 0){
|
||||
throw new JeroBootException("待确收金额不能小于开票金额");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 税额是否正确
|
||||
* @param tax 税额
|
||||
@@ -1224,6 +1253,213 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
|
||||
payPaymentCheckMapper.update(payPaymentRecordSub,updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editReceivableAmount(EditReceivableAmountParam param) {
|
||||
String projectId = param.getProjectId();
|
||||
Integer projectType = param.getProjectType();
|
||||
BigDecimal receivableAmount = param.getReceivableAmount();
|
||||
|
||||
//到账金额
|
||||
BigDecimal paidAmount;
|
||||
//确认收入金额
|
||||
BigDecimal confirmAmount;
|
||||
//开票金额
|
||||
BigDecimal invoiceAmount;
|
||||
//开票状态
|
||||
Integer needInvoice;
|
||||
int makeInvoice;
|
||||
//确认收入状态
|
||||
Integer affirmIncome;
|
||||
Integer inAccount;
|
||||
//税率
|
||||
BigDecimal taxRate;
|
||||
//税额
|
||||
BigDecimal tax;
|
||||
//未税金额
|
||||
BigDecimal noTaxAmount;
|
||||
//税额是否正确
|
||||
switch (String.valueOf(projectType)) {
|
||||
// 普通项目
|
||||
case PayIncomeContractCommon.PROJECT_TYPE1:
|
||||
PayCommonProject payCommonProject = payCommonProjectMapper.selectById(projectId);
|
||||
//获取到账、确收、开票金额
|
||||
paidAmount = payCommonProject.getPaidAmount();
|
||||
confirmAmount = payCommonProject.getConfirmAmount();
|
||||
invoiceAmount = payCommonProject.getInvoiceAmount();
|
||||
//判断能否修改待确收金额
|
||||
editReceivableAmountFlag(receivableAmount, paidAmount, confirmAmount, invoiceAmount);
|
||||
//开票状态
|
||||
needInvoice = payCommonProject.getNeedInvoice();
|
||||
makeInvoice = mailBillService.getMakeInvoice(receivableAmount, needInvoice, invoiceAmount);
|
||||
payCommonProject.setMakeInvoice(makeInvoice);
|
||||
//保存新的税额、未税金额
|
||||
taxRate = payCommonProject.getTaxRate();
|
||||
noTaxAmount = receivableAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
|
||||
payCommonProject.setNoTaxAmount(noTaxAmount);
|
||||
payCommonProject.setTax(receivableAmount.subtract(noTaxAmount));
|
||||
//到账状态
|
||||
inAccount = getInAccount(receivableAmount, paidAmount);
|
||||
payCommonProject.setInAccount(inAccount);
|
||||
//确认收入状态
|
||||
affirmIncome = confirmPaymentRecordService.getAffirmIncome(receivableAmount, confirmAmount);
|
||||
payCommonProject.setAffirmIncome(affirmIncome);
|
||||
//更新
|
||||
payCommonProject.setReceivableAmount(receivableAmount);
|
||||
payCommonProjectMapper.updateById(payCommonProject);
|
||||
|
||||
break;
|
||||
// 工作组项目
|
||||
case PayIncomeContractCommon.PROJECT_TYPE2:
|
||||
PayWorkingGroupSubItem payWorking = payWorkingGroupSubItemMapper.selectById(projectId);
|
||||
//获取到账、确收、开票金额
|
||||
paidAmount = payWorking.getPaidAmount();
|
||||
confirmAmount = payWorking.getConfirmAmount();
|
||||
invoiceAmount = payWorking.getInvoiceAmount();
|
||||
//判断能否修改待确收金额
|
||||
editReceivableAmountFlag(receivableAmount, paidAmount, confirmAmount, invoiceAmount);
|
||||
//开票状态
|
||||
needInvoice = payWorking.getNeedInvoice();
|
||||
makeInvoice = mailBillService.getMakeInvoice(receivableAmount, needInvoice, invoiceAmount);
|
||||
payWorking.setMakeInvoice(makeInvoice);
|
||||
//保存新的税额、未税金额
|
||||
taxRate = payWorking.getTaxRate();
|
||||
noTaxAmount = receivableAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
|
||||
payWorking.setNoTaxAmount(noTaxAmount);
|
||||
payWorking.setTax(receivableAmount.subtract(noTaxAmount));
|
||||
//到账状态
|
||||
inAccount = getInAccount(receivableAmount, paidAmount);
|
||||
payWorking.setInAccount(inAccount);
|
||||
//确认收入状态
|
||||
affirmIncome = confirmPaymentRecordService.getAffirmIncome(receivableAmount, confirmAmount);
|
||||
payWorking.setAffirmIncome(affirmIncome);
|
||||
//更新
|
||||
payWorking.setReceivableAmount(receivableAmount);
|
||||
payWorkingGroupSubItemMapper.updateById(payWorking);
|
||||
|
||||
break;
|
||||
//会议项目
|
||||
case PayIncomeContractCommon.PROJECT_TYPE3:
|
||||
PayMeetingSituation meetingSituation = payMeetingSituationMapper.selectById(projectId);
|
||||
//获取到账、确收、开票金额
|
||||
paidAmount = meetingSituation.getPaidAmount();
|
||||
confirmAmount = meetingSituation.getConfirmAmount();
|
||||
invoiceAmount = meetingSituation.getInvoiceAmount();
|
||||
//判断能否修改待确收金额
|
||||
editReceivableAmountFlag(receivableAmount, paidAmount, confirmAmount, invoiceAmount);
|
||||
//开票状态
|
||||
needInvoice = meetingSituation.getNeedInvoice();
|
||||
makeInvoice = mailBillService.getMakeInvoice(receivableAmount, needInvoice, invoiceAmount);
|
||||
meetingSituation.setMakeInvoice(makeInvoice);
|
||||
//保存新的税额、未税金额
|
||||
taxRate = meetingSituation.getTaxRate();
|
||||
noTaxAmount = receivableAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
|
||||
meetingSituation.setNoTaxAmount(noTaxAmount);
|
||||
meetingSituation.setTax(receivableAmount.subtract(noTaxAmount));
|
||||
//到账状态
|
||||
inAccount = getInAccount(receivableAmount, paidAmount);
|
||||
meetingSituation.setInAccount(inAccount);
|
||||
//确认收入状态
|
||||
affirmIncome = confirmPaymentRecordService.getAffirmIncome(receivableAmount, confirmAmount);
|
||||
meetingSituation.setAffirmIncome(affirmIncome);
|
||||
//更新
|
||||
meetingSituation.setAmountReceivable(receivableAmount);
|
||||
payMeetingSituationMapper.updateById(meetingSituation);
|
||||
|
||||
break;
|
||||
//会员项目
|
||||
case PayIncomeContractCommon.PROJECT_TYPE4:
|
||||
PayMemberProjectSubitem member = payMemberProjectSubitemMapper.selectById(projectId);
|
||||
//获取到账、确收、开票金额
|
||||
paidAmount = member.getPaidAmount();
|
||||
confirmAmount = member.getConfirmAmount();
|
||||
invoiceAmount = member.getInvoiceAmount();
|
||||
//判断能否修改待确收金额
|
||||
editReceivableAmountFlag(receivableAmount, paidAmount, confirmAmount, invoiceAmount);
|
||||
//开票状态
|
||||
needInvoice = member.getNeedInvoice();
|
||||
makeInvoice = mailBillService.getMakeInvoice(receivableAmount, needInvoice, invoiceAmount);
|
||||
member.setMakeInvoice(makeInvoice);
|
||||
//保存新的税额、未税金额
|
||||
taxRate = member.getTaxRate();
|
||||
noTaxAmount = receivableAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
|
||||
member.setNoTaxAmount(noTaxAmount);
|
||||
member.setTax(receivableAmount.subtract(noTaxAmount));
|
||||
//到账状态
|
||||
inAccount = getInAccount(receivableAmount, paidAmount);
|
||||
member.setInAccount(inAccount);
|
||||
//确认收入状态
|
||||
affirmIncome = confirmPaymentRecordService.getAffirmIncome(receivableAmount, confirmAmount);
|
||||
member.setAffirmIncome(affirmIncome);
|
||||
//更新
|
||||
member.setAmountReceivable(receivableAmount);
|
||||
payMemberProjectSubitemMapper.updateById(member);
|
||||
|
||||
break;
|
||||
//标协会员
|
||||
case PayIncomeContractCommon.PROJECT_TYPE5:
|
||||
TbMemberProjectSubitem projectSubitem = tbMemberProjectSubitemMapper.selectById(projectId);
|
||||
//获取到账、确收、开票金额
|
||||
paidAmount = projectSubitem.getPaidAmount();
|
||||
confirmAmount = projectSubitem.getConfirmAmount();
|
||||
invoiceAmount = projectSubitem.getInvoiceAmount();
|
||||
//判断能否修改待确收金额
|
||||
editReceivableAmountFlag(receivableAmount, paidAmount, confirmAmount, invoiceAmount);
|
||||
//开票状态
|
||||
needInvoice = projectSubitem.getInvoiceRequirements();
|
||||
makeInvoice = mailBillService.getMakeInvoice(receivableAmount, needInvoice, invoiceAmount);
|
||||
projectSubitem.setMakeInvoice(makeInvoice);
|
||||
//保存新的税额、未税金额
|
||||
taxRate = projectSubitem.getTaxRate();
|
||||
noTaxAmount = receivableAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
|
||||
projectSubitem.setNoTaxAmount(noTaxAmount);
|
||||
projectSubitem.setTax(receivableAmount.subtract(noTaxAmount));
|
||||
//到账状态
|
||||
inAccount = getInAccount(receivableAmount, paidAmount);
|
||||
projectSubitem.setInAccount(inAccount);
|
||||
//确认收入状态
|
||||
affirmIncome = confirmPaymentRecordService.getAffirmIncome(receivableAmount, confirmAmount);
|
||||
projectSubitem.setAffirmIncome(affirmIncome);
|
||||
//更新
|
||||
projectSubitem.setAmountReceivable(receivableAmount);
|
||||
tbMemberProjectSubitemMapper.updateById(projectSubitem);
|
||||
break;
|
||||
//标协证书
|
||||
case PayIncomeContractCommon.PROJECT_TYPE6:
|
||||
throw new JeroBootException("标协证书类型不可编辑!");
|
||||
// 打包项目
|
||||
case PayIncomeContractCommon.PROJECT_TYPE8:
|
||||
PayPackCompany payPackCompany = payPackCompanyService.getById(projectId);
|
||||
//获取到账、确收、开票金额
|
||||
paidAmount = payPackCompany.getPaidAmount();
|
||||
confirmAmount = payPackCompany.getConfirmAmount();
|
||||
invoiceAmount = payPackCompany.getInvoiceAmount();
|
||||
//判断能否修改待确收金额
|
||||
editReceivableAmountFlag(receivableAmount, paidAmount, confirmAmount, invoiceAmount);
|
||||
//开票状态
|
||||
needInvoice = payPackCompany.getNeedInvoice();
|
||||
makeInvoice = mailBillService.getMakeInvoice(receivableAmount, needInvoice, invoiceAmount);
|
||||
payPackCompany.setMakeInvoice(makeInvoice);
|
||||
//保存新的税额、未税金额
|
||||
taxRate = payPackCompany.getTaxRate();
|
||||
noTaxAmount = receivableAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
|
||||
payPackCompany.setNoTaxAmount(noTaxAmount);
|
||||
payPackCompany.setTax(receivableAmount.subtract(noTaxAmount));
|
||||
//到账状态
|
||||
inAccount = getInAccount(receivableAmount, paidAmount);
|
||||
payPackCompany.setInAccount(inAccount);
|
||||
//确认收入状态
|
||||
affirmIncome = confirmPaymentRecordService.getAffirmIncome(receivableAmount, confirmAmount);
|
||||
payPackCompany.setIncomeAffirm(affirmIncome);
|
||||
//更新
|
||||
payPackCompany.setReceivableAmount(receivableAmount);
|
||||
payPackCompanyService.updateById(payPackCompany);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 标协会员项目来款推送到标协项目
|
||||
* @param typr5List
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.jero.payment.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2024-07-18 10:33
|
||||
*/
|
||||
@Data
|
||||
public class EditReceivableAmountParam {
|
||||
/**项目id*/
|
||||
@ApiModelProperty(value = "项目id")
|
||||
@NotBlank(message = "项目id不能为空")
|
||||
private String projectId;
|
||||
/**项目类型*/
|
||||
@ApiModelProperty(value = "项目类型")
|
||||
@NotNull(message = "项目类型不能为空")
|
||||
private Integer projectType;
|
||||
|
||||
/**邮寄联系人id*/
|
||||
@ApiModelProperty(value = "待确收金额")
|
||||
@NotNull(message = "待确收金额不能为空")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private BigDecimal receivableAmount;
|
||||
}
|
||||
Reference in New Issue
Block a user