|
@@ -302,7 +302,14 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
|
paymentManagement1.setSettlementDate(new Date());
|
|
|
//未付
|
|
|
paymentManagement1.setAmountNotPayable(paymentManagement.getAmountIngPayable() - paymentManagement1.getAmountEdPayable());
|
|
|
- this.openAuditFlow(paymentManagement1);
|
|
|
+ if ("1".equals(paymentManagement1.getReverseFlag())){
|
|
|
+ paymentManagement1.setReverseFlag("0");
|
|
|
+ this.updateById(paymentManagement1);
|
|
|
+ workflowService.activateInstance(paymentManagement.getWorkflowId(),paymentManagement.getId());
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.openAuditFlow(paymentManagement1);
|
|
|
+ }
|
|
|
//查询关联流转记录
|
|
|
QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
|
|
|
.eq("relation_id", paymentManagement1.getRelationId())
|
|
@@ -625,6 +632,9 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String editCollect(PaymentManagement paymentManagement) {
|
|
|
+ if ("1".equals(paymentManagement.getReverseFlag())){
|
|
|
+ paymentManagement.setReverseFlag("0");
|
|
|
+ }
|
|
|
boolean one = this.updateById(paymentManagement);
|
|
|
if (one) {
|
|
|
return "OK";
|
|
@@ -744,6 +754,31 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
|
return taskIdNull;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 反结算
|
|
|
+ * @param paymentManagement
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String ReSettlement(PaymentManagement paymentManagement) {
|
|
|
+ workflowService.suspendInstance(paymentManagement.getWorkflowId(), paymentManagement.getId());
|
|
|
+ paymentManagement.setReverseFlag("1");
|
|
|
+ this.updateById(paymentManagement);
|
|
|
+ WarehouseInOutInfo warehouseInOutInfo=warehouseInOutInfoService.selectOne(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
+ .eq("payment_id",paymentManagement.getId()));
|
|
|
+ if (warehouseInOutInfo!=null){
|
|
|
+ WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
|
|
|
+ .eq("position_id", warehouseInOutInfo.getPositionId())
|
|
|
+ .eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
|
|
|
+ if (warehousePositionStorageInfo!=null){
|
|
|
+ warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage()-warehouseInOutInfo.getNetWeight());
|
|
|
+ warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
|
|
|
+ }
|
|
|
+ warehouseInOutInfoService.deleteById(warehouseInOutInfo.getId());
|
|
|
+ }
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private List<String> getResourceIdList() {
|
|
|
User currentUser = AuthSecurityUtils.getCurrentUserInfo();
|