|  |  |  | 
|---|
|  |  |  | import com.ld.igds.sh.param.ApiRequest; | 
|---|
|  |  |  | 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.DateFormatUtils; | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 粮食库存数据接口 | 
|---|
|  |  |  | 
|---|
|  |  |  | DicArea dicArea; | 
|---|
|  |  |  | for (Depot depot : depotList) { | 
|---|
|  |  |  | dto = new Dto1310(); | 
|---|
|  |  |  | dto.setHwbm(depot.getId()); | 
|---|
|  |  |  | dto.setHwbm(ApiShUtil.getGbDepotId(depot.getId()) + "01"); | 
|---|
|  |  |  | dto.setLspzbm(StringUtils.isEmpty(depot.getFoodVariety())?"0":depot.getFoodVariety()); | 
|---|
|  |  |  | dto.setLsxzbm(StringUtils.isEmpty(depot.getFoodType())?"0":depot.getFoodType()); | 
|---|
|  |  |  | dto.setDjbm(StringUtils.isEmpty(depot.getFoodLevel())?"0":depot.getFoodLevel()); | 
|---|
|  |  |  | 
|---|
|  |  |  | dicArea = areaService.listDicAreaByName(depot.getFoodLocation()); | 
|---|
|  |  |  | dto.setCd(dicArea == null ? "310114": dicArea.getCode()); | 
|---|
|  |  |  | dto.setGoodscode(dicArea == null ? "310114": dicArea.getCode()); | 
|---|
|  |  |  | dto.setLqgsdwbm(depot.getId().substring(0,18)); | 
|---|
|  |  |  | dto.setLqgsdwbm(ApiShUtil.getGbDepotId(depot.getId()).substring(0,18)); | 
|---|
|  |  |  | dto.setGlfs("01"); | 
|---|
|  |  |  | dto.setScdd("1"); | 
|---|
|  |  |  | dto.setClfs(StringUtils.isEmpty(depot.getStoreType())?"1":depot.getStoreType()); | 
|---|
|  |  |  | 
|---|
|  |  |  | dto.setSjsl(depot.getStorageReal()==null?"0.0":depot.getStorageReal() + ""); | 
|---|
|  |  |  | dto.setJjsl(depot.getStorageReal()==null?"0.0":depot.getStorageReal() + ""); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | dto.setNm(depot.getId().substring(0, 21)); | 
|---|
|  |  |  | dto.setZznm(depot.getId().substring(0, 21)); | 
|---|
|  |  |  | dto.setPzmc(StringUtils.isEmpty(depot.getFoodVariety())?"0":FoodVariety.getMsg(depot.getFoodVariety())); | 
|---|
|  |  |  | dto.setNm(ApiShUtil.getGbDepotId(depot.getId()).substring(0, 21)); | 
|---|
|  |  |  | dto.setZznm(ApiShUtil.getGbDepotId(depot.getId()).substring(0, 21)); | 
|---|
|  |  |  | dto.setPzmc(StringUtils.isEmpty(depot.getFoodVariety())?"0": FoodVariety.getMsg(depot.getFoodVariety())); | 
|---|
|  |  |  | dto.setPznm(StringUtils.isEmpty(depot.getFoodVariety())?"0":depot.getFoodVariety()); | 
|---|
|  |  |  | building = hApiShServiceImpl.getBuilding(companyId, depot.getId()); | 
|---|
|  |  |  | if(building != null){ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | dto.setZhgxsj(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); | 
|---|
|  |  |  | //查询日志状态表,设置操作标志 | 
|---|
|  |  |  | log = inteStatusLogService.getLogByBizId(companyId, ApiShConst.API_SH_1310 + "_" + depot.getId()); | 
|---|
|  |  |  | log = inteStatusLogService.getLogByBizId(companyId, ApiShConst.API_SH_1310 + "_" + ApiShUtil.getGbDepotId(depot.getId())); | 
|---|
|  |  |  | if(null == log){ | 
|---|
|  |  |  | addLog = new InteStatusLog(); | 
|---|
|  |  |  | addLog.setBizId(ApiShConst.API_SH_1310 + "_" + depot.getId()); | 
|---|
|  |  |  | addLog.setBizId(ApiShConst.API_SH_1310 + "_" + ApiShUtil.getGbDepotId(depot.getId())); | 
|---|
|  |  |  | addLog.setCompanyId(companyId); | 
|---|
|  |  |  | addLog.setBizType(ApiShConst.API_SH_TYPE_INOUT); | 
|---|
|  |  |  | addLog.setInterfaceId(ApiShConst.API_SH_1310); | 
|---|