1
0
DESKTOP-2K9OVK9\siwei 1 месяц назад
Родитель
Сommit
a8b0556f93
25 измененных файлов с 849 добавлено и 252 удалено
  1. 7 0
      pom.xml
  2. 18 0
      siwei-common/siwei-common-core/src/main/java/com/siwei/common/core/utils/DateUtils.java
  3. 17 0
      siwei-common/siwei-common-datasource/src/main/java/com/siwei/common/datasource/annotation/Oracle.java
  4. 5 0
      siwei-modules/siwei-apply/pom.xml
  5. 58 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/zrzysite/ZrzysiteConstructController.java
  6. 21 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/zrzysite/ZrzysiteConstructFilterVo.java
  7. 19 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteAttachment.java
  8. 37 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteConstruct.java
  9. 31 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteGhhs.java
  10. 47 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteLand.java
  11. 7 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/ProjectMapper.java
  12. 21 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteAttachmentMapper.java
  13. 22 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteConstructMapper.java
  14. 17 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteGhhsMapper.java
  15. 17 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteLandMapper.java
  16. 21 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteCommonService.java
  17. 285 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteCommonServiceImpl.java
  18. 26 26
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/NpoiHelper.java
  19. 19 21
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ServiceFileUtil.java
  20. 10 0
      siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml
  21. 54 0
      siwei-modules/siwei-apply/src/main/resources/mapper/zrzysite/ZrzysiteAttachmentMapper.xml
  22. 41 0
      siwei-modules/siwei-apply/src/main/resources/mapper/zrzysite/ZrzysiteGhhsMapper.xml
  23. 49 0
      siwei-modules/siwei-apply/src/main/resources/mapper/zrzysite/ZrzysiteLandMapper.xml
  24. 0 94
      siwei-modules/siwei-job/src/main/resources/mapper/mysql/job/SysJobLogMapper.xml
  25. 0 111
      siwei-modules/siwei-job/src/main/resources/mapper/mysql/job/SysJobMapper.xml

+ 7 - 0
pom.xml

@@ -43,6 +43,7 @@
         <org.geotools.version>26.0</org.geotools.version>
         <org.locationtech.jts.version>1.19.0</org.locationtech.jts.version>
         <net.lingala.zip4j.version>2.11.5</net.lingala.zip4j.version>
+        <ojdbc.version>18.3.0.0</ojdbc.version>
     </properties>
 
     <!-- 依赖声明 -->
@@ -270,6 +271,12 @@
                 <version>${org.postgresql.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>com.oracle.database.jdbc</groupId>
+                <artifactId>ojdbc8</artifactId>
+                <version>${ojdbc.version}</version>
+            </dependency>
+
             <!--geotools-->
             <dependency>
                 <groupId>org.geotools</groupId>

+ 18 - 0
siwei-common/siwei-common-core/src/main/java/com/siwei/common/core/utils/DateUtils.java

@@ -8,6 +8,7 @@ import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
 import java.util.Date;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
@@ -182,4 +183,21 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
         return Date.from(zdt.toInstant());
     }
+
+
+
+    /**
+     * 两个时间是否同一分钟
+     */
+    public static boolean isSameMinute(Date d1, Date d2) {
+        if (d1 == null || d2 == null) {
+            return false;
+        }
+        LocalDateTime t1 = d1.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().truncatedTo(ChronoUnit.MINUTES);
+        LocalDateTime t2 = d2.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().truncatedTo(ChronoUnit.MINUTES);
+        return t1.isEqual(t2);
+    }
+
+
+
 }

+ 17 - 0
siwei-common/siwei-common-datasource/src/main/java/com/siwei/common/datasource/annotation/Oracle.java

@@ -0,0 +1,17 @@
+package com.siwei.common.datasource.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import com.baomidou.dynamic.datasource.annotation.DS;
+
+@Target({ ElementType.TYPE, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@DS("oracle")
+public @interface Oracle
+{
+
+}

+ 5 - 0
siwei-modules/siwei-apply/pom.xml

@@ -42,6 +42,11 @@
             <artifactId>postgresql</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.oracle.database.jdbc</groupId>
+            <artifactId>ojdbc8</artifactId>
+        </dependency>
+
 
 
         <!-- siwei Common DataSource -->

+ 58 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/zrzysite/ZrzysiteConstructController.java

@@ -0,0 +1,58 @@
+package com.siwei.apply.controller.zrzysite;
+
+import com.siwei.apply.domain.zrzysite.ZrzysiteConstruct;
+import com.siwei.apply.domain.vo.zrzysite.ZrzysiteConstructFilterVo;
+import com.siwei.apply.service.zrzysite.IZrzysiteCommonService;
+import com.siwei.common.core.domain.R;
+import com.siwei.common.core.web.controller.BaseController;
+import com.siwei.common.core.web.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/zrzysite/construct")
+public class ZrzysiteConstructController extends BaseController {
+
+    @Autowired
+    private IZrzysiteCommonService zrzysiteConstructService;
+
+    @GetMapping("/list")
+    public TableDataInfo list(ZrzysiteConstructFilterVo filterVo) {
+        startPage();
+        List<ZrzysiteConstruct> list = zrzysiteConstructService.selectList(filterVo);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/{sqbh}")
+    public R<ZrzysiteConstruct> getById(@PathVariable String sqbh) {
+        ZrzysiteConstruct result = zrzysiteConstructService.selectById(sqbh);
+        if (result == null) {
+            return R.fail("未找到对应数据");
+        }
+        return R.ok(result);
+    }
+
+    @GetMapping("/count")
+    public R<Integer> count(ZrzysiteConstructFilterVo filterVo) {
+        return R.ok(zrzysiteConstructService.selectCount(filterVo));
+    }
+
+
+
+
+    @GetMapping("/dingshi")
+    public R<String> dingshi() {
+        zrzysiteConstructService.syncConstructInfo("");
+        return R.ok("success1");
+    }
+
+
+
+
+
+
+
+
+}

+ 21 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/zrzysite/ZrzysiteConstructFilterVo.java

@@ -0,0 +1,21 @@
+package com.siwei.apply.domain.vo.zrzysite;
+
+import lombok.Data;
+
+@Data
+public class ZrzysiteConstructFilterVo {
+
+    private String sqbh;
+
+    private String xmmc;
+
+    private String xmdm;
+
+    private String gcmc;
+
+    private String keyword;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+}

+ 19 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteAttachment.java

@@ -0,0 +1,19 @@
+package com.siwei.apply.domain.zrzysite;
+
+import lombok.Data;
+
+@Data
+public class ZrzysiteAttachment {
+
+    private String id;
+
+    private String attachment;
+
+    private String fjmc;
+
+    private String spsxmc;
+
+    private String applyinstId;
+
+    private String clmc;
+}

+ 37 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteConstruct.java

@@ -0,0 +1,37 @@
+package com.siwei.apply.domain.zrzysite;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ZrzysiteConstruct {
+
+    private String sqbh;
+
+    private String zsbh;
+
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date fzrq;
+
+    private String attachment;
+
+    private String xmdm;
+
+    private String xmmc;
+
+    private String zzrl;
+
+    private String gcmc;
+
+    private String ydwz;
+
+    private String jsgm;
+
+    private String bz;
+
+    private String xddw;
+
+    private String fadw;
+}

+ 31 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteGhhs.java

@@ -0,0 +1,31 @@
+package com.siwei.apply.domain.zrzysite;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ZrzysiteGhhs {
+
+    private String applyinstId;
+
+    private String fzjg;
+
+    private String hyyj;
+
+    private String xmdm;
+
+    private String spsxmc;
+
+    private String hgzh;
+
+    private String attachment;
+
+    private String xmmc;
+
+    private String yddw;
+
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date fzrq;
+}

+ 47 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/zrzysite/ZrzysiteLand.java

@@ -0,0 +1,47 @@
+package com.siwei.apply.domain.zrzysite;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ZrzysiteLand {
+
+    private String sqbh;
+
+    private String tdhqfs;
+
+    private String attachment;
+
+    private String zzrl;
+
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date fzrq;
+
+    private String zsbh;
+
+    private String ydmj;
+
+    private String tdyt;
+
+    private String xmdm;
+
+    private String xmmc;
+
+    private String gcmc;
+
+    private String ydwz;
+
+    private String jsgm;
+
+    private String bz;
+
+    private String pzydjg;
+
+    private String pzydwh;
+
+    private String xddw;
+
+    private String fadw;
+}

+ 7 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/ProjectMapper.java

@@ -98,6 +98,13 @@ public interface ProjectMapper {
     String getNodeSourceIdByTable(@Param("nodeId")String nodeId,@Param("tableName") String tableName);
 
 
+    /**
+     * 获取工改同步项目信息
+     * @param nodeTableName
+     * @return
+     */
+    List<Project> getZrzysiteProjectList(String nodeTableName);
+
     List<Map<String,Object>> getTdyProjectList(@Param("xmmc") String xmmc,
                                                 @Param("xmdm") String xmdm,
                                                 @Param("srf") String srf,

+ 21 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteAttachmentMapper.java

@@ -0,0 +1,21 @@
+package com.siwei.apply.mapper.zrzysite;
+
+import com.siwei.apply.domain.zrzysite.ZrzysiteAttachment;
+import com.siwei.common.datasource.annotation.Oracle;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+@Oracle
+public interface ZrzysiteAttachmentMapper {
+
+    ZrzysiteAttachment selectById(@Param("id") String id);
+
+    List<ZrzysiteAttachment> selectByApplyinstIdList(@Param("applyinstIdList") List<String> applyinstIdList);
+
+    List<ZrzysiteAttachment> selectByApplyinstId(@Param("applyinstId") String applyinstId);
+
+
+}

+ 22 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteConstructMapper.java

@@ -0,0 +1,22 @@
+package com.siwei.apply.mapper.zrzysite;
+
+import com.siwei.apply.domain.zrzysite.ZrzysiteConstruct;
+import com.siwei.apply.domain.vo.zrzysite.ZrzysiteConstructFilterVo;
+import com.siwei.common.datasource.annotation.Oracle;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+@Oracle
+public interface ZrzysiteConstructMapper {
+
+    List<ZrzysiteConstruct> selectList(ZrzysiteConstructFilterVo filterVo);
+
+    ZrzysiteConstruct selectById(@Param("sqbh") String sqbh);
+
+    int selectCount(ZrzysiteConstructFilterVo filterVo);
+
+    List<ZrzysiteConstruct> selectByXmdmList(@Param("xmdmList") List<String> xmdmList);
+}

+ 17 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteGhhsMapper.java

@@ -0,0 +1,17 @@
+package com.siwei.apply.mapper.zrzysite;
+
+import com.siwei.apply.domain.zrzysite.ZrzysiteGhhs;
+import com.siwei.common.datasource.annotation.Oracle;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+@Oracle
+public interface ZrzysiteGhhsMapper {
+
+    ZrzysiteGhhs selectById(@Param("applyinstId") String applyinstId);
+
+    List<ZrzysiteGhhs> selectByXmdmList(@Param("xmdmList") List<String> xmdmList);
+}

+ 17 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/zrzysite/ZrzysiteLandMapper.java

@@ -0,0 +1,17 @@
+package com.siwei.apply.mapper.zrzysite;
+
+import com.siwei.apply.domain.zrzysite.ZrzysiteLand;
+import com.siwei.common.datasource.annotation.Oracle;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+@Oracle
+public interface ZrzysiteLandMapper {
+
+    ZrzysiteLand selectById(@Param("sqbh") String sqbh);
+
+    List<ZrzysiteLand> selectByXmdmList(@Param("xmdmList") List<String> xmdmList);
+}

+ 21 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteCommonService.java

@@ -0,0 +1,21 @@
+package com.siwei.apply.service.zrzysite;
+
+import com.siwei.apply.domain.zrzysite.ZrzysiteConstruct;
+import com.siwei.apply.domain.vo.zrzysite.ZrzysiteConstructFilterVo;
+
+import java.util.List;
+
+public interface IZrzysiteCommonService {
+
+    List<ZrzysiteConstruct> selectList(ZrzysiteConstructFilterVo filterVo);
+
+    ZrzysiteConstruct selectById(String sqbh);
+
+    int selectCount(ZrzysiteConstructFilterVo filterVo);
+
+
+    void syncConstructInfo(String sqbh);
+
+
+
+}

+ 285 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteCommonServiceImpl.java

@@ -0,0 +1,285 @@
+package com.siwei.apply.service.zrzysite.impl;
+
+import com.siwei.apply.domain.BaseId;
+import com.siwei.apply.domain.Jsgcghxk;
+import com.siwei.apply.domain.Project;
+import com.siwei.apply.domain.vo.JsgcghxkUpdateVo;
+import com.siwei.apply.domain.vo.JsgcghxkVo;
+import com.siwei.apply.domain.zrzysite.ZrzysiteAttachment;
+import com.siwei.apply.domain.zrzysite.ZrzysiteConstruct;
+import com.siwei.apply.domain.vo.zrzysite.ZrzysiteConstructFilterVo;
+import com.siwei.apply.enums.AloneWorkFlowEnum;
+import com.siwei.apply.mapper.JsgcghxkMapper;
+import com.siwei.apply.mapper.ProjectMapper;
+import com.siwei.apply.mapper.zrzysite.ZrzysiteAttachmentMapper;
+import com.siwei.apply.mapper.zrzysite.ZrzysiteConstructMapper;
+import com.siwei.apply.service.JsgcghxkService;
+import com.siwei.apply.service.NodeAttachmentService;
+import com.siwei.apply.service.zrzysite.IZrzysiteCommonService;
+import com.siwei.apply.utils.ServiceFileUtil;
+import com.siwei.common.core.utils.DateUtils;
+import com.siwei.common.core.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZrzysiteCommonServiceImpl implements IZrzysiteCommonService {
+
+    @Autowired
+    private ZrzysiteConstructMapper zrzysiteConstructMapper;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+
+    @Autowired
+    private JsgcghxkMapper jsgcghxkMapper;
+
+
+
+    @Autowired
+    private JsgcghxkService jsgcghxkService;
+
+
+    @Autowired
+    private NodeAttachmentService nodeAttachmentService;
+
+
+    @Autowired
+    private ZrzysiteAttachmentMapper zrzysiteAttachmentMapper;
+
+
+    @Override
+    public List<ZrzysiteConstruct> selectList(ZrzysiteConstructFilterVo filterVo) {
+        return zrzysiteConstructMapper.selectList(filterVo);
+    }
+
+    @Override
+    public ZrzysiteConstruct selectById(String sqbh) {
+        return zrzysiteConstructMapper.selectById(sqbh);
+    }
+
+    @Override
+    public int selectCount(ZrzysiteConstructFilterVo filterVo) {
+        return zrzysiteConstructMapper.selectCount(filterVo);
+    }
+
+    /**
+     * 同步工程建设数据
+     * @param sqbh
+     */
+    @Override
+    public void syncConstructInfo(String sqbh) {
+        /**
+         * 1.查询所有的项目数据,及当前节点数据,不存在的,未上链的。
+         * 2.遍历这些数据,从Oracle中,根据项目号进行查询。
+         * 3.如果查到一条数据,然后进行入库一系列的操作。
+         * 4.不进行上链,上链操作,通过其他定时任务完成。
+         */
+
+        // 批量查询所有  项目名称,项目代码,workflow表中是否存在。如果存在,则不处理,如果不存在则处理。
+        List<Project> constructProjectList = projectMapper.getZrzysiteProjectList("t_jsgcghxk");
+        if (!constructProjectList.isEmpty()) {
+            List<String> projectCodes = constructProjectList.stream()
+                    .map(Project::getCode)
+                    .filter(StringUtils::isNotBlank)
+                    .collect(Collectors.toList());
+
+            List<ZrzysiteConstruct> constructList = zrzysiteConstructMapper.selectByXmdmList(projectCodes);
+
+            Map<String, List<ZrzysiteConstruct>> codeToConstructMap = constructList.stream()
+                    .collect(Collectors.groupingBy(ZrzysiteConstruct::getXmdm));
+
+
+            LinkedHashMap<Project, List<ZrzysiteConstruct>> zrzysiteConstructMap = new LinkedHashMap<>();
+            for (Project project : constructProjectList) {
+                List<ZrzysiteConstruct> items = codeToConstructMap.getOrDefault(project.getCode(), new ArrayList<>());
+                if(!items.isEmpty() && (project.getCode().equals("2020-360090-48-01-002429"))){
+                    zrzysiteConstructMap.put(project, items);
+                }
+            }
+
+            log.info("到这里来了");
+            addConstructInfoToDataBase(zrzysiteConstructMap);
+        }
+    }
+
+
+
+    /**
+     * 根据对应关系,映射转换,然后入库
+     * @param zrzysiteConstructMap
+     */
+    public void addConstructInfoToDataBase(Map<Project, List<ZrzysiteConstruct>> zrzysiteConstructMap) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        for (Map.Entry<Project, List<ZrzysiteConstruct>> entry : zrzysiteConstructMap.entrySet()) {
+            Project project = entry.getKey();
+            List<ZrzysiteConstruct> constructList = entry.getValue();
+            if (CollectionUtils.isEmpty(constructList)) {
+                continue;
+            }
+            String projectId = project.getId();
+            //来源类型。1.节点不存在的项目。2.节点存在的项目
+            String sourceType = project.getCreatorId();
+            if("2".equals(sourceType)){ //修改和新增的情况
+                List<Jsgcghxk> JsgcghxkList   = jsgcghxkMapper.get(projectId);
+                //1.如果有一个节点已经上链,直接外层跳过
+                Optional<Jsgcghxk> hasOnchainRes = JsgcghxkList.stream().filter(Jsgcghxk::getHasOnchain).findFirst();
+                if(hasOnchainRes.isPresent()){
+                    continue;
+                }
+
+                //如果用户手动修改过的数据直接用户操作为准,不再同步
+                if(JsgcghxkList.stream().anyMatch(obj ->
+                        !DateUtils.isSameMinute(obj.getCreatedAt(), obj.getUpdatedAt())
+                                && StringUtils.isNotBlank(obj.getZsbh())
+                                && StringUtils.isNotBlank(obj.getFzDate()))){
+                    continue;
+                }
+
+                //找出同步过的数据,不再同步
+                List<String> sourceIdList = new ArrayList<>();
+                List<String>  resSourceIdList =  JsgcghxkList.stream().map(Jsgcghxk::getSourceId).filter(StringUtils::isNotBlank).collect(Collectors.toList());
+                if(!resSourceIdList.isEmpty()){
+                    sourceIdList = new ArrayList<>(resSourceIdList);
+                }
+
+                //找出需要更新的节点id
+                List<String>  needUpdateNodeIdList =  JsgcghxkList.stream().filter(s->StringUtils.isBlank(s.getSourceId())).map(BaseId::getId).collect(Collectors.toList());
+
+                String addNodeId = "";
+                for (ZrzysiteConstruct construct : constructList) {
+                    if(sourceIdList.contains(construct.getSqbh())){
+                        //说明已经同步过了
+                        continue;
+                    }
+
+                    String needUpdateNodeId  = "";
+                    // 取出头部元素并从集合删除
+                    if (!needUpdateNodeIdList.isEmpty()) {
+                        needUpdateNodeId  = needUpdateNodeIdList.remove(0);
+                    }
+
+                    if(StringUtils.isNotBlank(needUpdateNodeId)){
+                        JsgcghxkUpdateVo jsgcghxkUpdateVo = new JsgcghxkUpdateVo();
+                        jsgcghxkUpdateVo.setId(needUpdateNodeId);
+                        jsgcghxkUpdateVo.setProjectId(projectId);
+                        jsgcghxkUpdateVo.setYddw(construct.getYdwz());
+                        jsgcghxkUpdateVo.setYddw(construct.getXddw());
+                        jsgcghxkUpdateVo.setJsgm(construct.getJsgm());
+                        jsgcghxkUpdateVo.setZsbh(construct.getZsbh());
+                        jsgcghxkUpdateVo.setFzjg(construct.getFadw());
+                        jsgcghxkUpdateVo.setSourceId(construct.getSqbh());
+                        jsgcghxkService.update(jsgcghxkUpdateVo);
+                        addNodeId = needUpdateNodeId;
+                    }else {
+                        JsgcghxkVo vo = new JsgcghxkVo();
+                        vo.setProjectId(projectId);
+                        vo.setYdwz(construct.getYdwz());
+                        vo.setYddw(construct.getXddw());
+                        vo.setJsgm(construct.getJsgm());
+                        vo.setZsbh(construct.getZsbh());
+                        vo.setFzjg(construct.getFadw());
+                        vo.setSourceId(construct.getSqbh());
+                        if (construct.getFzrq() != null) {
+                            vo.setFzDate(sdf.format(construct.getFzrq()));
+                        }
+                        addNodeId = jsgcghxkService.add(vo);
+                    }
+                    //这里进行文件处理
+                    getNodeAttachment(projectId,addNodeId,construct.getSqbh(),AloneWorkFlowEnum.NODE_5.getName());
+                }//end for
+
+            }else if("1".equals(sourceType)){ //只存在新增情况
+                for (ZrzysiteConstruct construct : constructList) {
+                    JsgcghxkVo vo = new JsgcghxkVo();
+                    vo.setProjectId(projectId);
+                    vo.setYdwz(construct.getYdwz());
+                    vo.setYddw(construct.getXddw());
+                    vo.setJsgm(construct.getJsgm());
+                    vo.setZsbh(construct.getZsbh());
+                    vo.setFzjg(construct.getFadw());
+                    vo.setSourceId(construct.getSqbh());
+                    if (construct.getFzrq() != null) {
+                        vo.setFzDate(sdf.format(construct.getFzrq()));
+                    }
+                    String addNodeId = jsgcghxkService.add(vo);
+                    //这里进行文件处理
+                    getNodeAttachment(projectId,addNodeId,construct.getSqbh(),AloneWorkFlowEnum.NODE_5.getName());
+                }
+            }
+
+        }// end for
+
+    }
+
+
+
+
+
+
+
+
+    /*
+    1.先拿到示例id
+    2.根据实例id,获取所有的附件材料条数。
+    3.把数据下载到当前目录。
+    4.获取当前附件的json
+    5.存储入库。
+    */
+    public String getNodeAttachment(String projectId, String nodeId, String sourceId, String nodeName) {
+        if (StringUtils.isBlank(sourceId)) {
+            log.info("文件关联id为空--附件材料无法下载-项目id:{}", projectId);
+            return "";
+        }
+
+        String fileDownLoadPath = "";
+
+        try {
+            //这里把文件下载下来,并且构建正确的目录结构
+            List<ZrzysiteAttachment> zrzysiteAttachmentList = zrzysiteAttachmentMapper.selectByApplyinstId(sourceId);
+            //这里增加一个方法,把文件下载下来
+
+            //先创建一个跟路径
+            //fileDownLoadPath = ServiceFileUtil.createDirectory(nodeName);
+
+            if (CollectionUtils.isNotEmpty(zrzysiteAttachmentList)) {
+                String[] subDirectoryNameArr =  zrzysiteAttachmentList.stream().map(s->s.getClmc()).collect(Collectors.toSet()).toArray(new String[0]);
+                //先删除相关目录
+                for(String subDirectoryName : subDirectoryNameArr){
+                    ServiceFileUtil.deleteDirectory(subDirectoryName);
+                }
+                //重新创建子目录
+                fileDownLoadPath = ServiceFileUtil.createMultipartDirectory(nodeName,subDirectoryNameArr);
+
+                for (ZrzysiteAttachment attachment : zrzysiteAttachmentList) {
+                    String url = attachment.getAttachment();
+                    String directoryName = attachment.getClmc();
+                    String fileName = attachment.getFjmc();
+//                    //子目录存在先删除
+                    String subDownLoadFilePath = fileDownLoadPath + "/" + directoryName;
+                    ServiceFileUtil.downloadFile(url,fileName, subDownLoadFilePath);
+                }
+            }
+
+            String nodeAttachmentId = nodeAttachmentService.processFileAndSave(fileDownLoadPath, null, null);
+            boolean success = nodeAttachmentService.updateNodeId(nodeAttachmentId, nodeId);
+            log.info("附件材料下载并关联入库成功:{},环节id:{]-项目id:{}",success,nodeId, projectId);
+            nodeAttachmentService.modifyAttachmentInfo(projectId, nodeId, nodeAttachmentId);
+            return nodeAttachmentId;
+        } catch (Exception e) {
+            log.error("处理文件异常", e);
+        }
+        return "";
+    }
+
+
+
+}

+ 26 - 26
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/NpoiHelper.java

@@ -1,6 +1,6 @@
 package com.siwei.apply.utils;
 
-import com.aspose.words.*;
+//import com.aspose.words.*;
 import com.siwei.common.core.utils.StringUtils;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.util.Units;
@@ -475,8 +475,8 @@ public class NpoiHelper {
                     "    <Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>\n" +
                     "</License>\n";
             is = new ByteArrayInputStream(xml.getBytes());
-            License aposeLic = new License();
-            aposeLic.setLicense(is);
+//            License aposeLic = new License();
+//            aposeLic.setLicense(is);
             result = true;
         } catch (Exception e) {
             e.printStackTrace();
@@ -499,29 +499,29 @@ public class NpoiHelper {
         FileOutputStream os = null;
         try {
             //取用户字体目录
-            String userfontsfoloder = System.getProperty("user.home") + "\\Microsoft\\Windows\\Fonts\\";
-            System.out.println("userfontsfoloder:" + userfontsfoloder);
-            FontSourceBase[] fontSourceBases = FontSettings.getDefaultInstance().getFontsSources();
-            FontSourceBase[] updatedFontSources = new FontSourceBase[FontSettings.getDefaultInstance().getFontsSources().length + 1];
-
-            //将用户目录字体添加到字体源中
-            FolderFontSource folderFontSource = new FolderFontSource(userfontsfoloder, true);
-
-            for (int i = 0; i < fontSourceBases.length; i++) {
-                updatedFontSources[i] = fontSourceBases[i];
-            }
-            updatedFontSources[fontSourceBases.length] = folderFontSource;
-
-            FontSettings.getDefaultInstance().setFontsSources(updatedFontSources);
-
-            long old = System.currentTimeMillis();
-            File file = new File(outPath); // 新建一个空白pdf文档
-            os = new FileOutputStream(file);
-            com.aspose.words.Document doc = new com.aspose.words.Document(inPath); // Address是将要被转化的word文档
-            doc.save(os, SaveFormat.PDF);// 全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF,
-            // EPUB, XPS, SWF 相互转换
-            long now = System.currentTimeMillis();
-            System.out.println("pdf转换成功,共耗时:" + ((now - old) / 1000.0) + "秒"); // 转化用时
+//            String userfontsfoloder = System.getProperty("user.home") + "\\Microsoft\\Windows\\Fonts\\";
+//            System.out.println("userfontsfoloder:" + userfontsfoloder);
+//            FontSourceBase[] fontSourceBases = FontSettings.getDefaultInstance().getFontsSources();
+//            FontSourceBase[] updatedFontSources = new FontSourceBase[FontSettings.getDefaultInstance().getFontsSources().length + 1];
+//
+//            //将用户目录字体添加到字体源中
+//            FolderFontSource folderFontSource = new FolderFontSource(userfontsfoloder, true);
+//
+//            for (int i = 0; i < fontSourceBases.length; i++) {
+//                updatedFontSources[i] = fontSourceBases[i];
+//            }
+//            updatedFontSources[fontSourceBases.length] = folderFontSource;
+//
+//            FontSettings.getDefaultInstance().setFontsSources(updatedFontSources);
+//
+//            long old = System.currentTimeMillis();
+//            File file = new File(outPath); // 新建一个空白pdf文档
+//            os = new FileOutputStream(file);
+//            com.aspose.words.Document doc = new com.aspose.words.Document(inPath); // Address是将要被转化的word文档
+//            doc.save(os, SaveFormat.PDF);// 全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF,
+//            // EPUB, XPS, SWF 相互转换
+//            long now = System.currentTimeMillis();
+//            System.out.println("pdf转换成功,共耗时:" + ((now - old) / 1000.0) + "秒"); // 转化用时
         } catch (Exception e) {
             e.printStackTrace();
             return false;

+ 19 - 21
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ServiceFileUtil.java

@@ -1,6 +1,5 @@
 package com.siwei.apply.utils;
 
-import com.siwei.apply.common.Constant;
 import com.siwei.common.core.exception.ServiceException;
 import com.siwei.common.core.utils.DateUtils;
 import com.siwei.common.core.utils.StringUtils;
@@ -314,22 +313,11 @@ public class ServiceFileUtil {
      * @param destinationPath
      * @throws IOException
      */
-    public static void downloadFile(String fileURL,String fileName, String destinationPath,String fromRoute) throws IOException {
-        String fullUrl= "";
-        if(Constant.GG.equalsIgnoreCase(fromRoute)){
-            String newUrl = "";
-            if(StringUtils.contains(fileName,"&")){
-                newUrl = StringUtils.replace(fileURL, "&fileName="+fileName, "");
-            }else {
-                newUrl = fileURL.replaceAll("&fileName=[^&]*$", "");
-            }
-            String encodeFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
-            // 拼接合法URL
-            fullUrl = newUrl + "&fileName=" + encodeFileName;
-        }else if(Constant.BDC.equalsIgnoreCase(fromRoute)){
-            fullUrl = fileURL;
-        }
-
+    public static void downloadFile(String fileURL,String fileName, String destinationPath) throws IOException {
+        String encodeFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name());
+        String newUrl = fileURL.replaceAll("&fileName=[^&]*$", "");
+        // 拼接合法URL
+        String fullUrl = newUrl + "&fileName=" + encodeFileName;
         URL url = new URL(fullUrl);
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("GET");
@@ -337,7 +325,7 @@ public class ServiceFileUtil {
         connection.setReadTimeout(5000); // 设置读取超时时间
         int contentLength = connection.getContentLength(); // 获取文件大小
 
-        logger.info("Downloading file of size: " + contentLength + " bytes");
+        System.out.println("Downloading file of size: " + contentLength + " bytes");
 
         //目录路径许哟啊拼接文件名称
         destinationPath += "/"+ fileName;
@@ -351,13 +339,20 @@ public class ServiceFileUtil {
             while ((bytesRead = in.read(buffer)) != -1) {
                 out.write(buffer, 0, bytesRead);
             }
-            logger.info("Download completed.");
+
+            System.out.println("Download completed.");
         } finally {
             connection.disconnect();
         }
     }
 
 
+
+
+
+
+
+
     public static void test() throws Exception {
         Path dirPath = Paths.get("C:\\Users\\Administrator\\Desktop\\01\\一码管地相关\\数据库.docx");
         String extension = FilenameUtils.getExtension(dirPath.toString());
@@ -370,11 +365,14 @@ public class ServiceFileUtil {
     public static void main(String[] args) {
         System.out.println("==========start=============");
         try {
+
             String baseUrl = "http://10.224.130.138:7071/aplanmis-rest/province/downDzzzFileByFileId?fileId=605028ecf919500a380acc5a&fileName=阳光三路工程规划许可证申请表.pdf";
             String fileName = "阳光三路工程规划许可证申请表.pdf";
+
             String savePath = "C:\\home\\siwei\\uploadPath\\2026\\06\\13\\建设用地规划许可_20260613182743A035_20260613182743A036\\建设工程规划许可证申请表";
-            downloadFile(baseUrl, fileName, savePath,Constant.GG);
-            downloadFile(baseUrl,fileName,savePath,Constant.GG);
+            downloadFile(baseUrl, fileName, savePath);
+
+            downloadFile(baseUrl,fileName,savePath);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }

+ 10 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

@@ -814,6 +814,16 @@
         WHERE id = #{nodeId}
     </delete>
 
+    <!-- 1.查询项目代码存在的所有项目,并且工程建设环节无新增数据的条数。2.查询当前环节已经新增数据但是未上链并且未同步过的数据(source_id-同步数据id)) -->
+    <select id="getZrzysiteProjectList" resultMap="projectMap">
+        SELECT    p.id,p.name,p.code ,p.project_type,  '1'  as creator_id
+        from "public"."t_project" p  LEFT JOIN  "public"."t_project_workflow"  w on p.id = w.project_id     and w.node_table_name=#{tableName}
+        where    LENGTH(TRIM(p.code))>0   and   w.id is  null
+        union
+        SELECT DISTINCT  p.id,p.name,p.code ,p.project_type ,'2' as  creator_id
+        from "public"."t_project"  p  LEFT JOIN "public".${tableName}  node  on  p.id=node.project_id
+        where  LENGTH(TRIM(p.code))>0   and  node.has_onchain=false  and  node.source_id is null
+    </select>
 
     <select id="getNodeSourceIdByTable"   resultType="string" >
         SELECT source_id FROM ${tableName}

+ 54 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/zrzysite/ZrzysiteAttachmentMapper.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.siwei.apply.mapper.zrzysite.ZrzysiteAttachmentMapper">
+
+    <resultMap id="ZrzysiteAttachmentResult" type="com.siwei.apply.domain.zrzysite.ZrzysiteAttachment">
+        <id column="ID" property="id"/>
+        <result column="ATTACHMENT" property="attachment"/>
+        <result column="FJMC" property="fjmc"/>
+        <result column="SPSXMC" property="spsxmc"/>
+        <result column="APPLYINST_ID" property="applyinstId"/>
+        <result column="CLMC" property="clmc"/>
+    </resultMap>
+
+    <sql id="selectColumns">
+        ID, ATTACHMENT, FJMC, SPSXMC, APPLYINST_ID, CLMC
+    </sql>
+
+    <select id="selectById" parameterType="string" resultMap="ZrzysiteAttachmentResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_FJCL_001012_003
+        WHERE ID = #{id}
+    </select>
+
+
+
+    <select id="selectByApplyinstId" resultMap="ZrzysiteAttachmentResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_FJCL_001012_003
+        WHERE APPLYINST_ID =  #{applyinstId}
+    </select>
+
+
+
+    <select id="selectByApplyinstIdList" resultMap="ZrzysiteAttachmentResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_FJCL_001012_003
+        WHERE APPLYINST_ID IN
+        <foreach collection="applyinstIdList" item="applyinstId" open="(" separator="," close=")">
+            #{applyinstId}
+        </foreach>
+    </select>
+
+
+
+
+
+
+
+</mapper>

+ 41 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/zrzysite/ZrzysiteGhhsMapper.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.siwei.apply.mapper.zrzysite.ZrzysiteGhhsMapper">
+
+    <resultMap id="ZrzysiteGhhsResult" type="com.siwei.apply.domain.zrzysite.ZrzysiteGhhs">
+        <id column="APPLYINST_ID" property="applyinstId"/>
+        <result column="FZJG" property="fzjg"/>
+        <result column="HYYJ" property="hyyj"/>
+        <result column="XMDM" property="xmdm"/>
+        <result column="SPSXMC" property="spsxmc"/>
+        <result column="HGZH" property="hgzh"/>
+        <result column="ATTACHMENT" property="attachment"/>
+        <result column="XMMC" property="xmmc"/>
+        <result column="YDDW" property="yddw"/>
+        <result column="FZRQ" property="fzrq"/>
+    </resultMap>
+
+    <sql id="selectColumns">
+        APPLYINST_ID, FZJG, HYYJ, XMDM, SPSXMC, HGZH, ATTACHMENT, XMMC, YDDW, FZRQ
+    </sql>
+
+    <select id="selectById" parameterType="string" resultMap="ZrzysiteGhhsResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_GHHS_001012_003
+        WHERE APPLYINST_ID = #{applyinstId}
+    </select>
+
+    <select id="selectByXmdmList" resultMap="ZrzysiteGhhsResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_GHHS_001012_003
+        WHERE XMDM IN
+        <foreach collection="xmdmList" item="xmdm" open="(" separator="," close=")">
+            #{xmdm}
+        </foreach>
+    </select>
+
+</mapper>

+ 49 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/zrzysite/ZrzysiteLandMapper.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.siwei.apply.mapper.zrzysite.ZrzysiteLandMapper">
+
+    <resultMap id="ZrzysiteLandResult" type="com.siwei.apply.domain.zrzysite.ZrzysiteLand">
+        <id column="SQBH" property="sqbh"/>
+        <result column="TDHQFS" property="tdhqfs"/>
+        <result column="ATTACHMENT" property="attachment"/>
+        <result column="ZZRL" property="zzrl"/>
+        <result column="FZRQ" property="fzrq"/>
+        <result column="ZSBH" property="zsbh"/>
+        <result column="YDMJ" property="ydmj"/>
+        <result column="TDYT" property="tdyt"/>
+        <result column="XMDM" property="xmdm"/>
+        <result column="XMMC" property="xmmc"/>
+        <result column="GCMC" property="gcmc"/>
+        <result column="YDWZ" property="ydwz"/>
+        <result column="JSGM" property="jsgm"/>
+        <result column="BZ" property="bz"/>
+        <result column="PZYDJG" property="pzydjg"/>
+        <result column="PZYDWH" property="pzydwh"/>
+        <result column="XDDW" property="xddw"/>
+        <result column="FADW" property="fadw"/>
+    </resultMap>
+
+    <sql id="selectColumns">
+        SQBH, TDHQFS, ATTACHMENT, ZZRL, FZRQ, ZSBH, YDMJ, TDYT, XMDM, XMMC, GCMC, YDWZ, JSGM, BZ, PZYDJG, PZYDWH, XDDW, FADW
+    </sql>
+
+    <select id="selectById" parameterType="string" resultMap="ZrzysiteLandResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_LAND_INFO_001012_003
+        WHERE SQBH = #{sqbh}
+    </select>
+
+    <select id="selectByXmdmList" resultMap="ZrzysiteLandResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_LAND_INFO_001012_003
+        WHERE XMDM IN
+        <foreach collection="xmdmList" item="xmdm" open="(" separator="," close=")">
+            #{xmdm}
+        </foreach>
+    </select>
+
+</mapper>

+ 0 - 94
siwei-modules/siwei-job/src/main/resources/mapper/mysql/job/SysJobLogMapper.xml

@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.siwei.job.mapper.SysJobLogMapper">
-
-	<resultMap type="SysJobLog" id="SysJobLogResult">
-		<id     property="jobLogId"       column="job_log_id"      />
-		<result property="jobName"        column="job_name"        />
-		<result property="jobGroup"       column="job_group"       />
-		<result property="invokeTarget"   column="invoke_target"   />
-		<result property="jobMessage"     column="job_message"     />
-		<result property="status"         column="status"          />
-		<result property="exceptionInfo"  column="exception_info"  />
-		<result property="createTime"     column="create_time"     />
-	</resultMap>
-	
-	<sql id="selectJobLogVo">
-        select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time 
-		from sys_job_log
-    </sql>
-	
-	<select id="selectJobLogList" parameterType="SysJobLog" resultMap="SysJobLogResult">
-		<include refid="selectJobLogVo"/>
-		<where>
-			<if test="jobName != null and jobName != ''">
-				AND job_name like concat('%', #{jobName}, '%')
-			</if>
-			<if test="jobGroup != null and jobGroup != ''">
-				AND job_group = #{jobGroup}
-			</if>
-			<if test="status != null and status != ''">
-				AND status = #{status}
-			</if>
-			<if test="invokeTarget != null and invokeTarget != ''">
-				AND invoke_target like concat('%', #{invokeTarget}, '%')
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
-			</if>
-		</where>
-        order by create_time desc
-	</select>
-	
-	<select id="selectJobLogAll" resultMap="SysJobLogResult">
-		<include refid="selectJobLogVo"/>
-	</select>
-	
-	<select id="selectJobLogById" parameterType="Long" resultMap="SysJobLogResult">
-		<include refid="selectJobLogVo"/>
-		where job_log_id = #{jobLogId}
-	</select>
-	
-	<delete id="deleteJobLogById" parameterType="Long">
- 		delete from sys_job_log where job_log_id = #{jobLogId}
- 	</delete>
- 	
- 	<delete id="deleteJobLogByIds" parameterType="Long">
- 		delete from sys_job_log where job_log_id in
- 		<foreach collection="array" item="jobLogId" open="(" separator="," close=")">
- 			#{jobLogId}
-        </foreach> 
- 	</delete>
- 	
- 	<update id="cleanJobLog">
-        truncate table sys_job_log
-    </update>
- 	
- 	<insert id="insertJobLog" parameterType="SysJobLog">
- 		insert into sys_job_log(
- 			<if test="jobLogId != null and jobLogId != 0">job_log_id,</if>
- 			<if test="jobName != null and jobName != ''">job_name,</if>
- 			<if test="jobGroup != null and jobGroup != ''">job_group,</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
- 			<if test="jobMessage != null and jobMessage != ''">job_message,</if>
- 			<if test="status != null and status != ''">status,</if>
- 			<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
- 			create_time
- 		)values(
- 			<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
- 			<if test="jobName != null and jobName != ''">#{jobName},</if>
- 			<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
- 			<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
- 			<if test="status != null and status != ''">#{status},</if>
- 			<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
- 			sysdate()
- 		)
-	</insert>
-
-</mapper> 

+ 0 - 111
siwei-modules/siwei-job/src/main/resources/mapper/mysql/job/SysJobMapper.xml

@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.siwei.job.mapper.SysJobMapper">
-
-	<resultMap type="SysJob" id="SysJobResult">
-		<id     property="jobId"          column="job_id"          />
-		<result property="jobName"        column="job_name"        />
-		<result property="jobGroup"       column="job_group"       />
-		<result property="invokeTarget"   column="invoke_target"   />
-		<result property="cronExpression" column="cron_expression" />
-		<result property="misfirePolicy"  column="misfire_policy"  />
-		<result property="concurrent"     column="concurrent"      />
-		<result property="status"         column="status"          />
-		<result property="createBy"       column="create_by"       />
-		<result property="createTime"     column="create_time"     />
-		<result property="updateBy"       column="update_by"       />
-		<result property="updateTime"     column="update_time"     />
-		<result property="remark"         column="remark"          />
-	</resultMap>
-	
-	<sql id="selectJobVo">
-        select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark 
-		from sys_job
-    </sql>
-	
-	<select id="selectJobList" parameterType="SysJob" resultMap="SysJobResult">
-		<include refid="selectJobVo"/>
-		<where>
-			<if test="jobName != null and jobName != ''">
-				AND job_name like concat('%', #{jobName}, '%')
-			</if>
-			<if test="jobGroup != null and jobGroup != ''">
-				AND job_group = #{jobGroup}
-			</if>
-			<if test="status != null and status != ''">
-				AND status = #{status}
-			</if>
-			<if test="invokeTarget != null and invokeTarget != ''">
-				AND invoke_target like concat('%', #{invokeTarget}, '%')
-			</if>
-		</where>
-	</select>
-	
-	<select id="selectJobAll" resultMap="SysJobResult">
-		<include refid="selectJobVo"/>
-	</select>
-	
-	<select id="selectJobById" parameterType="Long" resultMap="SysJobResult">
-		<include refid="selectJobVo"/>
-		where job_id = #{jobId}
-	</select>
-	
-	<delete id="deleteJobById" parameterType="Long">
- 		delete from sys_job where job_id = #{jobId}
- 	</delete>
- 	
- 	<delete id="deleteJobByIds" parameterType="Long">
- 		delete from sys_job where job_id in
- 		<foreach collection="array" item="jobId" open="(" separator="," close=")">
- 			#{jobId}
-        </foreach> 
- 	</delete>
- 	
- 	<update id="updateJob" parameterType="SysJob">
- 		update sys_job
- 		<set>
- 			<if test="jobName != null and jobName != ''">job_name = #{jobName},</if>
- 			<if test="jobGroup != null and jobGroup != ''">job_group = #{jobGroup},</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">invoke_target = #{invokeTarget},</if>
- 			<if test="cronExpression != null and cronExpression != ''">cron_expression = #{cronExpression},</if>
- 			<if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy = #{misfirePolicy},</if>
- 			<if test="concurrent != null and concurrent != ''">concurrent = #{concurrent},</if>
- 			<if test="status !=null">status = #{status},</if>
- 			<if test="remark != null and remark != ''">remark = #{remark},</if>
- 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
- 		</set>
- 		where job_id = #{jobId}
-	</update>
- 	
- 	<insert id="insertJob" parameterType="SysJob" useGeneratedKeys="true" keyProperty="jobId">
- 		insert into sys_job(
- 			<if test="jobId != null and jobId != 0">job_id,</if>
- 			<if test="jobName != null and jobName != ''">job_name,</if>
- 			<if test="jobGroup != null and jobGroup != ''">job_group,</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
- 			<if test="cronExpression != null and cronExpression != ''">cron_expression,</if>
- 			<if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy,</if>
- 			<if test="concurrent != null and concurrent != ''">concurrent,</if>
- 			<if test="status != null and status != ''">status,</if>
- 			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
- 			<if test="jobId != null and jobId != 0">#{jobId},</if>
- 			<if test="jobName != null and jobName != ''">#{jobName},</if>
- 			<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
- 			<if test="cronExpression != null and cronExpression != ''">#{cronExpression},</if>
- 			<if test="misfirePolicy != null and misfirePolicy != ''">#{misfirePolicy},</if>
- 			<if test="concurrent != null and concurrent != ''">#{concurrent},</if>
- 			<if test="status != null and status != ''">#{status},</if>
- 			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
- 		)
-	</insert>
-
-</mapper>