| | |
| | | |
| | | 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.models.InteStatusLog; |
| | | import com.ld.igds.models.InoutStockChange; |
| | | import com.ld.igds.models.InteStatusLog; |
| | | import com.ld.igds.sh.dto.ApiResponse; |
| | | import com.ld.igds.sh.dto.Dto1309; |
| | | 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.sys.service.SysDeptService; |
| | |
| | | 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_1309); |
| | | 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<InoutStockChange> dataList = hApiShServiceImpl.listStockChange(companyId, param.getDepotId(), startTime, param.getEndTime()); |
| | | List<InoutStockChange> dataList = hApiShServiceImpl.listStockChange(companyId, param.getDepotId(), param.getStartTime(), param.getEndTime()); |
| | | |
| | | //响应数据为空则直接返回响应码2000 |
| | | if (dataList == null || dataList.isEmpty()) { |
| | |
| | | dto.setDcdw(dept.getName()); |
| | | } |
| | | dto.setPzbm(StringUtils.isEmpty(data.getPlanCode())?"0":data.getFoodVariety()); |
| | | dto.setDchwbm(StringUtils.isEmpty(data.getDepotIdOut())?"0":data.getDepotIdOut()); |
| | | dto.setDrhwbm(StringUtils.isEmpty(data.getDepotIdIn())?"0":data.getDepotIdIn()); |
| | | dto.setDchwbm(StringUtils.isEmpty(data.getDepotIdOut())?"0": ApiShUtil.getGbDepotId(data.getDepotIdOut()) + "01"); |
| | | dto.setDrhwbm(StringUtils.isEmpty(data.getDepotIdIn())?"0":ApiShUtil.getGbDepotId(data.getDepotIdIn()) + "01"); |
| | | dto.setDcrq(DateFormatUtils.format((data.getChangeDate()==null?new Date():data.getChangeDate()),"yyyy-MM-dd")); |
| | | dto.setDcsl(data.getNumber()==null?"0.0":data.getNumber() + ""); |
| | | |