| 
														
															@@ -64,14 +64,6 @@ public class Mall2PointsRulesServiceImpl implements Mall2PointsRulesService { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public R save(Mall2PointsRulesEntity mall2PointsRules) { 
														 | 
														
														 | 
														
															     public R save(Mall2PointsRulesEntity mall2PointsRules) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //校验 积分类型和是否启用 查询出不让增加 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        HashMap<String, Object> map = new HashMap<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        map.put("pointsType",mall2PointsRules.getPointsType()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        map.put("isValid", Dict.isValid.item_0.getItem()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        List<Mall2PointsRulesEntity> mall2PointsRulesEntities = mall2PointsRulesDao.queryList(map); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if ((!mall2PointsRulesEntities.isEmpty()) && Dict.isValid.item_0.getItem().equals(mall2PointsRules.getIsValid())){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            return R.error("已存在该积分类型有效数据,请确认再进行操作"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //积分规则适用开始时间 
														 | 
														
														 | 
														
															         //积分规则适用开始时间 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Date pointsBeginTime = mall2PointsRules.getPointsBeginTime(); 
														 | 
														
														 | 
														
															         Date pointsBeginTime = mall2PointsRules.getPointsBeginTime(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //积分规则适用结束时间 
														 | 
														
														 | 
														
															         //积分规则适用结束时间 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -80,7 +72,22 @@ public class Mall2PointsRulesServiceImpl implements Mall2PointsRulesService { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (pointsBeginTime.getTime() > pointsEndTime.getTime()){ 
														 | 
														
														 | 
														
															         if (pointsBeginTime.getTime() > pointsEndTime.getTime()){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return R.error("设置的开始时间和结束时间冲突"); 
														 | 
														
														 | 
														
															             return R.error("设置的开始时间和结束时间冲突"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //校验 积分类型和是否启用 查询出不让增加 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        HashMap<String, Object> map = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        map.put("pointsType",mall2PointsRules.getPointsType()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        map.put("isValid", Dict.isValid.item_0.getItem()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Mall2PointsRulesEntity> mall2PointsRulesEntities = mall2PointsRulesDao.queryList(map); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        for (Mall2PointsRulesEntity mall2PointsRulesEntity : mall2PointsRulesEntities) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if (Dict.isValid.item_0.getItem().equals(mall2PointsRules.getIsValid())){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //  之前结束时间要小于新增得开始时间 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                Boolean aBoolean = DateUtils.IsInterSection(mall2PointsRules.getPointsBeginTime(),mall2PointsRules.getPointsEndTime(),mall2PointsRulesEntity.getPointsBeginTime(),mall2PointsRulesEntity.getPointsEndTime()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (aBoolean){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    return R.error("设置时间存在交集,请确认"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //不存在交集 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         log.debug("积分规则添加数据:{}",JacksonUtil.toJson(mall2PointsRules)); 
														 | 
														
														 | 
														
															         log.debug("积分规则添加数据:{}",JacksonUtil.toJson(mall2PointsRules)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         mall2PointsRulesDao.save(mall2PointsRules); 
														 | 
														
														 | 
														
															         mall2PointsRulesDao.save(mall2PointsRules); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -89,14 +96,6 @@ public class Mall2PointsRulesServiceImpl implements Mall2PointsRulesService { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public R update(Mall2PointsRulesEntity mall2PointsRules) { 
														 | 
														
														 | 
														
															     public R update(Mall2PointsRulesEntity mall2PointsRules) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //校验 积分类型和是否启用 查询出不让增加 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        HashMap<String, Object> map = new HashMap<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        map.put("pointsType",mall2PointsRules.getPointsType()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        map.put("isValid", Dict.isValid.item_0.getItem()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        List<Mall2PointsRulesEntity> mall2PointsRulesEntities = mall2PointsRulesDao.queryList(map); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if ((!mall2PointsRulesEntities.isEmpty()) && Dict.isValid.item_0.getItem().equals(mall2PointsRules.getIsValid())){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            return R.error("已存在该积分类型有效数据,请确认再进行操作"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //积分规则适用开始时间 
														 | 
														
														 | 
														
															         //积分规则适用开始时间 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Date pointsBeginTime = mall2PointsRules.getPointsBeginTime(); 
														 | 
														
														 | 
														
															         Date pointsBeginTime = mall2PointsRules.getPointsBeginTime(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //积分规则适用结束时间 
														 | 
														
														 | 
														
															         //积分规则适用结束时间 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -105,6 +104,22 @@ public class Mall2PointsRulesServiceImpl implements Mall2PointsRulesService { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (pointsBeginTime.getTime() > pointsEndTime.getTime()){ 
														 | 
														
														 | 
														
															         if (pointsBeginTime.getTime() > pointsEndTime.getTime()){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return R.error("设置的开始时间和结束时间冲突"); 
														 | 
														
														 | 
														
															             return R.error("设置的开始时间和结束时间冲突"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //校验 积分类型和是否启用 查询出不让增加 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        HashMap<String, Object> map = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        map.put("pointsType",mall2PointsRules.getPointsType()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        map.put("isValid", Dict.isValid.item_0.getItem()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Mall2PointsRulesEntity> mall2PointsRulesEntities = mall2PointsRulesDao.queryList(map); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        for (Mall2PointsRulesEntity mall2PointsRulesEntity : mall2PointsRulesEntities) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if (Dict.isValid.item_0.getItem().equals(mall2PointsRules.getIsValid())){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //  之前结束时间要小于新增得开始时间 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                Boolean aBoolean = DateUtils.IsInterSection(mall2PointsRules.getPointsBeginTime(),mall2PointsRules.getPointsEndTime(),mall2PointsRulesEntity.getPointsBeginTime(),mall2PointsRulesEntity.getPointsEndTime()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (aBoolean){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    return R.error("设置时间存在交集,请确认"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //不存在交集 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         log.debug("积分规则修改数据:{}",JacksonUtil.toJson(mall2PointsRules)); 
														 | 
														
														 | 
														
															         log.debug("积分规则修改数据:{}",JacksonUtil.toJson(mall2PointsRules)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         mall2PointsRulesDao.update(mall2PointsRules); 
														 | 
														
														 | 
														
															         mall2PointsRulesDao.update(mall2PointsRules); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return R.ok("修改成功"); 
														 | 
														
														 | 
														
															         return R.ok("修改成功"); 
														 |