| | |
| | | package com.ld.igds.sh.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.log.service.InteStatusLogService; |
| | | import com.ld.igds.models.DrugLog; |
| | | import com.ld.igds.models.InteStatusLog; |
| | |
| | | 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 org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | String companyId = ContextUtil.getDefaultCompanyId(); |
| | | |
| | | String key = RedisConst.buildKey(companyId, ApiShConst.API_SH_1404); |
| | | Date startTime = (Date) redisUtil.get(key); |
| | | if(null == startTime){ |
| | | startTime = DateUtils.addDays(param.getEndTime(), -30); |
| | | // 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<DrugLog> dataList = hApiShServiceImpl.listDrugLog(companyId, |
| | | param.getDepotId(), startTime, param.getEndTime()); |
| | | param.getDepotId(), param.getStartTime(), param.getEndTime()); |
| | | |
| | | //响应数据为空则直接返回响应码2000 |
| | | if (dataList == null || dataList.isEmpty()) { |
| | |
| | | //封装数据信息 |
| | | for (DrugLog data : dataList) { |
| | | dto = new Dto1404(); |
| | | dto.setXzzybm(data.getDepotId().substring(0, 25) + data.getId()); |
| | | dto.setCfdm(data.getDepotId().substring(0, 25)); |
| | | dto.setXzzybm(ApiShUtil.getGbDepotId(data.getDepotId()).substring(0, 25) + data.getId()); |
| | | dto.setCfdm(ApiShUtil.getGbDepotId(data.getDepotId()).substring(0, 25)); |
| | | dto.setXzkssj(DateFormatUtils.format(data.getStart()==null?(new Date()):data.getStart(),"yyyy-MM-dd")); |
| | | dto.setXzjssj(DateFormatUtils.format(data.getEnd()==null?(new Date()):data.getEnd(),"yyyy-MM-dd")); |
| | | dto.setHcjcdh(StringUtils.isEmpty(data.getPestBatchId())?"0":data.getPestBatchId()); |