|  |  |  | 
|---|
|  |  |  | package com.ld.igds.sh.service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.ld.igds.constant.DepotStatus; | 
|---|
|  |  |  | import com.ld.igds.log.service.InteStatusLogService; | 
|---|
|  |  |  | import com.ld.igds.models.Depot; | 
|---|
|  |  |  | import com.ld.igds.models.InteStatusLog; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.NumberUtil; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.commons.lang3.time.DateFormatUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | 
|---|
|  |  |  | InteStatusLog addLog; | 
|---|
|  |  |  | for (Depot depot : depotList) { | 
|---|
|  |  |  | dto = new Dto1104(); | 
|---|
|  |  |  | dto.setHwbm(depot.getId()); | 
|---|
|  |  |  | dto.setHwbm(ApiShUtil.getGbDepotId(depot.getId()) + "01"); | 
|---|
|  |  |  | dto.setHwmc(depot.getName()); | 
|---|
|  |  |  | dto.setHwqyrq(DateFormatUtils.format((depot.getStoreDate()==null?new Date():depot.getStoreDate()),"yyyy-MM-dd")); | 
|---|
|  |  |  | dto.setHwrl(depot.getStorageReal()==null?"0.0":depot.getStorageReal() + ""); | 
|---|
|  |  |  | dto.setCfbh(depot.getId().substring(0,25)); | 
|---|
|  |  |  | dto.setHwzt(DepotStatus.getGBCode(depot.getDepotStatus())); | 
|---|
|  |  |  | dto.setHwrl(depot.getStorageMax()==null?"0.0": NumberUtil.keepPrecision(depot.getStorageMax()/1000,1) + ""); | 
|---|
|  |  |  | dto.setCfbh(ApiShUtil.getGbDepotId(depot.getId()).substring(0,25)); | 
|---|
|  |  |  | dto.setHwzt(apiShUtil.getDepotStatus(depot.getDepotStatus())); | 
|---|
|  |  |  | dto.setClfs(depot.getStoreType()); | 
|---|
|  |  |  | dto.setBgy(depot.getStoreKeeper()); | 
|---|
|  |  |  | dto.setBgyxm(depot.getStoreKeeperName()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | dto.setZhgxsj(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); | 
|---|
|  |  |  | //查询日志状态表,设置操作标志 | 
|---|
|  |  |  | log = inteStatusLogService.getLogByBizId(companyId, ApiShConst.API_SH_1104 + "_" + depot.getId()); | 
|---|
|  |  |  | log = inteStatusLogService.getLogByBizId(companyId, ApiShConst.API_SH_1104 + "_" + ApiShUtil.getGbDepotId(depot.getId())); | 
|---|
|  |  |  | if(null == log){ | 
|---|
|  |  |  | addLog = new InteStatusLog(); | 
|---|
|  |  |  | addLog.setBizId(ApiShConst.API_SH_1104 + "_" + depot.getId()); | 
|---|
|  |  |  | addLog.setBizId(ApiShConst.API_SH_1104 + "_" + ApiShUtil.getGbDepotId(depot.getId())); | 
|---|
|  |  |  | addLog.setCompanyId(companyId); | 
|---|
|  |  |  | addLog.setBizType(ApiShConst.API_SH_TYPE_BASIC); | 
|---|
|  |  |  | addLog.setInterfaceId(ApiShConst.API_SH_1104); | 
|---|