YYC
2024-11-18 12a52e58d8d0ff76869c760ecd29095ed38484fa
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java
@@ -2,13 +2,11 @@
import com.alibaba.fastjson.JSON;
import com.fzzy.api.Constant;
import com.fzzy.api.entity.Api1102;
import com.fzzy.api.entity.Api1105;
import com.fzzy.api.entity.ApiInfoData;
import com.fzzy.api.entity.ApiLog;
import com.fzzy.api.entity.*;
import com.fzzy.api.service.ApiCommonService;
import com.fzzy.api.utils.ContextUtil;
import com.fzzy.api.view.repository.Api1102Rep;
import com.fzzy.api.view.repository.ApiConfsRep;
import com.fzzy.api.view.repository.ApiInfoDataRep;
import com.fzzy.api.view.repository.ApiLogRep;
import com.fzzy.async.fzzy40.entity.Fz40Depot;
@@ -45,9 +43,9 @@
    @Autowired
    private ApiCommonService commonService;
    @Autowired
    private Api1102Rep api1102Rep;
    @Autowired
    private ApiLogRep apiLogRep;
    @Autowired
    private ApiConfsRep apiConfsRep;
    @Autowired
    private ApiInfoDataRep apiInfoDataRep;
@@ -72,17 +70,17 @@
        apiLog.setStatus(99);
        apiLog.setId(ContextUtil.getUUID());
        try {
            //由于depotConf表中没有库区编码,先查询仓库表
            List<Fz40Depot> list = fzzy40SyncDepotRep.listDepotList(deptId);
            if (null == list || list.isEmpty()) {
                log.info("2103---粮情设备配置同步数据:没有查询到仓库信息");
                return;
            }
            List<Api1102> api1102List = api1102Rep.findPushData(kqdm);
            List<ApiConfs> apiConf = apiConfsRep.getDataByKqdm(kqdm);
            String bjw = "";
            if (null != api1102List && api1102List.size() > 0) {
                bjw = ShAreaBjw.getBjw(api1102List.get(0).getXzqhdm());
            if (null != apiConf && apiConf.size() > 0) {
                bjw = apiConf.get(0).getUserName();
            }
            SH2023Api2103 sh2023Api2103;
@@ -113,13 +111,21 @@
                sh2023Api2103.setDlcs(strs[0]);
                sh2023Api2103.setDlhs(strs[1]);
                sh2023Api2103.setDlls(strs[2]);
                //判断是否有层行转换
                if(null != depotConf.getStartConvert() && !"default".equals(depotConf.getStartConvert())){
                    sh2023Api2103.setDlcs(strs[1]);
                    sh2023Api2103.setDlhs(strs[0]);
                }
                // 1-3-5
                // 8-8-8
                //筒仓规则
                sh2023Api2103.setDlqs("0");
                if (StringUtils.isNotEmpty(depotConf.getCableCir())) {
                    sh2023Api2103.setDlqs(String.valueOf(strs.length));
                    sh2023Api2103.setDlhs(null);
                    sh2023Api2103.setDlls(null);
                    sh2023Api2103.setDlhs("0");
                    sh2023Api2103.setDlls("0");
                    //电缆圈排列详情
                    listItem = new ArrayList<>();
@@ -157,7 +163,7 @@
                sh2023Api2103.setXczd(Integer.valueOf(strs[1]) * Integer.valueOf(strs[2]) + "");
                sh2023Api2103.setYxfwqsc("1");
                sh2023Api2103.setYxfwjsc(strs[0]);
                sh2023Api2103.setYxfwjsc(sh2023Api2103.getDlcs());
                sh2023Api2103.setBjw(bjw);
                sh2023Api2103.setZhgxsj(new Date());
@@ -173,11 +179,13 @@
                infoData.setRemarks("粮情设备配置信息");
                //设置操作标志
                apiInfoDataList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2103, infoData.getDataId());
                apiInfoDataList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2103, infoData.getDataId(),kqdm);
                if (null == apiInfoDataList || apiInfoDataList.isEmpty()) {
                    infoData.setCzbz(Constant.CZBZ_I);
                    sh2023Api2103.setCzbz(Constant.CZBZ_I);
                } else {
                    infoData.setCzbz(apiInfoDataList.get(0).getCzbz());
                    sh2023Api2103.setCzbz(apiInfoDataList.get(0).getCzbz());
                }
                infoData.setData(JSON.toJSONString(sh2023Api2103));