Browse Source

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

ccj 3 years ago
parent
commit
8db08ee7b0
25 changed files with 766 additions and 137 deletions
  1. 4 3
      pom.xml
  2. 27 0
      winsea-haixin-plugin-operation/src/main/java/com/yh/saas/plugin/operation/controller/TenantController.java
  3. 3 0
      winsea-haixin-plugin-operation/src/main/java/com/yh/saas/plugin/operation/service/IOperationTenantService.java
  4. 12 0
      winsea-haixin-plugin-operation/src/main/java/com/yh/saas/plugin/operation/service/impl/OperationTenantServiceImpl.java
  5. 36 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PaymentManagementController.java
  6. 7 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/QualityInspectionManagementController.java
  7. 28 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WeighingManagementController.java
  8. 5 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java
  9. 67 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/PaymentManagement.java
  10. 8 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/QualityInspectionManagement.java
  11. 13 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseBaseInfo.java
  12. 26 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WeighingManagement.java
  13. 22 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IPaymentManagementService.java
  14. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IQualityInspectionManagementService.java
  15. 15 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWeighingManagementService.java
  16. 148 37
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java
  17. 5 5
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchasePriceServiceImpl.java
  18. 25 9
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/QualityInspectionManagementServiceImpl.java
  19. 44 10
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java
  20. 35 18
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java
  21. 172 38
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java
  22. 7 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/IdentityAuthenticationInfoMapper.xml
  23. 29 6
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml
  24. 10 4
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/QualityInspectionManagementMapper.xml
  25. 13 2
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WeighingManagementMapper.xml

+ 4 - 3
pom.xml

@@ -184,6 +184,10 @@
             <properties>
                 <env>local</env>
             </properties>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+
         </profile>
         <profile>
             <id>dev</id>
@@ -202,9 +206,6 @@
             <properties>
                 <env>prod</env>
             </properties>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
 
         </profile>
     </profiles>

+ 27 - 0
winsea-haixin-plugin-operation/src/main/java/com/yh/saas/plugin/operation/controller/TenantController.java

@@ -2,7 +2,9 @@ package com.yh.saas.plugin.operation.controller;
 
 import com.alipay.sofa.runtime.api.annotation.SofaReference;
 import com.baomidou.mybatisplus.plugins.Page;
+import com.winsea.svc.base.base.entity.CommonCompany;
 import com.winsea.svc.base.base.entity.CommonTenant;
+import com.winsea.svc.base.base.service.ICommonCompanyService;
 import com.winsea.svc.base.base.service.ICommonTenantService;
 import com.winsea.svc.base.plugin.entity.TenantService;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
@@ -27,6 +29,8 @@ public class TenantController {
 
     @Autowired
     private IOperationTenantService tenantService;
+    @Autowired
+    private ICommonCompanyService commonCompanyService;
 
     @SofaReference
     private ICommonTenantService commonTenantService;
@@ -52,6 +56,17 @@ public class TenantController {
         return tenantId;
     }
 
+
+    /**
+     * 修改租户信息
+     *
+     * @param tenant 租户信息
+     */
+    @PostMapping("/api/change")
+    public void change(@RequestBody CommonCompany tenant) {
+        tenantService.change(tenant);
+    }
+
     /**
      * 修改租户信息
      *
@@ -104,6 +119,18 @@ public class TenantController {
         return tenantService.getTenantDetail(tenantId);
     }
 
+
+    /**
+     * 获取详情
+     *
+     * @param compId 租户ID
+     * @return 租户详情
+     */
+    @GetMapping("/query/getCompIpm")
+    public CommonCompany getCompIpm(@RequestParam String compId) throws ParseException {
+        return commonCompanyService.selectById(compId);
+    }
+
     /**
      * 租户名称重复检查
      *

+ 3 - 0
winsea-haixin-plugin-operation/src/main/java/com/yh/saas/plugin/operation/service/IOperationTenantService.java

@@ -1,6 +1,7 @@
 package com.yh.saas.plugin.operation.service;
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.winsea.svc.base.base.entity.CommonCompany;
 import com.winsea.svc.base.base.entity.CommonTenant;
 import com.winsea.svc.base.base.util.DataResult;
 import com.winsea.svc.base.plugin.entity.TenantService;
@@ -105,4 +106,6 @@ public interface IOperationTenantService {
 	 * 新增用户
 	 */
 	void saveCommonTenant(CommonTenant tenant);
+
+	void change(CommonCompany commonCompany);
 }

+ 12 - 0
winsea-haixin-plugin-operation/src/main/java/com/yh/saas/plugin/operation/service/impl/OperationTenantServiceImpl.java

@@ -243,6 +243,7 @@ public class OperationTenantServiceImpl implements IOperationTenantService {
         company.setCompSimpleName(tenant.getCompSimpleNameEn());
         company.setCompSimpleNameEn(PinYinUtils.convertHanzi2Pinyin(tenant.getCompSimpleNameEn(), false).toLowerCase());
         company.setCompDomainName(tenant.getCompDomainName());
+        company.setCompImo(tenant.getShipNumber());
 
         DataResult dataResult = companyService.checkCommonCompany(company);
         if (null != dataResult) {
@@ -258,6 +259,17 @@ public class OperationTenantServiceImpl implements IOperationTenantService {
         tenantService.updateById(tenant);
     }
 
+
+    @Override
+    @Transactional
+    public void change(CommonCompany commonCompany) {
+        //通过租户名称自动化寻址
+
+        CommonCompany company = companyService.selectById(commonCompany.getCompId());
+        company.setCompImo(commonCompany.getCompImo());
+        companyService.updateById(company);
+    }
+
     @Override
     @Transactional
     public void changeTrialInfo(CommonTenant tenant) throws ParseException {

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

@@ -46,6 +46,33 @@ public class PaymentManagementController {
     public String payMoney(@RequestBody PaymentManagement paymentManagement){
         return paymentManagementService.payMoney(paymentManagement);
     }
+    /**
+     * 收款
+     * @param paymentManagement
+     * @return
+     */
+    @PostMapping("/api/collectMoney")
+    public String collectMoney(@RequestBody PaymentManagement paymentManagement){
+        return paymentManagementService.collectMoney(paymentManagement);
+    }
+    /**
+     * 编辑应收
+     * @param paymentManagement
+     * @return
+     */
+    @PostMapping("/api/editCollect")
+    public String editCollect(@RequestBody PaymentManagement paymentManagement){
+        return paymentManagementService.editCollect(paymentManagement);
+    }
+    /**
+     * 备注
+     * @param paymentManagement
+     * @return
+     */
+    @PostMapping("/api/addRemarks")
+    public String addRemarks(@RequestBody PaymentManagement paymentManagement){
+        return paymentManagementService.addRemarks(paymentManagement);
+    }
 
     /**
      * 结算
@@ -72,6 +99,15 @@ public class PaymentManagementController {
     public Float cumulant(PaymentManagement paymentManagement) {
         return paymentManagementService.cumulant(paymentManagement);
     }
+    /**
+     * 结算开启审核流
+     * @param paymentManagement
+     * @return
+     */
+    @PostMapping("/api/openAuditFlow")
+    public  String openAuditFlow(@RequestBody PaymentManagement paymentManagement){
+        return paymentManagementService.openAuditFlow(paymentManagement);
+    }
 
 }
 

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

@@ -86,6 +86,13 @@ public class QualityInspectionManagementController {
     public String addQualityInspectionOut(@RequestBody QualityInspectionManagement qualityInspectionManagement) {
         return qualityInspectionManagementService.addQualityInspectionOut(qualityInspectionManagement);
     }
+    /**
+     * 查客户待结算数量
+     */
+    @GetMapping("/api/settledCount")
+    public Integer settledCount(QualityInspectionManagement qualityInspectionManagement){
+        return qualityInspectionManagementService.settledCount(qualityInspectionManagement);
+    }
 
 }
 

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

@@ -51,6 +51,25 @@ public class WeighingManagementController {
     public String editTare(@RequestBody WeighingManagement weighingManagement){
         return weighingManagementService.editTare(weighingManagement);
     }
+
+    /**
+     * 出库管理添加皮重检斤
+     * @param weighingManagement
+     * @return
+     */
+    @PostMapping("/api/addTare")
+    public String addTare(@RequestBody WeighingManagement weighingManagement){
+        return weighingManagementService.addTare(weighingManagement);
+    }
+    /**
+     * 出库管理编辑皮重检斤
+     * @param weighingManagement
+     * @return
+     */
+    @PostMapping("/api/editTareOut")
+    public String editTareOut(@RequestBody WeighingManagement weighingManagement){
+        return weighingManagementService.editTareOut(weighingManagement);
+    }
     /**
      * 删除检斤管理信息
      * @param weighingManagement
@@ -59,6 +78,15 @@ public class WeighingManagementController {
     public void deleteWeightcheck(@RequestBody WeighingManagement weighingManagement){
         weighingManagementService.deleteWeightcheck(weighingManagement.getId());
     }
+    /**
+     * 查看检斤信息
+     *  @param id
+     * @return
+     */
+    @GetMapping("/getWeighingManagement")
+    public WeighingManagement getWeighingManagement(@RequestParam String id) {
+        return weighingManagementService.getWeighingManagement(id);
+    }
 
 }
 

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

@@ -249,7 +249,11 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
      */
     @TableField(exist = false)
     private Float completedQuantity;
-
+    /**
+     * 合同价格/移库任务价格
+     */
+    @TableField(exist = false)
+    private Float contractPrice;
 
 
     /**

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

@@ -59,10 +59,18 @@ public class PaymentManagement extends BaseModel<PaymentManagement> {
      * 编号
      */
     private String paymentNo;
+    /**
+     * 合同编号
+     */
+    private String contractNo;
     /**
      * 客户
      */
     private String customerName;
+    /**
+     * 客户电话
+     */
+    private String customerPhone;
     /**
      * 车牌号
      */
@@ -83,6 +91,18 @@ public class PaymentManagement extends BaseModel<PaymentManagement> {
      * 净重(公斤)
      */
     private Float netWeight;
+    /**
+     * 毛重(公斤)
+     */
+    private Float grossWeight;
+    /**
+     * 皮重(公斤)
+     */
+    private Float tare;
+    /**
+     * 管理类型
+     */
+    private String managementType;
     /**
      * 纯重(公斤)
      */
@@ -95,20 +115,42 @@ public class PaymentManagement extends BaseModel<PaymentManagement> {
      * 已付金额(元/吨)
      */
     private Float amountEdPayable;
+    /**
+     * 已收金额(元/吨)
+     */
+    private Float amountEdCollectionable;
     /**
      * 未付金额
      */
     private Float amountNotPayable;
+    /**
+     * 未收金额
+     */
+    private Float amountNotCollectable;
     /**
      * 付款截图
      */
     private String paymentScreenshot;
+    /**
+     * 收款截图
+     */
+    private String collectionScreenshot;
+    /**
+     * 图片地址
+     */
+    private String pictureAddress;
     /**
      * 付款日期
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date paymentDate;
+    /**
+     * 收款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date collectionDate;
     /**
      * 扣重比
      */
@@ -161,10 +203,18 @@ public class PaymentManagement extends BaseModel<PaymentManagement> {
      * 计算应付
      */
     private Float calculationPayable;
+    /**
+     * 计算应收
+     */
+    private Float calculationCollectable;
     /**
      * 实际付款
      */
     private Float actualPayment;
+    /**
+     * 实际收款
+     */
+    private Float actualCollectionment;
     /**
      * 人民币大写
      */
@@ -236,7 +286,23 @@ public class PaymentManagement extends BaseModel<PaymentManagement> {
     private WeighingManagement weighingManagement;
     @TableField(exist = false)
     private List<PaymentManagement> paymentManagementList;
-
+    @TableField(exist = false)
+    private IdentityAuthenticationInfo identityAuthenticationInfo;
+    /**
+     * 公司名
+     */
+    @TableField(exist = false)
+    private String compName;
+    /**
+     * 税务登记号
+     */
+    @TableField(exist = false)
+    private String taxRegistrationNo;
+    /**
+     * app端传1
+     */
+    @TableField(exist = false)
+    private String pcFlag;
 
     @Override
     protected Serializable pkVal() {

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

@@ -102,6 +102,10 @@ public class QualityInspectionManagement extends BaseModel<QualityInspectionMana
      * 货名key
      */
     private String goodsNameKey;
+    /**
+     * 图片地址
+     */
+    private String pictureAddress;
     /**
      * 货名
      */
@@ -114,6 +118,10 @@ public class QualityInspectionManagement extends BaseModel<QualityInspectionMana
      * 仓位编号
      */
     private String binNumber;
+    /**
+     * 管理类型
+     */
+    private String managementType;
     /**
      * 囤位编号
      */

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

@@ -76,6 +76,14 @@ public class WarehouseBaseInfo extends BaseModel<WarehouseBaseInfo> {
      * 负责人电话
      */
     private String personPhone;
+    /**
+     * 其他负责人
+     */
+    private String otherPersonCharge;
+    /**
+     * 其他负责人电话
+     */
+    private String otherPersonPhone;
     /**
      * 仓库所在地省
      */
@@ -113,6 +121,11 @@ public class WarehouseBaseInfo extends BaseModel<WarehouseBaseInfo> {
      */
     @TableField(exist = false)
     private Float residual;
+    /**
+     * 全部标识
+     */
+    @TableField(exist = false)
+    private String flag;
 
 
     /**

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

@@ -1,13 +1,11 @@
 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.fasterxml.jackson.annotation.JsonFormat;
@@ -58,6 +56,14 @@ public class WeighingManagement extends BaseModel<WeighingManagement> {
      * 合同编号
      */
     private String contractNo;
+    /**
+     * 图片地址
+     */
+    private String pictureAddress;
+    /**
+     * 合同价格/移库任务价格
+     */
+    private Float contractPrice;
     /**
      * 客户
      */
@@ -110,14 +116,22 @@ public class WeighingManagement extends BaseModel<WeighingManagement> {
      * 仓位号
      */
     private String binNumber;
+    /**
+     * 出库类型
+     */
+    private String inOutType;
     /**
      * 囤位号
      */
     private String storageNumber;
     /**
-     * 司称
+     * 毛检
      */
     private String secretaryWeigher;
+    /**
+     * 皮检员
+     */
+    private String skinInspector;
     /**
      * 质检时间
      */
@@ -148,6 +162,10 @@ public class WeighingManagement extends BaseModel<WeighingManagement> {
      * 霉变粒
      */
     private String mildewGrain;
+    /**
+     * 管理类型
+     */
+    private String managementType;
     /**
      * 不完善粒
      */
@@ -223,6 +241,11 @@ public class WeighingManagement extends BaseModel<WeighingManagement> {
      */
     @TableField(exist = false)
     private String warehouseId;
+    /**
+     *质检对象
+     */
+    @TableField(exist = false)
+    private QualityInspectionManagement qualityInspectionManagement;
 
 
     @Override

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

@@ -35,6 +35,22 @@ public interface IPaymentManagementService extends IService<PaymentManagement> {
      * @param paymentManagement
      */
     String payMoney(PaymentManagement paymentManagement);
+    /**
+     * 收款
+     * @param paymentManagement
+     */
+    String collectMoney(PaymentManagement paymentManagement);
+    /**
+     * 备注
+     * @param paymentManagement
+     */
+    String addRemarks(PaymentManagement paymentManagement);
+    /**
+     * 编辑应收
+     * @param paymentManagement
+     */
+    String editCollect(PaymentManagement paymentManagement);
+
     /**
      * 删除
      *
@@ -47,4 +63,10 @@ public interface IPaymentManagementService extends IService<PaymentManagement> {
      * @return
      */
     Float cumulant(PaymentManagement paymentManagement);
+    /**
+     * 结算开启审核流
+     * @param paymentManagement
+     * @return
+     */
+    String openAuditFlow(PaymentManagement paymentManagement);
 }

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

@@ -53,4 +53,9 @@ public interface IQualityInspectionManagementService extends IService<QualityIns
      * @param qualityInspectionManagement
      */
     String addQualityInspectionOut(QualityInspectionManagement qualityInspectionManagement);
+    /**
+     * 查客户待结算的数量
+     * @param qualityInspectionManagement
+     */
+    Integer settledCount(QualityInspectionManagement qualityInspectionManagement);
 }

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

@@ -30,11 +30,26 @@ public interface IWeighingManagementService extends IService<WeighingManagement>
      * @param weighingManagement
      */
     String editTare(WeighingManagement weighingManagement);
+    /**
+     * 出库管理添加皮重检斤
+     * @param weighingManagement
+     */
+    String addTare(WeighingManagement weighingManagement);
+    /**
+     * 出库管理编辑皮重检斤
+     * @param weighingManagement
+     */
+    String editTareOut(WeighingManagement weighingManagement);
     /**
      * 删除检斤管理信息
      * @param id
      */
     void deleteWeightcheck(String id);
+    /**
+     * 查看检斤管理信息
+     * @param id
+     */
+    WeighingManagement getWeighingManagement(String id);
 
 
 

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

@@ -5,7 +5,9 @@ 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.CommonCompany;
 import com.winsea.svc.base.base.entity.CommonRoleResource;
+import com.winsea.svc.base.base.service.ICommonCompanyService;
 import com.winsea.svc.base.base.service.ICommonRoleResourceService;
 import com.winsea.svc.base.security.entity.User;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
@@ -15,20 +17,16 @@ 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;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import com.yh.saas.plugin.yiliangyiyun.service.IQualityInspectionManagementService;
-import com.yh.saas.plugin.yiliangyiyun.service.IWeighingManagementService;
 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.text.SimpleDateFormat;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -50,6 +48,11 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
     private IQualityInspectionManagementService qualityInspectionManagementService;
     @Autowired
     private IWeighingManagementService weighingManagementService;
+    @Autowired
+    private ICommonCompanyService commonCompanyService;
+    @Autowired
+    private IIdentityAuthenticationInfoService iIdentityAuthenticationInfoService;
+
 
     /**
      * 付款管理列表
@@ -72,12 +75,15 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             statusSet.addAll(statusList);
         }
         //  公司ID
-        pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
+        pageView.put("compId", paymentManagement.getCompId());
         pageView.put("searchKeyWord", paymentManagement.getSearchKeyWord());
         pageView.put("searchType", paymentManagement.getSearchType());
+        pageView.put("pcFlag", paymentManagement.getPcFlag());
         pageView.put("pageSize", paymentManagement.getPageSize());
         pageView.put("warehouseName",paymentManagement.getWarehouseName());
+        pageView.put("customerPhone",paymentManagement.getCustomerPhone());
         pageView.put("currentPage", paymentManagement.getCurrentPage());
+        pageView.put("managementType",paymentManagement.getManagementType());
         pageView.put("businessKeys", businessKeys);
         pageView.put("statusSet", statusSet);
         // 查询服务商总数
@@ -85,6 +91,12 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         List<PaymentManagement> dataList = baseMapper.getListByCondition(pageView);
         if (!CollectionUtils.isEmpty(dataList)) {
             dataList.forEach(paymentManagement1 -> {
+                CommonCompany commonCompany=commonCompanyService.selectOne(new EntityWrapper<CommonCompany>()
+                        .eq("comp_id",paymentManagement1.getCompId()));
+                //公司名
+                if (commonCompany!=null){
+                    paymentManagement1.setCompName(commonCompany.getCompName());
+                }
                 String taskId = "";
                 // 只有待审核状态才有taskId
                 if (StringUtils.isNotBlank(paymentManagement1.getWorkflowId())) {
@@ -117,6 +129,17 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         //检斤信息
         WeighingManagement weighingManagement = weighingManagementService.selectOne(new EntityWrapper<WeighingManagement>()
                 .eq("relation_id", paymentManagement.getRelationId()));
+        CommonCompany commonCompany=commonCompanyService.selectOne(new EntityWrapper<CommonCompany>()
+                .eq("comp_id",paymentManagement.getCompId()));
+        //公司名
+        if (commonCompany!=null){
+            paymentManagement.setCompName(commonCompany.getCompName());
+            paymentManagement.setTaxRegistrationNo(commonCompany.getCompImo());
+        }
+        IdentityAuthenticationInfo identityAuthenticationInfo=iIdentityAuthenticationInfoService.selectOne(new EntityWrapper<IdentityAuthenticationInfo>()
+        .eq("customer_name",paymentManagement.getCustomerName())
+        .eq("customer_type_flag","1"));
+        paymentManagement.setIdentityAuthenticationInfo(identityAuthenticationInfo);
         paymentManagement.setQualityInspectionManagement(qualityInspectionManagement);
         paymentManagement.setWeighingManagement(weighingManagement);
         return paymentManagement;
@@ -128,32 +151,12 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String editInfo(PaymentManagement paymentManagement) {
         PaymentManagement paymentManagement1=this.selectById(paymentManagement.getId());
+        paymentManagement.setAmountIngPayable(paymentManagement.getActualPayment());
+        this.openAuditFlow(paymentManagement1);
         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";
     }
 
@@ -199,7 +202,78 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         }
         return "ok";
     }
-
+    /**
+     * 收款
+     * @param paymentManagement
+     * @return
+     */
+    @Override
+    public String collectMoney(PaymentManagement paymentManagement) {
+        List<PaymentManagement> paymentManagementList = paymentManagement.getPaymentManagementList();
+        Float money = paymentManagement.getMoney();
+        //收款多条
+        if (!CollectionUtils.isEmpty(paymentManagementList)) {
+            for (PaymentManagement paymentManagement1 : paymentManagementList) {
+                PaymentManagement paymentManagement2 = this.selectById(paymentManagement1.getId());
+                //收款金额大于本次循环未收金额
+                if (money >= paymentManagement1.getAmountNotCollectable()) {
+                    money = money - paymentManagement1.getAmountNotCollectable();
+                    //全部收款
+                    paymentManagement1.setStatus(StatusEnum.PUR_COLLECTaLL.getName());
+                    paymentManagement1.setStatusFlag(StatusEnum.PUR_COLLECTaLL.getFlag());
+                    paymentManagement1.setCollectionDate(paymentManagement.getCollectionDate());
+                    paymentManagement1.setCollectionScreenshot(paymentManagement2.getCollectionScreenshot() != null ? paymentManagement2.getCollectionScreenshot() + '$' + paymentManagement.getCollectionScreenshot() : paymentManagement.getCollectionScreenshot());
+                    paymentManagement1.setAmountEdCollectionable(paymentManagement1.getAmountEdCollectionable() + paymentManagement1.getAmountNotCollectable());
+                    paymentManagement1.setAmountNotCollectable(0.0f);
+                    this.updateById(paymentManagement1);
+                } else if (money > 0) {
+                    Float moneyTmp = money - paymentManagement1.getAmountNotCollectable();
+                    //部分收款
+                    paymentManagement1.setStatus(StatusEnum.PUR_COLLECT.getName());
+                    paymentManagement1.setStatusFlag(StatusEnum.PUR_COLLECT.getFlag());
+                    paymentManagement1.setCollectionDate(paymentManagement.getCollectionDate());
+                    paymentManagement1.setCollectionScreenshot(paymentManagement2.getCollectionScreenshot() != null ? paymentManagement2.getCollectionScreenshot() + '$' + paymentManagement.getCollectionScreenshot() : paymentManagement.getCollectionScreenshot());
+                    paymentManagement1.setAmountEdCollectionable(paymentManagement1.getAmountEdCollectionable() + money);
+                    paymentManagement1.setAmountNotCollectable(paymentManagement1.getAmountNotCollectable() - money);
+                    this.updateById(paymentManagement1);
+                    money = moneyTmp;
+                } else {
+                    break;
+                }
+            }
+        }
+        return "OK";
+    }
+    /**
+     * 添加备注
+     * @param paymentManagement
+     * @return
+     */
+    @Override
+    public String addRemarks(PaymentManagement paymentManagement) {
+        List<PaymentManagement> paymentManagementList = paymentManagement.getPaymentManagementList();
+        if (!CollectionUtils.isEmpty(paymentManagementList)) {
+            for (PaymentManagement paymentManagement1 : paymentManagementList) {
+                paymentManagement1.setRemarks(paymentManagement.getRemarks());
+                this.updateById(paymentManagement1);
+            }
+        }
+        return "OK";
+    }
+    /**
+     * 编辑应收
+     * @param paymentManagement
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String editCollect(PaymentManagement paymentManagement) {
+        boolean one =  this.updateById(paymentManagement);
+        if(one){
+            return "OK";
+        }
+        return "NG";
+    }
     /**
      * 删除
      * @param id
@@ -224,20 +298,28 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
     @Override
     public Float cumulant(PaymentManagement paymentManagement) {
         Float cumulant=0.0f;
+        //本年第一天零点
+        SimpleDateFormat now = new SimpleDateFormat("yyyy-01-01 00:00:00");
+        Calendar c = Calendar.getInstance();
+        c.setTime(new Date());
+        c.add(Calendar.YEAR, 0);
+        Date y = c.getTime();
+        String year = now.format(y);
         List<PaymentManagement> paymentManagementList = this.selectList(new EntityWrapper<PaymentManagement>()
         .eq("goods_name",paymentManagement.getGoodsName())
         .eq("customer_name",paymentManagement.getCustomerName())
-        .eq("comp_id",paymentManagement.getCompId()));
+        .eq("comp_id",paymentManagement.getCompId())
+        .ge("create_date",year));
         if (!CollectionUtils.isEmpty(paymentManagementList)){
             Float netWeight = 0f;
             for (PaymentManagement paymentManagement1:paymentManagementList){
                 //干粮净重
                 if ("干粮".equals(paymentManagement1.getType())){
-                    netWeight=paymentManagement1.getNetWeight();
+                    netWeight=netWeight+(paymentManagement1.getNetWeight()!=null?paymentManagement1.getNetWeight():0f);
                 }
                 //潮粮纯重
-                else {
-                    netWeight=paymentManagement1.getPureWeight();
+                else if("潮粮".equals(paymentManagement1.getType())){
+                    netWeight=netWeight+(paymentManagement1.getPureWeight()!=null?paymentManagement1.getPureWeight():0f);
                 }
             }
             cumulant=cumulant+netWeight;
@@ -245,6 +327,35 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         return cumulant;
     }
 
+    @Override
+    public String openAuditFlow(PaymentManagement paymentManagement1) {
+        PaymentManagement paymentManagement = this.selectById(paymentManagement1.getId());
+        boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(paymentManagement.getWorkflowId());
+        // 不是退回的单子
+        if (isStartWorkflow) {
+            Workflow workflow = workflowService
+                    .findLatestWorkflowByBusinessCodeByApp(paymentManagement.getCompId(), "PAYMENT-MANAGEMENT-APPROVE");
+            // 没配置审核流程,直接结束并处理信息
+            if (workflow == null) {
+                throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+            }
+            // 开启审核流
+            else {
+
+                // 设置状态 已提交审核
+                paymentManagement.setWorkflowId(workflow.getId());
+                this.updateById(paymentManagement);
+                workflowService.startInstance(workflow.getId(), paymentManagement.getId());
+            }
+        }
+        // 退回的单子 再启用
+        else {
+            this.updateById(paymentManagement);
+            workflowService.activateInstance(paymentManagement.getWorkflowId(), paymentManagement.getId());
+        }
+        return "OK";
+    }
+
 
     private List<String> getResourceIdList() {
         User currentUser = AuthSecurityUtils.getCurrentUserInfo();

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

@@ -205,9 +205,9 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String purchasePriceDel(PurchasePrice purchasePrice) {
-        this.purchasePriceDetailService.delete(new EntityWrapper<PurchasePriceDetail>().eq("main_id",purchasePrice.getId()));
-        this.purchasePriceDetailPrintService.delete(new EntityWrapper<PurchasePriceDetailPrint>().eq("main_id",purchasePrice.getId()));
-        this.deleteById(purchasePrice);
+        purchasePriceDetailService.delete(new EntityWrapper<PurchasePriceDetail>().eq("main_id",purchasePrice.getId()));
+        purchasePriceDetailPrintService.delete(new EntityWrapper<PurchasePriceDetailPrint>().eq("main_id",purchasePrice.getId()));
+        this.deleteById(purchasePrice.getId());
         return "ok";
     }
 
@@ -243,10 +243,10 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
                 else if ("二等品".equals(purchasePrice.getGrade())){
                     tidalGrainPrice=purchasePriceDetailPrint.getPrice2();
                 }
-                if ("三等品".equals(purchasePrice.getGrade())){
+                else if ("三等品".equals(purchasePrice.getGrade())){
                     tidalGrainPrice=purchasePriceDetailPrint.getPrice3();
                 }
-                if ("等外".equals(purchasePrice.getGrade())){
+                else{
                     tidalGrainPrice=purchasePriceDetailPrint.getPriceOther();
                 }
             }

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

@@ -7,19 +7,14 @@ import com.winsea.svc.base.base.entity.CommonCompany;
 import com.winsea.svc.base.base.service.ICommonCompanyService;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
-import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
-import com.yh.saas.plugin.yiliangyiyun.entity.QualityInspectionManagement;
-import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
-import com.yh.saas.plugin.yiliangyiyun.entity.WeighingManagement;
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.QualityInspectionManagementMapper;
-import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
-import com.yh.saas.plugin.yiliangyiyun.service.IQualityInspectionManagementService;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseBaseInfoService;
-import com.yh.saas.plugin.yiliangyiyun.service.IWeighingManagementService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,6 +37,8 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
     private ICommonCompanyService commonCompanyService;
     @Autowired
     private IWarehouseBaseInfoService warehouseBaseInfoService;
+    @Autowired
+    private IPaymentManagementService paymentManagementService;
     /**
      * 质检管理列表
      * @param qualityInspectionManagement
@@ -58,6 +55,7 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
         pageView.put("pageSize",qualityInspectionManagement.getPageSize());
         pageView.put("currentPage",qualityInspectionManagement.getCurrentPage());
         pageView.put("warehouseName",qualityInspectionManagement.getWarehouseName());
+        pageView.put("managementType",qualityInspectionManagement.getManagementType());
         // 查询销售订单总数
         Integer dataCount = baseMapper.getCountByCondition(pageView);
         List<QualityInspectionManagement> dataList = baseMapper.getListByCondition(pageView);
@@ -149,6 +147,8 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
         String relationId=IdGenerator.generateUUID();
         qualityInspectionManagement.setId(IdGenerator.generateUUID());
         qualityInspectionManagement.setRelationId(relationId);
+        qualityInspectionManagement.setManagementType("1");
+        qualityInspectionManagement.setQualityDate(new Date());
         //状态为已质检
         qualityInspectionManagement.setStatus(StatusEnum.INSPECTED.getName());
         qualityInspectionManagement.setStatusFlag(StatusEnum.INSPECTED.getFlag());
@@ -164,6 +164,7 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
         weighingManagement.setGoodsName(qualityInspectionManagement.getGoodsName());
         weighingManagement.setBinNumber(qualityInspectionManagement.getBinNumber());
         weighingManagement.setType(qualityInspectionManagement.getType());
+        weighingManagement.setManagementType("1");
         weighingManagement.setWarehouseName(qualityInspectionManagement.getWarehouseName());
         //状态为已质检
         weighingManagement.setStatus(StatusEnum.INSPECTED.getName());
@@ -173,7 +174,7 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
         boolean one=this.insert(qualityInspectionManagement);
         //成功返回ok
         if (one &&two ) {
-            return "OK";
+            return qualityInspectionManagement.getId();
         } else {
             return "NG";
         }
@@ -196,4 +197,19 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
             return "NG";
         }
     }
+
+    /**
+     * 查客户待结算的数量
+     * @param qualityInspectionManagement
+     * @return
+     */
+    @Override
+    public Integer settledCount(QualityInspectionManagement qualityInspectionManagement) {
+        Integer count=paymentManagementService.selectCount(new EntityWrapper<PaymentManagement>()
+        .eq("comp_id",qualityInspectionManagement.getCompId())
+        .eq("customer_name",qualityInspectionManagement.getCustomerName())
+        .eq("goods_name",qualityInspectionManagement.getGoodsName())
+        .eq("status_flag","1"));
+        return count;
+    }
 }

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

@@ -52,6 +52,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
     private ISaleOrderService saleOrderService;
     @Autowired
     private IPurchasePriceService purchasePriceService;
+    @Autowired
+    private IContractGoodsInfoService contractGoodsInfoService;
 
     /**
      * 仓库管理页面列表
@@ -602,7 +604,6 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     .eq("contract_type", "2")
                     .eq("delete_flag", "0")
                     .orderBy("update_date", false));
-
             for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
                 temp.add(contractManagementInfo);
             }
@@ -641,16 +642,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                             }
                         }
                     }
-//                    if(!CollectionUtils.isEmpty(contractManagementInfoList)) {
-//                        temp.add(contractManagementInfoList.get(i));
-//
-//                    }
                 }
                 temp.addAll(contractManagementInfoList);
             }
             return temp;
         }
-        //查销售合同编号
+        //查销售订单审核合同编号
         else if (flag == 4) {
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
@@ -670,16 +667,43 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                             }
                         }
                     }
-//                    if(!CollectionUtils.isEmpty(contractManagementInfoList)) {
-//                        temp.add(contractManagementInfoList.get(i));
-//                    }
                 }
                 temp.addAll(contractManagementInfoList);
             }
             return temp;
         }
+        //查销售合同编号,以及移库任务编号
+        else if(flag == 5){
+            List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+                    .eq("comp_id", compId)
+                    .eq("delete_flag", "0")
+                    .eq("contract_type", "1")
+                    .orderBy("update_date", false));
+            for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
+                ContractGoodsInfo contractGoodsInfo=contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                        .eq("contract_id",contractManagementInfo.getId()));
+                contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                //期货取点价,现货取单价
+                contractManagementInfo.setContractPrice(contractManagementInfo.getPointPrice()!=null?contractManagementInfo.getPointPrice():Float.valueOf(String.valueOf(contractManagementInfo.getUnitContractPrice())));
+                temp.add(contractManagementInfo);
+            }
+            List<InOutWarehouseTask> inOutWarehouseTaskList = iInOutWarehouseTaskService.selectList(new EntityWrapper<InOutWarehouseTask>()
+                    .eq("comp_id", compId)
+                    .eq("delete_flag", "0")
+                    .eq("task_type_key", "3")
+                    .eq("in_out_flag", "1")
+                    .orderBy("update_date", false));
+            for (InOutWarehouseTask inOutWarehouseTask : inOutWarehouseTaskList) {
+                ContractManagementInfo contractManagementInfo = new ContractManagementInfo();
+                BeanUtils.copyProperties(inOutWarehouseTask, contractManagementInfo);
+                contractManagementInfo.setContractNo(inOutWarehouseTask.getMoveTaskNo());
+                contractManagementInfo.setContractPrice(inOutWarehouseTask.getUnitPrice());
+                temp.add(contractManagementInfo);
+            }
+            return temp;
+        }
         //查采购、销售合同编号,以及移库任务编号
-        else {
+        else{
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
                     .eq("delete_flag", "0")
@@ -733,6 +757,16 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 warehouseBaseInfo.setCount(dataCount);
             }
         }
+        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("全部");
+            }
+            warehouseBaseInfoList=warehouseBaseInfoList1;
+        }
         return warehouseBaseInfoList;
     }
 }

+ 35 - 18
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -437,19 +437,30 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                     purchaseReceiptReport.setStatus(StatusEnum.FORM_REVIEWED.getName());
                     if (purchaseOrder != null) {
                         purchaseReceiptReport.setUnitPrice(purchaseOrder.getUnitPrice());
-                        purchaseReceiptReport.setBasisPrice(purchaseOrder.getBasis());
                         purchaseReceiptReport.setUnloadingCharge(purchaseOrder.getUnloadingCharge());
                         purchaseReceiptReport.setInvoiceFee(purchaseOrder.getInvoiceFee());
+                        //期货
+                        if (purchaseOrder.getBasis()!=null){
+                            purchaseReceiptReport.setBasisPrice(purchaseOrder.getBasis());
+                            BigDecimal unitPrice = new BigDecimal(Float.toString(purchaseReceiptReport.getUnitPrice()));
+                            BigDecimal basis = new BigDecimal(Float.toString(purchaseReceiptReport.getBasisPrice()));
+                            BigDecimal unloadingCharge = new BigDecimal(Float.toString(purchaseReceiptReport.getUnloadingCharge()));
+                            BigDecimal invoiceFee = new BigDecimal(Float.toString(purchaseReceiptReport.getInvoiceFee()));
+                            BigDecimal deductionAmount = new BigDecimal(Float.toString(purchaseReceiptReport.getDeductionAmount()));
+                            purchaseReceiptReport.setSettlementPrice(unitPrice.add(basis).add(unloadingCharge).add(invoiceFee).add(deductionAmount).floatValue());
+                        }
+                        //现货
+                        else {
+                            BigDecimal unitPrice = new BigDecimal(Float.toString(purchaseReceiptReport.getUnitPrice()));
+                            BigDecimal unloadingCharge = new BigDecimal(Float.toString(purchaseReceiptReport.getUnloadingCharge()));
+                            BigDecimal invoiceFee = new BigDecimal(Float.toString(purchaseReceiptReport.getInvoiceFee()));
+                            BigDecimal deductionAmount = new BigDecimal(Float.toString(purchaseReceiptReport.getDeductionAmount()));
+                            purchaseReceiptReport.setSettlementPrice(unitPrice.add(unloadingCharge).add(invoiceFee).add(deductionAmount).floatValue());
+
+                        }
                         purchaseReceiptReport.setCustomerName(purchaseOrder.getSeller());
                         purchaseReceiptReport.setInvoiceType(purchaseOrder.getType());
                         purchaseReceiptReport.setInvoiceTypeKey(purchaseOrder.getType());
-                        BigDecimal unitPrice = new BigDecimal(Float.toString(purchaseReceiptReport.getUnitPrice()));
-                        BigDecimal basis = new BigDecimal(Float.toString(purchaseReceiptReport.getBasisPrice()));
-                        BigDecimal unloadingCharge = new BigDecimal(Float.toString(purchaseReceiptReport.getUnloadingCharge()));
-                        BigDecimal invoiceFee = new BigDecimal(Float.toString(purchaseReceiptReport.getInvoiceFee()));
-                        BigDecimal deductionAmount = new BigDecimal(Float.toString(purchaseReceiptReport.getDeductionAmount()));
-
-                        purchaseReceiptReport.setSettlementPrice(unitPrice.add(basis).add(unloadingCharge).add(invoiceFee).add(deductionAmount).floatValue());
                         purchaseReceiptReport.setAmountIngPayable(CalculationUtil.mulToFloat(purchaseReceiptReport.getSettlementPrice(), purchaseReceiptReport.getNetWeight()));
                         purchaseReceiptReport.setAmountEdPayable(0f);
                         purchaseReceiptReport.setAmountNotPayable(purchaseReceiptReport.getAmountIngPayable());
@@ -592,21 +603,27 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                     salesDeliveryReport.setStatus(StatusEnum.FORM_REVIEWED.getName());
                     if (saleOrder != null) {
                         salesDeliveryReport.setUnitPrice(saleOrder.getUnitPrice());
-                        salesDeliveryReport.setBasisPrice(saleOrder.getBasis());
                         salesDeliveryReport.setInvoiceFee(saleOrder.getInvoiceFee());
+                        //期货
+                        if (saleOrder.getBasis()!=null){
+                            salesDeliveryReport.setBasisPrice(saleOrder.getBasis());
+                            BigDecimal unitPrice = new BigDecimal(Float.toString(salesDeliveryReport.getUnitPrice()));
+                            BigDecimal basis = new BigDecimal(Float.toString(salesDeliveryReport.getBasisPrice()));
+                            BigDecimal invoiceFee = new BigDecimal(Float.toString(salesDeliveryReport.getInvoiceFee()));
+                            salesDeliveryReport.setSettlementPrice(unitPrice.add(basis).add(invoiceFee).floatValue());
+                            tranCarInfo.setSettlementPrice(saleOrder.getUnitPrice() + saleOrder.getBasis() + saleOrder.getInvoiceFee());
+                        }
+                        //现货
+                        else{
+                            BigDecimal unitPrice = new BigDecimal(Float.toString(salesDeliveryReport.getUnitPrice()));
+                            BigDecimal invoiceFee = new BigDecimal(Float.toString(salesDeliveryReport.getInvoiceFee()));
+                            salesDeliveryReport.setSettlementPrice(unitPrice.add(invoiceFee).floatValue());
+                            tranCarInfo.setSettlementPrice(saleOrder.getUnitPrice()+ saleOrder.getInvoiceFee());
+                        }
                         salesDeliveryReport.setCustomerName(saleOrder.getBuyer());
-
-                        BigDecimal unitPrice = new BigDecimal(Float.toString(salesDeliveryReport.getUnitPrice()));
-                        BigDecimal basis = new BigDecimal(Float.toString(salesDeliveryReport.getBasisPrice()));
-                        BigDecimal invoiceFee = new BigDecimal(Float.toString(salesDeliveryReport.getInvoiceFee()));
-
-                        salesDeliveryReport.setSettlementPrice(unitPrice.add(basis).add(invoiceFee).floatValue());
                         salesDeliveryReport.setCollectionIngPayable(CalculationUtil.mulToFloat(salesDeliveryReport.getSettlementPrice(), salesDeliveryReport.getNetWeight()));
                         salesDeliveryReport.setCollectionEdPayable(0f);
                         salesDeliveryReport.setCollectionNotPayable(salesDeliveryReport.getCollectionIngPayable());
-                        if (saleOrder != null) {
-                            tranCarInfo.setSettlementPrice(saleOrder.getUnitPrice() + saleOrder.getBasis() + saleOrder.getInvoiceFee());
-                        }
                         tranCarInfoService.insert(tranCarInfo);
                     }
 

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

@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -41,6 +42,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
     private IWarehouseBaseInfoService warehouseBaseInfoService;
     @Autowired
     private IPurchasePriceService purchasePriceService;
+    @Autowired
+    private IContractManagementInfoService contractManagementInfoService;
     /**
      * 检斤管理列表
      * @param weighingManagement
@@ -56,6 +59,7 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
         pageView.put("searchKeyWord",weighingManagement.getSearchKeyWord());
         pageView.put("pageSize",weighingManagement.getPageSize());
         pageView.put("currentPage",weighingManagement.getCurrentPage());
+        pageView.put("managementType",weighingManagement.getManagementType());
         pageView.put("warehouseName",weighingManagement.getWarehouseName());
         // 查询销售订单总数
         Integer dataCount = baseMapper.getCountByCondition(pageView);
@@ -97,6 +101,7 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
         //状态改为已称毛重
         weighingManagement.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
         weighingManagement.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
+        weighingManagement.setGrossDate(new Date());
         //质检信息
         QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
                 .eq("relation_id", weighingManagement.getRelationId()));
@@ -106,6 +111,36 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
             qualityInspectionManagement.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
             qualityInspectionManagementService.updateById(qualityInspectionManagement);
         }
+        if ("3".equals(weighingManagement.getManagementType())){
+            WeighingManagement weighingManagement1=this.selectById(weighingManagement.getId());
+            //查关联的收款信息
+            PaymentManagement paymentManagement=paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
+                    .eq("relation_id",weighingManagement1.getRelationId()));
+            if (paymentManagement!=null){
+                paymentManagement.setNetWeight(weighingManagement.getGrossWeight());
+                paymentManagementService.updateById(paymentManagement);
+            }
+            else {
+                //生成收款信息
+                PaymentManagement paymentManagement1=new PaymentManagement();
+                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.setGrossWeight(weighingManagement.getGrossWeight());
+                paymentManagement1.setTare(weighingManagement1.getTare());
+                paymentManagement1.setNetWeight(weighingManagement.getNetWeight());
+                //应收
+                paymentManagement1.setCalculationCollectable(weighingManagement1.getContractPrice()*weighingManagement.getNetWeight());
+                paymentManagement1.setManagementType("3");
+                paymentManagement1.setWarehouseName(weighingManagement1.getWarehouseName());
+                paymentManagementService.insert(paymentManagement1);
+            }
+        }
         boolean one = this.updateById(weighingManagement);
         if (one) {
             return "OK";
@@ -123,11 +158,10 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
     @Transactional(rollbackFor = Exception.class)
     public String editTare(WeighingManagement weighingManagement) {
         WeighingManagement weighingManagement1=this.selectById(weighingManagement.getId());
-        //司称员(毛检,皮检)
-        weighingManagement.setSecretaryWeigher(weighingManagement1.getSecretaryWeigher()+','+weighingManagement.getSecretaryWeigher());
         //状态改为已称皮重
         weighingManagement.setStatus(StatusEnum.TARED.getName());
         weighingManagement.setStatusFlag(StatusEnum.TARED.getFlag());
+        weighingManagement.setTareDate(new Date());
         //质检信息
         QualityInspectionManagement qualityInspectionManagement1 = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
                 .eq("relation_id", weighingManagement1.getRelationId()));
@@ -137,47 +171,52 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
             qualityInspectionManagement1.setStatusFlag(StatusEnum.TARED.getFlag());
             qualityInspectionManagementService.updateById(qualityInspectionManagement1);
         }
-        //查关联的付款信息
-        PaymentManagement paymentManagement=paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
-        .eq("relation_id",weighingManagement1.getRelationId()));
-        if (paymentManagement!=null){
-            paymentManagement.setNetWeight(weighingManagement.getNetWeight());
-            paymentManagementService.updateById(paymentManagement);
-        }
-        else {
-            //生成付款信息
-            PaymentManagement paymentManagement1=new PaymentManagement();
-            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());
-            if ("潮粮".equals(weighingManagement1.getType())){
-                //查收购设置数据
-                PurchasePrice purchasePrice=purchasePriceService.selectOne(new EntityWrapper<PurchasePrice>()
-                        .eq("warehouse_id",weighingManagement.getWarehouseId())
-                .eq("goods_name",weighingManagement.getGoodsName()));
-                Float pureWeight=weighingManagement1.getNetWeight()* (100-(Float.valueOf(qualityInspectionManagement1.getWaterContent())-purchasePrice.getWaterMin())*purchasePrice.getDeductWeight())/100;
-                paymentManagement1.setPureWeight(pureWeight);
+        //收购业务
+        if("1".equals(weighingManagement1.getManagementType())){
+            //查关联的付款信息
+            PaymentManagement paymentManagement=paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
+                    .eq("relation_id",weighingManagement1.getRelationId()));
+            if (paymentManagement!=null){
+                paymentManagement.setNetWeight(weighingManagement.getNetWeight());
+                paymentManagementService.updateById(paymentManagement);
             }
-            paymentManagement1.setStatus(StatusEnum.TO_BE_SETTLED.getName());
-            paymentManagement1.setStatusFlag(StatusEnum.TO_BE_SETTLED.getFlag());
-            paymentManagement1.setNetWeight(weighingManagement1.getNetWeight());
-            paymentManagement1.setWarehouseName(weighingManagement1.getWarehouseName());
-            //质检信息
-            QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
-                    .eq("relation_id", weighingManagement1.getRelationId()));
-            if (qualityInspectionManagement!=null){
-                paymentManagement1.setTidalGrainPrice(qualityInspectionManagement.getTidalGrainPrice());
+            else {
+                //生成付款信息
+                PaymentManagement paymentManagement1=new PaymentManagement();
+                paymentManagement1.setId(IdGenerator.generateUUID());
+                paymentManagement1.setRelationId(weighingManagement1.getRelationId());
+                paymentManagement1.setCompId(weighingManagement1.getCompId());
+                paymentManagement1.setPaymentNo(weighingManagement1.getNumber());
+                paymentManagement1.setCustomerName(weighingManagement1.getCustomer());
+                paymentManagement1.setCustomerPhone(weighingManagement1.getCustomerPhone());
+                paymentManagement1.setCarNo(weighingManagement1.getCarNumber());
+                paymentManagement1.setType(weighingManagement1.getType());
+                paymentManagement1.setGoodsName(weighingManagement1.getGoodsName());
+                if ("潮粮".equals(weighingManagement1.getType())){
+                    //查收购设置数据
+                    PurchasePrice purchasePrice=purchasePriceService.selectOne(new EntityWrapper<PurchasePrice>()
+                            .eq("warehouse_id",weighingManagement.getWarehouseId())
+                            .eq("goods_name",weighingManagement.getGoodsName()));
+                    Float pureWeight=weighingManagement.getNetWeight()* (100-(Float.valueOf(qualityInspectionManagement1.getWaterContent())-purchasePrice.getWaterMin())*purchasePrice.getDeductWeight())/100;
+                    paymentManagement1.setPureWeight(pureWeight);
+                }
+                paymentManagement1.setStatus(StatusEnum.TO_BE_SETTLED.getName());
+                paymentManagement1.setStatusFlag(StatusEnum.TO_BE_SETTLED.getFlag());
+                paymentManagement1.setNetWeight(weighingManagement.getNetWeight());
+                paymentManagement1.setManagementType("1");
+                paymentManagement1.setWarehouseName(weighingManagement1.getWarehouseName());
+                //质检信息
+                QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
+                        .eq("relation_id", weighingManagement1.getRelationId()));
+                if (qualityInspectionManagement!=null){
+                    paymentManagement1.setTidalGrainPrice(qualityInspectionManagement.getTidalGrainPrice());
+                }
+                paymentManagementService.insert(paymentManagement1);
             }
-            paymentManagementService.insert(paymentManagement1);
         }
         boolean one = this.updateById(weighingManagement);
         if (one) {
-            return "OK";
+            return weighingManagement.getId();
         } else {
             return "NG";
         }
@@ -198,4 +237,99 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
         }
     }
 
+    /**
+     * 查看检斤信息
+     * @param id
+     * @return
+     */
+    @Override
+    public WeighingManagement getWeighingManagement(String id) {
+        WeighingManagement weighingManagement = this.selectById(id);
+        if (weighingManagement!=null){
+            CommonCompany commonCompany=commonCompanyService.selectOne(new EntityWrapper<CommonCompany>()
+                    .eq("comp_id",weighingManagement.getCompId()));
+            //公司名
+            if (commonCompany!=null){
+                weighingManagement.setCompName(commonCompany.getCompName());
+            }
+            WarehouseBaseInfo warehouseBaseInfo=warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
+                    .eq("comp_id",weighingManagement.getCompId())
+                    .eq("warehouse_name",weighingManagement.getWarehouseName()));
+            if (warehouseBaseInfo!=null){
+                //仓库负责人,电话
+                weighingManagement.setPerson(warehouseBaseInfo.getPersonCharge());
+                weighingManagement.setPersonPhone(warehouseBaseInfo.getPersonPhone());
+            }
+            //质检信息
+            QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
+                    .eq("relation_id", weighingManagement.getRelationId()));
+            if (qualityInspectionManagement!=null) {
+                weighingManagement.setQualityInspectionManagement(qualityInspectionManagement);
+            }
+        }
+        return weighingManagement;
+    }
+
+    /**
+     * 出库管理添加皮重检斤管理信息
+     * @param weighingManagement
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String addTare(WeighingManagement weighingManagement) {
+        String relationId=IdGenerator.generateUUID();
+        weighingManagement.setId(IdGenerator.generateUUID());
+        weighingManagement.setRelationId(relationId);
+        weighingManagement.setTareDate(new Date());
+        weighingManagement.setManagementType("3");
+        //状态改为已称皮重
+        weighingManagement.setStatus(StatusEnum.TARED.getName());
+        weighingManagement.setStatusFlag(StatusEnum.TARED.getFlag());
+        //生成质检信息
+        QualityInspectionManagement qualityInspectionManagement = new QualityInspectionManagement();
+        qualityInspectionManagement.setId(IdGenerator.generateUUID());
+        qualityInspectionManagement.setRelationId(relationId);
+        qualityInspectionManagement.setContractNo(weighingManagement.getContractNo());
+        qualityInspectionManagement.setCarNumber(weighingManagement.getCarNumber());
+        qualityInspectionManagement.setCompId(weighingManagement.getCompId());
+        qualityInspectionManagement.setGoodsName(weighingManagement.getGoodsName());
+        qualityInspectionManagement.setBinNumber(weighingManagement.getBinNumber());
+        qualityInspectionManagement.setManagementType("3");
+        qualityInspectionManagement.setQualityDate(new Date());
+        qualityInspectionManagement.setWarehouseName(weighingManagement.getWarehouseName());
+        qualityInspectionManagement.setStorageTagNo(weighingManagement.getStorageNumber());
+        boolean two=qualityInspectionManagementService.insert(qualityInspectionManagement);
+        boolean one=this.insert(weighingManagement);
+        //成功返回ok
+        if (one &&two ) {
+            return "OK";
+        } else {
+            return "NG";
+        }
+    }
+
+    /**
+     * 出库管理编辑皮重检斤管理信息
+     * @param weighingManagement
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String editTareOut(WeighingManagement weighingManagement) {
+        //状态改为已称皮重
+        weighingManagement.setStatus(StatusEnum.TARED.getName());
+        weighingManagement.setStatusFlag(StatusEnum.TARED.getFlag());
+        //更新检斤信息
+        boolean one = this.updateById(weighingManagement);
+        //更新质检信息
+        boolean two = qualityInspectionManagementService.updateById(weighingManagement.getQualityInspectionManagement());
+        //成功返回ok
+        if (one &&two ) {
+            return "OK";
+        } else {
+            return "NG";
+        }
+    }
+
 }

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

@@ -35,6 +35,8 @@
         <if test="authenticationStatusKey != null and authenticationStatusKey != ''">
             a.authentication_status_key=#{authenticationStatusKey}
         </if>
+        group by
+        a.id
         ORDER BY a.update_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}
@@ -42,6 +44,9 @@
     </select>
     <!-- 获得客户总数 -->
     <select id="getIdentityCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        select
+        count(1)
+        from(
         SELECT
         COUNT(a.id)
         FROM identity_authentication_info a
@@ -60,5 +65,7 @@
         <if test="authenticationStatusKey != null and authenticationStatusKey != ''">
             a.authentication_status_key=#{authenticationStatusKey}
         </if>
+        group by
+        a.id) t
     </select>
 </mapper>

+ 29 - 6
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml

@@ -7,9 +7,7 @@
         SELECT
         COUNT(id)
         FROM payment_management
-        WHERE
-        comp_id = #{compId}
-        and delete_flag = '0'
+        WHERE delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 2">
                 AND amount_ing_payable-amount_ed_payable>0
@@ -18,6 +16,15 @@
         <if test="warehouseName != null and warehouseName != ''">
             AND warehouse_name= #{warehouseName}
         </if>
+        <if test="pcFlag != null and pcFlag != ''and pcFlag == '2'">
+            AND comp_id = #{compId}
+        </if>
+        <if test="managementType != null and managementType != ''">
+            AND management_type = #{managementType}
+        </if>
+        <if test="customerPhone != null and customerPhone != ''">
+            AND customer_phone = #{customerPhone}
+        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(payment_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower( customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
@@ -51,26 +58,42 @@
         goods_name as goodsName,
         car_no as carNo,
         type,
+--         contract_no as contractNo,
         net_weight as netWeight,
+        gross_weight as grossWeight,
+        tare,
         pure_weight as pureWeight,
         tidal_grain_price as tidalGrainPrice,
         solid_grain_price as solidGrainPrice,
         amount_ing_payable as amountIngPayable,
         amount_ed_payable as amountEdPayable,
+        calculation_collectable as calculationCollectable,
+        actual_collectionment as actualCollectionment,
+        amount_ed_collectionable as amountEdCollectionable,
+        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
-        comp_id = #{compId}
-        and delete_flag = '0'
+        WHERE delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 2">
                 AND amount_ing_payable-amount_ed_payable>0
             </if>
         </if>
+        <if test="managementType != null and managementType != ''">
+            AND management_type = #{managementType}
+        </if>
+        <if test="pcFlag != null and pcFlag != ''and pcFlag == '2'">
+            AND comp_id = #{compId}
+        </if>
+        <if test="customerPhone != null and customerPhone != ''">
+            AND customer_phone = #{customerPhone}
+        </if>
         <if test="warehouseName != null and warehouseName != ''">
             AND warehouse_name= #{warehouseName}
         </if>

+ 10 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/QualityInspectionManagementMapper.xml

@@ -6,14 +6,17 @@
         SELECT
         COUNT(q.id)
         FROM quality_inspection_management q
-        WHERE
-        q.delete_flag = '0'
+        WHERE q.comp_id = #{compId}
+        and q.delete_flag = '0'
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(q.quality_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(q.customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(q.contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(q.car_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
+        <if test="managementType != null and managementType != ''">
+            AND q.management_type = #{managementType}
+        </if>
         <if test="warehouseName != null and warehouseName != ''">
             AND q.warehouse_name= #{warehouseName}
         </if>
@@ -39,8 +42,8 @@
         q.update_date as updateDate,
         q.quality_date as qualityDate
         FROM quality_inspection_management q
-        WHERE
-        q.delete_flag = '0'
+        WHERE q.comp_id = #{compId}
+        and q.delete_flag = '0'
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(q.quality_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(q.customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
@@ -50,6 +53,9 @@
         <if test="warehouseName != null and warehouseName != ''">
             AND q.warehouse_name= #{warehouseName}
         </if>
+        <if test="managementType != null and managementType != ''">
+            AND q.management_type = #{managementType}
+        </if>
         ORDER BY q.update_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}

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

@@ -6,7 +6,8 @@
         SELECT
         COUNT(id)
         FROM weighing_management
-        WHERE delete_flag = '0'
+        WHERE  comp_id = #{compId}
+        and delete_flag = '0'
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(number) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(customer) like lower(CONCAT('%',#{searchKeyWord},'%'))
@@ -16,6 +17,9 @@
         <if test="warehouseName != null and warehouseName != ''">
             AND warehouse_name= #{warehouseName}
         </if>
+        <if test="managementType != null and managementType != ''">
+            AND management_type = #{managementType}
+        </if>
     </select>
     <!-- 获得检斤管理列表 -->
     <select id="getListByCondition" parameterType="Map"
@@ -31,16 +35,20 @@
         goods_name as goodsName,
         gross_weight as grossWeight,
         tare,
+        in_out_type as inOutType,
         bin_number as binNumber,
         storage_number as storageNumber,
         secretary_weigher as secretaryWeigher,
+        skin_inspector as skinInspector,
         gross_date as grossDate,
         tare_date as tareDate,
         status,
         address_url as addressUrl,
+        net_weight as netWeight,
         status_flag as statusFlag
         FROM weighing_management
-        WHERE delete_flag = '0'
+        WHERE comp_id = #{compId}
+        and delete_flag = '0'
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(number) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(customer) like lower(CONCAT('%',#{searchKeyWord},'%'))
@@ -50,6 +58,9 @@
         <if test="warehouseName != null and warehouseName != ''">
             AND warehouse_name= #{warehouseName}
         </if>
+        <if test="managementType != null and managementType != ''">
+            AND management_type = #{managementType}
+        </if>
         ORDER BY update_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}