Commit a2325080 authored by 廖旭伟's avatar 廖旭伟

基础事项信息通过feign接口获取

parent 12b12846
......@@ -14,13 +14,5 @@ public class RespData<T> {
private T data;
private T entity;
private PageInfo pageInfo;
public static void main(String[] args) {
String resp="";
//JSON.parseObject()
}
private Object dict;
}
package com.mortals.xhx.common.pdu.matter;
import com.mortals.framework.model.BaseEntityLong;
import java.util.List;
public class MatterAcceptPdu extends BaseEntityLong {
/**
* 基础事项表id
*/
private Long matterId;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项名称
*/
private String matterName;
/**
* 受理条件
*/
private String content;
/**
* 事项来源 (0.政务网,1.自定义)
*/
private Integer source;
/** 主键,自增长列表 */
private List<Long> idList;
public Long getMatterId() {
return matterId;
}
public void setMatterId(Long matterId) {
this.matterId = matterId;
}
public String getMatterCode() {
return matterCode;
}
public void setMatterCode(String matterCode) {
this.matterCode = matterCode;
}
public String getMatterName() {
return matterName;
}
public void setMatterName(String matterName) {
this.matterName = matterName;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
public List<Long> getIdList() {
return idList;
}
public void setIdList(List<Long> idList) {
this.idList = idList;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterAcceptPdu) {
MatterAcceptPdu tmp = (MatterAcceptPdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",matterId:").append(getMatterId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",matterName:").append(getMatterName());
sb.append(",content:").append(getContent());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.matterId = 0L;
this.matterCode = "";
this.matterName = "";
this.content = "";
this.source = 0;
}
}
package com.mortals.xhx.common.pdu.matter;
import com.mortals.framework.model.BaseEntityLong;
import java.util.List;
public class MatterChargesPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 事项基础表matter id
*/
private Long matterId;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项名称
*/
private String matterName;
/**
* 收费标准
*/
private String content;
/**
* 事项来源,(0.政务网,1.自定义)
*/
private Integer source;
/** 主键,自增长列表 */
private List<Long> idList;
public Long getMatterId() {
return matterId;
}
public void setMatterId(Long matterId) {
this.matterId = matterId;
}
public String getMatterCode() {
return matterCode;
}
public void setMatterCode(String matterCode) {
this.matterCode = matterCode;
}
public String getMatterName() {
return matterName;
}
public void setMatterName(String matterName) {
this.matterName = matterName;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
public List<Long> getIdList() {
return idList;
}
public void setIdList(List<Long> idList) {
this.idList = idList;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterChargesPdu) {
MatterChargesPdu tmp = (MatterChargesPdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",matterId:").append(getMatterId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",matterName:").append(getMatterName());
sb.append(",content:").append(getContent());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.matterId = 0L;
this.matterCode = "";
this.matterName = "";
this.content = "";
this.source = 0;
}
}
package com.mortals.xhx.common.pdu.matter;
import com.mortals.framework.model.BaseEntityLong;
public class MatterDatumFilePdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 材料id
*/
private Long datumId;
/**
* 事项编码
*/
private String matterCode;
/**
* 材料名
*/
private String materialName;
/**
* 附件名称
*/
private String fileName;
/**
* 附件下载地址
*/
private String fileUrl;
/**
* 附件本地下载地址
*/
private String localFileUrl;
/**
* 附件类型 (示例样表.示例样表,空白表格.空白表格)
*/
private String filetype;
/**
* 附件来源 (0.政务网,1.自定义)
*/
private Integer source;
public Long getDatumId() {
return datumId;
}
public void setDatumId(Long datumId) {
this.datumId = datumId;
}
public String getMatterCode() {
return matterCode;
}
public void setMatterCode(String matterCode) {
this.matterCode = matterCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
public String getLocalFileUrl() {
return localFileUrl;
}
public void setLocalFileUrl(String localFileUrl) {
this.localFileUrl = localFileUrl;
}
public String getFiletype() {
return filetype;
}
public void setFiletype(String filetype) {
this.filetype = filetype;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterDatumFilePdu) {
MatterDatumFilePdu tmp = (MatterDatumFilePdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",datumId:").append(getDatumId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",materialName:").append(getMaterialName());
sb.append(",fileName:").append(getFileName());
sb.append(",fileUrl:").append(getFileUrl());
sb.append(",localFileUrl:").append(getLocalFileUrl());
sb.append(",filetype:").append(getFiletype());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.datumId = null;
this.matterCode = "";
this.materialName = "";
this.fileName = "";
this.fileUrl = "";
this.localFileUrl = "";
this.filetype = "示例样表";
this.source = 1;
}
}
package com.mortals.xhx.common.pdu.matter;
import com.mortals.framework.model.BaseEntityLong;
public class MatterFlowlimitPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 事项基础表id
*/
private Long matterId;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项名称
*/
private String matterName;
/**
* 办理流程
*/
private String flowName;
/**
* 办理时长
*/
private String flowTime;
/**
* 转外时限
*/
private String flowLimit;
/**
* 办理流程说明
*/
private String flowDesc;
/**
* 事项来源(0.政务网,1.自定义)
*/
private Integer source;
public MatterFlowlimitPdu(){}
/**
* 获取 事项基础表id
* @return Long
*/
public Long getMatterId(){
return matterId;
}
/**
* 设置 事项基础表id
* @param matterId
*/
public void setMatterId(Long matterId){
this.matterId = matterId;
}
/**
* 获取 事项编码
* @return String
*/
public String getMatterCode(){
return matterCode;
}
/**
* 设置 事项编码
* @param matterCode
*/
public void setMatterCode(String matterCode){
this.matterCode = matterCode;
}
/**
* 获取 事项名称
* @return String
*/
public String getMatterName(){
return matterName;
}
/**
* 设置 事项名称
* @param matterName
*/
public void setMatterName(String matterName){
this.matterName = matterName;
}
/**
* 获取 办理流程
* @return String
*/
public String getFlowName(){
return flowName;
}
/**
* 设置 办理流程
* @param flowName
*/
public void setFlowName(String flowName){
this.flowName = flowName;
}
/**
* 获取 办理时长
* @return String
*/
public String getFlowTime(){
return flowTime;
}
/**
* 设置 办理时长
* @param flowTime
*/
public void setFlowTime(String flowTime){
this.flowTime = flowTime;
}
/**
* 获取 转外时限
* @return String
*/
public String getFlowLimit(){
return flowLimit;
}
/**
* 设置 转外时限
* @param flowLimit
*/
public void setFlowLimit(String flowLimit){
this.flowLimit = flowLimit;
}
/**
* 获取 办理流程说明
* @return String
*/
public String getFlowDesc(){
return flowDesc;
}
/**
* 设置 办理流程说明
* @param flowDesc
*/
public void setFlowDesc(String flowDesc){
this.flowDesc = flowDesc;
}
/**
* 获取 事项来源(0.政务网,1.自定义)
* @return Integer
*/
public Integer getSource(){
return source;
}
/**
* 设置 事项来源(0.政务网,1.自定义)
* @param source
*/
public void setSource(Integer source){
this.source = source;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterFlowlimitPdu) {
MatterFlowlimitPdu tmp = (MatterFlowlimitPdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",matterId:").append(getMatterId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",matterName:").append(getMatterName());
sb.append(",flowName:").append(getFlowName());
sb.append(",flowTime:").append(getFlowTime());
sb.append(",flowLimit:").append(getFlowLimit());
sb.append(",flowDesc:").append(getFlowDesc());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.matterId = 0L;
this.matterCode = "";
this.matterName = "";
this.flowName = "";
this.flowTime = "";
this.flowLimit = "";
this.flowDesc = "";
this.source = 0;
}
}
package com.mortals.xhx.common.pdu.matter;
import com.mortals.framework.model.BaseEntityLong;
public class MatterIntermediaryPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 事项matter id
*/
private Long matterId;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项名称
*/
private String matterName;
/**
* 中介服务事项名称
*/
private String title;
/**
* 中介服务实施机构及资质资格要求
*/
private String intermediaryRequest;
/**
* 服务时限
*/
private String intermediaryRequestTime;
/**
* 内容
*/
private String remark;
/**
* 事项来源,(0.政务网,1.自定义)
*/
private Integer source;
public MatterIntermediaryPdu(){}
/**
* 获取 事项matter id
* @return Long
*/
public Long getMatterId(){
return matterId;
}
/**
* 设置 事项matter id
* @param matterId
*/
public void setMatterId(Long matterId){
this.matterId = matterId;
}
/**
* 获取 事项编码
* @return String
*/
public String getMatterCode(){
return matterCode;
}
/**
* 设置 事项编码
* @param matterCode
*/
public void setMatterCode(String matterCode){
this.matterCode = matterCode;
}
/**
* 获取 事项名称
* @return String
*/
public String getMatterName(){
return matterName;
}
/**
* 设置 事项名称
* @param matterName
*/
public void setMatterName(String matterName){
this.matterName = matterName;
}
/**
* 获取 中介服务事项名称
* @return String
*/
public String getTitle(){
return title;
}
/**
* 设置 中介服务事项名称
* @param title
*/
public void setTitle(String title){
this.title = title;
}
/**
* 获取 中介服务实施机构及资质资格要求
* @return String
*/
public String getIntermediaryRequest(){
return intermediaryRequest;
}
/**
* 设置 中介服务实施机构及资质资格要求
* @param intermediaryRequest
*/
public void setIntermediaryRequest(String intermediaryRequest){
this.intermediaryRequest = intermediaryRequest;
}
/**
* 获取 服务时限
* @return String
*/
public String getIntermediaryRequestTime(){
return intermediaryRequestTime;
}
/**
* 设置 服务时限
* @param intermediaryRequestTime
*/
public void setIntermediaryRequestTime(String intermediaryRequestTime){
this.intermediaryRequestTime = intermediaryRequestTime;
}
/**
* 获取 内容
* @return String
*/
public String getRemark(){
return remark;
}
/**
* 设置 内容
* @param remark
*/
public void setRemark(String remark){
this.remark = remark;
}
/**
* 获取 事项来源,(0.政务网,1.自定义)
* @return Integer
*/
public Integer getSource(){
return source;
}
/**
* 设置 事项来源,(0.政务网,1.自定义)
* @param source
*/
public void setSource(Integer source){
this.source = source;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterIntermediaryPdu) {
MatterIntermediaryPdu tmp = (MatterIntermediaryPdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",matterId:").append(getMatterId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",matterName:").append(getMatterName());
sb.append(",title:").append(getTitle());
sb.append(",intermediaryRequest:").append(getIntermediaryRequest());
sb.append(",intermediaryRequestTime:").append(getIntermediaryRequestTime());
sb.append(",remark:").append(getRemark());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.matterId = 0L;
this.matterCode = "";
this.matterName = "";
this.title = "";
this.intermediaryRequest = "";
this.intermediaryRequestTime = "";
this.remark = "";
this.source = 0;
}
}
package com.mortals.xhx.common.pdu.matter;
import com.mortals.framework.model.BaseEntityLong;
public class MatterQuestionPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 事项基础表matter id
*/
private Long matterId;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项名称
*/
private String matterName;
/**
* 问题
*/
private String question;
/**
* 常见问题
*/
private String answer;
/**
* 事项来源,(0.政务网,1.自定义)
*/
private Integer source;
public MatterQuestionPdu(){}
/**
* 获取 事项基础表matter id
* @return Long
*/
public Long getMatterId(){
return matterId;
}
/**
* 设置 事项基础表matter id
* @param matterId
*/
public void setMatterId(Long matterId){
this.matterId = matterId;
}
/**
* 获取 事项编码
* @return String
*/
public String getMatterCode(){
return matterCode;
}
/**
* 设置 事项编码
* @param matterCode
*/
public void setMatterCode(String matterCode){
this.matterCode = matterCode;
}
/**
* 获取 事项名称
* @return String
*/
public String getMatterName(){
return matterName;
}
/**
* 设置 事项名称
* @param matterName
*/
public void setMatterName(String matterName){
this.matterName = matterName;
}
/**
* 获取 问题
* @return String
*/
public String getQuestion(){
return question;
}
/**
* 设置 问题
* @param question
*/
public void setQuestion(String question){
this.question = question;
}
/**
* 获取 常见问题
* @return String
*/
public String getAnswer(){
return answer;
}
/**
* 设置 常见问题
* @param answer
*/
public void setAnswer(String answer){
this.answer = answer;
}
/**
* 获取 事项来源,(0.政务网,1.自定义)
* @return Integer
*/
public Integer getSource(){
return source;
}
/**
* 设置 事项来源,(0.政务网,1.自定义)
* @param source
*/
public void setSource(Integer source){
this.source = source;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterQuestionPdu) {
MatterQuestionPdu tmp = (MatterQuestionPdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",matterId:").append(getMatterId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",matterName:").append(getMatterName());
sb.append(",question:").append(getQuestion());
sb.append(",answer:").append(getAnswer());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.matterId = 0L;
this.matterCode = "";
this.matterName = "";
this.question = "";
this.answer = "";
this.source = 0;
}
}
package com.mortals.xhx.common.pdu.matter;
import com.mortals.framework.model.BaseEntityLong;
public class MatterSetbasePdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 事项matter id
*/
private Long matterId;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项名称
*/
private String matterName;
/**
* 法规标题
*/
private String policyName;
/**
* 法规类型,(法律.法律,行政法规.行政法规,地方法规.地方法规,部门规章.部门规章,其他.其他,政府规章.政府规章,规范性文件.规范性文件)
*/
private String policyType;
/**
* 条例
*/
private String policyitem;
/**
* 条款内容
*/
private String content;
/**
* 事项来源,(0.政务网,1.自定义)
*/
private Integer source;
public MatterSetbasePdu(){}
/**
* 获取 事项matter id
* @return Long
*/
public Long getMatterId(){
return matterId;
}
/**
* 设置 事项matter id
* @param matterId
*/
public void setMatterId(Long matterId){
this.matterId = matterId;
}
/**
* 获取 事项编码
* @return String
*/
public String getMatterCode(){
return matterCode;
}
/**
* 设置 事项编码
* @param matterCode
*/
public void setMatterCode(String matterCode){
this.matterCode = matterCode;
}
/**
* 获取 事项名称
* @return String
*/
public String getMatterName(){
return matterName;
}
/**
* 设置 事项名称
* @param matterName
*/
public void setMatterName(String matterName){
this.matterName = matterName;
}
/**
* 获取 法规标题
* @return String
*/
public String getPolicyName(){
return policyName;
}
/**
* 设置 法规标题
* @param policyName
*/
public void setPolicyName(String policyName){
this.policyName = policyName;
}
/**
* 获取 法规类型,(法律.法律,行政法规.行政法规,地方法规.地方法规,部门规章.部门规章,其他.其他,政府规章.政府规章,规范性文件.规范性文件)
* @return String
*/
public String getPolicyType(){
return policyType;
}
/**
* 设置 法规类型,(法律.法律,行政法规.行政法规,地方法规.地方法规,部门规章.部门规章,其他.其他,政府规章.政府规章,规范性文件.规范性文件)
* @param policyType
*/
public void setPolicyType(String policyType){
this.policyType = policyType;
}
/**
* 获取 条例
* @return String
*/
public String getPolicyitem(){
return policyitem;
}
/**
* 设置 条例
* @param policyitem
*/
public void setPolicyitem(String policyitem){
this.policyitem = policyitem;
}
/**
* 获取 条款内容
* @return String
*/
public String getContent(){
return content;
}
/**
* 设置 条款内容
* @param content
*/
public void setContent(String content){
this.content = content;
}
/**
* 获取 事项来源,(0.政务网,1.自定义)
* @return Integer
*/
public Integer getSource(){
return source;
}
/**
* 设置 事项来源,(0.政务网,1.自定义)
* @param source
*/
public void setSource(Integer source){
this.source = source;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterSetbasePdu) {
MatterSetbasePdu tmp = (MatterSetbasePdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",matterId:").append(getMatterId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",matterName:").append(getMatterName());
sb.append(",policyName:").append(getPolicyName());
sb.append(",policyType:").append(getPolicyType());
sb.append(",policyitem:").append(getPolicyitem());
sb.append(",content:").append(getContent());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){
this.matterId = 0L;
this.matterCode = "";
this.matterName = "";
this.policyName = "";
this.policyType = "法律";
this.policyitem = "";
this.content = "";
this.source = 0;
}
}
package com.mortals.xhx.feign.dept;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.dept.DeptPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 部门 Feign接口
* @author zxfei
* @date 2022-12-09
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = DeptFeignFallbackFactory.class)
public interface IDeptFeign extends IFeign {
/**
* 查看部门列表
*
* @param deptPdu
* @return
*/
@PostMapping(value = "/dept/interlist")
Rest<RespData<List<DeptPdu>>> list(@RequestBody DeptPdu deptPdu);
/**
* 查看部门
*
* @param id
* @return
*/
@GetMapping(value = "/dept/info")
Rest<DeptPdu> info(@RequestParam(value = "id") Long id);
/**
* 删除部门
*
* @param ids
* @return
*/
@GetMapping(value = "/dept/delete")
Rest<Void> delete(Long[] ids,@RequestHeader("Authorization") String authorization);
/**
* 部门保存更新
*
* @param deptPdu
* @return
*/
@PostMapping(value = "/dept/save")
Rest<RespData<DeptPdu>> save(@RequestBody DeptPdu deptPdu, @RequestHeader("Authorization") String authorization);
}
@Slf4j
@Component
class DeptFeignFallbackFactory implements FallbackFactory<IDeptFeign> {
@Override
public IDeptFeign create(Throwable t) {
return new IDeptFeign() {
@Override
public Rest<RespData<List<DeptPdu>>> list(DeptPdu deptPdu) {
return Rest.fail("暂时无法获取部门列表,请稍后再试!");
}
@Override
public Rest<DeptPdu> info(Long id) {
return Rest.fail("暂时无法获取部门详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除部门,请稍后再试!");
}
@Override
public Rest<RespData<DeptPdu>> save(DeptPdu deptPdu, String authorization) {
return Rest.fail("暂时无法保存部门,请稍后再试!");
}
};
}
}
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterAcceptPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterAcceptFallbackFactory.class)
public interface IMatterAcceptFeign extends IFeign {
/**
* 查看事项受理条件列表
*
* @param matterAcceptPdu
* @return
*/
@PostMapping(value = "/matter/accept/interlist")
Rest<RespData<List<MatterAcceptPdu>>> list(@RequestBody MatterAcceptPdu matterAcceptPdu);
/**
* 查看事项受理条件
*
* @param id
* @return
*/
@GetMapping(value = "/matter/accept/interinfo")
Rest<MatterAcceptPdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterAcceptFallbackFactory implements FallbackFactory<IMatterAcceptFeign> {
@Override
public IMatterAcceptFeign create(Throwable throwable) {
return new IMatterAcceptFeign(){
@Override
public Rest<RespData<List<MatterAcceptPdu>>> list(MatterAcceptPdu matterAcceptPdu) {
return Rest.fail("暂时无法获取事项受理条件列表,请稍后再试!");
}
@Override
public Rest<MatterAcceptPdu> info(Long id) {
return Rest.fail("暂时无法获取事项受理条件,请稍后再试!");
}
};
}
}
\ No newline at end of file
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterChargesPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterChargesFallbackFactory.class)
public interface IMatterChargesFeign extends IFeign {
/**
* 查看事项收费标准列表
*
* @param matterChargesPdu
* @return
*/
@PostMapping(value = "/matter/charges/interlist")
Rest<RespData<List<MatterChargesPdu>>> list(@RequestBody MatterChargesPdu matterChargesPdu);
/**
* 查看事项收费标准
*
* @param id
* @return
*/
@GetMapping(value = "/matter/charges/interinfo")
Rest<MatterChargesPdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterChargesFallbackFactory implements FallbackFactory<IMatterChargesFeign> {
@Override
public IMatterChargesFeign create(Throwable throwable) {
return new IMatterChargesFeign(){
@Override
public Rest<RespData<List<MatterChargesPdu>>> list(MatterChargesPdu matterChargesPdu) {
return Rest.fail("暂时无法获取事项收费标准列表,请稍后再试!");
}
@Override
public Rest<MatterChargesPdu> info(Long id) {
return Rest.fail("暂时无法获取事项收费标准列表,请稍后再试!");
}
};
}
}
\ No newline at end of file
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterDatumPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterDatumFallbackFactory.class)
public interface IMatterDatumFeign extends IFeign {
/**
* 查看事项申请材料业务列表
*
* @param matterDatumPdu
* @return
*/
@PostMapping(value = "/matter/datum/interlist")
Rest<RespData<List<MatterDatumPdu>>> list(@RequestBody MatterDatumPdu matterDatumPdu);
/**
* 查看事项申请材料业务
*
* @param id
* @return
*/
@GetMapping(value = "/matter/datum/interinfo")
Rest<MatterDatumPdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterDatumFallbackFactory implements FallbackFactory<IMatterDatumFeign> {
@Override
public IMatterDatumFeign create(Throwable throwable) {
return new IMatterDatumFeign(){
@Override
public Rest<RespData<List<MatterDatumPdu>>> list(MatterDatumPdu matterDatumPdu) {
return Rest.fail("暂时无法获取事项申请材料业务列表,请稍后再试!");
}
@Override
public Rest<MatterDatumPdu> info(Long id) {
return Rest.fail("暂时无法获取事项申请材料业务详细,请稍后再试!");
}
};
}
}
\ No newline at end of file
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterDatumFilePdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterDatumFileFallbackFactory.class)
public interface IMatterDatumFileFeign extends IFeign {
/**
* 查看材料附件业务列表
*
* @param matterDatumFilePdu
* @return
*/
@PostMapping(value = "/matter/datum/file/interlist")
Rest<RespData<List<MatterDatumFilePdu>>> list(@RequestBody MatterDatumFilePdu matterDatumFilePdu);
/**
* 查看材料附件业务
*
* @param id
* @return
*/
@GetMapping(value = "/matter/datum/file/interinfo")
Rest<MatterDatumFilePdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterDatumFileFallbackFactory implements FallbackFactory<IMatterDatumFileFeign> {
@Override
public IMatterDatumFileFeign create(Throwable throwable) {
return new IMatterDatumFileFeign(){
@Override
public Rest<RespData<List<MatterDatumFilePdu>>> list(MatterDatumFilePdu matterDatumFilePdu) {
return Rest.fail("暂时无法获取材料附件业务列表,请稍后再试!");
}
@Override
public Rest<MatterDatumFilePdu> info(Long id) {
return Rest.fail("暂时无法获取材料附件业务详细,请稍后再试!");
}
};
}
}
package com.mortals.xhx.feign.matter;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterFallbackFactory.class)
public interface IMatterFeign extends IFeign {
/**
* 查看基础事项列表
*
* @param matterPdu
* @return
*/
@PostMapping(value = "/matter/interlist")
Rest<RespData<List<MatterPdu>>> list(@RequestBody MatterPdu matterPdu);
/**
* 查看基础事项
*
* @param id
* @return
*/
@PostMapping(value = "/matter/interinfo")
String info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterFallbackFactory implements FallbackFactory<IMatterFeign> {
@Override
public IMatterFeign create(Throwable throwable) {
return new IMatterFeign(){
@Override
public Rest<RespData<List<MatterPdu>>> list(MatterPdu matterPdu) {
return Rest.fail("暂时无法获取基础事项列表,请稍后再试!");
}
@Override
public String info(Long id) {
return JSONObject.toJSONString(Rest.fail("暂时无法获取基础事项,请稍后再试!"));
}
};
}
}
\ No newline at end of file
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterFlowlimitPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterFlowlimitFallbackFactory.class)
public interface IMatterFlowlimitFeign extends IFeign {
/**
* 查看事项办理流程列表
*
* @param matterFlowlimitPdu
* @return
*/
@PostMapping(value = "/matter/flowlimit/interlist")
Rest<RespData<List<MatterFlowlimitPdu>>> list(@RequestBody MatterFlowlimitPdu matterFlowlimitPdu);
/**
* 查看事项办理流程
*
* @param id
* @return
*/
@GetMapping(value = "/matter/flowlimit/interinfo")
Rest<MatterFlowlimitPdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterFlowlimitFallbackFactory implements FallbackFactory<IMatterFlowlimitFeign> {
@Override
public IMatterFlowlimitFeign create(Throwable throwable) {
return new IMatterFlowlimitFeign(){
@Override
public Rest<RespData<List<MatterFlowlimitPdu>>> list(MatterFlowlimitPdu matterFlowlimitPdu) {
return Rest.fail("暂时无法获取事项办理流程列表,请稍后再试!");
}
@Override
public Rest<MatterFlowlimitPdu> info(Long id) {
return Rest.fail("暂时无法获取事项办理流程,请稍后再试!");
}
};
}
}
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterIntermediaryPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterIntermediaryFallbackFactory.class)
public interface IMatterIntermediaryFeign extends IFeign {
/**
* 查看事项中介服务列表
*
* @param matterIntermediaryPdu
* @return
*/
@PostMapping(value = "/matter/intermediary/interlist")
Rest<RespData<List<MatterIntermediaryPdu>>> list(@RequestBody MatterIntermediaryPdu matterIntermediaryPdu);
/**
* 查看事项中介服务
*
* @param id
* @return
*/
@GetMapping(value = "/matter/intermediary/interinfo")
Rest<MatterIntermediaryPdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterIntermediaryFallbackFactory implements FallbackFactory<IMatterIntermediaryFeign> {
@Override
public IMatterIntermediaryFeign create(Throwable throwable) {
return new IMatterIntermediaryFeign(){
@Override
public Rest<RespData<List<MatterIntermediaryPdu>>> list(MatterIntermediaryPdu matterIntermediaryPdu) {
return Rest.fail("暂时无法获取事项中介服务列表,请稍后再试!");
}
@Override
public Rest<MatterIntermediaryPdu> info(Long id) {
return Rest.fail("暂时无法获取事项中介服务,请稍后再试!");
}
};
}
}
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterQuestionPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterQuestionFallbackFactory.class)
public interface IMatterQuestionFeign extends IFeign {
/**
* 查看事项常见问题列表
*
* @param matterQuestionPdu
* @return
*/
@PostMapping(value = "/matter/question/interlist")
Rest<RespData<List<MatterQuestionPdu>>> list(@RequestBody MatterQuestionPdu matterQuestionPdu);
/**
* 查看事项常见问题
*
* @param id
* @return
*/
@GetMapping(value = "/matter/question/interinfo")
Rest<MatterQuestionPdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterQuestionFallbackFactory implements FallbackFactory<IMatterQuestionFeign> {
@Override
public IMatterQuestionFeign create(Throwable throwable) {
return new IMatterQuestionFeign(){
@Override
public Rest<RespData<List<MatterQuestionPdu>>> list(MatterQuestionPdu matterQuestionPdu) {
return Rest.fail("暂时无法获取事项常见问题列表,请稍后再试!");
}
@Override
public Rest<MatterQuestionPdu> info(Long id) {
return Rest.fail("暂时无法获取事项常见问题,请稍后再试!");
}
};
}
}
package com.mortals.xhx.feign.matter;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.matter.MatterSetbasePdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = MatterSetbaseFallbackFactory.class)
public interface IMatterSetbaseFeign extends IFeign {
/**
* 查看事项设定依据列表
*
* @param matterSetbasePdu
* @return
*/
@PostMapping(value = "/matter/setbase/interlist")
Rest<RespData<List<MatterSetbasePdu>>> list(@RequestBody MatterSetbasePdu matterSetbasePdu);
/**
* 查看事项设定依据
*
* @param id
* @return
*/
@GetMapping(value = "/matter/setbase/interinfo")
Rest<MatterSetbasePdu> info(@RequestParam(value = "id") Long id);
}
@Slf4j
@Component
class MatterSetbaseFallbackFactory implements FallbackFactory<IMatterSetbaseFeign> {
@Override
public IMatterSetbaseFeign create(Throwable throwable) {
return new IMatterSetbaseFeign(){
@Override
public Rest<RespData<List<MatterSetbasePdu>>> list(MatterSetbasePdu matterSetbasePdu) {
return Rest.fail("暂时无法获取事项设定依据列表,请稍后再试!");
}
@Override
public Rest<MatterSetbasePdu> info(Long id) {
return Rest.fail("暂时无法获取事项设定依据,请稍后再试!");
}
};
}
}
\ No newline at end of file
package com.mortals.xhx.feign.site;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 站点 Feign接口
*
* @author zxfei
* @date 2022-06-28
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SiteFeignFallbackFactory.class)
public interface ISiteFeign extends IFeign {
/**
* 查看站点列表
*
* @param sitePdu
* @return
*/
@PostMapping(value = "/site/interlist")
Rest<RespData<List<SitePdu>>> list(@RequestBody SitePdu sitePdu);
/**
* 查看站点
*
* @param id
* @return
*/
@GetMapping(value = "/site/interinfo")
Rest<SitePdu> info(@RequestParam(value = "id") Long id);
/**
* 删除站点
*
* @param ids
* @return
*/
@GetMapping(value = "/site/delete")
Rest<Void> delete(Long[] ids, @RequestHeader("Authorization") String authorization);
/**
* 站点保存更新
*
* @param sitePdu
* @return
*/
@PostMapping(value = "/site/save")
Rest<RespData<SitePdu>> save(@RequestBody SitePdu sitePdu, @RequestHeader("Authorization") String authorization);
/**
* 获取站点树
*
* @return
*/
@GetMapping(value = "/site/siteTree")
String siteTree(@RequestHeader("Authorization") String authorization);
/**
* 查询站点及子站点
*
* @param sitePdu
* @return
*/
@PostMapping(value = "/site/getFlatSitesBySiteId")
Rest<List<SitePdu>> getFlatSitesBySiteId(@RequestBody SitePdu sitePdu);
/**
* 查询站点及子站点
*
* @param sitePdu
* @return
*/
@PostMapping(value = "/site/getFlatSitesByAreaCode")
Rest<List<SitePdu>> getFlatSitesByAreaCode(@RequestBody SitePdu sitePdu);
}
@Slf4j
@Component
class SiteFeignFallbackFactory implements FallbackFactory<ISiteFeign> {
@Override
public ISiteFeign create(Throwable t) {
log.error("异常:", t);
return new ISiteFeign() {
@Override
public Rest<RespData<List<SitePdu>>> list(SitePdu sitePdu) {
return Rest.fail("暂时无法获取站点列表,请稍后再试!");
}
@Override
public Rest<SitePdu> info(Long id) {
return Rest.fail("暂时无法获取站点详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除站点,请稍后再试!");
}
@Override
public Rest<RespData<SitePdu>> save(SitePdu sitePdu, String authorization) {
return Rest.fail("暂时无法保存站点,请稍后再试!");
}
@Override
public String siteTree(String authorization) {
return JSON.toJSONString(Rest.fail("暂时无法获取站点树,请稍后再试!"));
}
@Override
public Rest<List<SitePdu>> getFlatSitesBySiteId(SitePdu sitePdu) {
return Rest.fail("暂时无法获取站点子站点,请稍后再试!");
}
@Override
public Rest<List<SitePdu>> getFlatSitesByAreaCode(SitePdu sitePdu) {
return Rest.fail("暂时无法获取站点子站点,请稍后再试!");
}
};
}
}
package com.mortals.xhx.feign.site;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SiteMatterPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 站点事项 Feign接口
* @author zxfei
* @date 2023-02-17
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SiteMatterFeignFallbackFactory.class)
public interface ISiteMatterFeign extends IFeign {
/**
* 查看站点事项列表
*
* @param siteMatterPdu
* @return
*/
@PostMapping(value = "/site/matter/interlist")
Rest<RespData<List<SiteMatterPdu>>> list(@RequestBody SiteMatterPdu siteMatterPdu);
/**
* 查看站点事项
*
* @param id
* @return
*/
@GetMapping(value = "/site/matter/interinfo")
Rest<SiteMatterPdu> info(@RequestParam(value = "id") Long id);
/**
* 删除站点事项
*
* @param ids
* @return
*/
@GetMapping(value = "/site/matter/delete")
Rest<Void> delete(Long[] ids,@RequestHeader("Authorization") String authorization);
/**
* 站点事项保存更新
*
* @param siteMatterPdu
* @return
*/
@PostMapping(value = "/site/matter/save")
Rest<RespData<SiteMatterPdu>> save(@RequestBody SiteMatterPdu siteMatterPdu, @RequestHeader("Authorization") String authorization);
}
@Slf4j
@Component
class SiteMatterFeignFallbackFactory implements FallbackFactory<ISiteMatterFeign> {
@Override
public ISiteMatterFeign create(Throwable t) {
return new ISiteMatterFeign() {
@Override
public Rest<RespData<List<SiteMatterPdu>>> list(SiteMatterPdu siteMatterPdu) {
return Rest.fail("暂时无法获取站点事项列表,请稍后再试!");
}
@Override
public Rest<SiteMatterPdu> info(Long id) {
return Rest.fail("暂时无法获取站点事项详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除站点事项,请稍后再试!");
}
@Override
public Rest<RespData<SiteMatterPdu>> save(SiteMatterPdu siteMatterPdu, String authorization) {
return Rest.fail("暂时无法保存站点事项,请稍后再试!");
}
};
}
}
......@@ -17,7 +17,7 @@
<modules>
<module>common-lib</module>
<module>single-matter</module>
<module>knowledge-base</module>
<!-- <module>knowledge-base</module>-->
</modules>
<properties>
......
package com.mortals.xhx.daemon.task;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SiteMatterPdu;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.feign.site.ISiteMatterFeign;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.service.SiteMatterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.List;
import java.util.stream.Collectors;
/**
* 同步事项列表
*/
@Slf4j
@Service("SyncSiteMatterTask")
public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
@Autowired
private ISiteFeign siteFeign;
@Autowired
private ISiteMatterFeign siteMatterFeign;
@Autowired
private SiteMatterService siteMatterService;
@Override
public void excuteTask(ITask task) throws AppException {
log.info("开始同步事项列表!");
SitePdu sitePdu = new SitePdu();
sitePdu.setId(1L);
Rest<List<SitePdu>> siteRest = siteFeign.getFlatSitesBySiteId(sitePdu);
if (siteRest.getCode() == YesNoEnum.YES.getValue()) {
log.info("总数量:{}",siteRest.getData().size());
siteRest.getData().forEach(site -> {
siteMatterService.getDao().delete(new SiteMatterQuery().siteId(site.getId()));
int page=100;
int pageNum=100;
for(int i=1;i<=page;i++){
SiteMatterPdu siteMatterPdu = new SiteMatterPdu();
siteMatterPdu.setPage(i);
siteMatterPdu.setSize(pageNum);
siteMatterPdu.setSiteId(site.getId());
log.info("请求列表:"+i);
Rest<RespData<List<SiteMatterPdu>>> siteMatterRest = siteMatterFeign.list(siteMatterPdu);
if (siteMatterRest.getCode() == YesNoEnum.YES.getValue()) {
if(siteMatterRest.getData().getData().size()==0){
log.info("数据没有!跳出循环");
break;
}
//删除后新增
log.info("事项总数量:{}",siteMatterRest.getData().getData().size());
List<SiteMatterEntity> siteMatterEntities = siteMatterRest.getData().getData().stream().map(siteMatter -> {
SiteMatterEntity sheetMatterEntity = new SiteMatterEntity();
sheetMatterEntity.initAttrValue();
sheetMatterEntity.setId(siteMatter.getMatterId());
sheetMatterEntity.setSiteId(siteMatter.getSiteId());
sheetMatterEntity.setMatterName(siteMatter.getMatterName());
sheetMatterEntity.setMatterCode(siteMatter.getMatterCode());
sheetMatterEntity.setDeptId(siteMatter.getDeptId());
sheetMatterEntity.setDeptCode(siteMatter.getDeptCode());
sheetMatterEntity.setDeptName(siteMatter.getDeptName());
sheetMatterEntity.setAreaCode(siteMatter.getAreaCode());
sheetMatterEntity.setSource(siteMatter.getSource());
sheetMatterEntity.setEventTypeShow(siteMatter.getEventTypeShow());
sheetMatterEntity.setViewsCount(0l);
sheetMatterEntity.setIsConvert(0);
return sheetMatterEntity;
}).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(siteMatterEntities)) {
// sheetMatterService.getDao().delete(new SheetMatterQuery().siteId(site.getId()));
log.info("新增数量:{}",siteMatterEntities.size());
siteMatterService.save(siteMatterEntities);
/* List<List<SheetMatterEntity>> partition = ListUtil.partition(sheetMatterEntities, 500);
for (List<SheetMatterEntity> matterEntities : partition) {
}*/
}
}else{
log.info("请求错误,code:{}",siteMatterRest.getCode());
}
}
});
}
}
@Override
public void stopTask(ITask task) throws AppException {
}
}
......@@ -103,4 +103,18 @@ public class SingleMatterServiceImpl extends AbstractCRUDServiceImpl<SingleMatte
condition.put("id",id);
dao.update(data,condition);
}
@Override
public SingleMatterEntity get(Long key, Context context) throws AppException {
SingleMatterEntity entity = this.dao.get(key);
if(entity!=null) {
SingleMatterFileEntity singleMatterFileEntity = singleMatterFileService.selectOne(new SingleMatterFileQuery().matterId(entity.getMatterId()));
if (singleMatterFileEntity != null) {
entity.setHasApplyForm(1);
entity.setApplyFormUrl(singleMatterFileEntity.getFileUrl());
entity.setApplyFormFileName(singleMatterFileEntity.getFilename());
}
}
return entity;
}
}
\ No newline at end of file
......@@ -629,6 +629,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
for (MatterEntity matterEntity : subList) {
DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName());
matterEntity.setCreateTime(new Date());
matterService.save(matterEntity, context);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment