Selaa lähdekoodia

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

ccjgmwz 3 vuotta sitten
vanhempi
commit
ad3af63b45
23 muutettua tiedostoa jossa 278 lisäystä ja 92 poistoa
  1. 10 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/DriverViewInfoController.java
  2. 21 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/IdentityAuthenticationInfoController.java
  3. 4 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PurchaseOrderController.java
  4. 3 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TranCarInfoController.java
  5. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CustomerInfo.java
  6. 18 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/DriverViewInfo.java
  7. 3 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/IdentityAuthenticationInfo.java
  8. 0 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TranCarInfo.java
  9. 2 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInOutInfo.java
  10. 3 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/ExceptionDefinition.java
  11. 7 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IDriverViewInfoService.java
  12. 13 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IIdentityAuthenticationInfoService.java
  13. 3 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ITranCarInfoService.java
  14. 2 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java
  15. 41 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverViewInfoServiceImpl.java
  16. 69 24
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/IdentityAuthenticationInfoServiceImpl.java
  17. 25 25
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchaseOrderServiceImpl.java
  18. 7 10
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranCarInfoServiceImpl.java
  19. 19 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java
  20. 7 3
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CustomerInfoMapper.xml
  21. 18 4
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/DriverViewInfoMapper.xml
  22. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PurchaseOrderMapper.xml
  23. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutInfoMapper.xml

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

@@ -120,5 +120,15 @@ public class DriverViewInfoController {
     public DriverCarInfo selectDriverPhoneByName(String id){
         return driverViewInfoService.selectDriverDetail(id);
     }
+    /**
+     * 审核
+     * @param id
+     * @return
+     */
+    @PostMapping("/api/examine")
+    public String examine(String id,Integer flag){
+        return driverViewInfoService.examine(id,flag);
+
+    }
 }
 

+ 21 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/IdentityAuthenticationInfoController.java

@@ -58,7 +58,7 @@ public class IdentityAuthenticationInfoController {
      * @return
      */
     @PostMapping("/api/addIdentityAuthenticationInfo")
-    public String addIdentityAuthenticationInfo(@RequestBody IdentityAuthenticationInfo identityAuthenticationInfo) {
+    public String addIdentityAuthenticationInfo(@RequestBody IdentityAuthenticationInfo identityAuthenticationInfo) throws ServiceException {
         return iIdentityAuthenticationInfoService.addIdentityAuthenticationInfo(identityAuthenticationInfo);
     }
 
@@ -77,7 +77,7 @@ public class IdentityAuthenticationInfoController {
      * @return
      */
     @GetMapping("/api/getIdentityAuthenticationInfo")
-    public IdentityAuthenticationInfo getIdentityAuthenticationInfo(@RequestBody IdentityAuthenticationInfo identityAuthenticationInfo){
+    public IdentityAuthenticationInfo getIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo){
         return iIdentityAuthenticationInfoService.getIdentityAuthenticationInfo(identityAuthenticationInfo.getId());
     }
 
@@ -98,6 +98,25 @@ public class IdentityAuthenticationInfoController {
     public IdentityAuthenticationInfo getInfo(@RequestParam String commonId) throws ServiceException {
         return iIdentityAuthenticationInfoService.getInfo(commonId);
     }
+    /**
+     * 审核
+     * @param id
+     * @return
+     */
+    @PostMapping("/api/examine")
+    public String examine(String id,Integer flag){
+        return iIdentityAuthenticationInfoService.examine(id,flag);
+    }
+
+    /**
+     * 设置默认
+     * @param identityAuthenticationInfo
+     * @return
+     */
+    @PostMapping("/api/setDefault")
+    public String setDefault(@RequestBody IdentityAuthenticationInfo identityAuthenticationInfo){
+        return iIdentityAuthenticationInfoService.setDefault(identityAuthenticationInfo);
+    }
 
 }
 

+ 4 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PurchaseOrderController.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
 import com.baomidou.mybatisplus.plugins.Page;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.Valid;
 import java.text.ParseException;
 
 
@@ -60,12 +61,12 @@ public class PurchaseOrderController {
 
     /**
      * 客户点价
-     * @param id
+     * @param purchaseOrder
      * @return
      */
     @PostMapping("/api/pointPrice")
-    public String pointPrice(String id,Float unitPrice) throws ServiceException, ParseException {
-        return purchaseOrderService.pointPrice(id, unitPrice);
+    public String pointPrice(@RequestBody PurchaseOrder purchaseOrder) throws ServiceException, ParseException {
+        return purchaseOrderService.pointPrice(purchaseOrder.getId(), purchaseOrder.getUnitPrice());
     }
 
     /**

+ 3 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TranCarInfoController.java

@@ -9,6 +9,8 @@ import com.yh.saas.plugin.yiliangyiyun.service.ITranTaskInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * <p>
  * 记录车次 前端控制器
@@ -49,7 +51,7 @@ public class TranCarInfoController {
      * @return
      */
     @GetMapping("/api/selectTranCarInfoNum")
-    public Integer selectTranCarInfoNum(@RequestBody TranCarInfo tranCarInfo){
+    public List<TranCarInfo> selectTranCarInfoNum(TranCarInfo tranCarInfo){
         return tranCarInfoService.selectTranCarInfoNum(tranCarInfo);
     }
 

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

@@ -46,7 +46,7 @@ public class CustomerInfo extends BaseModel<CustomerInfo> {
     /**
      * 客户类型
      */
-    private Float customerType;
+    private String customerType;
     /**
      * 公司名称
      */

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

@@ -57,6 +57,10 @@ public class DriverViewInfo extends BaseModel<DriverViewInfo> {
      * 附件地址
      */
     private String addressUrl;
+    /**
+     * 身份证附件地址
+     */
+    private String cardAddressUrl;
     /**
      * 司机身份证号码
      */
@@ -65,6 +69,14 @@ public class DriverViewInfo extends BaseModel<DriverViewInfo> {
      * 司机年龄
      */
     private String driverAge;
+    /**
+     * 认证状态key(1审核中3未通过5已覆盖7已认证)
+     */
+    private String authenticationStatusKey;
+    /**
+     * 认证状态
+     */
+    private String authenticationStatus;
     /**
      * 禁用标识(1:已禁用,0:没禁用)
      */
@@ -77,6 +89,11 @@ public class DriverViewInfo extends BaseModel<DriverViewInfo> {
      * 用户id
      */
     private String commonId;
+    /**
+     * APP端(传0)
+     */
+    @TableField(exist = false)
+    private String pcFlag;
 
     /**
      * 模糊查询
@@ -103,7 +120,7 @@ public class DriverViewInfo extends BaseModel<DriverViewInfo> {
 
         public static final String DISABLE_STATUS_FLAG ="disable_status_flag";
 
-        public static final String DRIVER_NAME = "driver_name";
+        public static final String DRIVER_PHONE = "driver_phone";
 
         public static final String NUMBER_CARD = "number_card";
     }

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

@@ -44,7 +44,7 @@ public class IdentityAuthenticationInfo extends BaseModel<IdentityAuthentication
     /**
      * 粮商类型
      */
-    private Float customerType;
+    private String customerType;
     /**
      * 公司名称
      */
@@ -148,5 +148,7 @@ public class IdentityAuthenticationInfo extends BaseModel<IdentityAuthentication
         public static final String CUSTOMER_PHONE = "customer_phone";
 
         public static final String DELETE_FLAG = "delete_flag";
+
+        public static final String DEFAULT_FLAG = "default_flag";
     }
 }

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

@@ -1,14 +1,12 @@
 package com.yh.saas.plugin.yiliangyiyun.entity;
 
 import java.util.Date;
-import com.baomidou.mybatisplus.activerecord.Model;
 import java.io.Serializable;
 import java.util.List;
 
 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;

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

@@ -254,11 +254,12 @@ public class WarehouseInOutInfo extends BaseModel<WarehouseInOutInfo> {
     private String protein;
 
     /**
-     * PC端(传1)
+     * PC端(传1,APP传0)
      */
     @TableField(exist = false)
     private String pcFlag;
 
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 3 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/ExceptionDefinition.java

@@ -77,6 +77,9 @@ public class ExceptionDefinition {
     public static  ServiceExceptionDefinition IDENTITY_IS_BEING_AUDITED =
             new ServiceExceptionDefinition(11017, "粮商身份正在审核中");
 
+    public static  ServiceExceptionDefinition PHONE_NUMBER_ALREADY_EXISTS=
+            new ServiceExceptionDefinition(11018, "手机号已存在,是否覆盖");
+
     public static  ServiceExceptionDefinition ADDRESS_DATABASE_QUERY_FAILED  =
             new ServiceExceptionDefinition(16002, "执行语句失败");
     public static  ServiceExceptionDefinition PURCHASE_OVER_NUM  =
@@ -91,7 +94,6 @@ public class ExceptionDefinition {
     public static  ServiceExceptionDefinition ADVERTISEMENT_SQL_UPDATE_FAILED =
             new ServiceExceptionDefinition(22003, "修改广告数据库失败");
 
-
     public static  ServiceExceptionDefinition ADMIN_UNKNOWN_EXCEPTION =
             new ServiceExceptionDefinition(50000, "管理员系统未知异常");
 

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

@@ -67,6 +67,13 @@ public interface IDriverViewInfoService extends IService<DriverViewInfo> {
      * @return
      */
     DriverCarInfo selectDriverDetail(String id);
+    /**
+     * 审核
+     * @param id
+     * @param flag 1通过 2 驳回
+     * @return
+     */
+    String examine(String id,Integer flag);
 
 
 }

+ 13 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IIdentityAuthenticationInfoService.java

@@ -32,7 +32,7 @@ public interface IIdentityAuthenticationInfoService extends IService<IdentityAut
      * 添加身份认证
      * @param identityAuthenticationInfo
      */
-    String addIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo);
+    String addIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo) throws ServiceException;
 
     /**
      * 编辑身份认证
@@ -55,4 +55,16 @@ public interface IIdentityAuthenticationInfoService extends IService<IdentityAut
      * @param
      */
     IdentityAuthenticationInfo getInfo(String commonId) throws ServiceException;
+    /**
+     * 审核
+     * @param id
+     * @param flag 1通过 2 驳回
+     * @return
+     */
+    String examine(String id,Integer flag);
+    /**
+     * 设置默认
+     * @param identityAuthenticationInfo
+     */
+    String setDefault(IdentityAuthenticationInfo identityAuthenticationInfo);
 }

+ 3 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ITranCarInfoService.java

@@ -1,12 +1,11 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
-import com.baomidou.mybatisplus.plugins.Page;
-import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranCarInfo;
 import com.baomidou.mybatisplus.service.IService;
-import com.yh.saas.plugin.yiliangyiyun.entity.TranTaskInfo;
 import com.yh.saas.plugin.yiliangyiyun.exception.ServiceException;
 
+import java.util.List;
+
 /**
  * <p>
  * 记录车次 服务类
@@ -33,7 +32,7 @@ public interface ITranCarInfoService extends IService<TranCarInfo> {
      * 查发车数量
      * @param tranCarInfo
      */
-    Integer selectTranCarInfoNum(TranCarInfo tranCarInfo);
+    List<TranCarInfo> selectTranCarInfoNum(TranCarInfo tranCarInfo);
 
 
 }

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

@@ -160,7 +160,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                 .eq(WarehouseBaseInfo.QueryFiles.COMP_ID,AuthSecurityUtils.getCurrentUserInfo().getCompId())
                 .eq(WarehouseBaseInfo.QueryFiles.WAREHOUSE_NAME, contractManagementInfo.getContractNo())
                 .eq(WarehouseBaseInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
-        if(warehouseBaseInfo!=null){
+        if(!StringUtils.isEmpty(warehouseBaseInfo.getId())){
             warehouseBaseInfo.setPersonChargeKey(contractManagementInfo.getPersonChargeKey());
             warehouseBaseInfo.setPersonCharge(contractManagementInfo.getPersonCharge());
             warehouseBaseInfo.setPersonPhone(contractManagementInfo.getPersonPhone());
@@ -292,7 +292,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                     TranTaskInfo tranTaskInfo = tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
                             .eq("contract_no",contractManagementInfo1.getContractNo())
                             .eq("delete_flag","0"));
-                    if (tranTaskInfo!=null) {
+                    if (!StringUtils.isEmpty(tranTaskInfo.getId())) {
                         //定义装车净重
                         Float loadNetWeight = 0.0f;
                         //定义卸车净重

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

@@ -8,6 +8,7 @@ import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.entity.DriverCarInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.DriverPayeeInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.DriverViewInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.DriverViewInfoMapper;
@@ -62,13 +63,18 @@ public class DriverViewInfoServiceImpl extends ServiceImpl<DriverViewInfoMapper,
     public String addInfo(DriverViewInfo driverViewInfo) {
         //新增主键id
         driverViewInfo.setId(IdGenerator.generateUUID());
+        //APP添加的司机需要审核
+        if("0".equals(driverViewInfo.getPcFlag())) {
+            driverViewInfo.setAuthenticationStatus(StatusEnum.IDENTITY_REVIEWED.getName());
+            driverViewInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
+        }
         //判断司机电话是否唯一
         List<DriverViewInfo> driverViewInfos =
                 this.selectList(new EntityWrapper<DriverViewInfo>()
-                        .eq(DriverViewInfo.QueryFiles.DRIVER_NAME, driverViewInfo.getDriverPhone())
+                        .eq(DriverViewInfo.QueryFiles.DRIVER_PHONE, driverViewInfo.getDriverPhone())
                         .eq(DriverViewInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
         if (driverViewInfos.size() > 0) {
-            throw new YException(YExceptionEnum.DRIVER_PHONE_ERROR);
+                throw new YException(YExceptionEnum.DRIVER_PHONE_ERROR);
         }
         //判断司机身份证号是否唯一
         List<DriverViewInfo> driverViewInfoList =
@@ -127,6 +133,8 @@ public class DriverViewInfoServiceImpl extends ServiceImpl<DriverViewInfoMapper,
      */
     @Override
     public String editInfo(DriverViewInfo driverViewInfo) {
+        driverViewInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COVERED.getFlag());
+        driverViewInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COVERED.getName());
         //主表信息编辑
         this.updateById(driverViewInfo);
         //货车信息编辑
@@ -172,6 +180,8 @@ public class DriverViewInfoServiceImpl extends ServiceImpl<DriverViewInfoMapper,
                 * driverViewInfo.getPageSize());
         //公司id
         pageView.put("compId", driverViewInfo.getCompId());
+        pageView.put("commonId", driverViewInfo.getCommonId());
+        pageView.put("pcFlag", driverViewInfo.getPcFlag());
         pageView.put("residentCityProvincial", driverViewInfo.getResidentCityProvincial());
         pageView.put("residentCityMunicipal", driverViewInfo.getResidentCityMunicipal());
         pageView.put("searchKeyWord", driverViewInfo.getSearchKeyWord());
@@ -292,6 +302,35 @@ public class DriverViewInfoServiceImpl extends ServiceImpl<DriverViewInfoMapper,
                 .eq(DriverCarInfo.QueryFiles.DRIVER_ID, id).eq(DriverViewInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
         return driverCarInfo;
     }
+
+    /**
+     * 审核
+     * @param id
+     * @param flag 1通过 2 驳回
+     * @return
+     */
+    @Override
+    public String examine(String id, Integer flag) {
+        //查询司机列表
+        DriverViewInfo driverViewInfo = this.selectById(id);
+        if (driverViewInfo != null ){
+            //通过
+            if(flag==1){
+                driverViewInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
+                driverViewInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
+            }
+            //驳回
+            else{
+                driverViewInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
+                driverViewInfo.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
+            }
+            //更改司机信息
+            this.updateById(driverViewInfo);
+            return "OK";
+        }
+        return "NG";
+    }
+
     public void DBConnection(){
         try{
             //加载驱动程序

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

@@ -2,15 +2,14 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import cn.hutool.core.lang.UUID;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.common.support.util.StringUtils;
 import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
-import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutDetail;
-import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.ProcurementPlanInfo;
 import com.yh.saas.plugin.yiliangyiyun.exception.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.IdentityAuthenticationInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
@@ -19,7 +18,6 @@ import com.yh.saas.plugin.yiliangyiyun.util.MD5Util;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.sqlite.util.StringUtils;
 
 import java.sql.*;
 import java.util.List;
@@ -91,7 +89,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
      * @return
      */
     @Override
-    public String addIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo){
+    public String addIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo)throws ServiceException{
         // 根据传参手机号判断手机号是否存在
         //  空是新增
         identityAuthenticationInfo.setId(IdGenerator.generateUUID());
@@ -104,16 +102,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
                         .eq(IdentityAuthenticationInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
         //同一手机号再次被认证
         if (identityAuthenticationInfoList.size() > 0) {
-            //认证状态改为已覆盖
-            identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COVERED.getName());
-            identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COVERED.getFlag());
-            // 操作主表数据
-            this.updateById(identityAuthenticationInfo);
-            // 插入操作历史
-            String staffName = this.billOperateHisService.getStaffAndName();
-            // 插入操作历史
-            this.billOperateHisService.saveBillOperateHis(identityAuthenticationInfo.getId(), NumberConstant.CONSTANT_PURCHASE, staffName, null,
-                    identityAuthenticationInfo.getAuthenticationStatus(), null, "");
+            throw new AppServiceException(ExceptionDefinition.PHONE_NUMBER_ALREADY_EXISTS);
         }
         // 操作主表数据
         this.insert(identityAuthenticationInfo);
@@ -136,13 +125,14 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
      */
     @Override
     public String editIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo) {
-        if("5".equals(identityAuthenticationInfo.getAuthenticationStatusKey())){
-            this.updateById(identityAuthenticationInfo);
-                return "OK";
-        }
-        //身份认证状态非未通过
-        else{
-            throw new YException(YExceptionEnum.AUTHENTICATION_INFORMATION_CHANGE_FAILED);
+        identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COVERED.getFlag());
+        identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COVERED.getName());
+        boolean one=this.updateById(identityAuthenticationInfo);
+        //成功返回ok
+        if (one ) {
+            return "OK";
+        } else {
+            return "NG";
         }
     }
     /**
@@ -154,7 +144,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
     public IdentityAuthenticationInfo getIdentityAuthenticationInfo(String id) {
        //查看身份认证
         IdentityAuthenticationInfo identityAuthenticationInfo = this.selectById(id);
-            return identityAuthenticationInfo;
+        return identityAuthenticationInfo;
     }
 
     /**
@@ -183,7 +173,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
                 this.selectOne(new EntityWrapper<IdentityAuthenticationInfo>()
                         .eq(IdentityAuthenticationInfo.QueryFiles.COMMON_ID, commonId)
                         .eq(IdentityAuthenticationInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
-        if(identityAuthenticationInfo!=null){
+        if(!StringUtils.isEmpty(identityAuthenticationInfo.getId())){
             //身份审核中
             if ("1".equals(identityAuthenticationInfo.getAuthenticationStatusKey())){
                 throw new AppServiceException(ExceptionDefinition.IDENTITY_IS_BEING_AUDITED);
@@ -195,6 +185,61 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
         }
         return identityAuthenticationInfo;
     }
+
+    /**
+     * 审核
+     * @param id
+     * @param flag 1通过 2 驳回
+     * @return
+     */
+    @Override
+    public String examine(String id, Integer flag) {
+        //查询粮商列表
+        IdentityAuthenticationInfo identityAuthenticationInfo = this.selectById(id);
+        if (!StringUtils.isEmpty(identityAuthenticationInfo.getId())){
+            //通过
+            if(flag==1){
+                identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
+                identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
+            }
+            //驳回
+            else{
+                identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
+                identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
+            }
+            //更改粮商信息
+            this.updateById(identityAuthenticationInfo);
+            return "OK";
+        }
+        return "NG";
+    }
+
+    /**
+     * 设置默认
+     * @param identityAuthenticationInfo
+     */
+    @Override
+    public String setDefault(IdentityAuthenticationInfo identityAuthenticationInfo) {
+        //查询是否有默认身份
+        IdentityAuthenticationInfo identityAuthenticationInfo1=this.selectOne(new EntityWrapper<IdentityAuthenticationInfo>()
+                .eq("common_id",identityAuthenticationInfo.getCommonId())
+                .eq(IdentityAuthenticationInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0)
+                .eq(IdentityAuthenticationInfo.QueryFiles.DEFAULT_FLAG,NumberConstant.CONSTANT1));
+        if(!StringUtils.isEmpty(identityAuthenticationInfo1.getId())){
+            //取消默认
+            identityAuthenticationInfo1.setDefaultFlag("0");
+            this.updateById(identityAuthenticationInfo1);
+        }
+        identityAuthenticationInfo.setDefaultFlag("1");
+        boolean one=this.updateById(identityAuthenticationInfo);
+        //成功返回ok
+        if (one ) {
+            return "OK";
+        } else {
+            return "NG";
+        }
+    }
+
     public void DBConnection(){
         try{
             //加载驱动程序

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

@@ -29,7 +29,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.RequestBody;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -158,6 +157,7 @@ public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, P
                 priceChangeRecord.setPrice(unitPrice);
                 priceChangeRecord.setPriceType("点价");
                 priceChangeRecordService.insert(priceChangeRecord);
+                return "OK";
             }
         }
         return "NG";
@@ -320,30 +320,30 @@ public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, P
         purchaseOrder.setId(IdGenerator.generateUUID());
         // 操作主表数据
         boolean one = this.insert(purchaseOrder);
-        boolean isStartWorkflow = StringUtils.isBlank(purchaseOrder.getWorkflowId());
-        // 不是退回的单子
-        if (isStartWorkflow) {
-            Workflow workflow = workflowService
-                    .findLatestWorkflowByBusinessCode("PURCHASE-ORDER-APPROVE");
-            // 没配置审核流程,直接结束并处理信息
-            if (workflow == null) {
-                throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
-            }
-            // 开启审核流
-            else {
-
-                // 设置状态 已提交审核
-                purchaseOrder.setWorkflowId(workflow.getId());
-                this.updateById(purchaseOrder);
-                workflowService.startInstance(workflow.getId(), purchaseOrder.getId());
-            }
-        }
-        // 退回的单子 再启用
-        else {
-
-            this.updateById(purchaseOrder);
-            workflowService.activateInstance(purchaseOrder.getWorkflowId(), purchaseOrder.getId());
-        }
+//        boolean isStartWorkflow = StringUtils.isBlank(purchaseOrder.getWorkflowId());
+//        // 不是退回的单子
+//        if (isStartWorkflow) {
+//            Workflow workflow = workflowService
+//                    .findLatestWorkflowByBusinessCode("PURCHASE-ORDER-APPROVE");
+//            // 没配置审核流程,直接结束并处理信息
+//            if (workflow == null) {
+//                throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+//            }
+//            // 开启审核流
+//            else {
+//
+//                // 设置状态 已提交审核
+//                purchaseOrder.setWorkflowId(workflow.getId());
+//                this.updateById(purchaseOrder);
+//                workflowService.startInstance(workflow.getId(), purchaseOrder.getId());
+//            }
+//        }
+//        // 退回的单子 再启用
+//        else {
+//
+//            this.updateById(purchaseOrder);
+//            workflowService.activateInstance(purchaseOrder.getWorkflowId(), purchaseOrder.getId());
+//        }
         if (one) {
             return "OK";
         }else{

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

@@ -1,10 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.baomidou.mybatisplus.plugins.Page;
-import com.baomidou.mybatisplus.toolkit.CollectionUtils;
 import com.yh.saas.common.support.util.IdGenerator;
-import com.yh.saas.common.support.util.StringUtils;
 import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
@@ -18,7 +15,6 @@ import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.text.ParseException;
 import java.util.List;
 
 /**
@@ -48,13 +44,13 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
     public String addTranCar(TranCarInfo tranCarInfo) throws ServiceException {
         //新增主键id
         tranCarInfo.setId(IdGenerator.generateUUID());
-        tranCarInfo.setStatus(StatusEnum.TRAN_DO.getName());
-        tranCarInfo.setStatusFlag(StatusEnum.TRAN_DO.getFlag());
+        tranCarInfo.setStatus(StatusEnum.NOT_DELIVERED.getName());
+        tranCarInfo.setStatusFlag(StatusEnum.NOT_DELIVERED.getFlag());
         tranCarInfo.setConfirmFlag(StatusEnum.NOT_CONFIRM.getFlag());
         //根据手机号判断司机是否认证
         DriverViewInfo driverViewInfo =
                 driverViewInfoService.selectOne(new EntityWrapper<DriverViewInfo>()
-                        .eq(DriverViewInfo.QueryFiles.DRIVER_NAME, tranCarInfo.getDriverPhone())
+                        .eq(DriverViewInfo.QueryFiles.DRIVER_PHONE, tranCarInfo.getDriverPhone())
                         .eq(DriverViewInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
         if (driverViewInfo==null) {
             throw new AppServiceException(ExceptionDefinition.DRIVER_NOT_CERTIFIED);
@@ -115,10 +111,11 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
      * @param tranCarInfo
      */
     @Override
-    public Integer selectTranCarInfoNum(TranCarInfo tranCarInfo) {
-        Integer count = this.selectCount(new EntityWrapper<TranCarInfo>()
+    public List<TranCarInfo> selectTranCarInfoNum(TranCarInfo tranCarInfo) {
+        //查合同下的发车数据
+        List<TranCarInfo> tranCarInfoList=this.selectList(new EntityWrapper<TranCarInfo>()
                 .eq("contract_no", tranCarInfo.getContractNo())
                 .eq(TranCarInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
-        return count;
+        return tranCarInfoList;
     }
 }

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

@@ -7,8 +7,6 @@ import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
-import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
-import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInOutInfoMapper;
@@ -25,9 +23,7 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.RequestBody;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import java.util.HashMap;
@@ -53,6 +49,8 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
     private IWarehousePositionInfoService warehousePositionInfoService;
     @Autowired
     private IWarehouseInOutInfoService warehouseInOutInfoService;
+    @Autowired
+    private ITranCarInfoService tranCarInfoService;
 
     /**
      * 待完成页面列表
@@ -299,6 +297,23 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
             }
             // 编辑修改记录
             else {
+                //App端入库关联派车表
+                if("0".equals(warehouseInOutInfo.getPcFlag())){
+                    TranCarInfo tranCarInfo=tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
+                        .eq("contract_no", warehouseInOutInfo.getContractNo())
+                        .eq("car_no",warehouseInOutInfo.getCarNo())
+                        .eq(TranCarInfo.QueryFiles.DELETE_FLAG,NumberConstant.CONSTANT0));
+                    if (!StringUtils.isEmpty(tranCarInfo.getId())){
+                        //将到货数据同步到派车表
+                        tranCarInfo.setUnloadNetWeight(warehouseInOutInfo.getNetWeight());
+                        tranCarInfo.setUnloadPoundImg(warehouseInOutInfo.getAddressUrl());
+                        tranCarInfo.setDeductionAmount(warehouseInOutInfo.getDeductionAmount());
+                        tranCarInfo.setDeductionItems(warehouseInOutInfo.getDeductionItems());
+                        tranCarInfo.setStatus(StatusEnum.DELIVERED.getName());
+                        tranCarInfo.setStatusFlag(StatusEnum.DELIVERED.getFlag());
+                        tranCarInfoService.updateById(tranCarInfo);
+                    }
+                }
                 warehouseInOutInfo.setStatusFlag(StatusEnum.SUBMITTED.getFlag());
                 warehouseInOutInfo.setStatus(StatusEnum.SUBMITTED.getName());
                 this.updateById(warehouseInOutInfo);

+ 7 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CustomerInfoMapper.xml

@@ -10,7 +10,8 @@
         comp_id = #{compId}
         and delete_flag = '0'
         <if test="searchKeyWord != null and searchKeyWord != ''">
-            AND (lower(customer) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            AND (lower(comp_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
     </select>
@@ -19,7 +20,9 @@
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.CustomerInfo">
         SELECT
         id,
-        customer as customer,
+        comp_name as compName,
+        customer_name as customerName,
+        customer_type_flag as customerTypeFlag,
         comp_address as compAddress,
         customer_phone as customerPhone,
         pay_taxes_card as payTaxesCard,
@@ -34,7 +37,8 @@
         comp_id = #{compId}
         and delete_flag = '0'
         <if test="searchKeyWord != null and searchKeyWord != ''">
-            AND (lower(customer) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            AND (lower(comp_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         ORDER BY update_date DESC

+ 18 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/DriverViewInfoMapper.xml

@@ -12,8 +12,7 @@
         left join driver_car_info c on d.id=c.driver_id
         left join driver_payee_info p on d.id=p.driver_id
         WHERE
-        d.comp_id = #{compId}
-        and d.delete_flag = '0'
+        d.delete_flag = '0'
         <if test="residentCityProvincial != null and residentCityProvincial != ''">
             AND d.resident_city_provincial = #{residentCityProvincial}
         </if>
@@ -26,6 +25,14 @@
             OR lower(d.number_card) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(c.car_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
+        <if test="pcFlag != null and pcFlag != ''">
+            <if test="pcFlag == 0">
+                AND common_id = #{commonId}
+            </if>
+            <if test="pcFlag == 1">
+                AND comp_id = #{compId}
+            </if>
+        </if>
         group by
         d.id
         ) t
@@ -48,8 +55,7 @@
         left join driver_car_info c on d.id=c.driver_id
         left join driver_payee_info p on d.id=p.driver_id
         WHERE
-        d.comp_id = #{compId}
-        and d.delete_flag = '0'
+        d.delete_flag = '0'
         <if test="residentCityProvincial != null and residentCityProvincial != ''">
             AND d.resident_city_provincial = #{residentCityProvincial}
         </if>
@@ -62,6 +68,14 @@
             OR lower(d.number_card) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(c.car_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
+        <if test="pcFlag != null and pcFlag != ''">
+            <if test="pcFlag == 0">
+                AND common_id = #{commonId}
+            </if>
+            <if test="pcFlag == 1">
+                AND comp_id = #{compId}
+            </if>
+        </if>
         group by
         d.id
         ORDER BY d.update_date DESC

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

@@ -43,6 +43,7 @@
         p.id,
         p.contract_no as contractNo,
         p.procurement_plan as procurementPlan,
+        p.goods_name as goodsName,
         p.customer,
         p.unit_price as unitPrice,
         p.basis,

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

@@ -53,6 +53,7 @@
         d.mildew_grain as mildewGrain,
         d.imperfect_grain as imperfectGrain,
         d.quality_inspector as qualityInspector,
+        w.start_weight as startWeight,
         w.address_url as addressUrl
         FROM warehouse_in_out_info w
         left join warehouse_in_out_detail d on w.id=d.info_id