Browse Source

大屏接口内容更新

huxy 2 năm trước cách đây
mục cha
commit
03cfde1c83

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/SupplierCapacityMapper.java

@@ -47,5 +47,5 @@ public interface SupplierCapacityMapper extends BaseMapper<SupplierCapacity> {
 
     List<SupplierCapacity5> statement3(@Param("year")String year,@Param("month")String month);
 
-    List<SupplierCapacity5> statement4(@Param("min")int min,@Param("max")int max);
+    List<SupplierCapacity5> statement4(@Param("minYear")String minYear,@Param("maxYear")String maxYear,@Param("minMonth")String minMonth,@Param("maxMonth")String maxMonth);
 }

+ 5 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/xml/SupplierCapacityMapper.xml

@@ -354,22 +354,16 @@
 
     <select id="statement4" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5" parameterType="java.lang.String">
         select
-        darrivedate yearMonth,
-        darrivemonth,
-        cdepcode,
+        cdepcode venname,
         cast(sum(coefficient  *iquantity)/60 as decimal(20,2)) productionCapacity,
         (select sum(capacity_quota) from sy_capacity_control where state!=-1)  quotaCapacity
         from Supplier_Capacity_Test
         right join sy_capacity_control
         on supplier=cvencode and  state!=-1
-        where (dArriveYear > DATEPART(yyyy,GETDATE())-1
-        OR (dArriveYear = DATEPART(yyyy,GETDATE())-1
-        AND dArriveMonth >= ${min}))
-        AND (dArriveYear  &lt; DATEPART(yyyy,GETDATE())+1
-        OR (dArriveYear = DATEPART(yyyy,GETDATE())+1
-        AND dArriveMonth  &lt;= ${max}))
-        GROUP BY darrivedate,darrivemonth,cdepcode
-        ORDER BY darrivedate
+        where (dArriveYear > #{minYear} OR (dArriveYear = #{minYear} AND dArriveMonth >= #{minMonth} ))
+        AND (dArriveYear &lt; #{maxYear} OR (dArriveYear = #{maxYear} AND dArriveMonth  &lt;=#{maxMonth} ))
+        GROUP BY cdepcode
+        ORDER BY cdepcode
     </select>
 
 </mapper>

+ 4 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/service/impl/SupplierCapacityServiceImpl.java

@@ -78,23 +78,10 @@ public class SupplierCapacityServiceImpl extends ServiceImpl<SupplierCapacityMap
     @Override
     @DS("multi-three")
     public List<SupplierCapacity5> statement4(String yearMonths) {
-        String [] yearMonth=yearMonths.split("-");
-        //String [] yearMonth= new SimpleDateFormat("yyyy-MM").format(System.currentTimeMillis()).split("-");
-        int year=Integer.parseInt(yearMonth[0]);//当前年份
-        int month=Integer.parseInt(yearMonth[1]);//当前月份
-        int min=3;
-        int max=2;
-        if (month/3>=4||month/3<1){//冬-秋
-            min=12;
-            max=11;
-        }else if(month/3>=3){//秋-夏
-            min=9;
-            max=8;
-        }else if(month/3>=2){//夏-春
-            min=6;
-            max=5;
-        }
-        return supplierCapacityMapper.statement4(min,max);
+        String [] yearMonth=yearMonths.split(" ");
+        String[] min=yearMonth[0].split("-");
+        String[] max=yearMonth[1].split("-");
+        return supplierCapacityMapper.statement4(min[0],max[0],min[1],max[1]);
     }
 
     @DS("multi-three")