diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcSyncJobDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcSyncJobDTO.java new file mode 100644 index 0000000000..320acd13b9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcSyncJobDTO.java @@ -0,0 +1,89 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 同步任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-11-08 + */ +@Data +public class IcSyncJobDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级,包括org_id + */ + private String orgIdPath; + + /** + * 任务类型,残疾:disability;死亡:death;核酸:nat; + */ + private String jobType; + + /** + * 操作员ID【staffId】 + */ + private String operatorId; + + /** + * 操作状态,等待中:waiting;进行中:processing;结束:finish + */ + private String operationStatus; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncConfigController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncConfigController.java index 2ea0a33db9..56ec47f551 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncConfigController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncConfigController.java @@ -112,4 +112,16 @@ public class DataSyncConfigController { return new Result(); } + @PostMapping("deathInfoScanTask") + public Result deathInfoScanTask(@RequestBody DataSyncTaskParam formDTO){ + dataSyncConfigService.deathInfoScanTask(formDTO); + return new Result(); + } + + @PostMapping("disabilityInfoScanTask") + public Result disabilityInfoScanTask(@RequestBody DataSyncTaskParam formDTO){ + dataSyncConfigService.disabilityInfoScanTask(formDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java new file mode 100644 index 0000000000..5b4ad6684e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcSyncJobEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 同步任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-11-08 + */ +@Mapper +public interface IcSyncJobDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java new file mode 100644 index 0000000000..0a83b7aa56 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java @@ -0,0 +1,59 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 同步任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-11-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_sync_job") +public class IcSyncJobEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级,包括org_id + */ + private String orgIdPath; + + /** + * 任务类型,残疾:disability;死亡:death;核酸:nat; + */ + private String jobType; + + /** + * 操作员ID【staffId】 + */ + private String operatorId; + + /** + * 操作状态,等待中:waiting;进行中:processing;结束:finish + */ + private String operationStatus; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncConfigService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncConfigService.java index fe51881c46..50e65d3b23 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncConfigService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncConfigService.java @@ -83,4 +83,9 @@ public interface DataSyncConfigService extends BaseService void scopeSave(ScopeSaveFormDTO formDTO); void dataSyncForYanTaiTask(DataSyncTaskParam formDTO); + + void deathInfoScanTask(DataSyncTaskParam formDTO); + + void disabilityInfoScanTask(DataSyncTaskParam formDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcSyncJobService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcSyncJobService.java new file mode 100644 index 0000000000..fab06ea871 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcSyncJobService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcSyncJobDTO; +import com.epmet.entity.IcSyncJobEntity; + +import java.util.List; +import java.util.Map; + +/** + * 同步任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-11-08 + */ +public interface IcSyncJobService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-11-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-11-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcSyncJobDTO + * @author generator + * @date 2022-11-08 + */ + IcSyncJobDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-11-08 + */ + void save(IcSyncJobDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-11-08 + */ + void update(IcSyncJobDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-11-08 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 815c36d9cf..cd544907bb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -225,6 +225,28 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl configList, DataSyncTaskParam formDTO) { if (CollectionUtils.isEmpty(configList)) { log.warn("dataSyncYanTaiParallel configList is null"); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcSyncJobServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcSyncJobServiceImpl.java new file mode 100644 index 0000000000..c9e415eead --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcSyncJobServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcSyncJobDao; +import com.epmet.dto.IcSyncJobDTO; +import com.epmet.entity.IcSyncJobEntity; +import com.epmet.service.IcSyncJobService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 同步任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-11-08 + */ +@Service +public class IcSyncJobServiceImpl extends BaseServiceImpl implements IcSyncJobService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcSyncJobDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcSyncJobDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcSyncJobDTO get(String id) { + IcSyncJobEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcSyncJobDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcSyncJobDTO dto) { + IcSyncJobEntity entity = ConvertUtils.sourceToTarget(dto, IcSyncJobEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcSyncJobDTO dto) { + IcSyncJobEntity entity = ConvertUtils.sourceToTarget(dto, IcSyncJobEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml new file mode 100644 index 0000000000..0b7ecc334d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file