| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ld.igds.constant.CheckType; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.inout.InoutConstant; |
| | | import com.ld.igds.log.service.InteStatusLogService; |
| | | import com.ld.igds.models.CheckItem; |
| | |
| | | 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.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 粮食入库检验信息数据接口 |
| | |
| | | |
| | | String companyId = ContextUtil.getDefaultCompanyId(); |
| | | |
| | | String key = RedisConst.buildKey(companyId, ApiShConst.API_SH_1303); |
| | | 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<InoutRecord> inoutRecords = hApiShServiceImpl.listInoutRecord(companyId, |
| | | param.getDepotId(), startTime, param.getEndTime(), InoutConstant.TYPE_IN); |
| | | param.getDepotId(), param.getStartTime(), param.getEndTime(), InoutConstant.TYPE_IN); |
| | | |
| | | //响应数据为空则直接返回响应码2000 |
| | | if (inoutRecords == null || inoutRecords.isEmpty()) { |
| | |
| | | for (InoutRecord inoutRecord : inoutRecords) { |
| | | dto = new Dto1303(); |
| | | dto.setQydbh("14" + inoutRecord.getCheckId().substring(2)); |
| | | dto.setHwbm(inoutRecord.getDepotId()); |
| | | dto.setHwbm(ApiShUtil.getGbDepotId(inoutRecord.getDepotId()) + "01"); |
| | | dto.setYpbm("14" + inoutRecord.getCheckId().substring(2)); |
| | | dto.setQysj(DateFormatUtils.format(inoutRecord.getEmptyWeightTime(),"yyyy-MM-dd HH:mm:ss")); |
| | | dto.setQyrxm(StringUtils.isEmpty(inoutRecord.getCheckUser())?"0":inoutRecord.getCheckUser()); |