YYC
2023-10-25 84e6dc37bf0079f14fa4f69e892ece977d8b785f
src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1107PR.java
@@ -24,13 +24,12 @@
import java.util.List;
/**
 * 货位信息
 * 廒间信息
 *
 * @Author:YAN
 */
@Component
public class WhjlApi1107PR {
    @Autowired
    private ApiCommonService apiCommonService;
@@ -41,32 +40,32 @@
    /**
     * 获取列表信息
     * whjlApi1107PR#listData
     * whjlApi1106PR#listData
     *
     * @return
     */
    @DataProvider
    public List<WhjlApi1107> listData() {
        List<ApiInfoData> result = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1107);
        List<ApiInfoData> result = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1106);
        if (null == result || result.isEmpty()) {
            return null;
        }
        List<WhjlApi1107> list = new ArrayList<>();
        WhjlApi1107 whjlApi1107;
        WhjlApi1107 whjlApi1106;
        for (ApiInfoData infoData : result) {
            whjlApi1107 = JSONObject.parseObject(infoData.getData(), WhjlApi1107.class);
            whjlApi1107.setKqdm(infoData.getKqdm());
            whjlApi1107.setCzbz(infoData.getCzbz());
            whjlApi1107.setUpdateTime(infoData.getUpdateTime());
            whjlApi1107.setBizId(infoData.getDataId());
            list.add(whjlApi1107);
            whjlApi1106 = JSONObject.parseObject(infoData.getData(), WhjlApi1107.class);
            whjlApi1106.setKqdm(infoData.getKqdm());
            whjlApi1106.setCzbz(infoData.getCzbz());
            whjlApi1106.setUpdateTime(infoData.getUpdateTime());
            whjlApi1106.setBizId(infoData.getDataId());
            list.add(whjlApi1106);
        }
        return list;
    }
    /**
     * 更新或修改
     * whjlApi1107PR#saveData
     * whjlApi1106PR#saveData
     *
     * @param data
     * @return
@@ -77,7 +76,7 @@
        infoData.setId(data.getBizId());
        infoData.setKqdm(data.getKqdm());
        infoData.setInteType(WhjlConstant.API_CATEGORY_11);
        infoData.setInteId(WhjlConstant.API_CODE_1107);
        infoData.setInteId(WhjlConstant.API_CODE_1106);
        infoData.setUpdateTime(new Date());
        infoData.setDataId(data.getBizId());
        infoData.setData(JSON.toJSONString(data));
@@ -89,7 +88,7 @@
    /**
     * 删除
     * whjlApi1107PR#delData
     * whjlApi1106PR#delData
     *
     * @param data
     * @return
@@ -102,14 +101,14 @@
    /**
     * 上传
     * whjlApi1107PR#pushData
     * whjlApi1106PR#pushData
     *
     * @param items
     * @return
     */
    @Expose
    public String pushData(List<WhjlApi1107> items) {
        ResponseDto responseDto;
        String result = "";
        String kqdm = items.get(0).getKqdm();
@@ -120,7 +119,7 @@
        }
        //封装参数
        ApiParam param = new ApiParam(apiConf, WhjlConstant.API_CATEGORY_11, WhjlConstant.API_CODE_1107);
        ApiParam param = new ApiParam(apiConf, WhjlConstant.API_CATEGORY_11, WhjlConstant.API_CODE_1106);
        //获取实现接口
        ApiRemoteService apiService = apiPushManager.getApiRemoteService(param.getPushProtocol());
@@ -128,19 +127,18 @@
            return "系统没有当前推送协议配置,执行失败";
        }
        //推送,数据为集合形式
        responseDto = apiService.pushData(param, apiConf, items);
        if (responseDto.getSuccess() == 0) {
            //推送成功,更新数据上传状态
            ApiInfoData infoData;
            for (WhjlApi1107 data : items) {
        ResponseDto responseDto;
        ApiInfoData infoData;
        for (WhjlApi1107 data : items) {
            responseDto = apiService.pushData(param, apiConf, data);
            if (responseDto.getSuccess() == 0) {
                if (Constant.CZBZ_I.equals(data.getCzbz())) {
                    infoData = new ApiInfoData();
                    infoData.setId(data.getBizId());
                    infoData.setKqdm(data.getKqdm());
                    infoData.setInteType(WhjlConstant.API_CATEGORY_11);
                    infoData.setInteId(WhjlConstant.API_CODE_1107);
                    infoData.setInteId(WhjlConstant.API_CODE_1106);
                    infoData.setUpdateTime(new Date());
                    infoData.setDataId(data.getBizId());