Explorar o código

月度账单 调账流水记录 开票相关

zxf hai 9 horas
pai
achega
4f3de60d0f
Modificáronse 17 ficheiros con 226 adicións e 27 borrados
  1. 51 2
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/front/controller/Kd100Controller.java
  2. 63 0
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/front/service/impl/Kuaidi100Service.java
  3. 3 0
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/config/KD100ExpressConfig.java
  4. 2 1
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/controller/BizInvoiceController.java
  5. 4 4
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/controller/BizWaybillCostDetailsController.java
  6. 19 0
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/domain/BizFinancialAdjustmentRecord.java
  7. 10 0
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/domain/BizWaybillCostDetails.java
  8. 11 1
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/domain/RptFinancialMonthSummary.java
  9. 2 0
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/mapper/RptFinancialMonthSummaryMapper.java
  10. 2 0
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/IRptFinancialMonthSummaryService.java
  11. 1 1
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/InvoiceService.java
  12. 5 5
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/BizWaybillCostDetailsServiceImpl.java
  13. 8 2
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/InvoiceServiceImpl.java
  14. 9 3
      jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/RptFinancialMonthSummaryServiceImpl.java
  15. 10 4
      jd-logistics-modules/jd-logistics-system/src/main/resources/mapper/logistics/BizFinancialAdjustmentRecordMapper.xml
  16. 2 2
      jd-logistics-modules/jd-logistics-system/src/main/resources/mapper/logistics/BizWaybillCostDetailsMapper.xml
  17. 24 2
      jd-logistics-modules/jd-logistics-system/src/main/resources/mapper/logistics/RptFinancialMonthSummaryMapper.xml

+ 51 - 2
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/front/controller/Kd100Controller.java

@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
@@ -29,17 +30,25 @@ public class Kd100Controller {
    @Autowired
    RedisTemplate redisTemplate;
 
-   @GetMapping("/test") @PostMapping("/queryExpres")
+    @PostMapping("/queryExpres")
     public AjaxResult queryExpres(@RequestBody Map param)  {
         try {
             logger.info("调用快递100查询实时快递接口  运单号: {}", param.get("number"));
-            param.put("resultv2","1");
+            param.put("resultv2","4");
             Object  redisResult= redisTemplate.opsForValue().get(param.get("number"));
             if(redisResult==null){
                 String   result = kuaidi100Service.queryExpress(param);
                 ObjectMapper objectMapper = new ObjectMapper();
                 Map<String, Object> map = objectMapper.readValue(result, Map.class);
                 if("ok".equals(map.get("message"))){
+                    //通过返回的公司编码返回物流公司名称
+                    List<Map<String,Object>> comList=kuaidi100Service.getComList(map.get("com").toString());
+                    if(comList.size()!=0){
+                        map.put("compamyName",comList.get(0).get("company_name"));
+                    }
+                    else{
+                        map.put("compamyName",null);
+                    }
                     redisTemplate.opsForValue().set(param.get("number"), map, 30, TimeUnit.MINUTES);;
                     return AjaxResult.success(map);
                 }
@@ -55,4 +64,44 @@ public class Kd100Controller {
 
 
     }
+
+
+
+
+
+
+    @PostMapping("/queryExpresPlus")
+    public AjaxResult queryExpresPlus(@RequestBody Map param)  {
+        try {
+            logger.info("调用快递100查询实时快递接口  运单号: {}", param.get("number"));
+            param.put("resultv2","4");
+            Object  redisResult= redisTemplate.opsForValue().get(param.get("number"));
+            if(redisResult==null){
+                String   result = kuaidi100Service.queryExpresPlus(param);
+                ObjectMapper objectMapper = new ObjectMapper();
+                Map<String, Object> map = objectMapper.readValue(result, Map.class);
+                if("ok".equals(map.get("message"))){
+                    //通过返回的公司编码返回物流公司名称
+                    List<Map<String,Object>> comList=kuaidi100Service.getComList(map.get("com").toString());
+                    if(comList.size()!=0){
+                        map.put("compamyName",comList.get(0).get("company_name"));
+                    }
+                    else{
+                        map.put("compamyName",null);
+                    }
+                    redisTemplate.opsForValue().set(param.get("number"), map, 30, TimeUnit.MINUTES);;
+                    return AjaxResult.success(map);
+                }
+                else{
+                    return  AjaxResult.error(map.get("message").toString());
+                }
+            }
+
+            return AjaxResult.success(redisResult);
+        } catch (Exception e) {
+            return AjaxResult.error("快递100查寻接口异常! 原因:{}" ,e.getMessage());
+        }
+
+
+    }
 }

+ 63 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/front/service/impl/Kuaidi100Service.java

@@ -4,6 +4,7 @@ package com.ruoyi.front.service.impl;
 import com.alibaba.fastjson2.JSONObject;
 import com.ruoyi.logistics.config.KD100ExpressConfig;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 
 import java.io.BufferedReader;
@@ -14,6 +15,7 @@ import java.net.URL;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
+import java.util.List;
 import java.util.Map;
 
 
@@ -21,6 +23,9 @@ import java.util.Map;
 public class Kuaidi100Service {
     @Autowired
      KD100ExpressConfig kd100ExpressConfig;
+
+    @Autowired
+    JdbcTemplate jdbcTemplate;
     /**
      * 查询快递信息
      * @return API原始返回的JSON字符串
@@ -82,4 +87,62 @@ public class Kuaidi100Service {
         }
         return sb.toString();
     }
+
+    /**
+     * 查询快递100返回公司编码对应的物流公司名称
+     */
+
+    public List<Map<String, Object>> getComList(String com) {
+     return    jdbcTemplate.queryForList("select  company_name from   biz_kd100_company where company_code=?",com);
+    }
+
+
+    /**
+     * 查快递查询地图轨迹
+     */
+    public String queryExpresPlus(Map map)  throws Exception{
+        // 1. 构建查询参数
+        String param = "{\"com\":\"" + map.get("company") + "\",\"num\":\"" + map.get("number") + "\",\"from\":\"" + map.get("from") +"\",\"to\":\"" + map.get("to") + "\"}";
+        // 2. 生成签名
+        String sign = md5(param + kd100ExpressConfig.getAppKey() + kd100ExpressConfig.getCustomer()).toUpperCase();
+        // 3. 构建请求体
+        String postData = "customer=" + URLEncoder.encode(kd100ExpressConfig.getCustomer(), "UTF-8")
+                + "&sign=" + URLEncoder.encode(sign, "UTF-8")
+                + "&param=" + URLEncoder.encode(param, "UTF-8");
+
+        // 4. 发送HTTP POST请求
+        URL url = new URL(kd100ExpressConfig.getQueryPUrl());
+        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+        conn.setRequestMethod("POST");
+        conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+        conn.setDoOutput(true);
+        conn.setDoInput(true);
+        conn.setConnectTimeout(5000);
+        conn.setReadTimeout(10000);
+
+        // 5. 写入请求数据
+        try (OutputStream os = conn.getOutputStream()) {
+            os.write(postData.getBytes(StandardCharsets.UTF_8));
+            os.flush();
+        }
+
+        // 6. 读取响应结果
+        int responseCode = conn.getResponseCode();
+        StringBuilder response = new StringBuilder();
+
+        if (responseCode == HttpURLConnection.HTTP_OK) {
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
+            String inputLine;
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+        } else {
+            throw new RuntimeException("HTTP请求失败,状态码: " + responseCode);
+        }
+        conn.disconnect();
+        return response.toString();
+    }
+
 }

+ 3 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/config/KD100ExpressConfig.java

@@ -28,4 +28,7 @@ public class KD100ExpressConfig {
      */
     private String queryUrl;
 
+
+    private String queryPUrl;
+
 }

+ 2 - 1
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/controller/BizInvoiceController.java

@@ -1,4 +1,5 @@
 package com.ruoyi.logistics.controller;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.logistics.callback.SfRoutingPushCallback;
 import com.ruoyi.logistics.domain.InvoiceRequest;
@@ -51,7 +52,7 @@ public class BizInvoiceController {
      * 发票查询
      */
     @PostMapping("/selectInvoice")
-    public AjaxResult selectInvoice(@RequestBody Map param) {
+    public AjaxResult selectInvoice(@RequestBody Map param) throws JsonProcessingException {
         Map result=invoiceService.selectInvoice(param);
         return  null;
     }

+ 4 - 4
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/controller/BizWaybillCostDetailsController.java

@@ -64,17 +64,17 @@ public class BizWaybillCostDetailsController extends BaseController
      *
      */
 
-    @RequiresPermissions("system:costDetails:edit")
+   // @RequiresPermissions("system:costDetails:edit")
     @Log(title = "运单明细调整", businessType = BusinessType.UPDATE)
-    @PutMapping("/getAccountAdjustment")
-    public AjaxResult getAccountAdjustment(@RequestBody BizWaybillCostDetails bizWaybillCostDetails)
+    @GetMapping ("/getAccountAdjustment")
+    public AjaxResult getAccountAdjustment( BizWaybillCostDetails bizWaybillCostDetails)
     {
         try {
             RptFinancialMonthSummary rptFinancialMonthSummary = new RptFinancialMonthSummary();
             rptFinancialMonthSummary.setSummaryMonth(bizWaybillCostDetails.getSummaryMonth());
             rptFinancialMonthSummary.setStatus("1");
             rptFinancialMonthSummary.setDeptId(bizWaybillCostDetails.getDeptId());
-            List<RptFinancialMonthSummary> list = rptFinancialMonthSummaryService.selectRptFinancialMonthSummaryList(rptFinancialMonthSummary);
+            List<RptFinancialMonthSummary> list = rptFinancialMonthSummaryService.selectRptFinancialMonthSummaryListToCheck(rptFinancialMonthSummary);
             if (list.size() != 1) {
                 return AjaxResult.success("月度汇总状态发生变化 无法进行调账!");
             }

+ 19 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/domain/BizFinancialAdjustmentRecord.java

@@ -56,6 +56,25 @@ public class BizFinancialAdjustmentRecord extends BaseEntity
     @Excel(name = "用户ID")
     private Long userId;
 
+    private String userName;
+    private String deptName;
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
     /** 删除标志 */
     private String delFlag;
 

+ 10 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/domain/BizWaybillCostDetails.java

@@ -94,6 +94,16 @@ public class BizWaybillCostDetails extends BaseEntity
     @Excel(name = "账单月份")//
     private String summaryMonth;
 
+    private String  adjustmentReason;
+
+    public String getAdjustmentReason() {
+        return adjustmentReason;
+    }
+
+    public void setAdjustmentReason(String adjustmentReason) {
+        this.adjustmentReason = adjustmentReason;
+    }
+
     public String getUserName() {
         return userName;
     }

+ 11 - 1
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/domain/RptFinancialMonthSummary.java

@@ -22,6 +22,8 @@ public class RptFinancialMonthSummary extends BaseEntity
     @Excel(name = "汇总月份")
     private String summaryMonth;
 
+    private String summaryMonthEnd;
+
     /** 应付金额 */
     @Excel(name = "应付金额")
     private String payableAmount;
@@ -65,7 +67,15 @@ public class RptFinancialMonthSummary extends BaseEntity
     @Excel(name = "电子发票xml地址")
     private String bwDzfpXmlUrl;
 
-    public void setSummaryId(Long summaryId) 
+    public void setSummaryMonthEnd(String summaryMonthEnd) {
+        this.summaryMonthEnd = summaryMonthEnd;
+    }
+
+    public String getSummaryMonthEnd() {
+        return summaryMonthEnd;
+    }
+
+    public void setSummaryId(Long summaryId)
     {
         this.summaryId = summaryId;
     }

+ 2 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/mapper/RptFinancialMonthSummaryMapper.java

@@ -65,4 +65,6 @@ public interface RptFinancialMonthSummaryMapper
     List<Map<String, Object>> selectMonthSummaryList( Map param);
 
     int insertBachRptFinancialMonthSummary(List<Map<String, Object>> monthSummaryList);
+
+    List<RptFinancialMonthSummary> selectRptFinancialMonthSummaryListToCheck(RptFinancialMonthSummary rptFinancialMonthSummary);
 }

+ 2 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/IRptFinancialMonthSummaryService.java

@@ -66,4 +66,6 @@ public interface IRptFinancialMonthSummaryService
     public int deleteRptFinancialMonthSummaryBySummaryId(Long summaryId);
 
     int creatMontSummary(Map param);
+
+    List<RptFinancialMonthSummary> selectRptFinancialMonthSummaryListToCheck(RptFinancialMonthSummary rptFinancialMonthSummary);
 }

+ 1 - 1
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/InvoiceService.java

@@ -16,5 +16,5 @@ public interface InvoiceService {
 
     Map invoiceIssuance(InvoiceRequest invoiceRequest) throws JsonProcessingException;
 
-    Map selectInvoice(Map param);
+    Map selectInvoice(Map param) throws JsonProcessingException;
 }

+ 5 - 5
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/BizWaybillCostDetailsServiceImpl.java

@@ -124,14 +124,13 @@ public class BizWaybillCostDetailsServiceImpl implements IBizWaybillCostDetailsS
      *  5.调账原因  字典获取value值
      *  6.运单号    费用明细的运单号
      *  7.费用明细id
-     *  8.
+     *
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int accountAdjustment(BizWaybillCostDetails bizWaybillCostDetails) {
 
     try {
-
         LoginUser loginUser = SecurityUtils.getLoginUser();
     //调账流水记录
     BizFinancialAdjustmentRecord bizFinancialAdjustmentRecord = new BizFinancialAdjustmentRecord();
@@ -146,7 +145,8 @@ public class BizWaybillCostDetailsServiceImpl implements IBizWaybillCostDetailsS
     bizFinancialAdjustmentRecord.setCreateTime(new Date());
     bizFinancialAdjustmentRecord.setCreateBy(loginUser.getSysUser().getNickName());
     bizFinancialAdjustmentRecord.setUserId(loginUser.getUserid());
-    bizFinancialAdjustmentRecord.setDeptId(loginUser.getSysUser().getDeptId());
+    bizFinancialAdjustmentRecord.setDeptId(bizWaybillCostDetails.getDeptId());
+        bizFinancialAdjustmentRecord.setAdjustmentReason(bizWaybillCostDetails.getAdjustmentReason());
     bizFinancialAdjustmentRecordMapper.insertBizFinancialAdjustmentRecord(bizFinancialAdjustmentRecord);
     bizWaybillCostDetails.setUpdateTime(DateUtils.getNowDate());
     bizWaybillCostDetails.setUpdateBy(loginUser.getSysUser().getNickName());
@@ -156,8 +156,8 @@ public class BizWaybillCostDetailsServiceImpl implements IBizWaybillCostDetailsS
         Map param= new HashMap();
         param.put("deptId",bizWaybillCostDetails.getDeptId());
         param.put("monthCode",bizWaybillCostDetails.getSummaryMonth());
-        rptFinancialMonthSummaryService.creatMontSummary(param);
-        return 0;
+        return  rptFinancialMonthSummaryService.creatMontSummary(param);
+
 
     }
 catch(Exception e)

+ 8 - 2
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/InvoiceServiceImpl.java

@@ -116,7 +116,7 @@ public class InvoiceServiceImpl implements InvoiceService {
      */
 
     @Override
-    public Map selectInvoice(Map param) {
+    public Map selectInvoice(Map param) throws JsonProcessingException {
         // 1. 组装正票申请的业务报文(content)
         JSONObject content = new JSONObject();
         content.put("djbh",param.get("djbh"));
@@ -133,6 +133,12 @@ public class InvoiceServiceImpl implements InvoiceService {
         requestParam.put("signature", signature);
         requestParam.put("signType", invoiceConfig.getSignType());
         String responseJson = HttpUtil.doPostJson(invoiceConfig.getBaseUrl(), requestParam.toJSONString());
-        return null;
+        ObjectMapper objectMapper = new ObjectMapper();
+        // JsonNode jsonNode = objectMapper.readTree(responseJson);
+        Map<String, Object> invoiceMap = objectMapper.readValue(
+                responseJson,
+                new TypeReference<Map<String, Object>>() {}
+        );
+        return invoiceMap;
     }
 }

+ 9 - 3
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/RptFinancialMonthSummaryServiceImpl.java

@@ -2,6 +2,7 @@ package com.ruoyi.logistics.service.impl;
 
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -107,16 +108,21 @@ public class RptFinancialMonthSummaryServiceImpl implements IRptFinancialMonthSu
      *  部门Id和 账单月份必传其一  分别代表以上两种情况
      */
     @Override
-    public int creatMontSummary(@NotNull Map param) {
+    public int creatMontSummary( Map param) {
         LocalDate today = LocalDate.now();
         LocalDate lastMonth = today.minusMonths(1);
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM");
         // 格式化上个月日期为字符串
         String formattedDate = lastMonth.format(formatter);
         //按照传值条件查询统计账单情况
-        param.put("monthCode",formattedDate);
-        param.put("deptId",null);
+        param.put("monthCode",param.get("monthCode")!=null?param.get("monthCode").toString():formattedDate);
+        param.put("deptId",param.get("deptId")!=null?param.get("deptId"):null);
         List<Map<String,Object>> monthSummaryList=rptFinancialMonthSummaryMapper.selectMonthSummaryList(param);
         return rptFinancialMonthSummaryMapper.insertBachRptFinancialMonthSummary(monthSummaryList);
     }
+
+    @Override
+    public List<RptFinancialMonthSummary> selectRptFinancialMonthSummaryListToCheck(RptFinancialMonthSummary rptFinancialMonthSummary) {
+        return rptFinancialMonthSummaryMapper.selectRptFinancialMonthSummaryListToCheck(rptFinancialMonthSummary);
+    }
 }

+ 10 - 4
jd-logistics-modules/jd-logistics-system/src/main/resources/mapper/logistics/BizFinancialAdjustmentRecordMapper.xml

@@ -21,14 +21,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="delFlag"    column="del_flag"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
+        <result property="userName"    column="user_name"    />
+        <result property="deptName"    column="dept_name"    />
     </resultMap>
 
     <sql id="selectBizFinancialAdjustmentRecordVo">
-        select financial_adjust_id, waybill_no, waybill_cost_detail_id, adjustment_type, original_amount, adjusted_amount, adjustment_amount, adjustment_reason, create_time, update_time, remark, dept_id, user_id, del_flag, create_by, update_by from biz_financial_adjustment_record
+        select a.financial_adjust_id, a.waybill_no, a.waybill_cost_detail_id, a.adjustment_type, a.original_amount, a.adjusted_amount, a.adjustment_amount, a.adjustment_reason, a.create_time, a.update_time, a.remark, a.dept_id, a.user_id, a.del_flag, a.create_by, a.update_by,u.nick_name  user_name,d.dept_name  from biz_financial_adjustment_record  a
+                                                                                                                                                                                                                                                                                                                                       left  join sys_user u on  a.user_id=u.user_id
+                                                                                                                                                                                                                                                                                                                                       left join sys_dept d on  a.dept_id=d.dept_id
     </sql>
 
     <select id="selectBizFinancialAdjustmentRecordList" parameterType="com.ruoyi.logistics.domain.BizFinancialAdjustmentRecord" resultMap="BizFinancialAdjustmentRecordResult">
-        <include refid="selectBizFinancialAdjustmentRecordVo"/>
+        select a.financial_adjust_id, a.waybill_no, a.waybill_cost_detail_id, a.adjustment_type, a.original_amount, a.adjusted_amount, a.adjustment_amount, a.adjustment_reason, a.create_time, a.update_time, a.remark, a.dept_id, a.user_id, a.del_flag, a.create_by, a.update_by,u.nick_name user_name,d.dept_name  from biz_financial_adjustment_record  a
+        left  join sys_user u on  a.user_id=u.user_id
+        left join sys_dept d on  a.dept_id=d.dept_id
         <where>  
             <if test="waybillNo != null  and waybillNo != ''"> and waybill_no = #{waybillNo}</if>
             <if test="waybillCostDetailId != null "> and waybill_cost_detail_id = #{waybillCostDetailId}</if>
@@ -37,8 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="adjustedAmount != null "> and adjusted_amount = #{adjustedAmount}</if>
             <if test="adjustmentAmount != null "> and adjustment_amount = #{adjustmentAmount}</if>
             <if test="adjustmentReason != null  and adjustmentReason != ''"> and adjustment_reason = #{adjustmentReason}</if>
-            <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="deptId != null "> and a.dept_id = #{deptId}</if>
+            <if test="userId != null "> and a.user_id = #{userId}</if>
         </where>
     </select>
     

+ 2 - 2
jd-logistics-modules/jd-logistics-system/src/main/resources/mapper/logistics/BizWaybillCostDetailsMapper.xml

@@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectBizWaybillCostDetailsList" parameterType="com.ruoyi.logistics.domain.BizWaybillCostDetails" resultMap="BizWaybillCostDetailsResult">
         <include refid="selectBizWaybillCostDetailsVo"/>
         <where>
-            b.order_status = 6
+            b.order_status = 5
             <if test="summaryMonth != null "> AND DATE_FORMAT( b.sign_time, '%Y.%m' ) = #{summaryMonth}</if>
             <if test="deptId != null "> AND a.dept_id = #{deptId}</if>
             <if test="externalWaybillNo != null  and externalWaybillNo != ''"> and a.external_waybill_no = #{externalWaybillNo}</if>
@@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <where>
 
-        <if test="waybillId != null "> and waybill_detail_id = #{waybillDetailId}</if>
+        <if test="waybillDetailId != null "> and a.waybill_detail_id = #{waybillDetailId}</if>
 
     </where>
     </select>

+ 24 - 2
jd-logistics-modules/jd-logistics-system/src/main/resources/mapper/logistics/RptFinancialMonthSummaryMapper.xml

@@ -35,10 +35,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         a.bw_dzfp_pdf_url, a.bw_dzfp_ofd_url, a.bw_dzfp_xml_url,d.dept_name from rpt_financial_month_summary a
                left join  sys_dept d on  a.dept_id=d.dept_id
         <where>  
-            <if test="summaryMonth != null  and summaryMonth != ''"> and a.summary_month = #{summaryMonth}</if>
+            <if test="summaryMonth != null  and summaryMonth != ''"> and a.summary_month >= #{summaryMonth}</if>
+            <if test="summaryMonthEnd != null  and summaryMonthEnd != ''"> and a.summary_month <![CDATA[ <= ]]> #{summaryMonthEnd}</if>
+
             <if test="payableAmount != null  and payableAmount != ''"> and a.payable_amount = #{payableAmount}</if>
             <if test="transactionCount != null  and transactionCount != ''"> a.and transaction_count = #{transactionCount}</if>
             <if test="status != null  and status != ''"> and a.status = #{status}</if>
+            <if test="deptId != null  and deptId != ''"> and a.dept_id = #{deptId}</if>
             <if test="deptName != null "> and d.dept_name  like concat('%', #{deptName}, '%')</if>
             <if test="bwDjbh != null  and bwDjbh != ''"> and a.bw_djbh = #{bwDjbh}</if>
             <if test="bwDzfpPdfUrl != null  and bwDzfpPdfUrl != ''"> and a.bw_dzfp_pdf_url = #{bwDzfpPdfUrl}</if>
@@ -52,6 +55,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     </select>
+
+
+    <select id="selectRptFinancialMonthSummaryListToCheck" parameterType="com.ruoyi.logistics.domain.RptFinancialMonthSummary" resultMap="RptFinancialMonthSummaryResult">
+        select a.summary_id, a.summary_month, a.payable_amount, a.transaction_count, a.status, a.create_time,
+        a.update_time, a.remark, a.del_flag, a.create_by, a.update_by, a.dept_id, a.user_id, a.bw_djbh,
+        a.bw_dzfp_pdf_url, a.bw_dzfp_ofd_url, a.bw_dzfp_xml_url,d.dept_name from rpt_financial_month_summary a
+        left join  sys_dept d on  a.dept_id=d.dept_id
+        <where>
+        <if test="summaryMonth != null  and summaryMonth != ''"> and a.summary_month = #{summaryMonth}</if>
+        <if test="status != null  and status != ''"> and a.status = #{status}</if>
+        <if test="deptId != null  and deptId != ''"> and a.dept_id = #{deptId}</if>
+        </where>
+    </select>
+
+
+
+
     
     <select id="selectRptFinancialMonthSummaryBySummaryId" parameterType="Long" resultMap="RptFinancialMonthSummaryResult">
         <include refid="selectRptFinancialMonthSummaryVo"/>
@@ -143,7 +163,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             sum(
                     ifnull(adjust_amount, rate_amount  )) payable_amount
         FROM
-            ( SELECT * FROM biz_waybill_order WHERE order_status = 6 AND DATE_FORMAT( sign_time, '%Y.%m' )= #{monthCode}  and  dept_id=#{deptId}  ) a
+            ( SELECT * FROM biz_waybill_order WHERE order_status = 5 AND DATE_FORMAT( sign_time, '%Y.%m' )= #{monthCode}
+        <if test="deptId != null"> and  dept_id = #{deptId}</if>
+                                              ) a
                 INNER JOIN biz_waybill_cost_details b ON a.external_waybill_no = b.external_waybill_no
         WHERE
             1 = 1