Ver código fonte

新增标准成本计算流程任务模块

wangqiong 1 ano atrás
pai
commit
7f8f31100a
31 arquivos alterados com 1582 adições e 76 exclusões
  1. 6
    4
      qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java
  2. 1
    0
      qomo-kn-cost-manage/pom.xml
  3. 179
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java
  4. 75
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java
  5. 15
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.java
  6. 14
    3
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java
  7. 5
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.xml
  8. 51
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java
  9. 71
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java
  10. 52
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java
  11. 44
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java
  12. 51
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java
  13. 76
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java
  14. 52
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java
  15. 44
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java
  16. 51
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java
  17. 76
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java
  18. 52
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java
  19. 44
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java
  20. 51
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java
  21. 74
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java
  22. 52
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java
  23. 44
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java
  24. 91
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/StandardCostService.java
  25. 51
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java
  26. 72
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java
  27. 52
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java
  28. 44
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java
  29. 14
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java
  30. 20
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java
  31. 58
    69
      qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java

+ 6
- 4
qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java Ver arquivo

2
 
2
 
3
 import lombok.extern.slf4j.Slf4j;
3
 import lombok.extern.slf4j.Slf4j;
4
 import org.jeecg.common.util.oConvertUtils;
4
 import org.jeecg.common.util.oConvertUtils;
5
+import org.mybatis.spring.annotation.MapperScan;
5
 import org.springframework.boot.SpringApplication;
6
 import org.springframework.boot.SpringApplication;
6
 import org.springframework.boot.autoconfigure.SpringBootApplication;
7
 import org.springframework.boot.autoconfigure.SpringBootApplication;
7
 import org.springframework.boot.builder.SpringApplicationBuilder;
8
 import org.springframework.boot.builder.SpringApplicationBuilder;
14
 import java.net.UnknownHostException;
15
 import java.net.UnknownHostException;
15
 
16
 
16
 /**
17
 /**
17
-* 单体启动类
18
-* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
19
-*/
18
+ * 单体启动类
19
+ * 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
20
+ */
20
 @Slf4j
21
 @Slf4j
21
-@SpringBootApplication (scanBasePackages ={"org.jeecg", "com.zzsmart.qomo"})
22
+@SpringBootApplication(scanBasePackages = {"org.jeecg", "com.zzsmart.qomo"})
23
+//@MapperScan({"com.zzsmart.qomo.kn.cost.manage.mapper"})
22
 //@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
24
 //@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
23
 @EnableAsync
25
 @EnableAsync
24
 public class QomoCostManageApplication extends SpringBootServletInitializer {
26
 public class QomoCostManageApplication extends SpringBootServletInitializer {

+ 1
- 0
qomo-kn-cost-manage/pom.xml Ver arquivo

56
             <artifactId>easyexcel</artifactId>
56
             <artifactId>easyexcel</artifactId>
57
             <version>4.0.1</version> <!-- 请检查并使用最新稳定版本 -->
57
             <version>4.0.1</version> <!-- 请检查并使用最新稳定版本 -->
58
         </dependency>
58
         </dependency>
59
+
59
     </dependencies>
60
     </dependencies>
60
 </project>
61
 </project>

+ 179
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java Ver arquivo

1
+package com.zzsmart.qomo.kn.cost.manage.controller;
2
+
3
+import java.util.Arrays;
4
+import java.util.List;
5
+import java.util.Map;
6
+import java.util.stream.Collectors;
7
+import java.io.IOException;
8
+import java.io.UnsupportedEncodingException;
9
+import java.net.URLDecoder;
10
+import javax.servlet.http.HttpServletRequest;
11
+import javax.servlet.http.HttpServletResponse;
12
+
13
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
14
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
15
+import org.jeecg.common.api.vo.Result;
16
+import org.jeecg.common.system.query.QueryGenerator;
17
+import org.jeecg.common.util.oConvertUtils;
18
+
19
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
20
+import com.baomidou.mybatisplus.core.metadata.IPage;
21
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
22
+import lombok.extern.slf4j.Slf4j;
23
+
24
+import org.jeecgframework.poi.excel.ExcelImportUtil;
25
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
26
+import org.jeecgframework.poi.excel.entity.ExportParams;
27
+import org.jeecgframework.poi.excel.entity.ImportParams;
28
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
29
+import org.jeecg.common.system.base.controller.JeecgController;
30
+import org.springframework.beans.factory.annotation.Autowired;
31
+import org.springframework.web.bind.annotation.*;
32
+import org.springframework.web.multipart.MultipartFile;
33
+import org.springframework.web.multipart.MultipartHttpServletRequest;
34
+import org.springframework.web.servlet.ModelAndView;
35
+import com.alibaba.fastjson.JSON;
36
+import io.swagger.annotations.Api;
37
+import io.swagger.annotations.ApiOperation;
38
+import org.jeecg.common.aspect.annotation.AutoLog;
39
+import org.apache.shiro.authz.annotation.RequiresPermissions;
40
+
41
+ /**
42
+ * @Description: app_scene_cost_result_value
43
+ * @Author: jeecg-boot
44
+ * @Date:   2024-07-23
45
+ * @Version: V1.0
46
+ */
47
+@Api(tags="app_scene_cost_result_value")
48
+@RestController
49
+@RequestMapping("/com.zzsmart.qomo.kn.cost.manage/appSceneCostResultValue")
50
+@Slf4j
51
+public class AppSceneCostResultValueController extends JeecgController<AppSceneCostResultValue, IAppSceneCostResultValueService> {
52
+	@Autowired
53
+	private IAppSceneCostResultValueService appSceneCostResultValueService;
54
+	
55
+	/**
56
+	 * 分页列表查询
57
+	 *
58
+	 * @param appSceneCostResultValue
59
+	 * @param pageNo
60
+	 * @param pageSize
61
+	 * @param req
62
+	 * @return
63
+	 */
64
+	//@AutoLog(value = "app_scene_cost_result_value-分页列表查询")
65
+	@ApiOperation(value="app_scene_cost_result_value-分页列表查询", notes="app_scene_cost_result_value-分页列表查询")
66
+	@GetMapping(value = "/list")
67
+	public Result<IPage<AppSceneCostResultValue>> queryPageList(AppSceneCostResultValue appSceneCostResultValue,
68
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
69
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
70
+								   HttpServletRequest req) {
71
+		QueryWrapper<AppSceneCostResultValue> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostResultValue, req.getParameterMap());
72
+		Page<AppSceneCostResultValue> page = new Page<AppSceneCostResultValue>(pageNo, pageSize);
73
+		IPage<AppSceneCostResultValue> pageList = appSceneCostResultValueService.page(page, queryWrapper);
74
+		return Result.OK(pageList);
75
+	}
76
+	
77
+	/**
78
+	 *   添加
79
+	 *
80
+	 * @param appSceneCostResultValue
81
+	 * @return
82
+	 */
83
+	@AutoLog(value = "app_scene_cost_result_value-添加")
84
+	@ApiOperation(value="app_scene_cost_result_value-添加", notes="app_scene_cost_result_value-添加")
85
+	@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:add")
86
+	@PostMapping(value = "/add")
87
+	public Result<String> add(@RequestBody AppSceneCostResultValue appSceneCostResultValue) {
88
+		appSceneCostResultValueService.save(appSceneCostResultValue);
89
+		return Result.OK("添加成功!");
90
+	}
91
+	
92
+	/**
93
+	 *  编辑
94
+	 *
95
+	 * @param appSceneCostResultValue
96
+	 * @return
97
+	 */
98
+	@AutoLog(value = "app_scene_cost_result_value-编辑")
99
+	@ApiOperation(value="app_scene_cost_result_value-编辑", notes="app_scene_cost_result_value-编辑")
100
+	@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:edit")
101
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
102
+	public Result<String> edit(@RequestBody AppSceneCostResultValue appSceneCostResultValue) {
103
+		appSceneCostResultValueService.updateById(appSceneCostResultValue);
104
+		return Result.OK("编辑成功!");
105
+	}
106
+	
107
+	/**
108
+	 *   通过id删除
109
+	 *
110
+	 * @param id
111
+	 * @return
112
+	 */
113
+	@AutoLog(value = "app_scene_cost_result_value-通过id删除")
114
+	@ApiOperation(value="app_scene_cost_result_value-通过id删除", notes="app_scene_cost_result_value-通过id删除")
115
+	@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:delete")
116
+	@DeleteMapping(value = "/delete")
117
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
118
+		appSceneCostResultValueService.removeById(id);
119
+		return Result.OK("删除成功!");
120
+	}
121
+	
122
+	/**
123
+	 *  批量删除
124
+	 *
125
+	 * @param ids
126
+	 * @return
127
+	 */
128
+	@AutoLog(value = "app_scene_cost_result_value-批量删除")
129
+	@ApiOperation(value="app_scene_cost_result_value-批量删除", notes="app_scene_cost_result_value-批量删除")
130
+	@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:deleteBatch")
131
+	@DeleteMapping(value = "/deleteBatch")
132
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
133
+		this.appSceneCostResultValueService.removeByIds(Arrays.asList(ids.split(",")));
134
+		return Result.OK("批量删除成功!");
135
+	}
136
+	
137
+	/**
138
+	 * 通过id查询
139
+	 *
140
+	 * @param id
141
+	 * @return
142
+	 */
143
+	//@AutoLog(value = "app_scene_cost_result_value-通过id查询")
144
+	@ApiOperation(value="app_scene_cost_result_value-通过id查询", notes="app_scene_cost_result_value-通过id查询")
145
+	@GetMapping(value = "/queryById")
146
+	public Result<AppSceneCostResultValue> queryById(@RequestParam(name="id",required=true) String id) {
147
+		AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValueService.getById(id);
148
+		if(appSceneCostResultValue==null) {
149
+			return Result.error("未找到对应数据");
150
+		}
151
+		return Result.OK(appSceneCostResultValue);
152
+	}
153
+
154
+    /**
155
+    * 导出excel
156
+    *
157
+    * @param request
158
+    * @param appSceneCostResultValue
159
+    */
160
+    @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:exportXls")
161
+    @RequestMapping(value = "/exportXls")
162
+    public ModelAndView exportXls(HttpServletRequest request, AppSceneCostResultValue appSceneCostResultValue) {
163
+        return super.exportXls(request, appSceneCostResultValue, AppSceneCostResultValue.class, "app_scene_cost_result_value");
164
+    }
165
+
166
+    /**
167
+      * 通过excel导入数据
168
+    *
169
+    * @param request
170
+    * @param response
171
+    * @return
172
+    */
173
+    @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:importExcel")
174
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
175
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
176
+        return super.importExcel(request, response, AppSceneCostResultValue.class);
177
+    }
178
+
179
+}

+ 75
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java Ver arquivo

1
+package com.zzsmart.qomo.kn.cost.manage.entity;
2
+
3
+import java.io.Serializable;
4
+import java.io.UnsupportedEncodingException;
5
+import java.util.Date;
6
+import java.math.BigDecimal;
7
+import com.baomidou.mybatisplus.annotation.IdType;
8
+import com.baomidou.mybatisplus.annotation.TableId;
9
+import com.baomidou.mybatisplus.annotation.TableName;
10
+import com.baomidou.mybatisplus.annotation.TableLogic;
11
+import lombok.Data;
12
+import com.fasterxml.jackson.annotation.JsonFormat;
13
+import org.springframework.format.annotation.DateTimeFormat;
14
+import org.jeecgframework.poi.excel.annotation.Excel;
15
+import org.jeecg.common.aspect.annotation.Dict;
16
+import io.swagger.annotations.ApiModel;
17
+import io.swagger.annotations.ApiModelProperty;
18
+import lombok.EqualsAndHashCode;
19
+import lombok.experimental.Accessors;
20
+
21
+/**
22
+ * @Description: app_scene_cost_result_value
23
+ * @Author: jeecg-boot
24
+ * @Date:   2024-07-23
25
+ * @Version: V1.0
26
+ */
27
+@Data
28
+@TableName("app_scene_cost_result_value")
29
+@Accessors(chain = true)
30
+@EqualsAndHashCode(callSuper = false)
31
+@ApiModel(value="app_scene_cost_result_value对象", description="app_scene_cost_result_value")
32
+public class AppSceneCostResultValue implements Serializable {
33
+    private static final long serialVersionUID = 1L;
34
+
35
+	/**主键*/
36
+	@TableId(type = IdType.ASSIGN_ID)
37
+    @ApiModelProperty(value = "主键")
38
+    private Integer id;
39
+	/**所属最上级物料号*/
40
+	@Excel(name = "所属最上级物料号", width = 15)
41
+    @ApiModelProperty(value = "所属最上级物料号")
42
+    private String belongTopMaterialNo;
43
+	/**物料编号*/
44
+	@Excel(name = "物料编号", width = 15)
45
+    @ApiModelProperty(value = "物料编号")
46
+    private String marterialNo;
47
+	/**父类物料编号*/
48
+	@Excel(name = "父类物料编号", width = 15)
49
+    @ApiModelProperty(value = "父类物料编号")
50
+    private String parentMarterialNo;
51
+	/**任务类型*/
52
+	@Excel(name = "任务类型", width = 15)
53
+    @ApiModelProperty(value = "任务类型")
54
+    private String taskType;
55
+	/**任务代码*/
56
+	@Excel(name = "任务代码", width = 15)
57
+    @ApiModelProperty(value = "任务代码")
58
+    private String taskCode;
59
+	/**流程id*/
60
+	@Excel(name = "流程id", width = 15)
61
+    @ApiModelProperty(value = "流程id")
62
+    private String flowInstanceId;
63
+	/**计算结果值(多个值通过字段拼接)*/
64
+	@Excel(name = "计算结果值(多个值通过字段拼接)", width = 15)
65
+    @ApiModelProperty(value = "计算结果值(多个值通过字段拼接)")
66
+    private String countValue;
67
+	/**创建时间*/
68
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
69
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
70
+    @ApiModelProperty(value = "创建时间")
71
+    private Date createTime;
72
+	/**创建人*/
73
+    @ApiModelProperty(value = "创建人")
74
+    private Integer createBy;
75
+}

+ 15
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.java Ver arquivo

1
+package com.zzsmart.qomo.kn.cost.manage.mapper;
2
+
3
+
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
6
+
7
+/**
8
+ * @Description: app_scene_cost_result_value
9
+ * @Author: jeecg-boot
10
+ * @Date:   2024-07-23
11
+ * @Version: V1.0
12
+ */
13
+public interface AppSceneCostResultValueMapper extends BaseMapper<AppSceneCostResultValue> {
14
+
15
+}

+ 14
- 3
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java Ver arquivo

1
 package com.zzsmart.qomo.kn.cost.manage.mapper;
1
 package com.zzsmart.qomo.kn.cost.manage.mapper;
2
 
2
 
3
-import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.Select;
8
+
9
+import java.util.List;
6
 
10
 
7
 /**
11
 /**
8
  * <p>
12
  * <p>
9
  * 物料bom Mapper 接口
13
  * 物料bom Mapper 接口
10
  * </p>
14
  * </p>
11
  *
15
  *
12
- * @author  
16
+ * @author
13
  * @since 2024-06-21
17
  * @since 2024-06-21
14
  */
18
  */
15
 @Mapper
19
 @Mapper
16
 public interface CostMaterialBomMapper extends BaseMapper<CostMaterialBom> {
20
 public interface CostMaterialBomMapper extends BaseMapper<CostMaterialBom> {
17
-
21
+    /**
22
+     * 根据动态SQL语句查询物料BOM表
23
+     *
24
+     * @param selectCommand
25
+     * @return
26
+     */
27
+    @Select("${selectCommand}")
28
+    List<CostMaterialBom> customSelect(@Param("selectCommand") String selectCommand);
18
 }
29
 }

+ 5
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.xml Ver arquivo

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostResultValueMapper">
4
+
5
+</mapper>

+ 51
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost;
19
+
20
+
21
+import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo;
22
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
23
+
24
+import java.util.ArrayList;
25
+import java.util.List;
26
+
27
+/**
28
+ *
29
+ */
30
+public class LaborCostParameters extends AbstractParameters {
31
+    @Override
32
+    public boolean checkParameters() {
33
+        return true;
34
+    }
35
+
36
+    @Override
37
+    public List<ResourceInfo> getResourceFilesList() {
38
+        return new ArrayList<>();
39
+    }
40
+
41
+    @Override
42
+    public void dealOutParam(String result) {
43
+
44
+    }
45
+
46
+    @Override
47
+    public String toString() {
48
+        return "人工成本任务";
49
+    }
50
+
51
+}

+ 71
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost;
19
+
20
+import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
21
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
22
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
23
+import com.zzsmart.qomo.plugin.task.api.TaskCallBack;
24
+import com.zzsmart.qomo.plugin.task.api.TaskException;
25
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
26
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
27
+import org.springframework.beans.factory.annotation.Autowired;
28
+
29
+/**
30
+ * 人工成本计算任务
31
+ */
32
+public class LaborCostTask extends AbstractTask {
33
+    /**
34
+     * taskExecutionContext
35
+     */
36
+    private TaskExecutionContext taskExecutionContext;
37
+
38
+    /**
39
+     * sql parameters
40
+     */
41
+    private LaborCostParameters emptyParameters;
42
+
43
+
44
+    /**
45
+     * Abstract Yarn Task
46
+     *
47
+     * @param taskRequest taskRequest
48
+     */
49
+    public LaborCostTask(TaskExecutionContext taskRequest) {
50
+        super(taskRequest);
51
+        this.taskExecutionContext = taskRequest;
52
+        this.emptyParameters = new LaborCostParameters();
53
+    }
54
+
55
+    @Override
56
+    public AbstractParameters getParameters() {
57
+        return emptyParameters;
58
+    }
59
+
60
+    @Override
61
+    public void handle(TaskCallBack taskCallBack) throws TaskException {
62
+        log.info("Full EmptyTask parameters: {}", emptyParameters);
63
+
64
+        //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS);
65
+    }
66
+
67
+    @Override
68
+    public void cancel() throws TaskException {
69
+
70
+    }
71
+}

+ 52
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost;
19
+
20
+
21
+import com.zzsmart.qomo.common.utils.JSONUtils;
22
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
23
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
24
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
25
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
26
+import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode;
27
+import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper;
28
+
29
+
30
+public class LaborCostTaskChannel implements TaskChannel {
31
+
32
+    @Override
33
+    public void cancelApplication(boolean status) {
34
+
35
+    }
36
+
37
+    @Override
38
+    public AbstractTask createTask(TaskExecutionContext taskRequest) {
39
+        return new LaborCostTask(taskRequest);
40
+    }
41
+
42
+    @Override
43
+    public AbstractParameters parseParameters(ParametersNode parametersNode) {
44
+        return JSONUtils.parseObject(parametersNode.getTaskParams(), LaborCostParameters.class);
45
+    }
46
+
47
+    @Override
48
+    public ResourceParametersHelper getResources(String parameters) {
49
+        return JSONUtils.parseObject(parameters, LaborCostParameters.class).getResources();
50
+    }
51
+
52
+}

+ 44
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost;
19
+
20
+import com.google.auto.service.AutoService;
21
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
22
+import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory;
23
+import com.zzsmart.qomo.spi.params.base.PluginParams;
24
+
25
+import java.util.List;
26
+
27
+@AutoService(TaskChannelFactory.class)
28
+public class LaborCostTaskChannelFactory implements TaskChannelFactory {
29
+
30
+    @Override
31
+    public String getName() {
32
+        return "LaborCost";
33
+    }
34
+
35
+    @Override
36
+    public List<PluginParams> getParams() {
37
+        return null;
38
+    }
39
+
40
+    @Override
41
+    public TaskChannel create() {
42
+        return new LaborCostTaskChannel();
43
+    }
44
+}

+ 51
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost;
19
+
20
+
21
+import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo;
22
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
23
+
24
+import java.util.ArrayList;
25
+import java.util.List;
26
+
27
+/**
28
+ *
29
+ */
30
+public class ManufacturingCostParameters extends AbstractParameters {
31
+    @Override
32
+    public boolean checkParameters() {
33
+        return true;
34
+    }
35
+
36
+    @Override
37
+    public List<ResourceInfo> getResourceFilesList() {
38
+        return new ArrayList<>();
39
+    }
40
+
41
+    @Override
42
+    public void dealOutParam(String result) {
43
+
44
+    }
45
+
46
+    @Override
47
+    public String toString() {
48
+        return "制造费用成本任务";
49
+    }
50
+
51
+}

+ 76
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost;
19
+
20
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
21
+import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
22
+import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
23
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
24
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
25
+import com.zzsmart.qomo.plugin.task.api.TaskCallBack;
26
+import com.zzsmart.qomo.plugin.task.api.TaskException;
27
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
28
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
29
+import org.springframework.beans.factory.annotation.Autowired;
30
+
31
+import java.util.Date;
32
+import java.util.List;
33
+
34
+/**
35
+ * 制造费用成本任务
36
+ */
37
+public class ManufacturingCostTask extends AbstractTask {
38
+    /**
39
+     * taskExecutionContext
40
+     */
41
+    private TaskExecutionContext taskExecutionContext;
42
+
43
+    /**
44
+     * sql parameters
45
+     */
46
+    private ManufacturingCostParameters emptyParameters;
47
+
48
+
49
+    /**
50
+     * Abstract Yarn Task
51
+     *
52
+     * @param taskRequest taskRequest
53
+     */
54
+    public ManufacturingCostTask(TaskExecutionContext taskRequest) {
55
+        super(taskRequest);
56
+        this.taskExecutionContext = taskRequest;
57
+        this.emptyParameters = new ManufacturingCostParameters();
58
+    }
59
+
60
+    @Override
61
+    public AbstractParameters getParameters() {
62
+        return emptyParameters;
63
+    }
64
+
65
+    @Override
66
+    public void handle(TaskCallBack taskCallBack) throws TaskException {
67
+        log.info("Full EmptyTask parameters: {}", emptyParameters);
68
+
69
+        //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS);
70
+    }
71
+
72
+    @Override
73
+    public void cancel() throws TaskException {
74
+
75
+    }
76
+}

+ 52
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost;
19
+
20
+
21
+import com.zzsmart.qomo.common.utils.JSONUtils;
22
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
23
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
24
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
25
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
26
+import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode;
27
+import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper;
28
+
29
+
30
+public class ManufacturingCostTaskChannel implements TaskChannel {
31
+
32
+    @Override
33
+    public void cancelApplication(boolean status) {
34
+
35
+    }
36
+
37
+    @Override
38
+    public AbstractTask createTask(TaskExecutionContext taskRequest) {
39
+        return new ManufacturingCostTask(taskRequest);
40
+    }
41
+
42
+    @Override
43
+    public AbstractParameters parseParameters(ParametersNode parametersNode) {
44
+        return JSONUtils.parseObject(parametersNode.getTaskParams(), ManufacturingCostParameters.class);
45
+    }
46
+
47
+    @Override
48
+    public ResourceParametersHelper getResources(String parameters) {
49
+        return JSONUtils.parseObject(parameters, ManufacturingCostParameters.class).getResources();
50
+    }
51
+
52
+}

+ 44
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost;
19
+
20
+import com.google.auto.service.AutoService;
21
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
22
+import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory;
23
+import com.zzsmart.qomo.spi.params.base.PluginParams;
24
+
25
+import java.util.List;
26
+
27
+@AutoService(TaskChannelFactory.class)
28
+public class ManufacturingCostTaskChannelFactory implements TaskChannelFactory {
29
+
30
+    @Override
31
+    public String getName() {
32
+        return "ManufacturingCost";
33
+    }
34
+
35
+    @Override
36
+    public List<PluginParams> getParams() {
37
+        return null;
38
+    }
39
+
40
+    @Override
41
+    public TaskChannel create() {
42
+        return new ManufacturingCostTaskChannel();
43
+    }
44
+}

+ 51
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost;
19
+
20
+
21
+import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo;
22
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
23
+
24
+import java.util.ArrayList;
25
+import java.util.List;
26
+
27
+/**
28
+ *
29
+ */
30
+public class MaterialCostParameters extends AbstractParameters {
31
+    @Override
32
+    public boolean checkParameters() {
33
+        return true;
34
+    }
35
+
36
+    @Override
37
+    public List<ResourceInfo> getResourceFilesList() {
38
+        return new ArrayList<>();
39
+    }
40
+
41
+    @Override
42
+    public void dealOutParam(String result) {
43
+
44
+    }
45
+
46
+    @Override
47
+    public String toString() {
48
+        return "物料成本任务";
49
+    }
50
+
51
+}

+ 76
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost;
19
+
20
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
21
+import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
22
+import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
23
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
24
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
25
+import com.zzsmart.qomo.plugin.task.api.TaskCallBack;
26
+import com.zzsmart.qomo.plugin.task.api.TaskException;
27
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
28
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
29
+import org.springframework.beans.factory.annotation.Autowired;
30
+
31
+import java.util.Date;
32
+import java.util.List;
33
+
34
+/**
35
+ * 物料成本计算任务
36
+ */
37
+public class MaterialCostTask extends AbstractTask {
38
+    /**
39
+     * taskExecutionContext
40
+     */
41
+    private TaskExecutionContext taskExecutionContext;
42
+
43
+    /**
44
+     * sql parameters
45
+     */
46
+    private MaterialCostParameters emptyParameters;
47
+
48
+
49
+    /**
50
+     * Abstract Yarn Task
51
+     *
52
+     * @param taskRequest taskRequest
53
+     */
54
+    public MaterialCostTask(TaskExecutionContext taskRequest) {
55
+        super(taskRequest);
56
+        this.taskExecutionContext = taskRequest;
57
+        this.emptyParameters = new MaterialCostParameters();
58
+    }
59
+
60
+    @Override
61
+    public AbstractParameters getParameters() {
62
+        return emptyParameters;
63
+    }
64
+
65
+    @Override
66
+    public void handle(TaskCallBack taskCallBack) throws TaskException {
67
+        log.info("Full EmptyTask parameters: {}", emptyParameters);
68
+
69
+        //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS);
70
+    }
71
+
72
+    @Override
73
+    public void cancel() throws TaskException {
74
+
75
+    }
76
+}

+ 52
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost;
19
+
20
+
21
+import com.zzsmart.qomo.common.utils.JSONUtils;
22
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
23
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
24
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
25
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
26
+import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode;
27
+import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper;
28
+
29
+
30
+public class MaterialCostTaskChannel implements TaskChannel {
31
+
32
+    @Override
33
+    public void cancelApplication(boolean status) {
34
+
35
+    }
36
+
37
+    @Override
38
+    public AbstractTask createTask(TaskExecutionContext taskRequest) {
39
+        return new MaterialCostTask(taskRequest);
40
+    }
41
+
42
+    @Override
43
+    public AbstractParameters parseParameters(ParametersNode parametersNode) {
44
+        return JSONUtils.parseObject(parametersNode.getTaskParams(), MaterialCostParameters.class);
45
+    }
46
+
47
+    @Override
48
+    public ResourceParametersHelper getResources(String parameters) {
49
+        return JSONUtils.parseObject(parameters, MaterialCostParameters.class).getResources();
50
+    }
51
+
52
+}

+ 44
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost;
19
+
20
+import com.google.auto.service.AutoService;
21
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
22
+import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory;
23
+import com.zzsmart.qomo.spi.params.base.PluginParams;
24
+
25
+import java.util.List;
26
+
27
+@AutoService(TaskChannelFactory.class)
28
+public class MaterialCostTaskChannelFactory implements TaskChannelFactory {
29
+
30
+    @Override
31
+    public String getName() {
32
+        return "MaterialCost";
33
+    }
34
+
35
+    @Override
36
+    public List<PluginParams> getParams() {
37
+        return null;
38
+    }
39
+
40
+    @Override
41
+    public TaskChannel create() {
42
+        return new MaterialCostTaskChannel();
43
+    }
44
+}

+ 51
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput;
19
+
20
+
21
+import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo;
22
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
23
+
24
+import java.util.ArrayList;
25
+import java.util.List;
26
+
27
+/**
28
+ *
29
+ */
30
+public class MaterialInputParameters extends AbstractParameters {
31
+    @Override
32
+    public boolean checkParameters() {
33
+        return true;
34
+    }
35
+
36
+    @Override
37
+    public List<ResourceInfo> getResourceFilesList() {
38
+        return new ArrayList<>();
39
+    }
40
+
41
+    @Override
42
+    public void dealOutParam(String result) {
43
+
44
+    }
45
+
46
+    @Override
47
+    public String toString() {
48
+        return "物料编号输入任务";
49
+    }
50
+
51
+}

+ 74
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput;
19
+
20
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
21
+import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
22
+import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
23
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
24
+import com.zzsmart.qomo.plugin.task.api.*;
25
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
26
+import org.springframework.beans.factory.annotation.Autowired;
27
+import org.springframework.stereotype.Service;
28
+
29
+import java.util.Date;
30
+import java.util.List;
31
+
32
+/**
33
+ * 物料编号输入任务
34
+ */
35
+public class MaterialInputTask extends AbstractTask {
36
+    /**
37
+     * taskExecutionContext
38
+     */
39
+    private TaskExecutionContext taskExecutionContext;
40
+
41
+    /**
42
+     * sql parameters
43
+     */
44
+    private MaterialInputParameters emptyParameters;
45
+
46
+
47
+    /**
48
+     * Abstract Yarn Task
49
+     *
50
+     * @param taskRequest taskRequest
51
+     */
52
+    public MaterialInputTask(TaskExecutionContext taskRequest) {
53
+        super(taskRequest);
54
+        this.taskExecutionContext = taskRequest;
55
+        this.emptyParameters = new MaterialInputParameters();
56
+    }
57
+
58
+    @Override
59
+    public AbstractParameters getParameters() {
60
+        return emptyParameters;
61
+    }
62
+
63
+    @Override
64
+    public void handle(TaskCallBack taskCallBack) throws TaskException {
65
+        log.info("Full EmptyTask parameters: {}", emptyParameters);
66
+
67
+        //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS);
68
+    }
69
+
70
+    @Override
71
+    public void cancel() throws TaskException {
72
+
73
+    }
74
+}

+ 52
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput;
19
+
20
+
21
+import com.zzsmart.qomo.common.utils.JSONUtils;
22
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
23
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
24
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
25
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
26
+import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode;
27
+import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper;
28
+
29
+
30
+public class MaterialInputTaskChannel implements TaskChannel {
31
+
32
+    @Override
33
+    public void cancelApplication(boolean status) {
34
+
35
+    }
36
+
37
+    @Override
38
+    public AbstractTask createTask(TaskExecutionContext taskRequest) {
39
+        return new MaterialInputTask(taskRequest);
40
+    }
41
+
42
+    @Override
43
+    public AbstractParameters parseParameters(ParametersNode parametersNode) {
44
+        return JSONUtils.parseObject(parametersNode.getTaskParams(), MaterialInputParameters.class);
45
+    }
46
+
47
+    @Override
48
+    public ResourceParametersHelper getResources(String parameters) {
49
+        return JSONUtils.parseObject(parameters, MaterialInputParameters.class).getResources();
50
+    }
51
+
52
+}

+ 44
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput;
19
+
20
+import com.google.auto.service.AutoService;
21
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
22
+import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory;
23
+import com.zzsmart.qomo.spi.params.base.PluginParams;
24
+
25
+import java.util.List;
26
+
27
+@AutoService(TaskChannelFactory.class)
28
+public class MaterialInputTaskChannelFactory implements TaskChannelFactory {
29
+
30
+    @Override
31
+    public String getName() {
32
+        return "MaterialInput";
33
+    }
34
+
35
+    @Override
36
+    public List<PluginParams> getParams() {
37
+        return null;
38
+    }
39
+
40
+    @Override
41
+    public TaskChannel create() {
42
+        return new MaterialInputTaskChannel();
43
+    }
44
+}

+ 91
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/StandardCostService.java Ver arquivo

1
+package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput;
2
+
3
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
4
+import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
5
+import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
6
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.stereotype.Service;
10
+
11
+import javax.annotation.PostConstruct;
12
+import java.util.Date;
13
+import java.util.List;
14
+
15
+@Service
16
+@Slf4j
17
+public class StandardCostService {
18
+    @Autowired
19
+    CostMaterialBomMapper costMaterialBomMapper;
20
+    @Autowired
21
+    IAppSceneCostResultValueService iAppSceneCostResultValueService;
22
+    public static StandardCostService standardCostService;
23
+
24
+    @PostConstruct
25
+    public void init() {
26
+        standardCostService = this;
27
+        standardCostService.costMaterialBomMapper = this.costMaterialBomMapper;
28
+        standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService;
29
+    }
30
+
31
+
32
+    /**
33
+     * 物料编号输入任务
34
+     */
35
+    public static void materialInputTask(String materialCode) {
36
+        //1.查询出所有满足物料编号的物料(BOM物料)
37
+        String sql = "select * from app_scene_cost_material_bom ";
38
+        List<CostMaterialBom> list = standardCostService.costMaterialBomMapper.customSelect(sql);
39
+        log.info("Full EmptyTask list: {}", list);
40
+        //2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code)
41
+        AppSceneCostResultValue appSceneCostResultValue = new AppSceneCostResultValue();
42
+
43
+        appSceneCostResultValue.setInstanceCode("11");
44
+        appSceneCostResultValue.setCountValue("11");
45
+        appSceneCostResultValue.setCreateTime(new Date());
46
+        standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue);
47
+
48
+    }
49
+
50
+    /**
51
+     * 物料成本任务
52
+     */
53
+    public static void materialCostTask(String materialCode) {
54
+        //1.查询出物料编号对应的下所有的BOM信息
55
+        //2.计算出所有的单个物料的物料成本
56
+        //2.1查询出物料的单价和采购数量
57
+        //2.2计算出物料成本并存储到成本结果数据表中
58
+    }
59
+
60
+    /**
61
+     * 人工成本任务
62
+     */
63
+    public static void laborCostTask(String materialCode) {
64
+        //1.查询出物料编号对应的下所有的BOM信息
65
+        //2.计算出所有的单个物料的人工成本
66
+        //2.1查询出物料的人员工时和人工费率
67
+        //2.2计算出人工成本并存储到成本结果数据表中
68
+    }
69
+
70
+    /**
71
+     * 制造费用成本任务
72
+     */
73
+    public static void manufacturingCostTask(String materialCode) {
74
+        //1.查询出物料编号对应的下所有的BOM信息
75
+        //2.根据费用类型进行不同的费用计算
76
+        //2.1机器折旧费(机器工时*费率)
77
+        //2.2机物料消耗费(辅料工时*费率)
78
+        //2.3水电费(燃动力工时*费率)
79
+        //2.4其他制费(其他工时*费率)
80
+        //2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%)
81
+    }
82
+
83
+    /**
84
+     * 标准成本计算任务
85
+     */
86
+    public static void standardCostTask(String materialCode) {
87
+        //1.查询出物料编号对应的下所有的BOM信息
88
+        //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用)
89
+        //3.计算出所有的单个物料的累计标准成本
90
+    }
91
+}

+ 51
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost;
19
+
20
+
21
+import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo;
22
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
23
+
24
+import java.util.ArrayList;
25
+import java.util.List;
26
+
27
+/**
28
+ *
29
+ */
30
+public class StandardCostParameters extends AbstractParameters {
31
+    @Override
32
+    public boolean checkParameters() {
33
+        return true;
34
+    }
35
+
36
+    @Override
37
+    public List<ResourceInfo> getResourceFilesList() {
38
+        return new ArrayList<>();
39
+    }
40
+
41
+    @Override
42
+    public void dealOutParam(String result) {
43
+
44
+    }
45
+
46
+    @Override
47
+    public String toString() {
48
+        return "标准成本计算任务";
49
+    }
50
+
51
+}

+ 72
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost;
19
+
20
+import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
21
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
22
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
23
+import com.zzsmart.qomo.plugin.task.api.TaskCallBack;
24
+import com.zzsmart.qomo.plugin.task.api.TaskException;
25
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
26
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
27
+import org.springframework.beans.factory.annotation.Autowired;
28
+
29
+/**
30
+ * 标准成本计算任务
31
+ */
32
+public class StandardCostTask extends AbstractTask {
33
+
34
+    /**
35
+     * taskExecutionContext
36
+     */
37
+    private TaskExecutionContext taskExecutionContext;
38
+
39
+    /**
40
+     * sql parameters
41
+     */
42
+    private StandardCostParameters emptyParameters;
43
+
44
+
45
+    /**
46
+     * Abstract Yarn Task
47
+     *
48
+     * @param taskRequest taskRequest
49
+     */
50
+    public StandardCostTask(TaskExecutionContext taskRequest) {
51
+        super(taskRequest);
52
+        this.taskExecutionContext = taskRequest;
53
+        this.emptyParameters = new StandardCostParameters();
54
+    }
55
+
56
+    @Override
57
+    public AbstractParameters getParameters() {
58
+        return emptyParameters;
59
+    }
60
+
61
+    @Override
62
+    public void handle(TaskCallBack taskCallBack) throws TaskException {
63
+        log.info("Full EmptyTask parameters: {}", emptyParameters);
64
+
65
+        //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS);
66
+    }
67
+
68
+    @Override
69
+    public void cancel() throws TaskException {
70
+
71
+    }
72
+}

+ 52
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost;
19
+
20
+
21
+import com.zzsmart.qomo.common.utils.JSONUtils;
22
+import com.zzsmart.qomo.plugin.task.api.AbstractTask;
23
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
24
+import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext;
25
+import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters;
26
+import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode;
27
+import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper;
28
+
29
+
30
+public class StandardCostTaskChannel implements TaskChannel {
31
+
32
+    @Override
33
+    public void cancelApplication(boolean status) {
34
+
35
+    }
36
+
37
+    @Override
38
+    public AbstractTask createTask(TaskExecutionContext taskRequest) {
39
+        return new StandardCostTask(taskRequest);
40
+    }
41
+
42
+    @Override
43
+    public AbstractParameters parseParameters(ParametersNode parametersNode) {
44
+        return JSONUtils.parseObject(parametersNode.getTaskParams(), StandardCostParameters.class);
45
+    }
46
+
47
+    @Override
48
+    public ResourceParametersHelper getResources(String parameters) {
49
+        return JSONUtils.parseObject(parameters, StandardCostParameters.class).getResources();
50
+    }
51
+
52
+}

+ 44
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java Ver arquivo

1
+/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements.  See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License.  You may obtain a copy of the License at
8
+ *
9
+ *    http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost;
19
+
20
+import com.google.auto.service.AutoService;
21
+import com.zzsmart.qomo.plugin.task.api.TaskChannel;
22
+import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory;
23
+import com.zzsmart.qomo.spi.params.base.PluginParams;
24
+
25
+import java.util.List;
26
+
27
+@AutoService(TaskChannelFactory.class)
28
+public class StandardCostTaskChannelFactory implements TaskChannelFactory {
29
+
30
+    @Override
31
+    public String getName() {
32
+        return "StandardCost";
33
+    }
34
+
35
+    @Override
36
+    public List<PluginParams> getParams() {
37
+        return null;
38
+    }
39
+
40
+    @Override
41
+    public TaskChannel create() {
42
+        return new StandardCostTaskChannel();
43
+    }
44
+}

+ 14
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java Ver arquivo

1
+package com.zzsmart.qomo.kn.cost.manage.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
5
+
6
+/**
7
+ * @Description: app_scene_cost_result_value
8
+ * @Author: jeecg-boot
9
+ * @Date:   2024-07-22
10
+ * @Version: V1.0
11
+ */
12
+public interface IAppSceneCostResultValueService extends IService<AppSceneCostResultValue> {
13
+
14
+}

+ 20
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java Ver arquivo

1
+package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
+
3
+
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
6
+import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostResultValueMapper;
7
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService;
8
+import org.springframework.stereotype.Service;
9
+
10
+
11
+/**
12
+ * @Description: app_scene_cost_result_value
13
+ * @Author: jeecg-boot
14
+ * @Date: 2024-07-22
15
+ * @Version: V1.0
16
+ */
17
+@Service
18
+public class AppSceneCostResultValueServiceImpl extends ServiceImpl<AppSceneCostResultValueMapper, AppSceneCostResultValue> implements IAppSceneCostResultValueService {
19
+
20
+}

+ 58
- 69
qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java Ver arquivo

1
 package com.zzsmart.qomo.kn.cost.manage;
1
 package com.zzsmart.qomo.kn.cost.manage;
2
 
2
 
3
-import com.baomidou.mybatisplus.annotation.IdType;
4
-import com.baomidou.mybatisplus.generator.FastAutoGenerator;
5
-import com.baomidou.mybatisplus.generator.config.OutputFile;
6
-import com.baomidou.mybatisplus.generator.config.TemplateType;
7
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
8
-import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
9
-import org.junit.Test;
10
-import org.springframework.boot.test.context.SpringBootTest;
11
-
12
-import java.util.Collections;
13
-
14
-@SpringBootTest
3
+//@SpringBootTest
15
 public class ApplicationTests {
4
 public class ApplicationTests {
16
 
5
 
17
     /**
6
     /**
18
      * 根据表名生成相应结构代码
7
      * 根据表名生成相应结构代码
19
-//     * @param databaseName 数据库名
20
-//     * @param tableName 表名
8
+     //     * @param databaseName 数据库名
9
+     //     * @param tableName 表名
21
      */
10
      */
22
-    @Test
23
-    public  void Generation(){
24
-        FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"knne"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#")
25
-                .globalConfig(builder -> {
26
-                    builder.author(" ")
27
-                            .fileOverride()//是否覆盖
28
-                            //启用swagger
29
-                            //.enableSwagger()
30
-                            //指定输出目录
31
-                            .outputDir(System.getProperty("user.dir")+"/src/main/java");
32
-                })
33
-                .packageConfig(builder -> {
34
-                    builder.entity("entity")//实体类包名
35
-                            .parent("com.zzsmart.qomo.kn.cost.manage")//父包名。如果为空,将下面子包名必须写全部, 否则就只需写子包名
36
-                            .controller("controller")//控制层包名
37
-                            .mapper("mapper")//mapper层包名
38
-                            //.other("dto")//生成dto目录 可不用
39
-                            .service("service")//service层包名
40
-                            .serviceImpl("service.impl")//service实现类包名
41
-                            //自定义mapper.xml文件输出目录
42
-                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml"));
43
-                })
44
-                .strategyConfig(builder -> {
45
-                    builder.addInclude("app_scene_cost_model")// todo 设置需要生成的表名
46
-                            //.addTablePrefix("sys_")//设置表前缀过滤
47
-                            .entityBuilder()
48
-                            .enableLombok()
49
-                            .enableChainModel()
50
-                            .naming(NamingStrategy.underline_to_camel)//数据表映射实体命名策略:默认下划线转驼峰underline_to_camel
51
-                            .columnNaming(NamingStrategy.underline_to_camel)//表字段映射实体属性命名规则:默认null,不指定按照naming执行
52
-                            .idType(IdType.AUTO)//添加全局主键类型
53
-                            .formatFileName("%s")//格式化实体名称,%s取消首字母I,
54
-                            .enableTableFieldAnnotation()
55
-                            .enableColumnConstant()
56
-                            .mapperBuilder()
57
-                            .enableMapperAnnotation()//开启mapper注解
58
-                            .enableBaseResultMap()//启用xml文件中的BaseResultMap 生成
59
-                            .enableBaseColumnList()//启用xml文件中的BaseColumnList
60
-                            .formatMapperFileName("%sMapper")//格式化Dao类名称
61
-                            .formatXmlFileName("%sMapper")//格式化xml文件名称
62
-                            .serviceBuilder()
63
-                            .formatServiceFileName("%sService")//格式化 service 接口文件名称
64
-                            .formatServiceImplFileName("%sServiceImpl")//格式化 service 接口文件名称
65
-                            .controllerBuilder()
66
-                            .enableRestStyle();
67
-                })
68
-                // 使用Freemarker引擎模板,默认的是Velocity引擎模板
69
-//                .templateConfig(builder -> {
70
-//                    builder.disable(TemplateType.CONTROLLER)
71
-//                            .disable(TemplateType.SERVICE)
72
-//                            .disable(TemplateType.SERVICEIMPL);
11
+//    @Test
12
+//    public  void Generation(){
13
+//        FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"knne"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#")
14
+//                .globalConfig(builder -> {
15
+//                    builder.author(" ")
16
+//                            .fileOverride()//是否覆盖
17
+//                            //启用swagger
18
+//                            //.enableSwagger()
19
+//                            //指定输出目录
20
+//                            .outputDir(System.getProperty("user.dir")+"/src/main/java");
73
 //                })
21
 //                })
74
-                .templateEngine(new FreemarkerTemplateEngine())
75
-                .execute();
76
-
77
-    }
22
+//                .packageConfig(builder -> {
23
+//                    builder.entity("entity")//实体类包名
24
+//                            .parent("com.zzsmart.qomo.kn.cost.manage")//父包名。如果为空,将下面子包名必须写全部, 否则就只需写子包名
25
+//                            .controller("controller")//控制层包名
26
+//                            .mapper("mapper")//mapper层包名
27
+//                            //.other("dto")//生成dto目录 可不用
28
+//                            .service("service")//service层包名
29
+//                            .serviceImpl("service.impl")//service实现类包名
30
+//                            //自定义mapper.xml文件输出目录
31
+//                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml"));
32
+//                })
33
+//                .strategyConfig(builder -> {
34
+//                    builder.addInclude("app_scene_cost_model")// todo 设置需要生成的表名
35
+//                            //.addTablePrefix("sys_")//设置表前缀过滤
36
+//                            .entityBuilder()
37
+//                            .enableLombok()
38
+//                            .enableChainModel()
39
+//                            .naming(NamingStrategy.underline_to_camel)//数据表映射实体命名策略:默认下划线转驼峰underline_to_camel
40
+//                            .columnNaming(NamingStrategy.underline_to_camel)//表字段映射实体属性命名规则:默认null,不指定按照naming执行
41
+//                            .idType(IdType.AUTO)//添加全局主键类型
42
+//                            .formatFileName("%s")//格式化实体名称,%s取消首字母I,
43
+//                            .enableTableFieldAnnotation()
44
+//                            .enableColumnConstant()
45
+//                            .mapperBuilder()
46
+//                            .enableMapperAnnotation()//开启mapper注解
47
+//                            .enableBaseResultMap()//启用xml文件中的BaseResultMap 生成
48
+//                            .enableBaseColumnList()//启用xml文件中的BaseColumnList
49
+//                            .formatMapperFileName("%sMapper")//格式化Dao类名称
50
+//                            .formatXmlFileName("%sMapper")//格式化xml文件名称
51
+//                            .serviceBuilder()
52
+//                            .formatServiceFileName("%sService")//格式化 service 接口文件名称
53
+//                            .formatServiceImplFileName("%sServiceImpl")//格式化 service 接口文件名称
54
+//                            .controllerBuilder()
55
+//                            .enableRestStyle();
56
+//                })
57
+//                // 使用Freemarker引擎模板,默认的是Velocity引擎模板
58
+////                .templateConfig(builder -> {
59
+////                    builder.disable(TemplateType.CONTROLLER)
60
+////                            .disable(TemplateType.SERVICE)
61
+////                            .disable(TemplateType.SERVICEIMPL);
62
+////                })
63
+//                .templateEngine(new FreemarkerTemplateEngine())
64
+//                .execute();
65
+//
66
+//    }
78
 }
67
 }