huxy il y a 2 ans
Parent
commit
990dc5edbe

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.scas.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@@ -123,6 +124,30 @@ public class SupplierCapacityController extends JeecgController<SupplierCapacity
       return result;
    }
 
+   @AutoLog(value = "供应链产能报表查询-通过条件查询")
+   @ApiOperation(value="供应链产能报表查询-通过条件查询", notes="供应链产能报表查询-通过条件查询")
+   @RequestMapping(value = "/list2",method = RequestMethod.GET)
+   public JSONObject list2(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+                                               @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+                                               HttpServletRequest req){
+      //System.out.println("开始月份"+supplierCapacityDto.getStartDate().getMonth());
+      //System.out.println("结束月份"+supplierCapacityDto.getEndDate().getMonth());
+      //System.out.println("开始年份"+new SimpleDateFormat("yyyy").format(supplierCapacityDto.getStartDate()));
+      //System.out.println("结束年份"+new SimpleDateFormat("yyyy").format(supplierCapacityDto.getEndDate()));
+      Result<IPage<SupplierCapacity>> result = new Result<IPage<SupplierCapacity>>();
+      QueryWrapper<SupplierCapacityDto> queryWrapper = new QueryWrapper<>();//初始化
+      IPage<SupplierCapacity> page2  = SupplierCapacityService.selectPage2(pageNo, pageSize, queryWrapper);
+      JSONObject jsonobject = new JSONObject();
+      jsonobject.put("data",page2.getRecords());
+      jsonobject.put("sie",page2.getSize());
+      jsonobject.put("total",page2.getTotal());
+      //  page.setRecords(pageList);
+      result.setSuccess(true);
+      result.setResult(page2);
+      result.setMessage("查询成功");
+      return jsonobject;
+   }
+
    /*@AutoLog(value = "供应商产能报表查询-通过条件查询")
    @ApiOperation(value="供应商产能报表查询-通过条件查询", notes="供应商产能报表查询-通过条件查询")
    @RequestMapping(value = "/list3",method = RequestMethod.GET)

+ 22 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java

@@ -1071,15 +1071,31 @@ public class SyPackingListFabricController implements Job {
 
 	 @Override
 	 public void execute(JobExecutionContext context) throws JobExecutionException {
-		 QueryWrapper queryWrapper=new QueryWrapper();
-		 queryWrapper.eq("push_State","3");//推送中
-		 queryWrapper.or();
-		 queryWrapper.like("recording_Error","超时");//超时
+
+		 QueryWrapper<SyPackingListFabric> queryWrapper=new QueryWrapper();
+		 queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or().eq("recording_Error","超时"))) ;//推送中
+		 //queryWrapper.or();
+		 //queryWrapper.like();//超时
 	 	 List<SyPackingListFabric> syPackingListFabrics=syPackingListFabricService.list(queryWrapper);//修改调整
+
+		 List<String> ids=new ArrayList<>();
+		 for (SyPackingListFabric syPackingListFabric : syPackingListFabrics){
+		 	ids.add(syPackingListFabric.getId());
+		 }
+		// RedisUtil redisUtil
+
+		 if(syPackingListFabrics.size()<=0){
+		 	return;
+		 }
+		 UpdateWrapper updateWrapper=new UpdateWrapper();
+		 updateWrapper.set("recording_Status",1);//推送中
+		 updateWrapper.in("id",ids);
+		 syPackingListFabricService.update(updateWrapper);
+
 		 String message2="";
 		 for (int i=0; i<syPackingListFabrics.size();i++){
 			 try {
-				 String id=syPackingListFabrics.get(0).getId();
+				 String id=syPackingListFabrics.get(i).getId();
 				 Map<String,Object> map=new HashMap<>();
 				 SyPackingListFabric main=syPackingListFabricService.getById(id);
 				 if(main.getIsReference()==0){
@@ -1209,7 +1225,7 @@ public class SyPackingListFabricController implements Job {
 		 }
 		 UpdateWrapper updateWrapper=new UpdateWrapper();
 		 updateWrapper.set("push_State","3");
-		 updateWrapper.set("recording_Status",1);//推送中
+		 //updateWrapper.set("recording_Status",1);//推送中
 		 updateWrapper.ne("push_State","4");//不等于4
 		 updateWrapper.in("id",ids);
 		 syPackingListFabricService.update(updateWrapper);

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

@@ -1333,15 +1333,30 @@ public class SyPackingListTailoringController implements Job {
 
 	 @Override
 	 public void execute(JobExecutionContext context) throws JobExecutionException {
-		 QueryWrapper queryWrapper=new QueryWrapper();
-		 queryWrapper.eq("push_State","3");//推送中
+		 QueryWrapper <SyPackingListTailoring> queryWrapper=new QueryWrapper();
+		 queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or().eq("recording_Error","超时"))) ;//推送中
+		/* queryWrapper.eq("push_State","3");//推送中
 		 queryWrapper.or();
-		 queryWrapper.like("recording_Error","超时");//超时
+		 queryWrapper.like("recording_Error","超时");//超时*/
 		 List<SyPackingListTailoring> syPackingListTailorings=syPackingListTailoringService.list(queryWrapper);//修改调整
+
+		 List<String> ids=new ArrayList<>();
+		 for (SyPackingListTailoring syPackingListTailoring : syPackingListTailorings){
+			 ids.add(syPackingListTailoring.getId());
+		 }
+		 if(syPackingListTailorings.size()<=0){
+		 	return;
+		 }
+		 // RedisUtil redisUtil
+		 UpdateWrapper updateWrapper=new UpdateWrapper();
+		 updateWrapper.set("recording_Status",1);//推送中
+		 updateWrapper.in("id",ids);
+		 syPackingListTailoringService.update(updateWrapper);
+
 		 String message2="";
 		 for (int i=0; i<syPackingListTailorings.size();i++){
 			 try {
-				 String id=syPackingListTailorings.get(0).getId();
+				 String id=syPackingListTailorings.get(i).getId();
 				 SyPackingListTailoring main=syPackingListTailoringService.getById(id);
 				 if(main.getIsReference()==0){
 					 message2="请先做托书再推送";
@@ -1461,7 +1476,7 @@ public class SyPackingListTailoringController implements Job {
 		 UpdateWrapper updateWrapper=new UpdateWrapper();
 		 updateWrapper.set("push_State","3");
 		 updateWrapper.ne("push_State","4");//不等于4
-		 updateWrapper.set("recording_Status",1);//推送中
+		 //updateWrapper.set("recording_Status",1);//推送中
 		 updateWrapper.in("id",ids);
 		 syPackingListTailoringService.update(updateWrapper);
 		 result.setSuccess(true);