陈战涛
2023-05-25 63ef6221e101b7606031343c8f87b2e42f801a01
上海嘉定纪委接口优化2
已修改2个文件
26 ■■■■■ 文件已修改
src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1310.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1404.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1310.java
@@ -13,6 +13,7 @@
import com.fzzy.async.fzzy35.repository.Fzzy35Sync1310Rep;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -72,13 +73,14 @@
            StringBuilder jyxm;
            StringBuilder jyxmz;
            List<Api1310> api1310List;
            int index = 10001;
            for (Fz35Quality fz35Quality : list) {
                api1105 = commonService.getApi1105Cache(fz35Quality.getDepotId());
                if (null == api1105) {
                    continue;
                }
                api1310 = new Api1310();
                api1310.setZjbgdh(fz35Quality.getId());
                api1310.setZjbgdh(fz35Quality.getType() + DateFormatUtils.format(fz35Quality.getTime(), "yyyyMMdd") + String.valueOf(index).substring(1));
                api1310.setHwdm(api1105.getHwdm());
                api1310.setKqdm(kqdm);
                api1310.setLspzdm(fz35Quality.getFoodVariety());
@@ -97,17 +99,19 @@
                if (null != fz35CheckItems && fz35CheckItems.size() > 0) {
                    for (Fz35CheckItem fz35CheckItem : fz35CheckItems) {
                        if(StringUtils.isEmpty(fz35CheckItem.getValue())){
                            continue;
                        }
                        gbCheckList = gbCheckItemRep.findByBizCode(fz35CheckItem.getStandardId());
                        if (gbCheckList == null || gbCheckList.isEmpty()) {
                            continue;
                        }
                        jyxm.append(gbCheckList.get(0).getCode()).append(",");
                        jyxmz.append(fz35CheckItem.getValue()).append(",");
                        jyxm.append(",").append(gbCheckList.get(0).getCode());
                        jyxmz.append(",").append(fz35CheckItem.getValue());
                    }
                }
                api1310.setJyxm(jyxm.toString());
                api1310.setJyxmz(jyxmz.toString());
                api1310.setJyxm(jyxm.toString().substring(1));
                api1310.setJyxmz(jyxmz.toString().substring(1));
                api1310.setZbjgpd(fz35Quality.getResult());
                api1310.setQfrq(fz35Quality.getTime());
@@ -133,6 +137,7 @@
                }
                api1310Rep.save(api1310);
                index ++;
            }
        } catch (Exception e) {
            log.error("---同步失败----{}", e);
src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1404.java
@@ -11,6 +11,7 @@
import com.fzzy.async.fzzy35.repository.Fzzy35Sync1403Rep;
import com.fzzy.async.fzzy35.repository.Fzzy35Sync1404Rep;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
@@ -71,18 +72,19 @@
                if (null == fz35PlanDetails || fz35PlanDetails.isEmpty()) {
                    continue;
                }
                int index = 10001;
                for (Fz35PlanDetail fz35PlanDetail : fz35PlanDetails) {
                    api1105 = commonService.getApi1105Cache(fz35PlanDetail.getDepotId());
                    if (null == api1105) {
                        continue;
                    }
                    api1404 = new Api1404();
                    api1404.setJhmxdh(fz35PlanDetail.getId());
                    api1404.setLhjhdh(fz35PlanDetail.getPlanId());
                    api1404.setLhjhdh(kqdm.substring(0, 18) + fz35PlanDetail.getPlanId().split("_")[1] + fz35PlanDetail.getPlanId().split("_")[2]);
                    api1404.setJhmxdh(api1404.getLhjhdh() + kqdm + String.valueOf(index).substring(1));
                    api1404.setLspzdm(fz35PlanDetail.getFoodVariety());
                    api1404.setLsdjdm(fz35PlanDetail.getFoodLevel());
                    api1404.setLsxzdm(fz35PlanDetail.getFoodType());
                    api1404.setShnd(fz35PlanDetail.getYear());
                    api1404.setShnd(StringUtils.isEmpty(fz35PlanDetail.getYear())?fz35Plan.getYear():fz35PlanDetail.getYear());
                    api1404.setLhhwdm(fz35PlanDetail.getDepotId());
                    api1404.setLhsl(fz35PlanDetail.getPlanNum());
                    api1404.setLhlx(fz35PlanDetail.getType());
@@ -96,6 +98,7 @@
                        api1404.setCzbz(api1404List.get(0).getCzbz());
                    }
                    api1404Rep.save(api1404);
                    index ++;
                }
            }
        } catch (Exception e) {