CZT
2023-11-27 c206acfaedc69c390fb67daa81bc686f58a212ef
igds-api-inte/src/main/java/com/ld/igds/sh/service/ApiShServiceImpl1304.java
@@ -1,7 +1,6 @@
package com.ld.igds.sh.service;
import com.alibaba.fastjson.JSONObject;
import com.ld.igds.constant.RedisConst;
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.log.service.InteStatusLogService;
import com.ld.igds.models.InoutNoticeIn;
@@ -14,6 +13,7 @@
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;
@@ -24,7 +24,10 @@
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;
/**
 * 粮食比如库结算信息数据接口
@@ -55,15 +58,18 @@
        String companyId = ContextUtil.getDefaultCompanyId();
        String key = RedisConst.buildKey(companyId, ApiShConst.API_SH_1304);
        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<InoutSettle> settleList = hApiShServiceImpl.listInoutSettle(companyId, param.getDepotId(), startTime, param.getEndTime(), InoutConstant.TYPE_IN);
        List<InoutSettle> settleList = hApiShServiceImpl.listInoutSettle(companyId, param.getDepotId(), param.getStartTime(), param.getEndTime(), InoutConstant.TYPE_IN);
        //响应数据为空则直接返回响应码2000
        if (settleList == null || settleList.isEmpty()) {
@@ -82,8 +88,8 @@
            dto.setJsdbm(settle.getId());
            inoutRecord = hApiShServiceImpl.getInoutRecord(companyId, settle.getId());
            if(null != inoutRecord){
                dto.setHwbm(inoutRecord.getDepotId());
                dto.setZznm(inoutRecord.getDepotId().substring(0, 21));
                dto.setHwbm(ApiShUtil.getGbDepotId(inoutRecord.getDepotId()) + "01");
                dto.setZznm(ApiShUtil.getGbDepotId(inoutRecord.getDepotId()).substring(0, 21));
            }else {
                dto.setHwbm("0");
                dto.setZznm("0");
@@ -100,7 +106,7 @@
            dto.setJsje(String.valueOf(settle.getPayMoney()));
            dto.setJssj(DateFormatUtils.format(settle.getPayTime()==null?new Date():settle.getPayTime(),"yyyy-MM-dd HH:mm:ss"));
            dto.setJsfs(StringUtils.isEmpty(settle.getPayType())?"0":settle.getPayType());
           // dto.setSkr(StringUtils.isEmpty(settle.getCustomerName())?"0":settle.getCustomerName()); TODO
            dto.setSkr(StringUtils.isEmpty(settle.getPayee())?"0":settle.getPayee());
            dto.setYhkh(StringUtils.isEmpty(settle.getBankNum())?"0":settle.getBankNum());
            dto.setSgjsdnm(settle.getId());