Commit b0e33ddd authored by 赵啸非's avatar 赵啸非

添加应用白名单接口

parent 0715e197
Pipeline #2478 canceled with stages
......@@ -41,6 +41,8 @@ public class SiteMatterPdu extends BaseEntityLong {
* 部门名称
*/
private String deptName;
private String areaCode;
/**
* 事项类型
*/
......@@ -163,6 +165,15 @@ public class SiteMatterPdu extends BaseEntityLong {
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<SiteMatterPdu> andConditionList;
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public SiteMatterPdu(){}
/**
* 获取 站点ID
......
......@@ -15,7 +15,7 @@ import java.util.List;
* @author zxfei
* @date 2023-02-17
*/
@FeignClient(name = "", path = "", fallbackFactory = SiteMatterFeignFallbackFactory.class)
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SiteMatterFeignFallbackFactory.class)
public interface ISiteMatterFeign extends IFeign {
......
......@@ -11,7 +11,6 @@ package com.mortals.xhx.base.system.task.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.base.system.task.dao.TaskDao;
import com.mortals.xhx.base.system.task.model.TaskEntity;
import org.springframework.stereotype.Repository;
/**
* <p>Title: 任务信息</p>
......
......@@ -8,11 +8,11 @@
package com.mortals.xhx.base.system.task.model;
import java.util.Date;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.framework.service.ITask;
import java.util.Date;
/**
* <p>Title: 任务信息</p>
* <p>Description: TaskEntity </p>
......
......@@ -4,17 +4,6 @@
package com.mortals.xhx.base.system.task.service.impl;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.code.ExcuteStatus;
import com.mortals.framework.common.code.TaskExcuteStrategy;
......@@ -30,6 +19,12 @@ import com.mortals.xhx.base.system.task.dao.TaskDao;
import com.mortals.xhx.base.system.task.model.TaskEntity;
import com.mortals.xhx.base.system.task.model.TaskQuery;
import com.mortals.xhx.base.system.task.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* <p>
......
package com.mortals.xhx.base.system.task.web;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.task.model.TaskQuery;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.task.model.TaskEntity;
import com.mortals.xhx.base.system.task.model.TaskQuery;
import com.mortals.xhx.base.system.task.service.TaskService;
import com.mortals.xhx.common.code.DataSatusEnum;
import com.mortals.xhx.common.code.TaskExcuteStatusEnum;
import com.mortals.xhx.common.code.TaskExcuteStrategyEnum;
import com.mortals.xhx.common.code.TaskInterimExcuteStatusEnum;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/**
* 任务信息
......
package com.mortals.xhx.daemon.task;
import cn.hutool.core.collection.ListUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
......@@ -11,6 +12,7 @@ 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.sheet.model.SheetMatterEntity;
import com.mortals.xhx.module.sheet.model.SheetMatterQuery;
import com.mortals.xhx.module.sheet.service.SheetMatterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -36,7 +38,7 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
@Override
public void excuteTask(ITask task) throws AppException {
log.info("开始同步事项列表!");
SitePdu sitePdu = new SitePdu();
sitePdu.setId(1L);
Rest<List<SitePdu>> siteRest = siteFeign.getFlatSitesBySiteId(sitePdu);
......@@ -51,16 +53,24 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
List<SheetMatterEntity> sheetMatterEntities = siteMatterRest.getData().getData().stream().map(siteMatter -> {
SheetMatterEntity sheetMatterEntity = new SheetMatterEntity();
sheetMatterEntity.initAttrValue();
sheetMatterEntity.setId(siteMatter.getMatterId());
sheetMatterEntity.setSiteId(siteMatter.getSiteId());
sheetMatterEntity.setMatterName(siteMatter.getMatterName());
sheetMatterEntity.setMatterNo(siteMatter.getMatterCode());
sheetMatterEntity.setDeptCode(siteMatter.getDeptCode());
sheetMatterEntity.setDeptName(siteMatter.getDeptCode());
sheetMatterEntity.setDeptName(siteMatter.getDeptName());
sheetMatterEntity.setAreaCode(siteMatter.getAreaCode());
sheetMatterEntity.setSource(siteMatter.getSource());
return sheetMatterEntity;
}).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(sheetMatterEntities)) {
sheetMatterService.save(sheetMatterEntities);
sheetMatterService.getDao().delete(new SheetMatterQuery().siteId(site.getId()));
List<List<SheetMatterEntity>> partition = ListUtil.partition(sheetMatterEntities, 500);
for (List<SheetMatterEntity> matterEntities : partition) {
sheetMatterService.save(matterEntities);
}
}
}
});
......
......@@ -5,6 +5,7 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.sheet.dao.SheetMatterDao;
import com.mortals.xhx.module.sheet.model.SheetMatterEntity;
/**
......@@ -17,5 +18,7 @@ import com.mortals.xhx.module.sheet.model.SheetMatterEntity;
*/
public interface SheetMatterService extends ICRUDService<SheetMatterEntity, Long> {
SheetMatterDao getDao();
Result<SheetMatterEntity> findSubList(SheetMatterEntity matterQuery, PageInfo pageInfo, Context context);
}
\ No newline at end of file
......@@ -20,9 +20,6 @@
<if test="condition.matterName != null and condition.matterName != ''">
and a.matterName like #{condition.matterName}
</if>
<if test="condition.matterFullName != null and condition.matterFullName != ''">
and a.matterName like #{condition.matterName}
</if>
</trim>
</trim>
</select>
......@@ -46,9 +43,6 @@
<if test="condition.matterName != null and condition.matterName != ''">
and a.matterName like #{condition.matterName}
</if>
<if test="condition.matterFullName != null and condition.matterFullName != ''">
and a.matterName like #{condition.matterName}
</if>
</trim>
</trim>
</select>
......
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