瀏覽代碼

修改代码

syh 5 年之前
父節點
當前提交
ee7c7820cb
共有 15 個文件被更改,包括 376 次插入197 次删除
  1. 6 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/ResultMapUtils.java
  2. 0 49
      mondule-jbpm/pom.xml
  3. 0 13
      mondule-jbpm/src/main/java/cn/com/ctop/jbpm/JbpmApplication.java
  4. 0 29
      mondule-jbpm/src/main/java/cn/com/ctop/jbpm/service/ActivitiTable.java
  5. 0 1
      mondule-jbpm/src/main/resources/application.properties
  6. 0 76
      mondule-jbpm/src/main/resources/processes/testbpm.bpmn
  7. 0 13
      mondule-jbpm/src/test/java/cn/com/ctop/jbpm/JbpmApplicationTests.java
  8. 0 13
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/PerformanceAppraisalApplication.java
  9. 248 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceConfigController.java
  10. 63 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/PerformanceConfig.java
  11. 15 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/PerformanceConfigMapper.java
  12. 5 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/xml/PerformanceConfigMapper.xml
  13. 15 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceConfigService.java
  14. 19 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceConfigServiceImpl.java
  15. 5 3
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceOptimizerServiceImpl.java

+ 6 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/ResultMapUtils.java

@@ -16,4 +16,10 @@ public class ResultMapUtils {
         map.put(MAP_MESSAGE, StatusCode.getDesc(statusCode));
         map.put(MAP_SUCCESS, StatusCode.getFlag(statusCode));
     }
+
+    public static void setResultMap(Map<String, Object> map, StatusCode statusCode) {
+        map.put(MAP_CODE, statusCode.getCode());
+        map.put(MAP_MESSAGE, statusCode.getDesc());
+        map.put(MAP_SUCCESS, statusCode.getFlag());
+    }
 }

+ 0 - 49
mondule-jbpm/pom.xml

@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <artifactId>jeecg-boot-parent</artifactId>
-        <groupId>org.jeecgframework.boot</groupId>
-        <version>2.0.2</version>
-    </parent>
-    <groupId>cn.com.ctop</groupId>
-    <artifactId>mondule-jbpm</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <name>mondule-jbpm</name>
-
-    <properties>
-        <java.version>1.8</java.version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>cn.com.ctop</groupId>
-            <artifactId>module-common</artifactId>
-            <version>2.0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.activiti</groupId>
-            <artifactId>activiti-spring</artifactId>
-            <version>6.0.0</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <resources>
-            <!-- 解决MyBatis配置文件引入问题 -->
-            <resource>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                </includes>
-                <!-- 是否替换资源中的属性-->
-                <filtering>false</filtering>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-            </resource>
-        </resources>
-    </build>
-
-</project>

+ 0 - 13
mondule-jbpm/src/main/java/cn/com/ctop/jbpm/JbpmApplication.java

@@ -1,13 +0,0 @@
-package cn.com.ctop.jbpm;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class JbpmApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(JbpmApplication.class, args);
-    }
-
-}

+ 0 - 29
mondule-jbpm/src/main/java/cn/com/ctop/jbpm/service/ActivitiTable.java

@@ -1,29 +0,0 @@
-package cn.com.ctop.jbpm.service;
-
-import org.activiti.engine.ProcessEngine;
-import org.activiti.engine.ProcessEngineConfiguration;
-
-/**
- * @author jeecg-boot
- * 2019年12月5日19:55:14
- */
-public class ActivitiTable {
-    public static void main(String[] args) {
-        // 引擎配置
-        ProcessEngineConfiguration pec = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
-        pec.setJdbcDriver("com.mysql.jdbc.Driver");
-        pec.setJdbcUrl("jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false");
-        pec.setJdbcUsername("hcst");
-        pec.setJdbcPassword("hcst2019");
-        /**
-         * false 不能自动创建表
-         * create-drop 先删除表再创建表
-         * true 自动创建和更新表
-         */
-        pec.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
-
-        // 获取流程引擎对象
-        ProcessEngine processEngine = pec.buildProcessEngine();
-
-    }
-}

+ 0 - 1
mondule-jbpm/src/main/resources/application.properties

@@ -1 +0,0 @@
-

文件差異過大導致無法顯示
+ 0 - 76
mondule-jbpm/src/main/resources/processes/testbpm.bpmn


+ 0 - 13
mondule-jbpm/src/test/java/cn/com/ctop/jbpm/JbpmApplicationTests.java

@@ -1,13 +0,0 @@
-package cn.com.ctop.jbpm;
-
-import org.junit.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-class JbpmApplicationTests {
-
-    @Test
-    void contextLoads() {
-    }
-
-}

+ 0 - 13
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/PerformanceAppraisalApplication.java

@@ -1,13 +0,0 @@
-package cn.com.ctop.performanceappraisal;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class PerformanceAppraisalApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(PerformanceAppraisalApplication.class, args);
-    }
-
-}

+ 248 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceConfigController.java

@@ -0,0 +1,248 @@
+package cn.com.ctop.performanceappraisal.controller;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import cn.com.ctop.performanceappraisal.service.IPerformanceConfigService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+@Slf4j
+@Api(tags = "绩效配置文件表")
+@RestController
+@RequestMapping("/ctop/performanceConfig")
+public class PerformanceConfigController {
+    @Autowired
+    private IPerformanceConfigService performanceConfigService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param performanceConfig
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-分页列表查询")
+    @ApiOperation(value = "绩效配置文件表-分页列表查询", notes = "绩效配置文件表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<PerformanceConfig>> queryPageList(PerformanceConfig performanceConfig,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        Result<IPage<PerformanceConfig>> result = new Result<IPage<PerformanceConfig>>();
+        QueryWrapper<PerformanceConfig> queryWrapper = QueryGenerator.initQueryWrapper(performanceConfig, req.getParameterMap());
+        Page<PerformanceConfig> page = new Page<PerformanceConfig>(pageNo, pageSize);
+        IPage<PerformanceConfig> pageList = performanceConfigService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param performanceConfig
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-添加")
+    @ApiOperation(value = "绩效配置文件表-添加", notes = "绩效配置文件表-添加")
+    @PostMapping(value = "/add")
+    public Result<PerformanceConfig> add(@RequestBody PerformanceConfig performanceConfig) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        try {
+            performanceConfigService.save(performanceConfig);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param performanceConfig
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-编辑")
+    @ApiOperation(value = "绩效配置文件表-编辑", notes = "绩效配置文件表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<PerformanceConfig> edit(@RequestBody PerformanceConfig performanceConfig) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        PerformanceConfig performanceConfigEntity = performanceConfigService.getById(performanceConfig.getId());
+        if (performanceConfigEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = performanceConfigService.updateById(performanceConfig);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-通过id删除")
+    @ApiOperation(value = "绩效配置文件表-通过id删除", notes = "绩效配置文件表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            performanceConfigService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-批量删除")
+    @ApiOperation(value = "绩效配置文件表-批量删除", notes = "绩效配置文件表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<PerformanceConfig> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.performanceConfigService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-通过id查询")
+    @ApiOperation(value = "绩效配置文件表-通过id查询", notes = "绩效配置文件表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<PerformanceConfig> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        PerformanceConfig performanceConfig = performanceConfigService.getById(id);
+        if (performanceConfig == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(performanceConfig);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<PerformanceConfig> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                PerformanceConfig performanceConfig = JSON.parseObject(deString, PerformanceConfig.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(performanceConfig, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<PerformanceConfig> pageList = performanceConfigService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "绩效配置文件表列表");
+        mv.addObject(NormalExcelConstants.CLASS, PerformanceConfig.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("绩效配置文件表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<PerformanceConfig> listPerformanceConfigs = ExcelImportUtil.importExcel(file.getInputStream(), PerformanceConfig.class, params);
+                performanceConfigService.saveBatch(listPerformanceConfigs);
+                return Result.ok("文件导入成功!数据行数:" + listPerformanceConfigs.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 63 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/PerformanceConfig.java

@@ -0,0 +1,63 @@
+package cn.com.ctop.performanceappraisal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+@Data
+@TableName("ctop_performance_config")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_performance_config对象", description = "绩效配置文件表")
+public class PerformanceConfig {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * year
+     */
+    @Excel(name = "year", width = 15)
+    @ApiModelProperty(value = "year")
+    private Integer year;
+    /**
+     * quarter
+     */
+    @Excel(name = "quarter", width = 15)
+    @ApiModelProperty(value = "quarter")
+    private Integer quarter;
+    /**
+     * mediaTaskRaise
+     */
+    @Excel(name = "mediaTaskRaise", width = 15)
+    @ApiModelProperty(value = "mediaTaskRaise")
+    private Integer mediaTaskRaise;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 15 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/PerformanceConfigMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.performanceappraisal.mapper;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-01-08
+ * @cersion: V1.0
+ */
+public interface PerformanceConfigMapper extends BaseMapper<PerformanceConfig> {
+
+}

+ 5 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/xml/PerformanceConfigMapper.xml

@@ -0,0 +1,5 @@
+<?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="cn.com.ctop.performanceappraisal.mapper.PerformanceConfigMapper">
+
+</mapper>

+ 15 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceConfigService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.performanceappraisal.service;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+public interface IPerformanceConfigService extends IService<PerformanceConfig> {
+
+}

+ 19 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceConfigServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.performanceappraisal.service.impl;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import cn.com.ctop.performanceappraisal.mapper.PerformanceConfigMapper;
+import cn.com.ctop.performanceappraisal.service.IPerformanceConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+@Service
+public class PerformanceConfigServiceImpl extends ServiceImpl<PerformanceConfigMapper, PerformanceConfig> implements IPerformanceConfigService {
+
+}

+ 5 - 3
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceOptimizerServiceImpl.java

@@ -43,12 +43,14 @@ public class PerformanceOptimizerServiceImpl extends ServiceImpl<PerformanceOpti
         Integer startIndex = (pageNo - 1) * pageSize;
         //查询当前登录人信息
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        LoginUser sysUser = new LoginUser();
-//        sysUser.setId("fcb3fbf6192640adaadb2a7df9c02dae");
+        String orgCode = sysUser.getOrgCode();
+        if () {
+
+        }
         //查询当前媒体配置信息
         OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(mediaType);
         if (null == config) {
-            ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_OPTINIZER_CONFIG_IS_NULL.getCode());
+            ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_OPTINIZER_CONFIG_IS_NULL);
             return result;
         }
         //:查询当前用户截止到目前当前季度的消耗统计数据