| | |
| | | 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.InoutVarietyChange; |
| | | 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 com.ld.igds.util.RedisUtil; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | 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_1312); |
| | | 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<InoutVarietyChange> dataList = hApiShServiceImpl.listFoodVarietyChange(companyId, |
| | | param.getDepotId(), startTime, param.getEndTime()); |
| | | param.getDepotId(), param.getStartTime(), param.getEndTime()); |
| | | |
| | | //响应数据为空则直接返回响应码2000 |
| | | if (dataList == null || dataList.isEmpty()) { |
| | |
| | | for (InoutVarietyChange variety : dataList) { |
| | | dto1312 = new Dto1312(); |
| | | dto1312.setXzzbdbh(variety.getId()); |
| | | dto1312.setHwbm(variety.getDepotId()); |
| | | dto1312.setHwbm(ApiShUtil.getGbDepotId(variety.getDepotId()) + "01"); |
| | | dto1312.setLssl(String.valueOf(variety.getNumber())); |
| | | dto1312.setHzsl(String.valueOf(variety.getChangeNumber())); |
| | | dto1312.setBzwh(StringUtils.isEmpty(variety.getApprovalId())?"0":variety.getApprovalId()); |