|  |  | @ -1,12 +1,16 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.api.service.inv.impl; |  |  |  | package com.glxp.api.service.inv.impl; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.bean.BeanUtil; |  |  |  | import cn.hutool.core.bean.BeanUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.util.StrUtil; |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.github.pagehelper.PageHelper; |  |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.common.enums.ResultEnum; |  |  |  | import com.glxp.api.common.enums.ResultEnum; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.common.res.BaseResponse; |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.common.util.ResultVOUtils; |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.dao.basic.UdiRelevanceDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.dao.inv.InvRemindSetDao; |  |  |  | import com.glxp.api.dao.inv.InvRemindSetDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.basic.UdiRelevanceEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inv.InvRemindSetEntity; |  |  |  | import com.glxp.api.entity.inv.InvRemindSetEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.inv.AddInvRemindSetRequest; |  |  |  | import com.glxp.api.req.inv.AddInvRemindSetRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.inv.FilterInvRemindSetRequest; |  |  |  | import com.glxp.api.req.inv.FilterInvRemindSetRequest; | 
			
		
	
	
		
		
			
				
					|  |  | @ -14,6 +18,10 @@ import com.glxp.api.res.inv.InvRemindSetResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.auth.CustomerService; |  |  |  | import com.glxp.api.service.auth.CustomerService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inv.InvRemindSetService; |  |  |  | import com.glxp.api.service.inv.InvRemindSetService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lombok.extern.slf4j.Slf4j; |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.apache.ibatis.session.ExecutorType; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.apache.ibatis.session.SqlSession; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.apache.ibatis.session.SqlSessionFactory; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.apache.ibatis.session.TransactionIsolationLevel; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.stereotype.Service; |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.transaction.annotation.Transactional; |  |  |  | import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -31,6 +39,10 @@ public class InvRemindSetServiceImpl implements InvRemindSetService { | 
			
		
	
		
		
			
				
					
					|  |  |  |     private InvRemindSetDao invRemindSetDao; |  |  |  |     private InvRemindSetDao invRemindSetDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     private CustomerService customerService; |  |  |  |     private CustomerService customerService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private UdiRelevanceDao udiRelevanceDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private SqlSessionFactory sqlSessionFactory; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     public List<InvRemindSetResponse> filterList(FilterInvRemindSetRequest filterInvRemindSetRequest) { |  |  |  |     public List<InvRemindSetResponse> filterList(FilterInvRemindSetRequest filterInvRemindSetRequest) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -51,10 +63,31 @@ public class InvRemindSetServiceImpl implements InvRemindSetService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (false == addInvRemindSetRequest.getLowStock() && false == addInvRemindSetRequest.getLackStock() && false == addInvRemindSetRequest.getOverStock() && false == addInvRemindSetRequest.getExpireDate() && false == addInvRemindSetRequest.getRecentDate()) { |  |  |  |         if (false == addInvRemindSetRequest.getLowStock() && false == addInvRemindSetRequest.getLackStock() && false == addInvRemindSetRequest.getOverStock() && false == addInvRemindSetRequest.getExpireDate() && false == addInvRemindSetRequest.getRecentDate()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "预警设置至少开启一项预警!"); |  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "预警设置至少开启一项预警!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         InvRemindSetEntity invRemindSetEntity = new InvRemindSetEntity(); |  |  |  |         //查询此设置项是否已经存在,若已经存在,则直接覆盖,没有则新增
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         BeanUtil.copyProperties(addInvRemindSetRequest, invRemindSetEntity); |  |  |  |         InvRemindSetEntity invRemindSetEntity = invRemindSetDao.selectOne(new QueryWrapper<InvRemindSetEntity>() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         setUpdateInfo(invRemindSetEntity); |  |  |  |                 .eq("invCode", addInvRemindSetRequest.getInvCode()) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         invRemindSetDao.insert(invRemindSetEntity); |  |  |  |                 .eq(StrUtil.isNotBlank(addInvRemindSetRequest.getInvSpaceCode()), "invSpaceCode", addInvRemindSetRequest.getInvSpaceCode()) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 .eq(StrUtil.isNotBlank(addInvRemindSetRequest.getRelId()), "relId", addInvRemindSetRequest.getRelId()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (null == invRemindSetEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetEntity = new InvRemindSetEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             BeanUtil.copyProperties(addInvRemindSetRequest, invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             verifySetParams(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             setUpdateInfo(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetDao.insert(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //设置预警参数设置
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetEntity.setLackStock(addInvRemindSetRequest.getLackStock()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetEntity.setLowStock(addInvRemindSetRequest.getLowStock()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetEntity.setOverStock(addInvRemindSetRequest.getOverStock()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetEntity.setExpireDate(addInvRemindSetRequest.getExpireDate()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetEntity.setRecentDate(addInvRemindSetRequest.getRecentDate()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //校验预警参数是否符合开启条件
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             verifySetParams(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             setUpdateInfo(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             invRemindSetDao.updateById(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success("添加成功"); |  |  |  |         return ResultVOUtils.success("添加成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -63,6 +96,7 @@ public class InvRemindSetServiceImpl implements InvRemindSetService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (false == invRemindSetEntity.getLowStock() && false == invRemindSetEntity.getLackStock() && false == invRemindSetEntity.getOverStock() && false == invRemindSetEntity.getExpireDate() && false == invRemindSetEntity.getRecentDate()) { |  |  |  |         if (false == invRemindSetEntity.getLowStock() && false == invRemindSetEntity.getLackStock() && false == invRemindSetEntity.getOverStock() && false == invRemindSetEntity.getExpireDate() && false == invRemindSetEntity.getRecentDate()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "预警设置至少开启一项预警!"); |  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "预警设置至少开启一项预警!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         verifySetParams(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         setUpdateInfo(invRemindSetEntity); |  |  |  |         setUpdateInfo(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         invRemindSetDao.updateById(invRemindSetEntity); |  |  |  |         invRemindSetDao.updateById(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success("更新成功"); |  |  |  |         return ResultVOUtils.success("更新成功"); | 
			
		
	
	
		
		
			
				
					|  |  | @ -77,6 +111,72 @@ public class InvRemindSetServiceImpl implements InvRemindSetService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success("删除成功"); |  |  |  |         return ResultVOUtils.success("删除成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public BaseResponse getInfoByInvId(Integer invId) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         InvRemindSetResponse response = invRemindSetDao.selectInfoByInvId(invId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (null != response) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (response.getIsDateBy() == 1 && null != response.getRecentDateTime()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //将近效期预警值由小时换算成天
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 response.setRecentDateTime(response.getRecentDateTime() / 24); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.success(response); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return ResultVOUtils.error(500, "未查询到指定的库存产品信息"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public BaseResponse batchAddInvRemindSet(AddInvRemindSetRequest addInvRemindSetRequest) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (CollUtil.isNotEmpty(addInvRemindSetRequest.getRelIdList())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //生成多条库存预警设置
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             addInvRemindSetRequest.getRelIdList().forEach(relId -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //查询此产品是否存在预警设置
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //查询此设置项是否已经存在,若已经存在,则直接覆盖,没有则新增
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 InvRemindSetEntity invRemindSetEntity = invRemindSetDao.selectOne(new QueryWrapper<InvRemindSetEntity>() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         .eq("invCode", addInvRemindSetRequest.getInvCode()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         .eq(StrUtil.isNotBlank(addInvRemindSetRequest.getInvSpaceCode()), "invSpaceCode", addInvRemindSetRequest.getInvSpaceCode()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         .eq("relId", relId) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         .eq(StrUtil.isNotBlank(addInvRemindSetRequest.getGgxh()), "ggxh", addInvRemindSetRequest.getGgxh()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (null == invRemindSetEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetEntity = new InvRemindSetEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     BeanUtil.copyProperties(addInvRemindSetRequest, invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetEntity.setRelId(relId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     verifySetParams(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     setUpdateInfo(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetDao.insert(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     //校验预警参数是否符合开启条件
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     verifySetParams(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     setUpdateInfo(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetDao.updateById(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sqlSession.commit(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sqlSession.close(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //只选择了仓库货位信息,未选择产品列表,直接添加单条预警设置
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //查询有无相同设置,有则更新时间
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             InvRemindSetEntity invRemindSetEntity = invRemindSetDao.selectOne(new QueryWrapper<InvRemindSetEntity>() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     .eq("invCode", addInvRemindSetRequest.getInvCode()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     .eq(StrUtil.isNotBlank(addInvRemindSetRequest.getInvSpaceCode()), "invSpaceCode", addInvRemindSetRequest.getInvSpaceCode()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     .isNull("relId") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (null == invRemindSetEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 invRemindSetEntity = new InvRemindSetEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BeanUtil.copyProperties(addInvRemindSetRequest, invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 invRemindSetEntity.setStatus(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 setUpdateInfo(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 invRemindSetDao.insert(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 verifySetParams(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 setUpdateInfo(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 invRemindSetDao.updateById(invRemindSetEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return ResultVOUtils.success("添加成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /** |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |      * 设置创建更新信息 |  |  |  |      * 设置创建更新信息 | 
			
		
	
		
		
			
				
					
					|  |  |  |      * |  |  |  |      * | 
			
		
	
	
		
		
			
				
					|  |  | @ -93,4 +193,29 @@ public class InvRemindSetServiceImpl implements InvRemindSetService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         invRemindSetEntity.setUpdateTime(date); |  |  |  |         invRemindSetEntity.setUpdateTime(date); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * 校验 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * @param invRemindSetEntity | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private void verifySetParams(InvRemindSetEntity invRemindSetEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //判断开启的预警设置,是否有设置对应的参数,若未设置,则修改状态为不启用
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (null != invRemindSetEntity.getRelId()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             UdiRelevanceEntity udiRelevanceEntity = udiRelevanceDao.selectRemindParams(Long.valueOf(invRemindSetEntity.getRelId())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (null == udiRelevanceEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 invRemindSetEntity.setStatus(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (invRemindSetEntity.getLowStock() && null == udiRelevanceEntity.getLowStockNum()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetEntity.setStatus(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } else if (invRemindSetEntity.getOverStock() && null == udiRelevanceEntity.getOverStockNum()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetEntity.setStatus(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } else if (invRemindSetEntity.getRecentDate() && null == udiRelevanceEntity.getRecentDateTime()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetEntity.setStatus(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     invRemindSetEntity.setStatus(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |