zhangyuewww 3 anos atrás
pai
commit
061808c7c8

+ 13 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ExpenseInfo.java

@@ -139,6 +139,14 @@ public class ExpenseInfo extends BaseModel<ExpenseInfo> {
      * 附件地址
      */
     private String addressUrl;
+    /**
+     * 驳回原因
+     */
+    private String rejectionReason;
+    /**
+     * 原因
+     */
+    private String reason;
     /**
      * 备注
      */
@@ -169,6 +177,11 @@ public class ExpenseInfo extends BaseModel<ExpenseInfo> {
      * 审核状态英文
      */
     private String approveStatusEn;
+    /**
+     * 合计分配
+     */
+    @TableField(exist = false)
+    private Double totalDistribution;
     /**
      * 工作流ID
      */

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehousingOrder.java

@@ -226,6 +226,11 @@ public class WarehousingOrder extends BaseModel<WarehousingOrder> {
     private Date endDate;
     @TableField(exist = false)
     private List<WarehousingOrder> warehousingOrderList;
+    /**
+     * 费用分配列表
+     */
+    @TableField(exist = false)
+    private List<ExpenseAllocationInfo> expenseAllocationInfoList;
 
     @Override
     protected Serializable pkVal() {

+ 24 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ExpenseInfoServiceImpl.java

@@ -143,6 +143,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
         {
             expenseInfo.setStatusFlag(StatusEnum.COST_PAYMENT.getFlag());
             expenseInfo.setStatus(StatusEnum.COST_PAYMENT.getName());
+            expenseInfo.setUnallocatedAmount(expenseInfo.getAmountMoney()-expenseInfo.getTotalDistribution());
             this.insert(expenseInfo);
             //分配列表
             List<ExpenseAllocationInfo> expenseAllocationInfoList = expenseInfo.getExpenseAllocationInfoList();
@@ -164,7 +165,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
             // 不是退回的单子
             if (isStartWorkflow) {
                 Workflow workflow = workflowService
-                        .findLatestWorkflowByBusinessCodeByApp(expenseInfo.getCompId(), "EX-CONTRACT-APPROVE");
+                        .findLatestWorkflowByBusinessCodeByApp(expenseInfo.getCompId(), "FEE_DETAILS_MANG");
                 // 没配置审核流程,直接结束并处理信息
                 if (workflow == null) {
                     throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
@@ -214,7 +215,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
             }
         }
         //编辑分配
-        else {
+        else if ("3".equals(expenseInfo.getFlag())){
             List<ExpenseAllocationInfo> expenseAllocationInfoList = expenseInfo.getExpenseAllocationInfoList();
             if (!CollectionUtils.isEmpty(expenseAllocationInfoList)) {
                 for (ExpenseAllocationInfo expenseAllocationInfo : expenseAllocationInfoList) {
@@ -222,7 +223,27 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
                 }
             }
         }
-
+        //主表编辑 flag==4
+        //驳回分配
+        else if ("5".equals(expenseInfo.getFlag())){
+            expenseInfo.setDistributionStatusFlag(StatusEnum.REJECTED.getFlag());
+            expenseInfo.setDistributionStatus(StatusEnum.REJECTED.getName());
+            List<ExpenseAllocationInfo> expenseAllocationInfos=expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
+                    .eq("info_id",expenseInfo.getId())
+                    .eq("status","待确认"));
+            if (!CollectionUtils.isEmpty(expenseAllocationInfos)){
+                for (ExpenseAllocationInfo expenseAllocationInfo:expenseAllocationInfos){
+                    expenseAllocationInfo.setStatusFlag(StatusEnum.REJECTED.getFlag());
+                    expenseAllocationInfo.setStatus(StatusEnum.REJECTED.getName());
+                    expenseAllocationInfoService.updateById(expenseAllocationInfo);
+                }
+            }
+        }
+        //驳回收款
+        else if ("6".equals(expenseInfo.getFlag())) {
+            expenseInfo.setStatusFlag(StatusEnum.REJECTED.getFlag());
+            expenseInfo.setStatus(StatusEnum.REJECTED.getName());
+        }
         // 主表信息编辑
         boolean one = this.updateById(expenseInfo);
         // 假如成功返回ok

+ 7 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java

@@ -68,6 +68,8 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
     private IQualityInspectionManagementService qualityInspectionManagementService;
     @Autowired
     private ICommonBillOperateHisService billOperateHisService;
+    @Autowired
+    private IExpenseAllocationInfoService expenseAllocationInfoService;
 
     /**
      * 添加/编辑出库选择货源
@@ -140,6 +142,11 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
         List<WarehousingOrder> dataList = baseMapper.getListByCondition(pageView);
         if (!CollectionUtils.isEmpty(dataList)) {
             dataList.forEach(warehousingOrder1 -> {
+                List<ExpenseAllocationInfo> expenseAllocationInfos=expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
+                .eq("order_id",warehousingOrder1.getId()));
+                if(!CollectionUtils.isEmpty(expenseAllocationInfos)){
+                    warehousingOrder1.setExpenseAllocationInfoList(expenseAllocationInfos);
+                }
                 String taskId = "";
                 // 只有待审核状态才有taskId
                 if (StringUtils.isNotBlank(warehousingOrder1.getWorkflowId())) {