| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.bstek.bdf2.core.model.DefaultDept; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.log.service.InteStatusLogService; |
| | | import com.ld.igds.m.InoutManageUtil; |
| | | import com.ld.igds.models.InteStatusLog; |
| | | import com.ld.igds.models.InoutPlan; |
| | | import com.ld.igds.models.InoutPlanDetail; |
| | | import com.ld.igds.models.InteStatusLog; |
| | | import com.ld.igds.sh.dto.ApiResponse; |
| | | import com.ld.igds.sh.dto.Dto1502; |
| | | import com.ld.igds.sh.param.ApiRequest; |
| | | import com.ld.igds.sh.param.BaseParam; |
| | | import com.ld.igds.sh.service.impl.HApiShServiceImpl; |
| | | import com.ld.igds.sh.util.ApiShConst; |
| | | import com.ld.igds.sh.util.ApiShUtil; |
| | | import com.ld.igds.sh.util.RespCodeEnum; |
| | | import com.ld.igds.sh.util.RespUtil; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.NumberUtil; |
| | | import com.ld.igds.util.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 轮换计划明细信息数据接口 |
| | |
| | | |
| | | String companyId = ContextUtil.getDefaultCompanyId(); |
| | | |
| | | String key = RedisConst.buildKey(companyId, ApiShConst.API_SH_1502); |
| | | Date startTime = (Date) redisUtil.get(key); |
| | | if(null == startTime){ |
| | | startTime = DateUtils.addDays(param.getEndTime(), -100); |
| | | // String key = RedisConst.buildKey(companyId, ApiShConst.API_SH_1112); |
| | | // Date startTime = (Date) redisUtil.get(key); |
| | | // if(null == startTime){ |
| | | // startTime = DateUtils.addDays(param.getEndTime(), -30); |
| | | // } |
| | | // redisUtil.set(key, param.getEndTime()); |
| | | if(null == param.getStartTime()){ |
| | | param.setStartTime(DateUtils.addDays(param.getEndTime(), -1)); |
| | | } |
| | | redisUtil.set(key, param.getEndTime()); |
| | | |
| | | //查询轮换计划信息 |
| | | List<InoutPlan> planList = hApiShServiceImpl.listPlan(companyId, |
| | | InoutManageUtil.PLAN_TYPE_3, startTime, param.getEndTime()); |
| | | InoutManageUtil.PLAN_TYPE_3, param.getStartTime(), param.getEndTime()); |
| | | if (planList == null || planList.isEmpty()) { |
| | | return RespUtil.error(RespCodeEnum.CODE_2000.getCode(), request); |
| | | } |
| | |
| | | dto1502.setDjbm(StringUtils.isEmpty(planDetail.getFoodLevel())?"0":planDetail.getFoodLevel()); |
| | | dto1502.setLsxzbm(StringUtils.isEmpty(planDetail.getFoodType())?"0":planDetail.getFoodType()); |
| | | dto1502.setShnd(StringUtils.isEmpty(planDetail.getYear())?"0":planDetail.getYear()); |
| | | dto1502.setLhhwdm(StringUtils.isEmpty(planDetail.getDepotId())?"0":planDetail.getDepotId()); |
| | | dto1502.setLhsl(planDetail.getPlanNum()==null?"0.0":planDetail.getPlanNum()+""); |
| | | dto1502.setLhhwdm(StringUtils.isEmpty(ApiShUtil.getGbDepotId(planDetail.getDepotId()))?"0":ApiShUtil.getGbDepotId(planDetail.getDepotId())); |
| | | dto1502.setLhsl(planDetail.getPlanNum()==null?"0.0": NumberUtil.keepPrecision(planDetail.getPlanNum(),1)+""); |
| | | dto1502.setLhlx(StringUtils.isEmpty(planDetail.getType())?"0":planDetail.getType()); |
| | | dto1502.setJhkq(dept.getCode()); |
| | | if("1".equals(planDetail.getType())){ |
| | | dto1502.setLcsl(planDetail.getPlanNum() + ""); |
| | | dto1502.setLcsl(NumberUtil.keepPrecision(planDetail.getPlanNum(),1) + ""); |
| | | } |
| | | if("2".equals(planDetail.getType())){ |
| | | dto1502.setLrsl(planDetail.getPlanNum() + ""); |
| | | dto1502.setLrsl(NumberUtil.keepPrecision(planDetail.getPlanNum(),1) + ""); |
| | | } |
| | | dto1502.setZznm(dept.getCode()); |
| | | |