Browse Source

计划单统计表 修改 保存

liuchaohui 2 years ago
parent
commit
bdd53bbea5

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/controller/SyCostLossReviewController.java

@@ -137,6 +137,7 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
            if(planStatistics!=null && planStatistics.size()>0){
                sy.setPlanMan(planStatistics.get(0).getPlanMan());
                sy.setRemarks(planStatistics.get(0).getRemarks());
+               sy.setId(planStatistics.get(0).getId());
            }
 
        }

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/entity/SyCostLossReview.java

@@ -67,6 +67,8 @@ public class SyCostLossReview {
 
 	private String cstatus;
 
+	private String id;
+
 	private String planMan;
 
 	private String remarks;

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/xml/SyCostLossReviewMapper.xml

@@ -334,7 +334,7 @@
     </select>
     <select id="queryCodeByPlanTable" resultType="String">
         select plan_num as cCode from sy_plan_statistics
-        where 1=1
+        where del_flag = 0
         <if test="remarks!=null and remarks!=''">
             and remarks=#{remarks}
         </if>

+ 13 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/syPlanStatistics/controller/SyPlanStatisticsController.java

@@ -84,10 +84,19 @@ public class SyPlanStatisticsController extends JeecgController<SyPlanStatistics
 	@ApiOperation(value="计划单统计表补充-添加", notes="计划单统计表补充-添加")
 	@PostMapping(value = "/add")
 	public Result<String> add(@RequestBody SyPlanStatistics syPlanStatistics) {
-		Date date = new Date();
-		SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
-		syPlanStatistics.setId(dateFormat.format(date));
-		syPlanStatisticsService.save(syPlanStatistics);
+//		Date date = new Date();
+//		SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
+//		syPlanStatistics.setId(dateFormat.format(date));
+//		QueryWrapper<SyPlanStatistics> queryWrapper = QueryGenerator.initQueryWrapper(syPlanStatistics,null);
+//		Page<SyPlanStatistics> page = new Page<SyPlanStatistics>(0, 10);
+//		queryWrapper.eq("del_flag",0);
+//		IPage<SyPlanStatistics> pageList = syPlanStatisticsService.page(page, queryWrapper);
+		if(syPlanStatistics.getId()==null){
+			syPlanStatisticsService.save(syPlanStatistics);
+		}else {
+			syPlanStatisticsService.updateById(syPlanStatistics);
+		}
+
 		return Result.OK("添加成功!");
 	}