Bläddra i källkod

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

ccjgmwz 3 år sedan
förälder
incheckning
d8cc5982dc

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

@@ -125,5 +125,16 @@ public class ContractManagementInfoController {
         contractManagementInfoService.exportStorageFee(example,response);
     }
 
+    /**
+     * 利润核算分页列表查询
+     *
+     * @param contractManagementInfo
+     * @return
+     */
+    @GetMapping("/selectContractInfo")
+    public Page<ContractManagementInfo> selectContractInfo(ContractManagementInfo contractManagementInfo) {
+        return contractManagementInfoService.selectContractInfo(contractManagementInfo);
+    }
+
     }
 

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

@@ -535,6 +535,17 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
     @TableField(exist = false)
     private String endFlag;
 
+    /**
+     * 利润核算查询类型
+     */
+    @TableField(exist = false)
+    private String searchTypeCon;
+    /**
+     * 合同查询类型
+     */
+    @TableField(exist = false)
+    private String searchContractType;
+
 
     @Override
     protected Serializable pkVal() {

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

@@ -34,4 +34,20 @@ public interface ContractManagementInfoMapper extends BaseMapper<ContractManagem
     List<ContractManagementInfo> getListByCondition(Map<String, Object> pageView);
     Double selectSumSale(String compId);
     Double selectSumBuy(String compId);
+
+    /**
+     * 根据条件查询利润核算
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getContractCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询利润核算信息列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<ContractManagementInfo> getContractListByCondition(Map<String, Object> pageView);
 }

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

@@ -89,4 +89,12 @@ public interface IContractManagementInfoService extends IService<ContractManagem
     void exportStorageFee(ContractManagementInfo example, HttpServletResponse response) throws Exception;
     Double selectSumSale(String compId);
     Double selectSumBuy(String compId);
+
+    /**
+     * 利润核算分页列表查询
+     *
+     * @param contractManagementInfo
+     * @return
+     */
+    Page<ContractManagementInfo> selectContractInfo(ContractManagementInfo contractManagementInfo);
 }

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

@@ -1662,6 +1662,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
     public Double selectSumBuy(String compId) {
         return baseMapper.selectSumBuy(compId);
     }
+
     /**
      * 删除
      *
@@ -2259,4 +2260,37 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
 
     }
 
+    /**
+     * 利润核算分页列表查询
+     * @param contractManagementInfo
+     * @return
+     */
+    @Override
+    public Page<ContractManagementInfo> selectContractInfo(ContractManagementInfo contractManagementInfo) {
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (contractManagementInfo.getCurrentPage() - 1)
+                * contractManagementInfo.getPageSize());
+        //  公司ID
+        pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
+        pageView.put("searchKeyWord", contractManagementInfo.getSearchKeyWord());
+        pageView.put("startDate", contractManagementInfo.getStartDate());
+        pageView.put("endDate", contractManagementInfo.getEndDate());
+        pageView.put("searchTypeCon", contractManagementInfo.getSearchTypeCon());
+        pageView.put("searchContractType", contractManagementInfo.getSearchContractType());
+        pageView.put("agreementType", contractManagementInfo.getAgreementType());
+        pageView.put("pageSize", contractManagementInfo.getPageSize());
+        pageView.put("currentPage", contractManagementInfo.getCurrentPage());
+        // 查询服务商总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<ContractManagementInfo> dataList = baseMapper.getListByCondition(pageView);
+
+        Page<ContractManagementInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(contractManagementInfo.getCurrentPage());
+        page.setSize(contractManagementInfo.getPageSize());
+
+        return page;
+    }
+
 }

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

@@ -330,6 +330,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             warehouseInOutInfo.setNetWeight(Double.valueOf(paymentManagement.getNetWeight() / 1000));
             warehouseInOutInfo.setContractNo(paymentManagement1.getPaymentNo());
             warehouseInOutInfo.setInOutType("收购入库");
+            warehouseInOutInfo.setInOutFlag("2");
             warehouseInOutInfo.setStatusFlag("3");
             warehouseInOutInfo.setStatus("已提交");
             warehouseInOutInfo.setPaymentId(paymentManagement.getId());

+ 139 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -241,4 +241,143 @@
         a.contract_no
         ) b
     </select>
+    <!--获得利润核算列表总数-->
+    <select id="getContractCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(m.id)
+        FROM contract_management_info m
+        LEFT JOIN warehouse_in_out_info wi on m.contract_no = wi.contract_no
+--         LEFT JOIN warehouse_position_info wp on wi.id = wp.base_id
+        WHERE
+        m.comp_id = #{compId}
+        AND m.delete_flag = '0'
+        <if test="searchTypeCon != null and searchTypeCon != ''">
+            <!--执行中-->
+            <if test="searchTypeCon == 1">
+                AND (m.status_flag == '1' or approve_status='待决策人审核')
+            </if>
+            <!--已完成-->
+            <if test="searchTypeCon == 2">
+                AND m.status_flag = '3'
+            </if>
+            <!--发运结束-->
+            <if test="searchTypeCon == 3">
+                AND m.status_flag = '2'
+            </if>
+            <!--待执行-->
+            <if test="searchTypeCon == 4">
+                AND m.status_flag = '0'
+            </if>
+        </if>
+        <if test="searchContractType != null and searchContractType != ''">
+            <!--销售合同-->
+            <if test="searchContractType == 1">
+                AND m.contract_type = '1'
+            </if>
+            <!--采购合同-->
+            <if test="searchContractType == 2">
+                AND m.contract_type = '2'
+            </if>
+            <!--代收合同-->
+            <if test="searchContractType == 3">
+                AND m.contract_type = '3'
+                AND m.agreement_type = '代收合同'
+            </if>
+            <!--代储合同-->
+            <if test="searchContractType == 4">
+                AND m.contract_type = '1'
+                AND m.agreement_type = '代储合同'
+            </if>
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(m.contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower( m.buyer) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower( m.seller) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+    </select>
+    <!--利润核算列表查询-->
+    <select id="getContractListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo">
+        SELECT
+        m.id,
+        m.comp_id as compId,
+        m.contract_no as contractNo,
+        m.contract_type as contractType,
+        m.seller,
+        m.buyer,
+        m.signing_date,
+        m.status,
+        wi.warehouse_name as warehouseName,
+        wi.net_weight as netWeight,
+        m.approve_status as approveStatus,
+        m.agreement_type as agreementType
+        FROM contract_management_info m
+        LEFT JOIN warehouse_in_out_info wi on m.contract_no = wi.contract_no
+        WHERE
+        m.comp_id = #{compId}
+        AND m.delete_flag = '0'
+        <if test="searchTypeCon != null and searchTypeCon != ''">
+            <!--执行中-->
+            <if test="searchTypeCon == 1">
+                AND (m.status_flag == '1' or approve_status='待决策人审核')
+            </if>
+            <!--已完成-->
+            <if test="searchTypeCon == 2">
+                AND m.status_flag = '3'
+            </if>
+            <!--发运结束-->
+            <if test="searchTypeCon == 3">
+                AND m.status_flag = '2'
+            </if>
+            <!--待执行-->
+            <if test="searchTypeCon == 4">
+                AND m.status_flag = '0'
+            </if>
+        </if>
+        <if test="searchContractType != null and searchContractType != ''">
+            <!--销售合同-->
+            <if test="searchContractType == 1">
+                AND m.contract_type = '1'
+            </if>
+            <!--采购合同-->
+            <if test="searchContractType == 2">
+                AND m.contract_type = '2'
+            </if>
+            <!--代收合同-->
+            <if test="searchContractType == 3">
+                AND m.contract_type = '2'
+                AND m.agreement_type = '代收合同'
+            </if>
+            <!--代储合同-->
+            <if test="searchContractType == 4">
+                AND m.contract_type = '1'
+                AND m.agreement_type = '代储合同'
+            </if>
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(m.contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower( m.buyer) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower( m.seller) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        ORDER BY m.signing_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
 </mapper>

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

@@ -8,6 +8,7 @@
         wbi.warehouse_name AS warehouseName,
         pp.id,
         pp.goods_name AS goodsName,
+        pp.goods_name_key AS goodsNameKey,
         pp.warehouse_id as warehouseId,
         pp.water_min AS waterMin,
         pp.water_max AS waterMax,