|
|
@@ -108,10 +108,11 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public DocSavedDTO saveFormData(VerificationFormDTO formdata) {
|
|
|
+ public DocBaseDTO saveFormData(VerificationFormDTO formdata) {
|
|
|
if (null == formdata || null == formdata.getMain()){
|
|
|
throw new BizException(BizExceptionCode.EMPTY_DATA);
|
|
|
}
|
|
|
+
|
|
|
//公司ID
|
|
|
Long companyId = BaseContextHolder.getCompanyId();
|
|
|
//人员Id
|
|
|
@@ -122,100 +123,71 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
List<VerificationdetDTO> items1 = formdata.getItems1();
|
|
|
//获取从表2
|
|
|
List<VerificationdetailDTO> items2 = formdata.getItems2();
|
|
|
- //插入从表数据
|
|
|
- List<Verificationdet> insertDetails1 = new ArrayList<>();
|
|
|
- List<Verificationdetail> insertDetails2 = new ArrayList<>();
|
|
|
- //更新从表数据
|
|
|
- List<Verificationdet> updateDetails1 = new ArrayList<>();
|
|
|
- List<Verificationdetail> updateDetails2 = new ArrayList<>();
|
|
|
- DocSavedDTO saveDTO = new DocSavedDTO();
|
|
|
+
|
|
|
+ DocBaseDTO baseDTO = null;
|
|
|
Long id = main.getId();
|
|
|
String code = main.getVc_code();
|
|
|
- Verification verification = BeanMapper.map(main,Verification.class);
|
|
|
- verification.setCompanyId(companyId);
|
|
|
- verification.setCreatorId(userId);
|
|
|
- verification.setCreateTime(new Date());
|
|
|
- String kind = verification.getVc_kind();
|
|
|
- verification.setVc_kind(transferKind(kind));
|
|
|
+ //编号校验
|
|
|
+ code = pushMaxnubmer(code, id);
|
|
|
+ main.setVc_code(code);
|
|
|
|
|
|
- //编号获取
|
|
|
- code = pushMaxnubmer(code,id);
|
|
|
- verification.setVc_code(code);
|
|
|
- saveDTO.setCode(code);
|
|
|
+ Verification verification = BeanMapper.map(main,Verification.class);
|
|
|
+ if(id.longValue() > 0 ){
|
|
|
+ String kind = verification.getVc_kind();
|
|
|
+ verification.setVc_kind(transferKind(kind));
|
|
|
+ verificationMapper.updateByPrimaryKey(verification);
|
|
|
+ baseDTO = new DocBaseDTO(id, code, BillCodeSeq.VERIFICATION.getCaller());
|
|
|
+ if (!("AUDITED".equals(verification.getVc_statuscode()))) {
|
|
|
+ //日志记录
|
|
|
+ messageLogService.update(baseDTO);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ verification.setCompanyId(companyId);
|
|
|
+ verification.setVc_recorder(BaseContextHolder.getUserName());
|
|
|
+ verification.setCreateTime(new Date());
|
|
|
+ verification.setCreatorId(userId);
|
|
|
+ verification.setCreatorName(BaseContextHolder.getUserName());
|
|
|
+ String kind = verification.getVc_kind();
|
|
|
+ verification.setVc_kind(transferKind(kind));
|
|
|
+ verificationMapper.insertSelective(verification);
|
|
|
+ id = verification.getId();
|
|
|
+ baseDTO = new DocBaseDTO(id, code, BillCodeSeq.VERIFICATION.getCaller());
|
|
|
+ if (!("AUDITED".equals(verification.getVc_statuscode()))) {
|
|
|
+ //日志记录
|
|
|
+ messageLogService.save(baseDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYYMM");
|
|
|
String dateYM = simpleDateFormat.format(verification.getVc_date());
|
|
|
Integer numberYM = Integer.valueOf(dateYM);
|
|
|
//判断更新与保存动作
|
|
|
- if (StringUtils.isEmpty(id) || "0".equals(id.toString())){
|
|
|
- //插入操作
|
|
|
- getMapper().insertSelective(verification);
|
|
|
- id = verification.getId();
|
|
|
-
|
|
|
- //添加从表传输对象
|
|
|
- for (VerificationdetDTO item : items1) {
|
|
|
- Verificationdet detail = BeanMapper.map(item,Verificationdet.class);
|
|
|
- detail.setVd_vcid(id);
|
|
|
- detail.setCompanyId(companyId);
|
|
|
- detail.setVd_ym(numberYM);
|
|
|
- insertDetails1.add(detail);
|
|
|
- }
|
|
|
- for (VerificationdetailDTO item : items2) {
|
|
|
- Verificationdetail detail = BeanMapper.map(item,Verificationdetail.class);
|
|
|
- detail.setVcd_vcid(id);
|
|
|
- detail.setVcd_ym(numberYM);
|
|
|
- detail.setCompanyId(companyId);
|
|
|
- insertDetails2.add(detail);
|
|
|
- }
|
|
|
- //插入从表
|
|
|
- if (insertDetails1.size()>0) {
|
|
|
- verificationdetMapper.batchInsert(insertDetails1);
|
|
|
- }
|
|
|
- if (insertDetails2.size()>0) {
|
|
|
- verificationdetailMapper.batchInsert(insertDetails2);
|
|
|
- }
|
|
|
- }
|
|
|
- //更新操作
|
|
|
- getMapper().updateByPrimaryKeySelective(verification);
|
|
|
//添加从表传输对象
|
|
|
for (VerificationdetDTO item : items1) {
|
|
|
- Verificationdet detail = BeanMapper.map(item, Verificationdet.class);
|
|
|
+ Verificationdet detail = BeanMapper.map(item,Verificationdet.class);
|
|
|
+ Long vd_id = detail.getId();
|
|
|
detail.setVd_vcid(id);
|
|
|
- detail.setVd_ym(numberYM);
|
|
|
detail.setCompanyId(companyId);
|
|
|
- if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
|
|
|
- insertDetails1.add(detail);
|
|
|
- } else {
|
|
|
- updateDetails1.add(detail);
|
|
|
+ detail.setVd_ym(numberYM);
|
|
|
+ if (vd_id>0){
|
|
|
+ verificationdetMapper.updateByPrimaryKey(detail);
|
|
|
+ }else{
|
|
|
+ verificationdetMapper.insertSelective(detail);
|
|
|
}
|
|
|
}
|
|
|
for (VerificationdetailDTO item : items2) {
|
|
|
- Verificationdetail detail = BeanMapper.map(item, Verificationdetail.class);
|
|
|
+ Verificationdetail detail = BeanMapper.map(item,Verificationdetail.class);
|
|
|
detail.setVcd_vcid(id);
|
|
|
detail.setVcd_ym(numberYM);
|
|
|
detail.setCompanyId(companyId);
|
|
|
- if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
|
|
|
- insertDetails2.add(detail);
|
|
|
- } else {
|
|
|
- updateDetails2.add(detail);
|
|
|
+ Long vcd_id = detail.getId();
|
|
|
+ if(vcd_id>0){
|
|
|
+ verificationdetailMapper.updateByPrimaryKey(detail);
|
|
|
+ }else{
|
|
|
+ verificationdetailMapper.insertSelective(detail);
|
|
|
}
|
|
|
}
|
|
|
- //插入从表
|
|
|
- if (insertDetails1.size()>0) {
|
|
|
- verificationdetMapper.batchInsert(insertDetails1);
|
|
|
- }
|
|
|
- if (insertDetails2.size()>0) {
|
|
|
- verificationdetailMapper.batchInsert(insertDetails2);
|
|
|
- }
|
|
|
- //更新从表
|
|
|
- if (updateDetails1.size()>0) {
|
|
|
- verificationdetMapper.batchUpdate(updateDetails1);
|
|
|
- }
|
|
|
- if (updateDetails2.size()>0) {
|
|
|
- verificationdetailMapper.batchUpdate(updateDetails2);
|
|
|
- }
|
|
|
updateCorrespondingData(formdata);
|
|
|
- saveDTO.setId(id);
|
|
|
- return saveDTO;
|
|
|
+ return baseDTO;
|
|
|
}
|
|
|
|
|
|
private void updateCorrespondingData(VerificationFormDTO formdata) {
|
|
|
@@ -292,6 +264,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
String kind = verification.getVc_kind();
|
|
|
subledger.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
subledger.setSl_code(verification.getVc_code());
|
|
|
+ kind = transferKind(kind);
|
|
|
subledger.setSl_kind(kind);
|
|
|
if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable") ||
|
|
|
kind.equals("receivable_offset_payable")){
|
|
|
@@ -301,17 +274,18 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
subledger.setSl_custid(verification.getVc_custid());
|
|
|
subledger.setSl_vendid(0);
|
|
|
}
|
|
|
-
|
|
|
+ Double amount1 = verification.getVc_amount1()==null?new Double(0):verification.getVc_amount1();
|
|
|
+ Double amount2 = verification.getVc_amount2()==null?new Double(0):verification.getVc_amount2();
|
|
|
subledger.setSl_date(verification.getVc_date());
|
|
|
- subledger.setSl_amount(-verification.getVc_amount2());
|
|
|
+ subledger.setSl_amount(-amount2);
|
|
|
subledger.setSl_orderamount(new Double(0));
|
|
|
subledger.setSl_yamount(new Double(0));
|
|
|
subledger.setSl_remark(verification.getVc_remark());
|
|
|
subledger.setSl_discount(new Double(0));
|
|
|
if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable")){
|
|
|
- subledger.setSl_preamount(-verification.getVc_amount1());
|
|
|
+ subledger.setSl_preamount(-amount1);
|
|
|
}else{
|
|
|
- subledger.setSl_preamount(new Double(0));
|
|
|
+ subledger.setSl_preamount(amount1);
|
|
|
}
|
|
|
return subledger;
|
|
|
}
|
|
|
@@ -320,10 +294,10 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
* @param id
|
|
|
* @param nowBalance
|
|
|
*/
|
|
|
- private void updateAuditSubledeger(int id , Double nowBalance){
|
|
|
- Subledger subledger = subledgerMapper.selectByPrimaryKey(id);
|
|
|
+ private void updateAuditSubledeger(Long id , Double nowBalance){
|
|
|
+ Subledger subledger = subledgerMapper.selectByPrimaryKey(Math.toIntExact(id));
|
|
|
Subledger newSubledeger = new Subledger();
|
|
|
- newSubledeger.setId(Long.valueOf(String.valueOf(id)));
|
|
|
+ newSubledeger.setId(id);
|
|
|
Double newNamout = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount()-nowBalance;
|
|
|
Double newYamout = subledger.getSl_yamount()==null?new Double(0):subledger.getSl_yamount()+nowBalance;
|
|
|
newSubledeger.setSl_yamount(newYamout);
|
|
|
@@ -332,15 +306,15 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
newSubledeger.setUpdateTime(new Date());
|
|
|
- subledgerMapper.updateByPrimaryKey(newSubledeger);
|
|
|
+ subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
|
|
|
}
|
|
|
/**
|
|
|
* 反审核更新来源单据的已核销,未核销
|
|
|
* @param id
|
|
|
* @param nowBalance
|
|
|
*/
|
|
|
- private void updateResAuditSubledeger(int id , Double nowBalance){
|
|
|
- Subledger subledger = subledgerMapper.selectByPrimaryKey(id);
|
|
|
+ private void updateResAuditSubledeger(Long id , Double nowBalance){
|
|
|
+ Subledger subledger = subledgerMapper.selectByPrimaryKey(Math.toIntExact(id));
|
|
|
Subledger newSubledeger = new Subledger();
|
|
|
newSubledeger.setId(Long.valueOf(String.valueOf(id)));
|
|
|
Double newNamout = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount()+nowBalance;
|
|
|
@@ -351,7 +325,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
newSubledeger.setUpdateTime(new Date());
|
|
|
- subledgerMapper.updateByPrimaryKey(newSubledeger);
|
|
|
+ subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
|
|
|
}
|
|
|
/**
|
|
|
* 转换核销单类型
|
|
|
@@ -370,7 +344,17 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
return "应收转应收";
|
|
|
case "payable_to_payable":
|
|
|
return "应付转应付";
|
|
|
- default:return "";
|
|
|
+ case "预收冲应收":
|
|
|
+ return "receipts_offset_receivable";
|
|
|
+ case "预付冲应付":
|
|
|
+ return "prepaid_offset_payable";
|
|
|
+ case "应收冲应付":
|
|
|
+ return "receivable_offset_payable";
|
|
|
+ case "应收转应收":
|
|
|
+ return "receivable_to_receivable";
|
|
|
+ case "应付转应付":
|
|
|
+ return "payable_to_payable";
|
|
|
+ default: return "";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -405,7 +389,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
- * @param id
|
|
|
+ * @param detno
|
|
|
*/
|
|
|
private boolean checkSetAcount(Integer detno){
|
|
|
boolean isSetAcount = false;
|
|
|
@@ -418,13 +402,13 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
@Override
|
|
|
public void deleteDetail1(Long id) {
|
|
|
if (null != id) {
|
|
|
- verificationdetMapper.deleteByParentPrimaryKey(Long.valueOf(String.valueOf(id)));
|
|
|
Verificationdet verificationdet = verificationdetMapper.selectByPrimaryKey(Integer.valueOf(String.valueOf(id)));
|
|
|
Verification verification = verificationMapper.selectByPrimaryKey(verificationdet.getVd_vcid());
|
|
|
DocBaseDTO baseDTO = new DocBaseDTO();
|
|
|
baseDTO.setId(id);
|
|
|
baseDTO.setCode(verification.getVc_code());
|
|
|
baseDTO.setName(BillCodeSeq.VERIFICATION.getName());
|
|
|
+ verificationdetMapper.deleteByParentPrimaryKey(Long.valueOf(String.valueOf(id)));
|
|
|
//日志
|
|
|
messageLogService.deleteDetail(baseDTO);
|
|
|
}
|
|
|
@@ -446,14 +430,14 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public DocSavedDTO audit(VerificationFormDTO formData) {
|
|
|
+ public DocBaseDTO audit(VerificationFormDTO formData) {
|
|
|
Long id = null;
|
|
|
- DocSavedDTO savedDTO = new DocSavedDTO();
|
|
|
+ DocBaseDTO baseDTO = new DocBaseDTO();
|
|
|
if (null != formData) {
|
|
|
- id = Long.valueOf(String.valueOf(formData.getMain().getVc_id()));
|
|
|
+ id = formData.getMain().getId();
|
|
|
if (StringUtils.isEmpty(id)) {
|
|
|
- DocSavedDTO saveDTO = saveFormData(formData);
|
|
|
- id = saveDTO.getId();
|
|
|
+ baseDTO = saveFormData(formData);
|
|
|
+ id = baseDTO.getId();
|
|
|
}
|
|
|
Verification verification = new Verification();
|
|
|
verification.setVc_status(Status.AUDITED.getDisplay());
|
|
|
@@ -484,8 +468,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
updateAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
|
|
|
}
|
|
|
}
|
|
|
- savedDTO.setId(id);
|
|
|
- return savedDTO;
|
|
|
+ baseDTO.setId(id);
|
|
|
+ return baseDTO;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -510,9 +494,9 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
customer.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
customer.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
customer.setUpdateTime(new Date());
|
|
|
- customer.setCu_preamount(preamount+amount1);
|
|
|
+ customer.setCu_preamount(preamount-amount1);
|
|
|
customer.setCu_recamount(recamount-amount2);
|
|
|
- customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-amount2-preamount-amount1);
|
|
|
+ customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-amount2-(preamount-amount1));
|
|
|
recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
|
|
|
}else if(kind.equals("receivable_offset_payable")){
|
|
|
Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(verificationDTO.getVc_custid());
|
|
|
@@ -557,8 +541,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
newCustomerIn.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
newCustomerIn.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
newCustomerIn.setUpdateTime(new Date());
|
|
|
- newCustomerIn.setCu_recamount(recamountIn-amount1);
|
|
|
- newCustomerIn.setCu_leftamount(beginapamountIn-beginprepayamountIn+recamountIn-amount1-preamountIn);
|
|
|
+ newCustomerIn.setCu_recamount(recamountIn+amount1);
|
|
|
+ newCustomerIn.setCu_leftamount(beginapamountIn-beginprepayamountIn+recamountIn+amount1-preamountIn);
|
|
|
recbalanceMapper.updateCustomerByPrimaryKeySelective(newCustomerIn);
|
|
|
|
|
|
Customer newCustomerOut = new Customer();
|
|
|
@@ -596,8 +580,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
vendor.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
vendor.setUpdateTime(new Date());
|
|
|
vendor.setVe_preamount(preamount-amount1);
|
|
|
- vendor.setVe_payamount(payamount+amount2);
|
|
|
- vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+amount2-preamount+amount1);
|
|
|
+ vendor.setVe_payamount(payamount-amount2);
|
|
|
+ vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amount2-(preamount-amount1));
|
|
|
paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
|
|
|
}else if(kind.equals("receivable_offset_payable")){
|
|
|
Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(verificationDTO.getVc_vendid());
|
|
|
@@ -610,11 +594,11 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
Double amount1 = verificationDTO.getVc_amount1()==null?new Double(0):verificationDTO.getVc_amount1();
|
|
|
Double amount2 = verificationDTO.getVc_amount2()==null?new Double(0):verificationDTO.getVc_amount2();
|
|
|
vendor.setId(Long.valueOf(String.valueOf(verificationDTO.getVc_vendid())));
|
|
|
- vendor.setVe_payamount(payamount+amount2);
|
|
|
+ vendor.setVe_payamount(payamount-amount2);
|
|
|
vendor.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
vendor.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
vendor.setUpdateTime(new Date());
|
|
|
- vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+amount2-preamount);
|
|
|
+ vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amount2-preamount);
|
|
|
paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
|
|
|
}else if(kind.equals("payable_to_payable")){
|
|
|
//转入供应商
|
|
|
@@ -669,7 +653,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
}
|
|
|
|
|
|
//更新客户或者供应商的金额
|
|
|
- Verification nowverification = verificationMapper.selectByPrimaryKey(id);
|
|
|
+ Verification nowverification = verificationMapper.selectByPrimaryKey(Math.toIntExact(id));
|
|
|
VerificationDTO verificationDTO = BeanMapper.map(nowverification,VerificationDTO.class);
|
|
|
updateResAuditCustomer(verificationDTO);
|
|
|
updateResAuditVendor(verificationDTO);
|
|
|
@@ -681,11 +665,11 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
List<Verificationdetail> items2 = verificationdetailMapper.selectByFK(id);
|
|
|
for(Verificationdet det : items1){
|
|
|
Double nowbalanceDet = det.getVd_nowbalance()==null?new Double(0):det.getVd_nowbalance();
|
|
|
- updateAuditSubledeger(det.getVd_slid(),nowbalanceDet);
|
|
|
+ updateResAuditSubledeger(det.getVd_slid(),nowbalanceDet);
|
|
|
}
|
|
|
for(Verificationdetail detail : items2){
|
|
|
Double nowbalanceDet = detail.getVcd_nowbalance()==null?new Double(0):detail.getVcd_nowbalance();
|
|
|
- updateAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
|
|
|
+ updateResAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
|
|
|
}
|
|
|
|
|
|
Verification verification = new Verification();
|
|
|
@@ -726,9 +710,9 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
customer.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
customer.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
customer.setUpdateTime(new Date());
|
|
|
- customer.setCu_preamount(preamount-amount1);
|
|
|
+ customer.setCu_preamount(preamount+amount1);
|
|
|
customer.setCu_recamount(recamount+amount2);
|
|
|
- customer.setCu_leftamount(beginapamount-beginprepayamount+recamount+amount2-preamount+amount1);
|
|
|
+ customer.setCu_leftamount(beginapamount-beginprepayamount+recamount+amount2-preamount-amount1);
|
|
|
recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
|
|
|
}else if(kind.equals("receivable_offset_payable")){
|
|
|
Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(verificationDTO.getVc_custid());
|
|
|
@@ -812,8 +796,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
vendor.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
vendor.setUpdateTime(new Date());
|
|
|
vendor.setVe_preamount(preamount+amount1);
|
|
|
- vendor.setVe_payamount(payamount-amount2);
|
|
|
- vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amount2-preamount-amount1);
|
|
|
+ vendor.setVe_payamount(payamount+amount2);
|
|
|
+ vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+amount2-preamount-amount1);
|
|
|
paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
|
|
|
}else if(kind.equals("receivable_offset_payable")){
|
|
|
Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(verificationDTO.getVc_vendid());
|
|
|
@@ -857,8 +841,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
|
|
|
newVendorIn.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
newVendorIn.setUpdaterName(BaseContextHolder.getUserName());
|
|
|
newVendorIn.setUpdateTime(new Date());
|
|
|
- newVendorIn.setVe_payamount(payamountIn+amount1);
|
|
|
- newVendorIn.setVe_leftamount(beginapamountIn-beginprepayamountIn+payamountIn+amount1-preamountIn);
|
|
|
+ newVendorIn.setVe_payamount(payamountIn-amount1);
|
|
|
+ newVendorIn.setVe_leftamount(beginapamountIn-beginprepayamountIn+payamountIn-amount1-preamountIn);
|
|
|
paybalanceMapper.updateVendorByPrimaryKeySelective(newVendorIn);
|
|
|
|
|
|
Vendor newVendorOut = new Vendor();
|