Sfoglia il codice sorgente

1、付款管理审核流 2.客户只能选已通过状态的3.根据仓库id货名差收购设置数据

zhangyuewww 3 anni fa
parent
commit
9f6a64d3e2

+ 3 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java

@@ -122,6 +122,9 @@ public enum StatusEnum {
     WEIGHED_GROSS_WEIGHT("3", "已称毛重", "weighedgrossweight"),
     TARED("5", "已称皮重", "tared"),
 
+    //付款管理状态
+    TO_BE_SETTLED("1", "待结算", "to_be_settled"),
+
     ;
     @Getter
     private String flag;

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

@@ -126,6 +126,8 @@ public class WarehouseBaseInfo extends BaseModel<WarehouseBaseInfo> {
      */
     @TableField(exist = false)
     private Integer count;
+    @TableField(exist = false)
+    private List<PurchasePrice> purchasePriceList;
 
 
     @Override

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

@@ -218,6 +218,11 @@ public class WeighingManagement extends BaseModel<WeighingManagement> {
      */
     @TableField(exist = false)
     private String personPhone;
+    /**
+     * 仓库id
+     */
+    @TableField(exist = false)
+    private String warehouseId;
 
 
     @Override

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

@@ -444,6 +444,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
         Map<String, Object> pageView = new HashMap<>();
         //公司id
         pageView.put("compId", identityAuthenticationInfo.getCompId());
+        pageView.put("authenticationStatusKey", identityAuthenticationInfo.getAuthenticationStatusKey());
         List<IdentityAuthenticationInfo> dataList = this.baseMapper.getIdentityInfoByCondition(pageView);
         return dataList;
     }

+ 52 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java

@@ -9,8 +9,11 @@ import com.winsea.svc.base.base.entity.CommonRoleResource;
 import com.winsea.svc.base.base.service.ICommonRoleResourceService;
 import com.winsea.svc.base.security.entity.User;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
+import com.winsea.svc.base.workflow.entity.Workflow;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.PaymentManagementMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPaymentManagementService;
@@ -60,7 +63,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
                 * paymentManagement.getPageSize());
         List<String> businessKeys = null;
         if ("1".equals(paymentManagement.getSearchType())) {
-            businessKeys = workflowService.getTaskBusinessKeysByCode("PROCUREMENT-RECEIPT-REPORT");
+            businessKeys = workflowService.getTaskBusinessKeysByCode("PAYMENT-MANAGEMENT-APPROVE");
         }
         List<String> statusSet = new ArrayList<>();
         List<String> resourceIdList = this.getResourceIdList();
@@ -126,7 +129,31 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
      */
     @Override
     public String editInfo(PaymentManagement paymentManagement) {
+        PaymentManagement paymentManagement1=this.selectById(paymentManagement.getId());
         this.updateById(paymentManagement);
+        boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(paymentManagement.getWorkflowId());
+        // 不是退回的单子
+        if (isStartWorkflow) {
+            Workflow workflow = workflowService
+                    .findLatestWorkflowByBusinessCodeByApp(paymentManagement1.getCompId(), "PAYMENT-MANAGEMENT-APPROVE");
+            // 没配置审核流程,直接结束并处理信息
+            if (workflow == null) {
+                throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+            }
+            // 开启审核流
+            else {
+
+                // 设置状态 已提交审核
+                paymentManagement1.setWorkflowId(workflow.getId());
+                this.updateById(paymentManagement1);
+                workflowService.startInstance(workflow.getId(), paymentManagement1.getId());
+            }
+        }
+        // 退回的单子 再启用
+        else {
+            this.updateById(paymentManagement1);
+            workflowService.activateInstance(paymentManagement1.getWorkflowId(), paymentManagement1.getId());
+        }
         return "OK";
     }
 
@@ -194,6 +221,30 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         }
     }
 
+    @Override
+    public Float cumulant(PaymentManagement paymentManagement) {
+        Float cumulant=0.0f;
+        List<PaymentManagement> paymentManagementList = this.selectList(new EntityWrapper<PaymentManagement>()
+        .eq("goods_name",paymentManagement.getGoodsName())
+        .eq("customer_name",paymentManagement.getCustomerName())
+        .eq("comp_id",paymentManagement.getCompId()));
+        if (!CollectionUtils.isEmpty(paymentManagementList)){
+            Float netWeight = 0f;
+            for (PaymentManagement paymentManagement1:paymentManagementList){
+                //干粮净重
+                if ("干粮".equals(paymentManagement1.getType())){
+                    netWeight=paymentManagement1.getNetWeight();
+                }
+                //潮粮纯重
+                else {
+                    netWeight=paymentManagement1.getPureWeight();
+                }
+            }
+            cumulant=cumulant+netWeight;
+        }
+        return cumulant;
+    }
+
 
     private List<String> getResourceIdList() {
         User currentUser = AuthSecurityUtils.getCurrentUserInfo();

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

@@ -50,6 +50,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
     private IPurchaseOrderService purchaseOrderService;
     @Autowired
     private ISaleOrderService saleOrderService;
+    @Autowired
+    private IPurchasePriceService purchasePriceService;
 
     /**
      * 仓库管理页面列表
@@ -716,6 +718,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 .eq("delete_flag", "0"));
         if (!CollectionUtils.isEmpty(warehouseBaseInfoList)){
             for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList) {
+                //查潮粮单价已审核的数据
+                List<PurchasePrice> purchasePriceList=purchasePriceService.selectList(new EntityWrapper<PurchasePrice>()
+                        .eq("warehouse_id",warehouseBaseInfo.getId())
+                        .eq("status_flag","3"));
+                if (!CollectionUtils.isEmpty(purchasePriceList)){
+                    warehouseBaseInfo.setPurchasePriceList(purchasePriceList);
+                }
                 Map<String, Object> pageView = new HashMap<>();
                 pageView.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                 pageView.put("compId", warehouseBaseInfo.getCompId());

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/IdentityAuthenticationInfoMapper.xml

@@ -33,6 +33,9 @@
             AND (lower(a.customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(a.customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
+        <if test="authenticationStatusKey != null and authenticationStatusKey != ''">
+            a.authentication_status_key=#{authenticationStatusKey}
+        </if>
         ORDER BY a.update_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}
@@ -56,5 +59,8 @@
             AND (lower(a.customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(a.customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
+        <if test="authenticationStatusKey != null and authenticationStatusKey != ''">
+            a.authentication_status_key=#{authenticationStatusKey}
+        </if>
     </select>
 </mapper>

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml

@@ -50,6 +50,7 @@
         payment_no as paymentNo,
         goods_name as goodsName,
         car_no as carNo,
+        type,
         net_weight as netWeight,
         pure_weight as pureWeight,
         tidal_grain_price as tidalGrainPrice,

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/QualityInspectionManagementMapper.xml

@@ -23,6 +23,7 @@
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.QualityInspectionManagement">
         SELECT
         q.id,
+        q.type,
         q.quality_no as qualityNo,
         q.contract_no as contractNo,
         q.customer_name as customerName,

+ 3 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WeighingManagementMapper.xml

@@ -11,7 +11,7 @@
             AND (lower(number) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(customer) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(car_number) like lower(CONCAT('%',#{searchKeyWord},'%'))
-            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="warehouseName != null and warehouseName != ''">
             AND warehouse_name= #{warehouseName}
@@ -24,6 +24,7 @@
         id,
         number,
         customer,
+        type,
         contract_no as contractNo,
         car_number as carNumber,
         relation_id as relationId,
@@ -44,7 +45,7 @@
             AND (lower(number) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(customer) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(car_number) like lower(CONCAT('%',#{searchKeyWord},'%'))
-            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="warehouseName != null and warehouseName != ''">
             AND warehouse_name= #{warehouseName}