Sfoglia il codice sorgente

1.查看自己负责的仓库接2,入库任务负责人3.粮商更换手机号

zhangyuewww 3 anni fa
parent
commit
87568c5984

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

@@ -57,6 +57,13 @@ public class WarehouseBaseInfoController {
     public List<WarehouseBaseInfo> selectWarehouse(@RequestParam String compId,String warehouseType){
         return warehouseBaseInfoService.selectWarehouse(compId,warehouseType);
     }
+    /**
+     * 查看自己负责的常用仓库
+     */
+    @GetMapping("/selectWarehouseSelf")
+    public List<WarehouseBaseInfo> selectWarehouseSelf(@RequestParam String compId,String personCharge){
+        return warehouseBaseInfoService.selectWarehouseSelf(compId,personCharge);
+    }
     /**
      * 查看库房
      */

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

@@ -83,4 +83,11 @@ public interface IWarehouseBaseInfoService extends IService<WarehouseBaseInfo> {
      * @param flag 0 采购合同编号 1销售合同编号 2 移库任务编号+采购、销售合同编号 null 采购、销售合同编号
      */
     List<ContractManagementInfo> selectContractNoList(String compId,Integer flag);
+
+    /**
+     * 查看自己负责的常用仓库
+     * @param compId
+     * @return
+     */
+    List<WarehouseBaseInfo> selectWarehouseSelf(String compId,String personCharge);
 }

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

@@ -8,10 +8,7 @@ import com.yh.saas.common.support.util.IdGenerator;
 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.CommonCompanyIdentity;
-import com.yh.saas.plugin.yiliangyiyun.entity.DriverViewInfo;
-import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
-import com.yh.saas.plugin.yiliangyiyun.entity.InOutWarehouseTask;
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.exception.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonCompanyIdentityMapper;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
@@ -44,6 +41,8 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
     private ICommonBillOperateHisService billOperateHisService;
     @Autowired
     private ICommonCompanyIdentityService iCommonCompanyIdentityService;
+    @Autowired
+    private ICustomerInfoService customerInfoService;
 
     /**
      * 粮商认证列表
@@ -83,6 +82,15 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
     @Transactional(rollbackFor = Exception.class)
     public String modifyIdentityPhone(IdentityAuthenticationInfo identityAuthenticationInfo) {
         IdentityAuthenticationInfo identityAuthenticationInfo2 = this.selectById(identityAuthenticationInfo.getId());
+        //根据原来的手机号查到客户表
+        CustomerInfo customerInfo=customerInfoService.selectOne(new EntityWrapper<CustomerInfo>()
+                .eq("customer_phone", identityAuthenticationInfo2.getCustomerPhone())
+                .eq("delete_flag", "0"));
+        if(customerInfo!=null){
+            customerInfo.setCustomerPhone(identityAuthenticationInfo.getCustomerPhone());
+            //更新客户表
+            customerInfoService.updateById(customerInfo);
+        }
         //已覆盖的粮商解除覆盖状态
         if ("1".equals(identityAuthenticationInfo2.getCover())) {
             identityAuthenticationInfo2.setCover("0");
@@ -401,9 +409,10 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String saveCompanyIdentity(IdentityAuthenticationInfo identityAuthenticationInfo) {
+        IdentityAuthenticationInfo identityAuthenticationInfo1=this.selectById(identityAuthenticationInfo.getId());
         CommonCompanyIdentity commonCompanyIdentity = new CommonCompanyIdentity();
-        commonCompanyIdentity.setIdentityId(identityAuthenticationInfo.getId());
-        commonCompanyIdentity.setComId(identityAuthenticationInfo.getCompId());
+        commonCompanyIdentity.setIdentityId(identityAuthenticationInfo1.getId());
+        commonCompanyIdentity.setComId(identityAuthenticationInfo1.getCompId());
 
         Boolean one = iCommonCompanyIdentityService.insert(commonCompanyIdentity);
         //成功返回ok
@@ -419,8 +428,9 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
     public void deleteCompanyIdentity(IdentityAuthenticationInfo identityAuthenticationInfo) {
         List<CommonCompanyIdentity> list = this.iCommonCompanyIdentityService.selectList(new EntityWrapper<CommonCompanyIdentity>()
                 .eq("com_id", identityAuthenticationInfo.getCompId()).eq("identity_id", identityAuthenticationInfo.getId()));
-        for (CommonCompanyIdentity commonCompanyIdentity : list) {
-            this.iCommonCompanyIdentityService.deleteById(commonCompanyIdentity);
+        if (!CollectionUtils.isEmpty(list)){
+            this.iCommonCompanyIdentityService.delete(new EntityWrapper<CommonCompanyIdentity>()
+                    .eq("com_id", identityAuthenticationInfo.getCompId()).eq("identity_id", identityAuthenticationInfo.getId()));
         }
     }
 

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

@@ -507,6 +507,7 @@ public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, P
         boolean one = this.insert(purchaseOrder);
         // 添加客户信息
         int count = customerInfoService.selectCount(new EntityWrapper<CustomerInfo>().eq("customer_phone", purchaseOrder.getSellerPhone())
+                .eq("customer_name",purchaseOrder.getSeller())
                 .eq("delete_flag", "0"));
         if (count == 0) {
             CustomerInfo customerInfo = new CustomerInfo();

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

@@ -502,6 +502,7 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
 
         // 添加客户信息
         int count = customerInfoService.selectCount(new EntityWrapper<CustomerInfo>().eq("customer_phone", saleOrder.getBuyerPhone())
+                .eq("customer_name",saleOrder.getBuyer())
                 .eq("delete_flag", "0"));
         if (count == 0) {
             CustomerInfo customerInfo = new CustomerInfo();

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

@@ -87,15 +87,18 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
         warehouseInOutInfo.setContractNo(tranCarInfo.getContractNo());
         warehouseInOutInfo.setGoodsName(tranCarInfo.getGoodsName());
         warehouseInOutInfo.setStartWeight(tranCarInfo.getLoadNetWeight());
-        boolean two = warehouseInOutInfoService.insert(warehouseInOutInfo);
+
         List<WarehouseBaseInfo> listTmo = warehouseBaseInfoService.selectList(new EntityWrapper<WarehouseBaseInfo>().eq("warehouse_name", warehouseInOutInfo.getWarehouseName()));
         if (listTmo.size() > 0) {
             WarehouseBaseInfo warehouseBaseInfo = listTmo.get(0);
+            warehouseInOutInfo.setAgent(warehouseBaseInfo.getPersonCharge());
+            warehouseInOutInfo.setCommonId(warehouseBaseInfo.getPersonChargeKey());
             List<CommonUser> tmp = commonUserService.selectList(new EntityWrapper<CommonUser>().eq("phone", warehouseBaseInfo.getPersonPhone()));
             if (tmp.size() > 0) {
                 geTuiUtils.pushByCid("入库任务", "您有新的入库任务待完成,车牌号:" + warehouseInOutInfo.getCarNo(), tmp.get(0).getId());
             }
         }
+        boolean two = warehouseInOutInfoService.insert(warehouseInOutInfo);
         boolean one = this.insert(tranCarInfo);
         // 插入操作历史
         String staffName = this.billOperateHisService.getStaffAndName();

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

@@ -684,4 +684,20 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             return temp;
         }
     }
+
+    /**
+     * 查看自己负责的常用仓库
+     * @param compId
+     * @param personCharge
+     * @return
+     */
+    @Override
+    public List<WarehouseBaseInfo> selectWarehouseSelf(String compId, String personCharge) {
+        List<WarehouseBaseInfo> warehouseBaseInfoList = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
+                .eq("comp_id", compId)
+                .eq("warehouse_type","1")
+                .eq("person_charge", personCharge)
+                .eq("delete_flag", "0"));
+        return warehouseBaseInfoList;
+    }
 }

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

@@ -772,7 +772,9 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
         WarehouseInOutInfo warehouseInOutInfo = this.selectById(id);
         //详情信息
         WarehouseInOutDetail warehouseInOutDetail = warehouseInOutDetailService.selectOne(new EntityWrapper<WarehouseInOutDetail>().eq(WarehouseInOutDetail.QueryFiles.INFO_ID, id));
-        warehouseInOutInfo.setWarehouseInOutDetail(warehouseInOutDetail);
+        if (warehouseInOutDetail!=null){
+            warehouseInOutInfo.setWarehouseInOutDetail(warehouseInOutDetail);
+        }
         return warehouseInOutInfo;
     }