Преглед изворни кода

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun

ccj пре 3 година
родитељ
комит
e8635a0343
21 измењених фајлова са 809 додато и 28 уклоњено
  1. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java
  2. 12 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PaymentManagementController.java
  3. 64 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/StockPurchaseReceiptReportController.java
  4. 17 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java
  5. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/PaymentManagement.java
  6. 153 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/StockPurchaseReceiptReport.java
  7. 2 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WeighingManagement.java
  8. 36 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/StockPurchaseReceiptReportMapper.java
  9. 9 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IPaymentManagementService.java
  10. 43 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IStockPurchaseReceiptReportService.java
  11. 16 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/IdentityAuthenticationInfoServiceImpl.java
  12. 45 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java
  13. 22 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchasePriceServiceImpl.java
  14. 164 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/StockPurchaseReceiptReportServiceImpl.java
  15. 43 12
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java
  16. 16 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java
  17. 2 2
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/IdentityAuthenticationInfoMapper.xml
  18. 25 4
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml
  19. 22 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PurchasePriceMapper.xml
  20. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/QualityInspectionManagementMapper.xml
  21. 107 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StockPurchaseReceiptReportMapper.xml

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java

@@ -53,7 +53,7 @@ public class GeneratorCodeByTables {
     }
 
     public static void main(String[] args) throws IOException {
-        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","quality_inspection_management");
+        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","stock_purchase_receipt_report");
     }
 
     /**

+ 12 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PaymentManagementController.java

@@ -2,12 +2,15 @@ package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
 import com.yh.saas.plugin.yiliangyiyun.service.IPaymentManagementService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * <p>
  * 付款管理 前端控制器
@@ -46,6 +49,15 @@ public class PaymentManagementController {
     public String payMoney(@RequestBody PaymentManagement paymentManagement){
         return paymentManagementService.payMoney(paymentManagement);
     }
+    /**
+     * 合同编号下拉列表
+     * @param compId
+     * @return
+     */
+    @GetMapping("/selectContractNoList")
+    public List<ContractManagementInfo> selectContractNoList(String compId) {
+        return paymentManagementService.selectContractNoList(compId);
+    }
     /**
      * 收款
      * @param paymentManagement

+ 64 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/StockPurchaseReceiptReportController.java

@@ -0,0 +1,64 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StockPurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
+import com.yh.saas.plugin.yiliangyiyun.service.IStockPurchaseReceiptReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 现货采购入库报表 前端控制器
+ * </p>
+ *
+ * @author Gdc
+ * @since 2021-09-17
+ */
+@RestController
+@RequestMapping("/stockPurchaseReceiptReport")
+public class StockPurchaseReceiptReportController {
+
+    @Autowired
+    private IStockPurchaseReceiptReportService stockPurchaseReceiptReportService;
+    /**
+     * 采购入库统计列表
+     * @param stockPurchaseReceiptReport
+     * @return
+     */
+    @GetMapping("/selectPurchaseOrder")
+    public Page<StockPurchaseReceiptReport> selectPurchaseOrder(StockPurchaseReceiptReport stockPurchaseReceiptReport){
+        return stockPurchaseReceiptReportService.selectPurchaseOrder(stockPurchaseReceiptReport);
+    }
+
+
+    /**
+     * 定金/备注
+     *
+     * @param contractManagementInfo
+     * @return
+     */
+    @PostMapping("/api/disAndRemark")
+    public  String disAndRemark(ContractManagementInfo contractManagementInfo){
+        return stockPurchaseReceiptReportService.disAndRemark(contractManagementInfo);
+    }
+
+
+
+    /**
+     * 修改结算重量
+     *
+     * @param stockPurchaseReceiptReport
+     * @return
+     */
+    @PostMapping("/api/edit")
+    public  String edit(StockPurchaseReceiptReport stockPurchaseReceiptReport){
+        return stockPurchaseReceiptReportService.edit(stockPurchaseReceiptReport);
+    }
+
+
+}
+

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

@@ -167,6 +167,18 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
      * 验收方式
      */
     private String acceptanceMethod;
+    /**
+     * 定金
+     */
+    private String deposit;
+    /**
+     * 定金路径
+     */
+    private String depositUrl;
+    /**
+     * 统计备注
+     */
+    private String remark;
     /**
      * 溢短装
      */
@@ -318,6 +330,11 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
      */
     @TableField(exist = false)
     private String reportStatus;
+    /**
+     * 收款列表状态
+     */
+    @TableField(exist = false)
+    private String listStatus;
 
 
     @Override

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

@@ -303,6 +303,11 @@ public class PaymentManagement extends BaseModel<PaymentManagement> {
      */
     @TableField(exist = false)
     private String pcFlag;
+    /**
+     * 合同价格/移库任务价格
+     */
+    @TableField(exist = false)
+    private Float contractPrice;
 
     @Override
     protected Serializable pkVal() {

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

@@ -0,0 +1,153 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import java.util.Date;
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 现货采购入库报表
+ * </p>
+ *
+ * @author Gdc
+ * @since 2021-09-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("stock_purchase_receipt_report")
+public class StockPurchaseReceiptReport extends BaseModel<StockPurchaseReceiptReport> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 合同编号
+     */
+    private String contractNo;
+    /**
+     * 车牌号
+     */
+    private String carNo;
+    /**
+     * 入库日期
+     */
+    private Date warehousingDate;
+    /**
+     * 净重(吨)
+     */
+    private Float netWeight;
+    /**
+     * 毛重(吨)
+     */
+    private Float grossWeight;
+    /**
+     * 皮重(吨)
+     */
+    private Float tare;
+    /**
+     * 扣重(吨)
+     */
+    private Float deductionWeight;
+    /**
+     * 结算重量(吨)
+     */
+    private Float settlementWeight;
+    /**
+     * 应付金额(元/吨)
+     */
+    private Float amountIngPayable;
+    /**
+     * 已付金额(元/吨)
+     */
+    private Float amountEdPayable;
+    /**
+     * 未付金额(元/吨)
+     */
+    private Float amountNotPayable;
+    /**
+     * 付款截图
+     */
+    private String paymentScreenshot;
+    /**
+     * 付款日期
+     */
+    private Date paymentDate;
+    /**
+     * 已开发票(元)
+     */
+    private Float alreadyInvoice;
+    /**
+     * 库点
+     */
+    private String warehouseName;
+    /**
+     * 状态标识
+     */
+    private String statusFlag;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 状态英文
+     */
+    private String statusEn;
+    /**
+     * 审核状态
+     */
+    private String approveStatus;
+    /**
+     * 审核流id
+     */
+    private String workflowId;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 模糊查询
+     */
+    @TableField(exist = false)
+    private String searchKeyWord;
+
+    /**
+     *查询类型
+     */
+    @TableField(exist = false)
+    private String searchType;
+    /**
+     *付款金额
+     */
+    @TableField(exist = false)
+    private Float money;
+
+    @TableField(exist = false)
+    private String taskId;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

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

@@ -246,7 +246,8 @@ public class WeighingManagement extends BaseModel<WeighingManagement> {
      */
     @TableField(exist = false)
     private QualityInspectionManagement qualityInspectionManagement;
-
+    @TableField(exist = false)
+    private PaymentManagement paymentManagement;
 
     @Override
     protected Serializable pkVal() {

+ 36 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/StockPurchaseReceiptReportMapper.java

@@ -0,0 +1,36 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StockPurchaseReceiptReport;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 现货采购入库报表 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2021-09-17
+ */
+public interface StockPurchaseReceiptReportMapper extends BaseMapper<StockPurchaseReceiptReport> {
+
+
+    /**
+     * 根据条件查询采购入库他统计总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询采购入库统计列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<StockPurchaseReceiptReport> getListByCondition(Map<String, Object> pageView);
+}

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

@@ -1,9 +1,12 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 付款管理 服务类
@@ -50,6 +53,12 @@ public interface IPaymentManagementService extends IService<PaymentManagement> {
      * @param paymentManagement
      */
     String editCollect(PaymentManagement paymentManagement);
+    /**
+     * 合同编号下拉列表
+     *
+     * @param compId
+     */
+    List<ContractManagementInfo> selectContractNoList(String compId);
 
     /**
      * 删除

+ 43 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IStockPurchaseReceiptReportService.java

@@ -0,0 +1,43 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StockPurchaseReceiptReport;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 现货采购入库报表 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2021-09-17
+ */
+public interface IStockPurchaseReceiptReportService extends IService<StockPurchaseReceiptReport> {
+
+    /**
+     * 采购入库统计
+     *
+     * @param stockPurchaseReceiptReport
+     * @return
+     */
+    Page<StockPurchaseReceiptReport> selectPurchaseOrder(StockPurchaseReceiptReport stockPurchaseReceiptReport);
+
+    /**
+     * 定金/备注
+     *
+     * @param contractManagementInfo
+     * @return
+     */
+    String disAndRemark(ContractManagementInfo contractManagementInfo);
+
+
+    /**
+     * 修改结算重量
+     *
+     * @param stockPurchaseReceiptReport
+     * @return
+     */
+    String edit(StockPurchaseReceiptReport stockPurchaseReceiptReport);
+
+}

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

@@ -68,6 +68,16 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
         }
         Page<IdentityAuthenticationInfo> recommendedIdentityAuthenticationInfoPage = this.selectPage(identityAuthenticationInfo.getQueryPage(), identityAuthenticationInfoWrapper);
         List<IdentityAuthenticationInfo> identityAuthenticationInfoList = recommendedIdentityAuthenticationInfoPage.getRecords();
+        if (CollectionUtils.isNotEmpty(identityAuthenticationInfoList)){
+            for (IdentityAuthenticationInfo identityAuthenticationInfo1:identityAuthenticationInfoList){
+                CommonCompanyIdentity commonCompanyIdentity = iCommonCompanyIdentityService.selectOne(new EntityWrapper<CommonCompanyIdentity>()
+                        .eq("com_id", identityAuthenticationInfo1.getCompId()).eq("identity_id", identityAuthenticationInfo1.getId()));
+                if (commonCompanyIdentity!=null){
+                    identityAuthenticationInfo1.setAuthenticationStatus("已接受");
+                }
+
+            }
+        }
         recommendedIdentityAuthenticationInfoPage.setRecords(identityAuthenticationInfoList);
         return recommendedIdentityAuthenticationInfoPage;
     }
@@ -120,8 +130,13 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
         // 根据传参手机号判断手机号是否存在
         //  空是新增
         identityAuthenticationInfo.setId(IdGenerator.generateUUID());
+        //中天昊元创建的客户不需审核
+        if(identityAuthenticationInfo.getCompId()!=null&&"2710b21efc1e4393930c5dc800010dc4".equals(identityAuthenticationInfo.getCompId())){
+            identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
+            identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
+        }
         //粮农身份不需审核
-        if ("3".equals(identityAuthenticationInfo.getCustomerTypeFlag())) {
+        else if ("3".equals(identityAuthenticationInfo.getCustomerTypeFlag())) {
             identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
             identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
         } else {

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

@@ -52,6 +52,8 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
     private ICommonCompanyService commonCompanyService;
     @Autowired
     private IIdentityAuthenticationInfoService iIdentityAuthenticationInfoService;
+    @Autowired
+    private IContractManagementInfoService ContractManagementInfoService;
 
 
     /**
@@ -82,6 +84,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         pageView.put("pageSize", paymentManagement.getPageSize());
         pageView.put("warehouseName",paymentManagement.getWarehouseName());
         pageView.put("customerPhone",paymentManagement.getCustomerPhone());
+        pageView.put("contractNo", paymentManagement.getContractNo());
         pageView.put("currentPage", paymentManagement.getCurrentPage());
         pageView.put("managementType",paymentManagement.getManagementType());
         pageView.put("businessKeys", businessKeys);
@@ -97,6 +100,11 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
                 if (commonCompany!=null){
                     paymentManagement1.setCompName(commonCompany.getCompName());
                 }
+                WeighingManagement weighingManagement = weighingManagementService.selectOne(new EntityWrapper<WeighingManagement>()
+                        .eq("relation_id", paymentManagement1.getRelationId()));
+                if (weighingManagement!=null){
+                    paymentManagement1.setContractPrice(weighingManagement.getContractPrice());
+                }
                 String taskId = "";
                 // 只有待审核状态才有taskId
                 if (StringUtils.isNotBlank(paymentManagement1.getWorkflowId())) {
@@ -154,7 +162,8 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
     @Transactional(rollbackFor = Exception.class)
     public String editInfo(PaymentManagement paymentManagement) {
         PaymentManagement paymentManagement1=this.selectById(paymentManagement.getId());
-        paymentManagement.setAmountIngPayable(paymentManagement.getActualPayment());
+        //未付
+        paymentManagement.setAmountNotPayable(paymentManagement.getAmountIngPayable()-paymentManagement1.getAmountEdPayable());
         this.openAuditFlow(paymentManagement1);
         this.updateById(paymentManagement);
         return "OK";
@@ -244,6 +253,41 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         }
         return "OK";
     }
+    /**
+     * 合同编号下拉列表
+     *
+     * @param compId
+     */
+    @Override
+    public List<ContractManagementInfo> selectContractNoList(String compId) {
+        //查销售合同
+        List<ContractManagementInfo> contractManagementInfoList = ContractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+                .eq("comp_id", compId)
+                .eq("contract_type", "1")
+                .eq("delete_flag", "0")
+                .orderBy("update_date", false));
+        for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
+//            Float money = 0.0f;
+            Float collectMoney = 0.0f;
+            //查收款管理列表
+            List<PaymentManagement> paymentManagementList = this.selectList(new EntityWrapper<PaymentManagement>()
+                    .eq("contract_no", contractManagementInfo.getContractNo())
+                    .eq("delete_flag", "0"));
+            if (!CollectionUtils.isEmpty(paymentManagementList)) {
+                for (PaymentManagement paymentManagement : paymentManagementList) {
+//                    money = money + paymentManagement.getAmountNotPayable();money > 0 ||
+                    collectMoney = collectMoney + paymentManagement.getAmountNotCollectable();
+                }
+                //有未付/未收金额
+                if ( collectMoney > 0) {
+                    contractManagementInfo.setListStatus("待付款");
+                } else {
+                    contractManagementInfo.setListStatus("已付款");
+                }
+            }
+        }
+        return contractManagementInfoList;
+    }
     /**
      * 添加备注
      * @param paymentManagement

+ 22 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchasePriceServiceImpl.java

@@ -1,9 +1,14 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.alipay.sofa.runtime.api.annotation.SofaReference;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
+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.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
@@ -19,9 +24,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -42,6 +49,8 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
     private IWarehouseBaseInfoService warehouseBaseInfoService;
     @Autowired
     private INewWorkflowService workflowService;
+    @SofaReference
+    private ICommonRoleResourceService roleResourceService;
     @Override
     public Page<PurchasePrice> purchasePriceList(PurchasePrice purchasePrice) {
 
@@ -49,11 +58,17 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
         pageView.put("startRecord", (purchasePrice.getCurrentPage() - 1)
                 * purchasePrice.getPageSize());
         //公司id
+        List<String> statusSet = new ArrayList<>();
+        List<String> resourceIdList = this.getResourceIdList();
+        if (resourceIdList.contains("procurementInReport-Edit")) { // 填写,提交    权限做完以后替换
+            List<String> statusList = Lists.newArrayList(StatusEnum.PUR_RETURN.getFlag());
+            statusSet.addAll(statusList);
+        }
         pageView.put("compId", purchasePrice.getCompId());
         pageView.put("warehouseId", purchasePrice.getWarehouseId());
         pageView.put("pageSize", purchasePrice.getPageSize());
         pageView.put("currentPage", purchasePrice.getCurrentPage());
-
+        pageView.put("statusSet", statusSet);
         List<PurchasePrice> dataList = this.baseMapper.purchasePriceList(pageView);
 
 
@@ -78,6 +93,12 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
         page.setSize(purchasePrice.getPageSize());
         return page;
     }
+    private List<String> getResourceIdList() {
+        User currentUser = AuthSecurityUtils.getCurrentUserInfo();
+        // 当前登录人主要角色
+        return roleResourceService.getBindResourcesByUserId(currentUser.getUserId()).stream()
+                .map(CommonRoleResource::getResourceId).collect(Collectors.toList());
+    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -113,7 +134,6 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
                     tmp.setMainId(mainId);
                     this.purchasePriceDetailPrintService.insert(tmp);
                 }
-                return "ok";
             } catch (Exception e) {
                 System.out.println("新增收购价格异常:" + e.toString());
             }

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

@@ -0,0 +1,164 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.sofa.runtime.api.annotation.SofaReference;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
+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.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StockPurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StockPurchaseReceiptReportMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
+import com.yh.saas.plugin.yiliangyiyun.service.IStockPurchaseReceiptReportService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 现货采购入库报表 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2021-09-17
+ */
+@Service
+public class StockPurchaseReceiptReportServiceImpl extends ServiceImpl<StockPurchaseReceiptReportMapper, StockPurchaseReceiptReport> implements IStockPurchaseReceiptReportService {
+
+
+    @Autowired
+    private INewWorkflowService workflowService;
+
+    @SofaReference
+    private ICommonRoleResourceService roleResourceService;
+    @Autowired
+    private IContractManagementInfoService contractManagementInfoService;
+
+
+    /**
+     * 采购入库统计
+     *
+     * @param stockPurchaseReceiptReport
+     * @return
+     */
+    @Override
+    public Page<StockPurchaseReceiptReport> selectPurchaseOrder(StockPurchaseReceiptReport stockPurchaseReceiptReport) {
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (stockPurchaseReceiptReport.getCurrentPage() - 1)
+                * stockPurchaseReceiptReport.getPageSize());
+        List<String> businessKeys = null;
+        if ("1".equals(stockPurchaseReceiptReport.getSearchType())) {
+            businessKeys = workflowService.getTaskBusinessKeysByCode("STOCK-PROCUREMENT-RECEIPT-REPORT");
+        }
+        List<String> statusSet = new ArrayList<>();
+        List<String> resourceIdList = this.getResourceIdList();
+        if (resourceIdList.contains("procurementStockInReport-Edit")) { // 填写,提交    权限做完以后替换
+            List<String> statusList = Lists.newArrayList(StatusEnum.PUR_RETURN.getFlag());
+            statusSet.addAll(statusList);
+        }
+        //公司id
+        pageView.put("compId", stockPurchaseReceiptReport.getCompId());
+        pageView.put("searchKeyWord", stockPurchaseReceiptReport.getSearchKeyWord());
+        pageView.put("searchType", stockPurchaseReceiptReport.getSearchType());
+        pageView.put("pageSize", stockPurchaseReceiptReport.getPageSize());
+        pageView.put("currentPage", stockPurchaseReceiptReport.getCurrentPage());
+        pageView.put("contractNo", stockPurchaseReceiptReport.getContractNo());
+        pageView.put("statusFlag", stockPurchaseReceiptReport.getStatusFlag());
+        pageView.put("businessKeys", businessKeys);
+        pageView.put("statusSet", statusSet);
+        // 查询采购入库总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<StockPurchaseReceiptReport> dataList = baseMapper.getListByCondition(pageView);
+        if (!CollectionUtils.isEmpty(dataList)) {
+            dataList.forEach(purchaseReceiptReport1 -> {
+
+                String taskId = "";
+                // 只有待审核状态才有taskId
+                if (StringUtils.isNotBlank(purchaseReceiptReport1.getWorkflowId())) {
+                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(purchaseReceiptReport1.getWorkflowId()), purchaseReceiptReport1.getId());
+                    taskId = jsonObject.getString("taskId");
+                    purchaseReceiptReport1.setTaskId(taskId);
+                }
+            });
+
+        }
+        Page<StockPurchaseReceiptReport> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(stockPurchaseReceiptReport.getCurrentPage());
+        page.setSize(stockPurchaseReceiptReport.getPageSize());
+        return page;
+    }
+
+
+    /**
+     * 定金/备注
+     *
+     * @param contractManagementInfo
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String disAndRemark(ContractManagementInfo contractManagementInfo) {
+        //查询合同
+        ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectById(contractManagementInfo.getId());
+        if (contractManagementInfo1 != null) {
+            if(StringUtils.isNotBlank(contractManagementInfo.getDeposit())){
+                contractManagementInfo1.setDeposit(contractManagementInfo.getDeposit());
+                contractManagementInfo1.setDepositUrl(contractManagementInfo.getDepositUrl());
+            }
+            if(StringUtils.isNotBlank(contractManagementInfo.getRemark())){
+                contractManagementInfo1.setRemark(contractManagementInfo.getRemark());
+            }
+            //更改采购入库报表信息
+            contractManagementInfoService.updateById(contractManagementInfo1);
+            return "OK";
+        }
+        return "NG";
+    }
+
+
+    /**
+     * 修改结算重量
+     *
+     * @param stockPurchaseReceiptReport
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String edit(StockPurchaseReceiptReport stockPurchaseReceiptReport) {
+        //查询采购入库报表
+        StockPurchaseReceiptReport stockPurchaseReceiptReport1 = this.selectById(stockPurchaseReceiptReport.getId());
+        if (stockPurchaseReceiptReport1 != null) {
+            stockPurchaseReceiptReport1.setSettlementWeight(stockPurchaseReceiptReport.getSettlementWeight());
+            //更改采购入库报表信息
+            this.updateById(stockPurchaseReceiptReport1);
+            return "OK";
+        }
+        return "NG";
+    }
+
+
+    private List<String> getResourceIdList() {
+        User currentUser = AuthSecurityUtils.getCurrentUserInfo();
+        // 当前登录人主要角色
+        return roleResourceService.getBindResourcesByUserId(currentUser.getUserId()).stream()
+                .map(CommonRoleResource::getResourceId).collect(Collectors.toList());
+    }
+
+}

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

@@ -3,6 +3,13 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.fasterxml.jackson.databind.BeanProperty;
+import com.winsea.svc.base.base.entity.CommonRole;
+import com.winsea.svc.base.base.entity.CommonStaff;
+import com.winsea.svc.base.base.entity.CommonStaffRole;
+import com.winsea.svc.base.base.service.ICommonRoleService;
+import com.winsea.svc.base.base.service.ICommonStaffRoleService;
+import com.winsea.svc.base.base.service.ICommonStaffService;
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.common.support.util.StringUtils;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
@@ -54,6 +61,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
     private IPurchasePriceService purchasePriceService;
     @Autowired
     private IContractGoodsInfoService contractGoodsInfoService;
+    @Autowired
+    private ICommonStaffService commonStaffService;
+    @Autowired
+    private ICommonStaffRoleService commonStaffRoleService;
+    @Autowired
+    private ICommonRoleService commonRoleService;
 
     /**
      * 仓库管理页面列表
@@ -735,11 +748,18 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
      */
     @Override
     public List<WarehouseBaseInfo> selectWarehouseSelf(String compId, String personCharge) {
-        List<WarehouseBaseInfo> warehouseBaseInfoList = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
-                .eq("comp_id", compId)
-                .eq("warehouse_type","1")
-                .eq("person_charge", personCharge)
-                .eq("delete_flag", "0"));
+        if(compId == null || compId.isEmpty()){
+            compId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
+        }
+        if(personCharge == null || personCharge.isEmpty()){
+            personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
+        }
+        Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
+                warehouseBaseInfoWrapper.eq("comp_id", compId)
+                .eq("warehouse_type","1").eq("delete_flag", "0");
+        warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
+                .like("other_person_charge", personCharge);
+        List<WarehouseBaseInfo> warehouseBaseInfoList=this.selectList(warehouseBaseInfoWrapper);
         if (!CollectionUtils.isEmpty(warehouseBaseInfoList)){
             for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList) {
                 //查潮粮单价已审核的数据
@@ -758,14 +778,25 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             }
         }
         else {
-            List<WarehouseBaseInfo> warehouseBaseInfoList1 = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
-                    .eq("comp_id", compId)
-                    .eq("warehouse_type","1")
-                    .eq("delete_flag", "0"));
-            for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList1){
-                warehouseBaseInfo.setFlag("全部");
+            String staffId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffId();
+            List<CommonStaffRole> staffRoles = commonStaffRoleService.selectList(new EntityWrapper<CommonStaffRole>().eq("staff_id",staffId));
+            List<CommonRole> list = new ArrayList<>();
+            for(CommonStaffRole commonStaffRole : staffRoles){
+                list.add(commonRoleService.selectById(commonStaffRole.getRoleId()));
+            }
+            for(CommonRole commonRole : list){
+                if(commonRole.getRoleName().equals("决策人") || commonRole.getRoleName().equals("系统管理员")|| commonRole.getRoleName().contains("总")){
+                    List<WarehouseBaseInfo> warehouseBaseInfoList1 = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
+                            .eq("comp_id", compId)
+                            .eq("warehouse_type","1")
+                            .eq("delete_flag", "0"));
+                    for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList1){
+                        warehouseBaseInfo.setFlag("全部");
+                    }
+                    warehouseBaseInfoList=warehouseBaseInfoList1;
+                    return warehouseBaseInfoList;
+                }
             }
-            warehouseBaseInfoList=warehouseBaseInfoList1;
         }
         return warehouseBaseInfoList;
     }

+ 16 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java

@@ -72,6 +72,11 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 if (commonCompany!=null){
                     weighingManagement1.setCompName(commonCompany.getCompName());
                 }
+                PaymentManagement paymentManagement=paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
+                        .eq("relation_id",weighingManagement1.getRelationId()));
+                if(paymentManagement!=null){
+                    weighingManagement1.setPaymentManagement(paymentManagement);
+                }
                 WarehouseBaseInfo warehouseBaseInfo=warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
                         .eq("comp_id",weighingManagement1.getCompId())
                         .eq("warehouse_name",weighingManagement1.getWarehouseName()));
@@ -126,16 +131,20 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 paymentManagement1.setId(IdGenerator.generateUUID());
                 paymentManagement1.setRelationId(weighingManagement1.getRelationId());
                 paymentManagement1.setCompId(weighingManagement1.getCompId());
-                //paymentManagement1.setPaymentNo(weighingManagement1.getNumber());
-                //paymentManagement1.setCustomerName(weighingManagement1.getCustomer());
                 paymentManagement1.setCarNo(weighingManagement1.getCarNumber());
-                //paymentManagement1.setType(weighingManagement1.getType());
                 paymentManagement1.setGoodsName(weighingManagement1.getGoodsName());
+                paymentManagement1.setContractNo(weighingManagement1.getContractNo());
                 paymentManagement1.setGrossWeight(weighingManagement.getGrossWeight());
                 paymentManagement1.setTare(weighingManagement1.getTare());
                 paymentManagement1.setNetWeight(weighingManagement.getNetWeight());
-                //应收
+                //计算应收
                 paymentManagement1.setCalculationCollectable(weighingManagement1.getContractPrice()*weighingManagement.getNetWeight());
+                //实际应收
+                paymentManagement1.setActualCollectionment(paymentManagement1.getCalculationCollectable());
+                //未收
+                paymentManagement1.setAmountNotCollectable(paymentManagement1.getCalculationCollectable());
+                //已收
+                paymentManagement1.setAmountEdCollectionable(0.0f);
                 paymentManagement1.setManagementType("3");
                 paymentManagement1.setWarehouseName(weighingManagement1.getWarehouseName());
                 paymentManagementService.insert(paymentManagement1);
@@ -187,6 +196,7 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 paymentManagement1.setRelationId(weighingManagement1.getRelationId());
                 paymentManagement1.setCompId(weighingManagement1.getCompId());
                 paymentManagement1.setPaymentNo(weighingManagement1.getNumber());
+                paymentManagement1.setContractNo(weighingManagement1.getContractNo());
                 paymentManagement1.setCustomerName(weighingManagement1.getCustomer());
                 paymentManagement1.setCustomerPhone(weighingManagement1.getCustomerPhone());
                 paymentManagement1.setCarNo(weighingManagement1.getCarNumber());
@@ -295,6 +305,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
         qualityInspectionManagement.setCompId(weighingManagement.getCompId());
         qualityInspectionManagement.setGoodsName(weighingManagement.getGoodsName());
         qualityInspectionManagement.setBinNumber(weighingManagement.getBinNumber());
+        qualityInspectionManagement.setStatus(StatusEnum.TARED.getName());
+        qualityInspectionManagement.setStatusFlag(StatusEnum.TARED.getFlag());
         qualityInspectionManagement.setManagementType("3");
         qualityInspectionManagement.setQualityDate(new Date());
         qualityInspectionManagement.setWarehouseName(weighingManagement.getWarehouseName());

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

@@ -34,7 +34,7 @@
             OR lower(a.customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="authenticationStatusKey != null and authenticationStatusKey != ''">
-            a.authentication_status_key=#{authenticationStatusKey}
+            and a.authentication_status_key=#{authenticationStatusKey}
         </if>
         group by
         a.id
@@ -64,7 +64,7 @@
             OR lower(a.customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="authenticationStatusKey != null and authenticationStatusKey != ''">
-            a.authentication_status_key=#{authenticationStatusKey}
+            and a.authentication_status_key=#{authenticationStatusKey}
         </if>
         group by
         a.id) t

+ 25 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml

@@ -10,7 +10,13 @@
         WHERE delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
+                AND status='待结算'
+            </if>
+            <if test="searchType == 3">
+                AND actual_collectionment-amount_ed_collectionable>0
+            </if>
+            <if test="searchType == 4">
+                AND actual_collectionment-amount_ed_collectionable=0
             </if>
         </if>
         <if test="warehouseName != null and warehouseName != ''">
@@ -37,6 +43,9 @@
             </foreach>
             )
         </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="statusSet != null and statusSet.size > 0">
             or (
             <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
@@ -57,8 +66,9 @@
         payment_no as paymentNo,
         goods_name as goodsName,
         car_no as carNo,
+        relation_id as relationId,
         type,
---         contract_no as contractNo,
+        contract_no as contractNo,
         net_weight as netWeight,
         gross_weight as grossWeight,
         tare,
@@ -67,22 +77,30 @@
         solid_grain_price as solidGrainPrice,
         amount_ing_payable as amountIngPayable,
         amount_ed_payable as amountEdPayable,
+        amount_not_payable as amountNotPayable,
+        remarks,
         calculation_collectable as calculationCollectable,
         actual_collectionment as actualCollectionment,
         amount_ed_collectionable as amountEdCollectionable,
+        amount_not_collectable as amountNotCollectable,
         management_type as managementType,
         customer_name as customerName,
         collection_date as collectionDate,
         status,
         approve_status as approveStatus,
         status_flag as statusFlag,
-        car_no as carNo,
         workflow_id as workflowId
         FROM payment_management
         WHERE delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
+                AND status='待结算'
+            </if>
+            <if test="searchType == 3">
+                AND actual_collectionment-amount_ed_collectionable>0
+            </if>
+            <if test="searchType == 4">
+                AND actual_collectionment-amount_ed_collectionable=0
             </if>
         </if>
         <if test="managementType != null and managementType != ''">
@@ -109,6 +127,9 @@
             </foreach>
             )
         </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="statusSet != null and statusSet.size > 0">
             or (
             <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">

+ 22 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PurchasePriceMapper.xml

@@ -13,6 +13,8 @@
         pp.water_max AS waterMax,
         pp.water_base AS waterBase,
         pp.deduct_weight AS deductWeight,
+        pp.dry_grain_price as dryGrainPrice,
+        pp.sale_limit as saleLimit,
         pp.`status`,
         pp.status_flag AS statusFlag,
         pp.pass_date AS passDate
@@ -25,6 +27,16 @@
         <if test="warehouseId != null and warehouseId != ''">
             AND pp.warehouse_id = #{warehouseId}
         </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
         and wbi.delete_flag = '0'
         and pp.delete_flag = '0'
         ORDER BY pp.warehouse_name DESC
@@ -44,6 +56,16 @@
         <if test="warehouseId != null and warehouseId != ''">
             AND pp.warehouse_id = #{warehouseId}
         </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
         and wbi.delete_flag = '0'
         and pp.delete_flag = '0'
         ORDER BY pp.warehouse_name DESC

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

@@ -33,6 +33,11 @@
         q.quality_inspector as qualityInspector,
         q.car_number as carNumber,
         q.goods_name as goodsName,
+        q.grade,
+        q.imperfect_grain as imperfectGrain,
+        q.jiaorenli,
+        q.impurity,
+        q.mildew_grain as mildewGrain,
         q.tidal_grain_price as tidalGrainPrice,
         q.water_content as waterContent,
         q.bin_number as binNumber,

+ 107 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StockPurchaseReceiptReportMapper.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.StockPurchaseReceiptReportMapper">
+
+
+
+    <!-- 获得采购入库统计总数 -->
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM stock_purchase_receipt_report
+        WHERE
+        comp_id = #{compId}
+        and delete_flag = '0'
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
+        <if test="businessKeys != null and businessKeys.size > 0">
+            and(
+            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
+                id = #{businessValue}
+            </foreach>
+            )
+        </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
+    </select>
+    <!-- 获得采购入库统计列表 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport">
+        SELECT
+        id,
+        comp_id as compId,
+        contract_no as contractNo,
+        car_no as carNo,
+        warehousing_date as warehousingDate,
+        net_weight as netWeight,
+        gross_weight as grossWeight,
+        tare as tare,
+        deduction_weight AS deductionWeight,
+        settlement_weight AS settlementWeight,
+        amount_ing_payable as amountIngPayable,
+        amount_ed_payable as amountEdPayable,
+        amount_not_payable as amountNotPayable,
+        payment_screenshot as paymentScreenshot,
+        payment_date as paymentDate,
+        already_invoice as alreadyInvoice,
+        warehouse_name  as warehouseName,
+        status,
+        approve_status as approveStatus,
+        status_flag as statusFlag,
+        approve_status as approveStatus,
+        workflow_id as workflowId
+        FROM stock_purchase_receipt_report
+        WHERE
+        comp_id = #{compId}
+        and delete_flag = '0'
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="businessKeys != null and businessKeys.size > 0">
+            and(
+            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
+                id = #{businessValue}
+            </foreach>
+            )
+        </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
+        ORDER BY warehousing_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
+</mapper>