YYC
2023-10-30 4160155c7749e752ae13b935afe7a60fbbeeda6b
src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1214PR.java
@@ -17,8 +17,7 @@
import com.fzzy.api.utils.ContextUtil;
import com.fzzy.api.view.repository.ApiInfoDataRep;
import com.fzzy.otherview.whhpjl.WhjlConstant;
import com.fzzy.otherview.whhpjl.dto.WhjlApi1214;
import com.fzzy.otherview.whhpjl.dto.WhjlQDItem;
import com.fzzy.otherview.whhpjl.dto.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
@@ -113,8 +112,13 @@
     * @return
     */
    @DataProvider
    public List<WhjlQDItem> listItem(String id) {
        return null;
    public List<WhjlJCNL> listJCNL(String code) {
        return JSON.parseArray(code, WhjlJCNL.class);
    }
    @DataProvider
    public List<WhjlYQSB> listYQSB(String code) {
        return JSON.parseArray(code, WhjlYQSB.class);
    }
    /**
@@ -126,17 +130,24 @@
     */
    @DataResolver
    public void saveData(WhjlApi1214 data) {
        ApiInfoData infoData = new ApiInfoData();
        data.setJcnlList(JSON.toJSONString(data.getJcnl()));
        data.setYqsbList(JSON.toJSONString(data.getYqsb()));
        ApiInfoData infoData;
        List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(WhjlConstant.API_CODE_1214, data.getBizId(), data.getKqdm());
        if (apiInfoList.size() != 0) {
            infoData = apiInfoList.get(0);
            infoData.setData(JSON.toJSONString(data));
        } else {
            infoData = new ApiInfoData();
        infoData.setId(data.getBizId());
        infoData.setKqdm(data.getKqdm());
        infoData.setInteType(WhjlConstant.API_CATEGORY_12);
        infoData.setInteId(WhjlConstant.API_CODE_1214);
        infoData.setUpdateTime(new Date());
        infoData.setDataId(data.getBizId());
        infoData.setData(JSON.toJSONString(data));
        infoData.setCzbz(data.getCzbz());
            infoData.setCzbz(Constant.CZBZ_I);
        infoData.setRemarks("备注信息");
        }
        apiInfoDataRep.save(infoData);
    }