Browse Source

新增大屏接口

huxy 1 year ago
parent
commit
1f510463ac

+ 82 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/controller/SupplierCapacityController.java

@@ -17,10 +17,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.scas.dto.SupplierCapacityDto;
 import org.jeecg.modules.scas.entity.SupplierCapacity;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
+import org.jeecg.modules.scas.entity.vo.*;
 import org.jeecg.modules.scas.service.ISupplierCapacityService;
 import org.jeecgframework.poi.excel.ExcelExportUtil;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -295,4 +292,85 @@ public class SupplierCapacityController extends JeecgController<SupplierCapacity
       }
       return super.export("供应商列表明细导出", SupplierCapacityVo4.class,SupplierCapacityService.excel4(queryWrapper));
    }
+
+   @AutoLog(value = "大屏接口-1")
+   @ApiOperation(value="大屏接口-1", notes="大屏接口-1")
+   @RequestMapping(value = "/statement1",method = RequestMethod.GET)
+   public Result statement1(String yearMonth){
+      Result result=new Result();
+      try {
+         List<SupplierCapacity5> supplierCapacities  = SupplierCapacityService.statement1(yearMonth);
+         result.setSuccess(true);
+         result.setResult(supplierCapacities);
+         result.setMessage("查询成功");
+      }catch (Exception e){
+         e.printStackTrace();
+         result.setSuccess(false);
+         result.setMessage("查询失败");
+      }
+      return result;
+   }
+
+   @AutoLog(value = "大屏接口-2")
+   @ApiOperation(value="大屏接口-2", notes="大屏接口-2")
+   @RequestMapping(value = "/statement2",method = RequestMethod.GET)
+   public Result statement2(String yearMonth){
+//      List<SupplierCapacity5> supplierCapacities  = SupplierCapacityService.statement2();
+//      System.out.println("supplierCapacities\t"+supplierCapacities);
+//      return supplierCapacities;Result result=new Result();
+      Result result=new Result();
+      try {
+         List<SupplierCapacity5> supplierCapacities  = SupplierCapacityService.statement2(yearMonth);
+         result.setSuccess(true);
+         result.setResult(supplierCapacities);
+         result.setMessage("查询成功");
+      }catch (Exception e){
+         e.printStackTrace();
+         result.setSuccess(false);
+         result.setMessage("查询失败");
+      }
+      return result;
+   }
+
+   @AutoLog(value = "大屏接口-3")
+   @ApiOperation(value="大屏接口-3", notes="大屏接口-3")
+   @RequestMapping(value = "/statement3",method = RequestMethod.GET)
+   public Result statement3(String yearMonth){
+//      List<SupplierCapacity5> supplierCapacities  = SupplierCapacityService.statement3();
+//      System.out.println("supplierCapacities\t"+supplierCapacities);
+//      return supplierCapacities;Result result=new Result();
+      Result result=new Result();
+      try {
+         List<SupplierCapacity5> supplierCapacities  = SupplierCapacityService.statement3(yearMonth);
+         result.setSuccess(true);
+         result.setResult(supplierCapacities);
+         result.setMessage("查询成功");
+      }catch (Exception e){
+         e.printStackTrace();
+         result.setSuccess(false);
+         result.setMessage("查询失败");
+      }
+      return result;
+   }
+
+   @AutoLog(value = "大屏接口-4")
+   @ApiOperation(value="大屏接口-4", notes="大屏接口-4")
+   @RequestMapping(value = "/statement4",method = RequestMethod.GET)
+   public Result statement4(String yearMonth){
+//      List<SupplierCapacity5> supplierCapacities  = SupplierCapacityService.statement4();
+//      System.out.println("supplierCapacities\t"+supplierCapacities);
+//      return supplierCapacities;Result result=new Result();
+      Result result=new Result();
+      try {
+         List<SupplierCapacity5> supplierCapacities  = SupplierCapacityService.statement4(yearMonth);
+         result.setSuccess(true);
+         result.setResult(supplierCapacities);
+         result.setMessage("查询成功");
+      }catch (Exception e){
+         e.printStackTrace();
+         result.setSuccess(false);
+         result.setMessage("查询失败");
+      }
+      return result;
+   }
 }

+ 4 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/SupplierCapacity.java

@@ -6,7 +6,10 @@ import lombok.Data;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @Data
 @ApiModel(description="供应链产能报表")
@@ -65,8 +68,7 @@ public class SupplierCapacity {
     private String dArriveDate;//计划到货日期
 
     @Excel(name = "工时(分)", width = 30)
-    @ApiModelProperty(value = "系数")
+    @ApiModelProperty(value = "工时(分)")
     private BigDecimal coefficient;//系数
 
-
 }

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

@@ -10,10 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.scas.dto.SupplierCapacityDto;
 import org.jeecg.modules.scas.entity.SupplierCapacity;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
+import org.jeecg.modules.scas.entity.vo.*;
 
 import java.util.List;
 import java.util.Map;
@@ -43,4 +40,12 @@ public interface SupplierCapacityMapper extends BaseMapper<SupplierCapacity> {
     long selectCounts(@Param("ew")QueryWrapper<SupplierCapacityDto> queryWrapper);
 
     List<SupplierCapacityVo4> excel004(@Param("ew")QueryWrapper<SupplierCapacityDto> queryWrapper);
+
+    List<SupplierCapacity5> statement1(@Param("year")String year,@Param("month")String month);
+
+    List<SupplierCapacity5> statement2(@Param("year")String year,@Param("month")String month);
+
+    List<SupplierCapacity5> statement3(@Param("year")String year,@Param("month")String month);
+
+    List<SupplierCapacity5> statement4(@Param("min")int min,@Param("max")int max);
 }

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

@@ -208,4 +208,168 @@
         ${ew.customSqlSegment}
     </select>
 
+<!--    <select id="statement1" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5">
+        select *,
+        (quotaCapacity-coefficient) spareCapacity,
+        IIF((quotaCapacity-coefficient)&lt;0,0,(quotaCapacity-coefficient)) productionCapacity
+        from
+        (select
+        darrivedate yearMonth,
+        cvencode,
+        cast(sum(coefficient  *iquantity)/60 as decimal(20,2)) coefficient
+        from Supplier_Capacity_Test
+        where (dArriveYear > DATEPART(yyyy,GETDATE())
+        OR (dArriveYear = DATEPART(yyyy,GETDATE())
+        AND dArriveMonth >= DATEPART(mm,GETDATE())))
+        AND (dArriveYear &lt; DATEPART(yyyy,GETDATE())+1
+        OR (dArriveYear = DATEPART(yyyy,GETDATE())+1
+        AND dArriveMonth &lt;= DATEPART(mm,GETDATE())-1))
+        GROUP BY darrivedate,cvencode) a
+        right join
+        (select supplier venName,capacity_quota quotaCapacity from sy_capacity_control
+        where state!=-1) b
+        on a.cvencode=b.venName
+        ORDER BY yearMonth;
+    </select>
+
+    <select id="statement2" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5">
+        select p.*,
+        (p.quotaCapacity-p.productionCapacity) spareCapacity  from (
+        select
+        darrivedate yearMonth,
+        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 >= DATEPART(mm,GETDATE())+1))
+        AND (dArriveYear &lt; DATEPART(yyyy,GETDATE())
+        OR (dArriveYear = DATEPART(yyyy,GETDATE())
+        AND dArriveMonth &lt;= DATEPART(mm,GETDATE())))
+        GROUP BY darrivedate) p
+        order by p.yearMonth
+    </select>
+
+    <select id="statement3" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5">
+       select *,
+        (quotaCapacity-coefficient) spareCapacity,
+        IIF((quotaCapacity-coefficient)&lt;0,0,(quotaCapacity-coefficient)) productionCapacity
+        from
+        (select
+        darrivedate yearMonth,
+        cvencode,
+        cast(sum(coefficient  *iquantity)/60 as decimal(20,2)) coefficient
+        from Supplier_Capacity_Test
+        where (dArriveYear > DATEPART(yyyy,GETDATE())
+        OR (dArriveYear = DATEPART(yyyy,GETDATE())
+        AND dArriveMonth >= DATEPART(mm,GETDATE())))
+        AND (dArriveYear &lt; DATEPART(yyyy,GETDATE())+1
+        OR (dArriveYear = DATEPART(yyyy,GETDATE())+1
+        AND dArriveMonth &lt;= DATEPART(mm,GETDATE())-1))
+        GROUP BY darrivedate,cvencode) a
+        right join
+        (select supplier venName,capacity_quota quotaCapacity from sy_capacity_control
+        where state!=-1) b
+        on a.cvencode=b.venName
+        ORDER BY yearMonth;
+    </select>
+
+    <select id="statement4" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5">
+        select
+        darrivedate yearMonth,
+        darrivemonth,
+        cdepcode,
+        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
+    </select>-->
+
+    <select id="statement1" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5" parameterType="java.lang.String">
+        select *,
+        (quotaCapacity-coefficient) spareCapacity,
+        IIF((quotaCapacity-coefficient)&lt;0,0,(quotaCapacity-coefficient)) productionCapacity
+        from
+        (select
+        darrivedate yearMonth,
+        cvencode,
+        cast(sum(coefficient  *iquantity)/60 as decimal(20,2)) coefficient
+        from Supplier_Capacity_Test
+        where dArriveYear = #{year}
+        AND dArriveMonth =  #{month}
+        GROUP BY darrivedate,cvencode) a
+        right join
+        (select supplier venName,capacity_quota quotaCapacity from sy_capacity_control
+        where state!=-1) b
+        on a.cvencode=b.venName
+        ORDER BY yearMonth
+    </select>
+
+    <select id="statement2" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5" parameterType="java.lang.String">
+         select p.*,
+        (p.quotaCapacity-p.productionCapacity) spareCapacity  from (
+        select
+        darrivedate yearMonth,
+        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= #{year}
+         and dArriveMonth= #{month}
+        GROUP BY darrivedate) p
+        order by p.yearMonth
+    </select>
+
+    <select id="statement3" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5" parameterType="java.lang.String">
+        select *,
+        (quotaCapacity-coefficient) spareCapacity,
+        IIF((quotaCapacity-coefficient)&lt;0,0,(quotaCapacity-coefficient)) productionCapacity
+        from
+        (select
+        darrivedate yearMonth,
+        cvencode,
+        cast(sum(coefficient  *iquantity)/60 as decimal(20,2)) coefficient
+        from Supplier_Capacity_Test
+        where dArriveYear = #{year}
+        AND dArriveMonth =  #{month}
+        GROUP BY darrivedate,cvencode) a
+        right join
+        (select supplier venName,capacity_quota quotaCapacity from sy_capacity_control
+        where state!=-1) b
+        on a.cvencode=b.venName
+        ORDER BY yearMonth
+    </select>
+
+    <select id="statement4" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacity5" parameterType="java.lang.String">
+        select
+        darrivedate yearMonth,
+        darrivemonth,
+        cdepcode,
+        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
+    </select>
+
 </mapper>

+ 9 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/service/ISupplierCapacityService.java

@@ -7,10 +7,7 @@ import org.apache.poi.ss.usermodel.Workbook;
 import org.jeecg.modules.scas.dto.SupplierCapacityDto;
 import org.jeecg.modules.scas.entity.SupplierCapacity;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
+import org.jeecg.modules.scas.entity.vo.*;
 
 import java.util.List;
 import java.util.Map;
@@ -31,4 +28,12 @@ public interface ISupplierCapacityService extends IService<SupplierCapacity> {
     IPage<SupplierCapacity>  selectPage2(Integer begin, Integer end, QueryWrapper<SupplierCapacityDto> queryWrapper);
 
     List<SupplierCapacityVo4> excel4(QueryWrapper<SupplierCapacityDto> queryWrapper);
+
+    List<SupplierCapacity5> statement1(String yearMonth);
+
+    List<SupplierCapacity5> statement2(String yearMonth);
+
+    List<SupplierCapacity5> statement3(String yearMonth);
+
+    List<SupplierCapacity5> statement4(String yearMonth);
 }

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

@@ -9,10 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.jeecg.modules.scas.dto.SupplierCapacityDto;
 import org.jeecg.modules.scas.entity.SupplierCapacity;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo2;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo3;
-import org.jeecg.modules.scas.entity.vo.SupplierCapacityVo4;
+import org.jeecg.modules.scas.entity.vo.*;
 import org.jeecg.modules.scas.mapper.SupplierCapacityMapper;
 import org.jeecg.modules.scas.service.ISupplierCapacityService;
 import org.jeecgframework.poi.excel.ExcelExportUtil;
@@ -21,6 +18,7 @@ import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -55,6 +53,50 @@ public class SupplierCapacityServiceImpl extends ServiceImpl<SupplierCapacityMap
     public List<SupplierCapacityVo4> excel4(QueryWrapper<SupplierCapacityDto> queryWrapper) {
         return supplierCapacityMapper.excel004(queryWrapper);
     }
+
+    @Override
+    @DS("multi-three")
+    public List<SupplierCapacity5> statement1(String yearMonths) {
+        String [] yearMonth=yearMonths.split("-");
+        return supplierCapacityMapper.statement1(yearMonth[0],yearMonth[1]);
+    }
+
+    @Override
+    @DS("multi-three")
+    public List<SupplierCapacity5> statement2(String yearMonths) {
+        String [] yearMonth=yearMonths.split("-");
+        return supplierCapacityMapper.statement2(yearMonth[0],yearMonth[1]);
+    }
+
+    @Override
+    @DS("multi-three")
+    public List<SupplierCapacity5> statement3(String yearMonths) {
+        String [] yearMonth=yearMonths.split("-");
+        return supplierCapacityMapper.statement3(yearMonth[0],yearMonth[1]);
+    }
+
+    @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);
+    }
+
     @DS("multi-three")
     public IPage<SupplierCapacity> selectPage(IPage<SupplierCapacity> page, QueryWrapper<SupplierCapacityDto> queryWrapper) {
         //return supplierCapacityMapper.selectPage(queryWrapper);

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java

@@ -1481,8 +1481,9 @@ public class SyPackingListTailoringController implements Job {
 							 }
 						 }catch (Exception e){
 							 e.printStackTrace();
+							 System.out.println("成衣批量推送报错");
 							 message+=e.getMessage();
-							 log.info("成衣修改流水号是什么报错\t"+message);
+							 log.info("成衣批量推送报错\t"+message);
 						 }
 					 }
 				 }

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

@@ -1564,7 +1564,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 						maps.get(account).put("code",resturn3.getJSONObject(0).get("U8ReceiptNo").toString());
 						recording(main,recording);
 						String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
-						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(u8ReceiptNo103,"108");
+						//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(u8ReceiptNo103,"108");
 						redisUtil.set("pushsno003", pushsno003);//采购委外入库单
 					case "3":
 						String consignmentName=maps.get(account).get("code");//获取销售发货单
@@ -1623,7 +1623,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		recording=result(main,resturn1,mapt.get("ordertype")+"入库单",((Map) mapList.get(0)).get("CACCID").toString(),"1");//采购入库单
 		redisUtil.set("pushsno001", pushsno001);//采购委外入库单
 		recording(main,recording);
-		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
+		//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 
 //		JSONObject jsonObject1=resturn1.getJSONObject(0);//采购入库单
 //		String purchaseinName=jsonObject1.get("U8ReceiptNo").toString();//获取销售发货单
@@ -1657,7 +1657,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		redisUtil.set("pushsno003", pushsno003);//采购委外入库单
 		recording(main,recording);
 		String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
-		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(u8ReceiptNo103,"108");
+		//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(u8ReceiptNo103,"108");
 
 		JSONObject jsonObject3=resturn3.getJSONObject(0);//销售发货单
 		String consignmentName=jsonObject3.get("U8ReceiptNo").toString();//获取销售发货单fadfad
@@ -1688,7 +1688,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		JSONObject jsonObject4=resturn4.getJSONObject(0);//销售出库单
 		String saleoutName=jsonObject4.get("U8ReceiptNo").toString();//销售出库单
 
-		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
+		//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
 
 		/*List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
 		if(saleoutMaps!=null){