haungfuli 2 年之前
父节点
当前提交
45b919b78b

+ 10 - 10
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FreightInfoController.java

@@ -25,6 +25,16 @@ public class FreightInfoController {
     @Autowired
     private IFreightInfoService freightInfoService;
 
+    /**
+     * 后台管理统计报表利润图表
+     * @param freightInfo
+     * @return
+     */
+    @GetMapping("/selectProfit")
+    public FreightInfo selectProfit(FreightInfo freightInfo){
+        return freightInfoService.selectProfit(freightInfo);
+    }
+
     /**
      * 预付
      * @param freightInfo
@@ -47,15 +57,5 @@ public class FreightInfoController {
         return freightInfoService.balance(freightInfo);
     }
 
-    /**
-     * 后台管理统计报表利润图表
-     * @param freightInfo
-     * @return
-     */
-    @Log(title = "统计报表利润图表")
-    @GetMapping("/selectProfit")
-    public FreightInfo selectProfit(FreightInfo freightInfo){
-        return freightInfoService.selectProfit(freightInfo);
-    }
 }
 

+ 18 - 13
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FreightInfo.java

@@ -146,67 +146,72 @@ public class FreightInfo extends BaseModel<FreightInfo> {
      * 1月
      */
     @TableField(exist = false)
-    private String Jan;
+    private Double Jan;
     /**
      * 2月
      */
     @TableField(exist = false)
-    private String Feb;
+    private Double Feb;
     /**
      * 3月
      */
     @TableField(exist = false)
-    private String Mar;
+    private Double Mar;
     /**
      * 4月
      */
     @TableField(exist = false)
-    private String Apr;
+    private Double Apr;
     /**
      * 5月
      */
     @TableField(exist = false)
-    private String May;
+    private Double May;
     /**
      * 6月
      */
     @TableField(exist = false)
-    private String June;
+    private Double June;
     /**
      * 7月
      */
     @TableField(exist = false)
-    private String July;
+    private Double July;
     /**
      * 8月
      */
     @TableField(exist = false)
-    private String Aug;
+    private Double Aug;
     /**
      * 9月
      */
     @TableField(exist = false)
-    private String Sept;
+    private Double Sept;
     /**
      * 10月
      */
     @TableField(exist = false)
-    private String Oct;
+    private Double Oct;
     /**
      * 11月
      */
     @TableField(exist = false)
-    private String Nov;
+    private Double Nov;
     /**
      * 12月
      */
     @TableField(exist = false)
-    private String Dece;
+    private Double Dece;
     /**
      * 合计
      */
     @TableField(exist = false)
-    private String total;
+    private Double total;
+    /**
+     * 日期
+     */
+    @TableField(exist = false)
+    private String date;
 
 
 

+ 5 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java

@@ -384,7 +384,11 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                 //查询银行key值
                 HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                         .eq("const_id", "BANK1").eq("const_value", orderInfo1.getBankDeposit()));
-                hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                if (hyCommonSysParameter == null){
+                    hyFreightSettlementInfo1.setBankKey("9999");
+                }else {
+                    hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                }
                 //上报
                 hyFreightSettlementInfo1.setToken(token);
                 EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);

+ 16 - 3
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FreightInfoMapper.xml

@@ -32,7 +32,7 @@
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo">
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
-                SELECT IFNULL(SUM(b.profit)/10000, 0 ) profit, aa.date create_date
+                SELECT IFNULL(SUM(b.profit)/10000, 0 ) as profit, aa.date as date
                 FROM (SELECT @cdate := date_add( @cdate, INTERVAL - 1 DAY ) date
                 FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 DAY ) FROM hy_freight_info LIMIT 30 ) a ) aa
                 LEFT JOIN (select id,profit, profit_date from hy_freight_info
@@ -42,10 +42,23 @@
                 ORDER BY aa.date DESC;
             </if>
             <if test="searchType == 2">
-
+                SELECT IFNULL( b.profit, 0 ) as profit , aa.date as date
+                FROM (SELECT DATE_FORMAT( @cdate := date_add( @cdate, INTERVAL - 1 MONTH ), '%Y-%m' ) date
+                FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 MONTH ) FROM hy_freight_info ) a LIMIT 12
+                ) aa LEFT JOIN (SELECT SUM(profit)/10000 profit,mon profit_date
+                FROM (SELECT profit,profit_date, DATE_FORMAT(profit_date,'%Y-%m') mon
+                FROM hy_freight_info WHERE profit_date >= DATE_SUB(CURDATE(),INTERVAL 1 YEAR)) a
+                GROUP BY mon DESC
+                ) b on aa.date = b.profit_date;
             </if>
             <if test="searchType == 3">
-
+                SELECT IFNULL( b.profit, 0 ) as profit,aa.date as date
+                FROM (SELECT DATE_FORMAT( @cdate := date_add( @cdate, INTERVAL - 1 YEAR ), '%Y' ) date
+                FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 YEAR ) FROM hy_freight_info LIMIT 10) a ) aa
+                LEFT JOIN (SELECT SUM(profit)/10000 profit,year profit_date
+                FROM (SELECT profit, DATE_FORMAT(profit_date,'%Y') year
+                FROM hy_freight_info WHERE profit_date >= DATE_SUB(CURDATE(),INTERVAL 10 YEAR)) a
+                GROUP BY year) b on aa.date = b.profit_date;
             </if>
         </if>
     </select>