ccj il y a 2 ans
Parent
commit
a67fff3429

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

@@ -46,7 +46,7 @@ public class AppVersionController {
      */
     @GetMapping("/test")
     public void test() {
-        geTuiUtils.pushByCid("工作事项提醒","您有新的易粮易运流程,请及时审批","10272f536dd9405da38c28c4e6c34457");
+        geTuiUtils.pushByCid("工作事项提醒","您有新的易粮易运流程,请及时审批","c6a204c9fea14549b83ea96ea389f436");
 //       List<CommonUser> list =   commonUserService.selectList(new EntityWrapper<>());
 //       for(CommonUser commonUser:list){
 //           commonUser.setPassword(Md5Crypt.md5Crypt("123456".getBytes(), "$1$" + commonUser.getPhone().substring(0, 7)));

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

@@ -2,6 +2,10 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 
 import com.yh.saas.plugin.yiliangyiyun.entity.CostManagementInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousingOrder;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface CostManagementInfoMapper extends BaseMapper<CostManagementInfo> {
 
+    List<CostManagementInfo> getListByCondition(Map<String, Object> pageView);
 }

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

@@ -18,7 +18,9 @@ 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;
 
 /**
  * <p>
@@ -46,20 +48,23 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
         if(compId == null){
             compId = AuthSecurityUtils.getCurrentUserInfo().getCompId();
         }
-        Wrapper<CostManagementInfo> costManagementInfoWrapper = new EntityWrapper<>();
-        costManagementInfoWrapper.eq("warehouse_type", costManagementInfo.getWarehouseType())
-                                 .eq("comp_id", compId);
-        if (costManagementInfo.getWarehouseId()!=null&&!costManagementInfo.getWarehouseId().isEmpty()){
-            costManagementInfoWrapper.eq("warehouse_id", costManagementInfo.getWarehouseId());
-        }
-        if (costManagementInfo.getWarehouseName()!=null&&!costManagementInfo.getWarehouseName().isEmpty()){
-            costManagementInfoWrapper.like("warehouse_name", "%" + costManagementInfo.getWarehouseName() + "%");
-        }
-
-        costManagementInfoWrapper.gt("storage", 0);
-        costManagementInfoWrapper.orderBy("warehouse_name",false);
-
-        List<CostManagementInfo> costManagementInfoList = this.selectList(costManagementInfoWrapper);
+//        Wrapper<CostManagementInfo> costManagementInfoWrapper = new EntityWrapper<>();
+//        costManagementInfoWrapper.eq("warehouse_type", costManagementInfo.getWarehouseType())
+//                                 .eq("comp_id", compId);
+//        if (costManagementInfo.getWarehouseId()!=null&&!costManagementInfo.getWarehouseId().isEmpty()){
+//            costManagementInfoWrapper.eq("warehouse_id", costManagementInfo.getWarehouseId());
+//        }
+//        if (costManagementInfo.getWarehouseName()!=null&&!costManagementInfo.getWarehouseName().isEmpty()){
+//            costManagementInfoWrapper.like("warehouse_name", "%" + costManagementInfo.getWarehouseName() + "%");
+//        }
+//
+//        costManagementInfoWrapper.gt("storage", 0);
+//        costManagementInfoWrapper.orderBy("warehouse_name",false);
+//
+//        List<CostManagementInfo> costManagementInfoList = this.selectList(costManagementInfoWrapper);
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("compId",compId);
+        List<CostManagementInfo> costManagementInfoList = baseMapper.getListByCondition(pageView);
         return costManagementInfoList;
     }
 

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

@@ -236,13 +236,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         //公司信息
         CommonCompany commonCompany = commonCompanyService.selectOne(new EntityWrapper<CommonCompany>()
                 .eq("comp_id", paymentManagement.getCompId()));
-        //合同信息
-        ContractManagementInfo contractManagementInfo=ContractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
-                .eq("comp_id",paymentManagement.getCompId())
-                .eq("contract_no",paymentManagement.getContractNo()));
-        if (contractManagementInfo!=null){
-            paymentManagement.setContractManagement(contractManagementInfo);
-        }
+
         //仓库信息
         WarehouseBaseInfo warehouseBaseInfo=warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
                 .eq("comp_id",qualityInspectionManagement.getCompId())
@@ -253,6 +247,19 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             paymentManagement.setCompName(commonCompany.getCompName());
             paymentManagement.setTaxRegistrationNo(commonCompany.getCompImo());
         }
+        //合同信息
+        ContractManagementInfo contractManagementInfo=ContractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                .eq("comp_id",paymentManagement.getCompId())
+                .eq("contract_no",paymentManagement.getContractNo()));
+        if (contractManagementInfo!=null){
+            paymentManagement.setContractManagement(contractManagementInfo);
+            paymentManagement.setCompName(contractManagementInfo.getBuyer());
+            CommonCompany commonCompany1 = commonCompanyService.selectOne(new EntityWrapper<CommonCompany>()
+                    .eq("comp_name", contractManagementInfo.getBuyer()));
+            if(commonCompany1 != null){
+                paymentManagement.setTaxRegistrationNo(commonCompany1.getCompImo());
+            }
+        }
         //联系人
         if(warehouseBaseInfo != null){
             paymentManagement.setContacts(warehouseBaseInfo.getPersonCharge());

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

@@ -1325,14 +1325,14 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
                 .eq("contract_no",inOutWarehouseTask.getWarehouseName())
                 .eq("comp_id",inOutWarehouseTask.getCompId()));
-                if (contractManagementInfo!=null) {
+                if (contractManagementInfo!=null&&contractManagementInfo.getUnitContractPrice() != null) {
                     contractManagementInfo1.setContractPrice(Float.valueOf(String.valueOf(contractManagementInfo.getUnitContractPrice())));
                 }
                 //自运采购的移库
                 ContractManagementInfo contractManagementInfo2 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
                         .eq("comp_id", inOutWarehouseTask.getCompId())
                         .eq("contract_no", inOutWarehouseTask.getSendWarehouse()));
-                if (contractManagementInfo2 != null) {
+                if (contractManagementInfo2 != null&&contractManagementInfo2.getUnitContractPrice()!=null) {
                     contractManagementInfo1.setContractPrice(Float.valueOf(String.valueOf(contractManagementInfo2.getUnitContractPrice())));
                 }
                 //移库看成自运

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

@@ -263,15 +263,24 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                             }
                             //采购入库客户信息
                             else if ("收购入库".equals(warehousingOrder2.getInType())) {
-                                IdentityAuthenticationInfo identityAuthenticationInfo = identityAuthenticationInfoService.selectOne(new EntityWrapper<IdentityAuthenticationInfo>()
-                                        .eq("customer_name", warehousingOrder2.getCustomer())
-                                        .eq("authentication_status_key", "7")
-                                        .eq("comp_id", warehousingOrder2.getCompId()));
-                                if (identityAuthenticationInfo != null) {
-                                    warehousingOrder2.setCustomerName(identityAuthenticationInfo.getCustomerName());
-                                    warehousingOrder2.setBankCard(identityAuthenticationInfo.getBankCard());
-                                    warehousingOrder2.setBankDeposit(identityAuthenticationInfo.getBankDeposit());
-                                    warehousingOrder2.setBankDepositBranch(identityAuthenticationInfo.getBankDepositBranch());
+//                                IdentityAuthenticationInfo identityAuthenticationInfo = identityAuthenticationInfoService.selectOne(new EntityWrapper<IdentityAuthenticationInfo>()
+//                                        .eq("customer_name", warehousingOrder2.getCustomer())
+//                                        .eq("authentication_status_key", "7")
+//                                        .eq("comp_id", warehousingOrder2.getCompId()));
+//                                if (identityAuthenticationInfo != null) {
+//                                    warehousingOrder2.setCustomerName(identityAuthenticationInfo.getCustomerName());
+//                                    warehousingOrder2.setBankCard(identityAuthenticationInfo.getBankCard());
+//                                    warehousingOrder2.setBankDeposit(identityAuthenticationInfo.getBankDeposit());
+//                                    warehousingOrder2.setBankDepositBranch(identityAuthenticationInfo.getBankDepositBranch());
+//                                }
+                                PaymentManagement paymentManagement = paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
+                                        .eq("order_id",warehousingOrder2.getId())
+                                        .eq("delete_flag",0));
+                                if (paymentManagement != null) {
+                                    warehousingOrder2.setCustomerName(paymentManagement.getCustomerName());
+                                    warehousingOrder2.setBankCard(paymentManagement.getBankCard());
+                                    warehousingOrder2.setBankDeposit(paymentManagement.getBankDeposit());
+                                    warehousingOrder2.setBankDepositBranch(paymentManagement.getBankDepositBranch());
                                 }
                             }
                         }

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CostManagementInfoMapper.xml

@@ -2,4 +2,20 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.CostManagementInfoMapper">
 
+    <select id="getListByCondition" resultType="com.yh.saas.plugin.yiliangyiyun.entity.CostManagementInfo">
+        SELECT
+            wo.warehouse_name as warehouseName,
+            wo.goods_name as goodsName,
+            SUM(wo.surplus_weight) as storage,
+            ROUND(AVG(wo.avg_cost),3 )as cost
+        FROM
+            warehousing_order wo
+        left join warehouse_base_info wbi on wbi.warehouse_name = wo.warehouse_name and wbi.warehouse_type = 1
+        WHERE
+            wo.delete_flag = 0
+        AND wo.surplus_weight > 0
+        and wbi.delete_flag = 0
+        and wo.comp_id = #{compId}
+        GROUP BY wo.goods_name,wo.warehouse_name
+    </select>
 </mapper>

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

@@ -149,8 +149,8 @@
         q.picture_address as qualityInspectionPictureAddress,
         w.picture_address as weighingPictureAddress,
         w.contract_price as contractPrice,
-        c.comp_name as compName,
-        c.comp_imo as taxRegistrationNo,
+        ifnull(cmi.buyer,c.comp_name) as compName,
+        ifnull(cc.comp_imo,c.comp_imo) as taxRegistrationNo,
         i.id as identityId,
         a.invoicing,
         q.grade,
@@ -164,6 +164,9 @@
         left join quality_inspection_management q on q.relation_id = a.relation_id and q.comp_id = a.comp_id and q.delete_flag = 0
         left join weighing_management w on w.relation_id = a.relation_id and w.comp_id = a.comp_id and w.delete_flag = 0
         left join common_company c on c.comp_id = a.comp_id and c.delete_flag = 0
+        left join contract_management_info cmi on cmi.comp_id = a.comp_id and cmi.delete_flag = 0
+            and cmi.contract_no = a.contract_no
+        left join common_company cc on  cc.comp_name = cmi.buyer and cc.delete_flag = 0
         left join identity_authentication_info i on i.customer_name = a.customer_name
             and i.customer_phone = a.customer_phone and i.customer_type_flag = 1 and i.delete_flag = 0 and i.cover = 0
         left join common_company_identity cci on  cci.com_id = a.comp_id  and cci.delete_flag = 0