Browse Source

Merge remote-tracking branch 'origin/master'

颜琼丽 2 weeks ago
parent
commit
5e0368db39
20 changed files with 327 additions and 135 deletions
  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
  18. 47 93
      jd-logistics-ui-v3/src/views/logistics/adjustmentRecord/index.vue
  19. 2 2
      jd-logistics-ui-v3/src/views/logistics/monthSummary/costList.vue
  20. 52 13
      jd-logistics-ui-v3/src/views/logistics/monthSummary/index.vue

+ 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

+ 47 - 93
jd-logistics-ui-v3/src/views/logistics/adjustmentRecord/index.vue

@@ -9,62 +9,16 @@
           @keyup.enter="handleQuery"
         />
       </el-form-item>
-<!--      <el-form-item label="费用明细id" prop="waybillCostDetailId">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.waybillCostDetailId"-->
-<!--          placeholder="请输入费用明细id"-->
-<!--          clearable-->
-<!--          @keyup.enter="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-      <el-form-item label="原金额" prop="originalAmount">
-        <el-input
-          v-model="queryParams.originalAmount"
-          placeholder="请输入原金额"
-          clearable
-          @keyup.enter="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="调整后金额" prop="adjustedAmount">
-        <el-input
-          v-model="queryParams.adjustedAmount"
-          placeholder="请输入调整后金额"
-          clearable
-          @keyup.enter="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="调整金额" prop="adjustmentAmount">
-        <el-input
-          v-model="queryParams.adjustmentAmount"
-          placeholder="请输入调整金额"
-          clearable
-          @keyup.enter="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="调账原因" prop="adjustmentReason">
-        <el-input
-          v-model="queryParams.adjustmentReason"
-          placeholder="请输入调账原因"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+      <el-form-item label="调账类型" prop="adjustmentType">
+        <el-select v-model="queryParams.adjustmentType" placeholder="请选择">
+          <el-option
+              v-for="item in adjustment_type"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+          </el-option>
+        </el-select>
       </el-form-item>
-<!--      <el-form-item label="部门ID" prop="deptId">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.deptId"-->
-<!--          placeholder="请输入部门ID"-->
-<!--          clearable-->
-<!--          @keyup.enter="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="用户ID" prop="userId">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.userId"-->
-<!--          placeholder="请输入用户ID"-->
-<!--          clearable-->
-<!--          @keyup.enter="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
       <el-form-item>
         <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -72,35 +26,35 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="Plus"
-          @click="handleAdd"
-          v-hasPermi="['system:adjustmentRecord:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="Edit"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['system:adjustmentRecord:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="Delete"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['system:adjustmentRecord:remove']"
-        >删除</el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="Plus"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['system:adjustmentRecord:add']"-->
+<!--        >新增</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="success"-->
+<!--          plain-->
+<!--          icon="Edit"-->
+<!--          :disabled="single"-->
+<!--          @click="handleUpdate"-->
+<!--          v-hasPermi="['system:adjustmentRecord:edit']"-->
+<!--        >修改</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="Delete"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['system:adjustmentRecord:remove']"-->
+<!--        >删除</el-button>-->
+<!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -114,8 +68,8 @@
     </el-row>
 
     <el-table v-loading="loading" :data="adjustmentRecordList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="调账流水id" align="center" prop="financialAdjustId" />
+<!--      <el-table-column type="selection" width="55" align="center" />-->
+<!--      <el-table-column label="调账流水id" align="center" prop="financialAdjustId" />-->
       <el-table-column label="运单号" align="center" prop="waybillNo" width="160" />
 <!--      <el-table-column label="费用明细id" align="center" prop="waybillCostDetailId" />-->
       <el-table-column label="调账类型" align="center" prop="adjustmentType" >
@@ -127,17 +81,17 @@
       <el-table-column label="调整后金额" align="center" prop="adjustedAmount" />
       <el-table-column label="调整金额" align="center" prop="adjustmentAmount" />
       <el-table-column label="调账原因" align="center" prop="adjustmentReason" />
-      <el-table-column label="备注" align="center" prop="remark" />
+<!--      <el-table-column label="备注" align="center" prop="remark" />-->
       <el-table-column label="部门" align="center" prop="deptName" />
       <el-table-column label="操作人" align="center" prop="userName" />
 <!--      <el-table-column label="部门ID" align="center" prop="deptId" />-->
 <!--      <el-table-column label="用户ID" align="center" prop="userId" />-->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
-        <template #default="scope">
-          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:adjustmentRecord:edit']">修改</el-button>
-          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:adjustmentRecord:remove']">删除</el-button>
-        </template>
-      </el-table-column>
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">-->
+<!--        <template #default="scope">-->
+<!--          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:adjustmentRecord:edit']">修改</el-button>-->
+<!--          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:adjustmentRecord:remove']">删除</el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
     </el-table>
     
     <pagination

+ 2 - 2
jd-logistics-ui-v3/src/views/logistics/monthSummary/costList.vue

@@ -15,7 +15,7 @@
       </el-form-item>
     </el-form>
     <el-table v-loading="loadingCost" :data="monthSummaryListCost">
-      <el-table-column label="序号" align="center" type="index"></el-table-column>
+<!--      <el-table-column label="序号" align="center" type="index"></el-table-column>-->
       <el-table-column label="日期" align="center" prop="signTime" show-overflow-tooltip />
       <el-table-column label="运单号码" align="center" prop="externalWaybillNo" show-overflow-tooltip />
       <el-table-column label="寄件地区" align="center" prop="senderCity" />
@@ -35,7 +35,7 @@
       <el-table-column label="费用(元)" align="center" prop="rateAmount" />
       <el-table-column label="经手人" align="center" prop="userName" />
       <el-table-column label="增值费用" align="center" prop="feeItemName" />
-      <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
+<!--      <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>-->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100" v-if="routeQuery.status == 1">
         <template #default="scope">
           <el-button type="text" @click="handleUpdate(scope.row)" v-hasPermi="['system:costDetails:edit']" >调账</el-button>

+ 52 - 13
jd-logistics-ui-v3/src/views/logistics/monthSummary/index.vue

@@ -6,11 +6,11 @@
             v-model="summaryMonthRange"
             type="monthrange"
             range-separator="-"
-            clearable
             format="YYYY.MM"
             value-format="YYYY.MM"
             start-placeholder="开始月份"
             end-placeholder="结束月份"
+            clearable
           @change="handleQuery">
         </el-date-picker>
       </el-form-item>
@@ -82,7 +82,7 @@
 
     <el-table v-loading="loading" :data="monthSummaryList">
 <!--      <el-table-column type="selection" width="55" align="center" />-->
-      <el-table-column label="月度汇总id" align="center" prop="summaryId" width="90" />
+<!--      <el-table-column label="月度汇总id" align="center" prop="summaryId" width="90" />-->
       <el-table-column label="汇总月份" align="center" >
         <template #default="scope">
           <el-button
@@ -102,16 +102,28 @@
         </template>
       </el-table-column>
       <el-table-column label="供应商" align="center" prop="deptName" />
-      <el-table-column label="用户id" align="center" prop="userId" />
-      <el-table-column label="百旺开票单据编号" align="center" prop="bwDjbh" />
-      <el-table-column label="电子发票pdf地址" align="center" prop="bwDzfpPdfUrl" />
-      <el-table-column label="电子发票ofd地址" align="center" prop="bwDzfpOfdUrl" />
-      <el-table-column label="电子发票xml地址" align="center" prop="bwDzfpXmlUrl" />
-      <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
+<!--      <el-table-column label="用户id" align="center" prop="userId" />-->
+<!--      <el-table-column label="百旺开票单据编号" align="center" prop="bwDjbh" />-->
+<!--      <el-table-column label="电子发票pdf地址" align="center" prop="bwDzfpPdfUrl" />-->
+<!--      <el-table-column label="电子发票ofd地址" align="center" prop="bwDzfpOfdUrl" />-->
+<!--      <el-table-column label="电子发票xml地址" align="center" prop="bwDzfpXmlUrl" />-->
+<!--      <el-table-column label="备注" align="center" prop="remark" />-->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="140">
         <template #default="scope">
-          <el-button link type="primary" @click="handleDuizhang(scope.row)" v-if="scope.row.status == 1">对账</el-button>
-          <el-button link type="primary" @click="handleKaipiao(scope.row)" v-if="scope.row.status == 2">开票</el-button>
+          <el-button
+              type="text"
+              @click="detailClick(scope.row)"
+              v-hasPermi="['system:costDetails:list']"
+              v-if="scope.row.status == 1"
+          >调账</el-button>
+          <el-button
+              type="text"
+              @click="detailClick(scope.row)"
+              v-hasPermi="['system:costDetails:list']"
+              v-if="scope.row.status == 2"
+          >查看</el-button>
+          <el-button link type="primary" @click="handleDuizhang(scope.row)" :disabled="scope.row.status != 1">对账</el-button>
+          <el-button link type="primary" @click="handleKaipiao(scope.row)" :disabled="scope.row.status != 2">开票</el-button>
 <!--          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:monthSummary:remove']">删除</el-button>-->
         </template>
       </el-table-column>
@@ -186,7 +198,7 @@
       <div class="info">
         <div>
           <span class="label">已勾选运单:</span>
-          <span class="label">共<span class="font-red">{{form.transactionCount}}</span></span>
+          <span class="label">共<span class="font-red">{{form.transactionCount}}</span></span>
         </div>
         <div>
           <span class="label">账单费用:</span>
@@ -387,7 +399,7 @@ function reset() {
 /** 搜索按钮操作 */
 function handleQuery() {
   queryParams.value.pageNum = 1;
-  if(summaryMonthRange.value.length > 0){
+  if(summaryMonthRange.value!=null && summaryMonthRange.value.length > 0){
     queryParams.value.summaryMonth = summaryMonthRange.value[0];
     queryParams.value.summaryMonthEnd = summaryMonthRange.value[1];
   }else{
@@ -401,6 +413,7 @@ function handleQuery() {
 function resetQuery() {
   summaryMonthRange.value =[];
   proxy.resetForm("queryRef")
+  setDefaultMonthRange();
   handleQuery()
 }
 
@@ -532,6 +545,32 @@ function detailClick(row){
     }
   })
 }
+// 计算上个月的日期范围
+const setDefaultMonthRange = () => {
+  const today = new Date();
+  const currentYear = today.getFullYear();
+  const currentMonth = today.getMonth() + 1; // 月份从0开始,所以要+1
+
+  // 计算上个月
+  let lastMonth = currentMonth - 1;
+  let lastYear = currentYear;
+
+  if (lastMonth === 0) {
+    lastMonth = 12;
+    lastYear = currentYear - 1;
+  }
+
+  // 格式化为 YYYY.MM
+  const startDate = `${lastYear}.${String(lastMonth).padStart(2, '0')}`;
+  const endDate = startDate; // 开始和结束相同,表示只选一个月
+
+  summaryMonthRange.value = [startDate, endDate];
+
+  // 同时设置查询参数
+  queryParams.value.summaryMonth = startDate;
+  queryParams.value.summaryMonthEnd = endDate;
+};
+setDefaultMonthRange();
 getList()
 </script>
 <style scoped>