| | |
| | | package com.fzzy.otherview.gd2022.pr; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.view.repository.Api9201Rep; |
| | | import com.fzzy.push.gd2022.dto.Gd2022Api1023Dtl; |
| | | import com.fzzy.push.gd2022.dto.Gd2022Api1023People; |
| | | import com.fzzy.push.gd2022.dto.Gd2022Api1023Way; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | if (null == param) { |
| | | org.springframework.data.domain.Page<Api9201> japPage = api9201Rep.findAll(pageable); |
| | | page.setEntityCount((int) japPage.getTotalElements()); |
| | | |
| | | for (Api9201 api9201 : japPage.getContent()) { |
| | | api9201.setDtls(JSONArray.parseArray(api9201.getDtl(), Gd2022Api1023Dtl.class)); |
| | | api9201.setPeoples(JSONArray.parseArray(api9201.getPeople(), Gd2022Api1023People.class)); |
| | | api9201.setWays(JSONArray.parseArray(api9201.getWay(), Gd2022Api1023Way.class)); |
| | | } |
| | | page.setEntities(japPage.getContent()); |
| | | |
| | | return; |
| | |
| | | |
| | | org.springframework.data.domain.Page<Api9201> japPage = api9201Rep.findAll(specification, pageable); |
| | | page.setEntityCount((int) japPage.getTotalElements()); |
| | | for (Api9201 api9201 : japPage.getContent()) { |
| | | api9201.setDtls(JSONArray.parseArray(api9201.getDtl(), Gd2022Api1023Dtl.class)); |
| | | api9201.setPeoples(JSONArray.parseArray(api9201.getPeople(), Gd2022Api1023People.class)); |
| | | api9201.setWays(JSONArray.parseArray(api9201.getWay(), Gd2022Api1023Way.class)); |
| | | } |
| | | page.setEntities(japPage.getContent()); |
| | | } |
| | | |
| | |
| | | // 手动将doradoEntity对象转换为标准Bean对象 |
| | | Api9201 data = new Api9201(); |
| | | BeanUtils.copyProperties(entity, data); |
| | | |
| | | data.setDtl(JSON.toJSONString(data.getDtls())); |
| | | data.setPeople(JSON.toJSONString(data.getPeoples())); |
| | | data.setWay(JSON.toJSONString(data.getWays())); |
| | | data.setKqdm(data.getKqdm().trim()); |
| | | |
| | | api9201Rep.save(data); |
| | | } |
| | | |
| | |
| | | result += responseDto.toString(); |
| | | if (responseDto.getSuccess() == 0) { |
| | | if (Constant.CZBZ_I.equals(d.getCzbz())) { |
| | | api9201Rep.updateStatus(data.getDwdm(), Constant.CZBZ_U); |
| | | api9201Rep.updateStatus(data.getTbrq(), Constant.CZBZ_U); |
| | | } |
| | | } |
| | | } |
| | |
| | | for (Api9201 data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | //更新状态 |
| | | api9201Rep.updateStatus(data.getDwdm(), Constant.CZBZ_U); |
| | | api9201Rep.updateStatus(data.getTbrq(), Constant.CZBZ_U); |
| | | } |
| | | } |
| | | } |