Przeglądaj źródła

新增模型计算任务相关的接口

wangqiong 1 rok temu
rodzic
commit
050a54246c
24 zmienionych plików z 729 dodań i 411 usunięć
  1. 2
    2
      qomo-kn-cost-manage-start/src/main/resources/application-dev.yml
  2. 165
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java
  3. 115
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java
  4. 0
    115
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostModelController.java
  5. 0
    26
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/FlowDefinitionController.java
  6. 85
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java
  7. 75
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java
  8. 53
    30
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java
  9. 14
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.java
  10. 15
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.java
  11. 0
    18
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostModelMapper.java
  12. 5
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.xml
  13. 5
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostModelMapper.xml
  14. 0
    26
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostModelMapper.xml
  15. 13
    5
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java
  16. 4
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java
  17. 0
    49
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostModelService.java
  18. 32
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java
  19. 24
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java
  20. 88
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java
  21. 34
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java
  22. 0
    120
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostModelServiceImpl.java
  23. 0
    9
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java
  24. 0
    11
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelVO.java

+ 2
- 2
qomo-kn-cost-manage-start/src/main/resources/application-dev.yml Wyświetl plik

@@ -283,8 +283,8 @@ jeecg:
283 283
     webapp: /opt/webapp
284 284
   shiro:
285 285
 #    excludeUrls: /api/**,/api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/**
286
-    excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/**
287
-    #excludeUrls: /**/**,/**/**/**
286
+#    excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/**
287
+    excludeUrls: /**/**,/**/**/**
288 288
 
289 289
   #阿里云oss存储和大鱼短信秘钥配置
290 290
   oss:

+ 165
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java Wyświetl plik

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

+ 115
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java Wyświetl plik

@@ -0,0 +1,115 @@
1
+package com.zzsmart.qomo.kn.cost.manage.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.zzsmart.qomo.dao.entity.FlowDefinition;
8
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel;
9
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService;
10
+import com.zzsmart.qomo.service.IDataFlowDefinitionService;
11
+import io.swagger.annotations.Api;
12
+import io.swagger.annotations.ApiOperation;
13
+import lombok.extern.slf4j.Slf4j;
14
+import org.apache.shiro.authz.annotation.RequiresPermissions;
15
+import org.jeecg.common.api.vo.Result;
16
+import org.jeecg.common.aspect.annotation.AutoLog;
17
+import org.jeecg.common.system.base.controller.JeecgController;
18
+import org.jeecg.common.system.query.QueryGenerator;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.web.bind.annotation.*;
21
+
22
+import javax.servlet.http.HttpServletRequest;
23
+import java.util.List;
24
+
25
+/**
26
+ * @Description: app_scene_cost_model
27
+ * @Author: jeecg-boot
28
+ * @Date: 2024-07-29
29
+ * @Version: V1.0
30
+ */
31
+@Api(tags = "cost-标准成本-模型管理")
32
+@RestController
33
+@RequestMapping("//cost-model")
34
+@Slf4j
35
+public class AppSceneCostModelController  {
36
+    @Autowired
37
+    private IAppSceneCostModelService appSceneCostModelService;
38
+    @Autowired
39
+    private IDataFlowDefinitionService flowDefinitionService;
40
+
41
+    /**
42
+     * 标准成本模型分页列表查询
43
+     *
44
+     * @param flowDefinition
45
+     * @param pageNo
46
+     * @param pageSize
47
+     * @param req
48
+     * @return
49
+     */
50
+    //@AutoLog(value = "app_scene_cost_model-分页列表查询")
51
+    @ApiOperation(value = "标准成本模型分页列表查询", notes = "标准成本模型分页列表查询")
52
+    @GetMapping(value = "/pageList")
53
+    public Result<IPage<FlowDefinition>> queryPageList(FlowDefinition flowDefinition, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
54
+        QueryWrapper<FlowDefinition> queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap());
55
+        Page<FlowDefinition> page = new Page((long) pageNo, (long) pageSize);
56
+        LambdaQueryWrapper<FlowDefinition> wrapper = queryWrapper.lambda();
57
+        wrapper.orderByDesc(FlowDefinition::getCreateTime);
58
+        IPage<FlowDefinition> pageList = flowDefinitionService.queryPageList(page, wrapper);
59
+        return Result.OK(pageList);
60
+    }
61
+
62
+    @ApiOperation(value = "标准成本模型列表", notes = "标准成本模型列表")
63
+    @GetMapping(value = "/list")
64
+    public Result<List<FlowDefinition>> queryList(FlowDefinition flowDefinition, HttpServletRequest req) {
65
+        QueryWrapper<FlowDefinition> queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap());
66
+        LambdaQueryWrapper<FlowDefinition> wrapper = queryWrapper.lambda();
67
+        wrapper.orderByDesc(FlowDefinition::getCreateTime);
68
+        List<FlowDefinition> list = appSceneCostModelService.queryListResult(wrapper);
69
+        return Result.OK(list);
70
+    }
71
+
72
+    /**
73
+     * 添加标准成本模型
74
+     *
75
+     * @param flowDefinition
76
+     * @return
77
+     */
78
+    @AutoLog(value = "app_scene_cost_model-添加")
79
+    @ApiOperation(value = "app_scene_cost_model-添加", notes = "app_scene_cost_model-添加")
80
+    @PostMapping(value = "/add")
81
+    public Result<FlowDefinition> add(@RequestBody FlowDefinition flowDefinition) {
82
+        FlowDefinition definition = flowDefinitionService.add(flowDefinition);
83
+        return Result.OK(definition);
84
+    }
85
+
86
+    /**
87
+     * 编辑
88
+     *
89
+     * @param flowDefinition
90
+     * @return
91
+     */
92
+    @AutoLog(value = "app_scene_cost_model-编辑")
93
+    @ApiOperation(value = "app_scene_cost_model-编辑", notes = "app_scene_cost_model-编辑")
94
+    @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_model:edit")
95
+    @PostMapping(value = "/edit")
96
+    public Result<FlowDefinition> edit(@RequestBody FlowDefinition flowDefinition) {
97
+        return Result.OK(flowDefinitionService.edit(flowDefinition));
98
+    }
99
+
100
+    /**
101
+     * 通过id删除
102
+     *
103
+     * @param id
104
+     * @return
105
+     */
106
+    @AutoLog(value = "app_scene_cost_model-通过id删除")
107
+    @ApiOperation(value = "app_scene_cost_model-通过id删除", notes = "app_scene_cost_model-通过id删除")
108
+    @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_model:delete")
109
+    @DeleteMapping(value = "/delete")
110
+    public Result<String> delete(@RequestParam(name = "id", required = true) Integer id) {
111
+        flowDefinitionService.delete(id);
112
+        return Result.OK("删除成功!");
113
+    }
114
+
115
+}

+ 0
- 115
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostModelController.java Wyświetl plik

@@ -1,115 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.controller;
2
-
3
-
4
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
-import com.baomidou.mybatisplus.core.metadata.IPage;
6
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
-import com.zzsmart.qomo.kn.cost.manage.entity.CostModel;
8
-import com.zzsmart.qomo.kn.cost.manage.service.CostModelService;
9
-import com.zzsmart.qomo.kn.cost.manage.vo.CostModelVO;
10
-import io.swagger.annotations.Api;
11
-import io.swagger.annotations.ApiOperation;
12
-import org.jeecg.common.api.vo.Result;
13
-import org.jeecg.common.system.query.QueryGenerator;
14
-import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.*;
16
-
17
-import javax.servlet.http.HttpServletRequest;
18
-import java.util.List;
19
-
20
-/**
21
- * <p>
22
- * 前端控制器
23
- * </p>
24
- *
25
- * @author
26
- * @since 2024-07-11
27
- */
28
-@RestController
29
-@RequestMapping("/cost-model")
30
-@Api(tags="cost-标准成本-模型管理")
31
-public class CostModelController {
32
-    @Autowired
33
-    CostModelService costModelService;
34
-
35
-    /**
36
-     * 分页列表查询
37
-     *
38
-     * @param costModel
39
-     * @param pageNo
40
-     * @param pageSize
41
-     * @param req
42
-     * @return
43
-     */
44
-    //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询")
45
-    @ApiOperation(value = "标准成本模型表格信息查询", notes = "标准成本模型表格信息查询")
46
-    @GetMapping(value = "/pageList")
47
-    public Result<IPage<CostModel>> queryPageList(CostModel costModel, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
48
-        QueryWrapper<CostModel> queryWrapper = QueryGenerator.initQueryWrapper(costModel, req.getParameterMap());
49
-        Page<CostModel> page = new Page<CostModel>(pageNo, pageSize);
50
-        IPage<CostModel> pageList = costModelService.page(page, queryWrapper);
51
-        return Result.OK(pageList);
52
-    }
53
-
54
-    /**
55
-     * 列表查询
56
-     *
57
-     * @return
58
-     */
59
-    @ApiOperation(value = "物料bom列表查询", notes = "物料bom列表查询")
60
-    @GetMapping(value = "/list")
61
-    public Result<List<CostModel>> queryList(@RequestParam(name = "materialNumber", required = false) String materialNumber) {
62
-        List<CostModel> list = costModelService.queryListResult(materialNumber);
63
-        return Result.OK(list);
64
-    }
65
-    /**
66
-     * 标准成本模型编辑
67
-     */
68
-    @ApiOperation(value = "标准成本模型保存", notes = "标准成本模型保存")
69
-    @PostMapping(value = "/save")
70
-    public Result<String> save(@RequestBody CostModelVO costModelVO) {
71
-        Boolean aBoolean = costModelService.saveCostModelInfo(costModelVO);
72
-        if (aBoolean) {
73
-            return Result.OK("保存成功!");
74
-        }
75
-        return Result.error("保存失败!");
76
-    }
77
-    /**
78
-     * 标准成本模型编辑
79
-     */
80
-    @ApiOperation(value = "标准成本模型编辑", notes = "标准成本模型编辑")
81
-    @PostMapping(value = "/edit")
82
-    public Result<String> edit(@RequestBody CostModelVO costModelVO) {
83
-        Boolean aBoolean = costModelService.updateCostModelInfo(costModelVO);
84
-        if (aBoolean) {
85
-            return Result.OK("编辑成功!");
86
-        }
87
-        return Result.error("编辑失败!");
88
-    }
89
-
90
-    /**
91
-     * 标准成本模型删除
92
-     */
93
-    @ApiOperation(value = "标准成本模型删除", notes = "标准成本模型删除")
94
-    @PostMapping(value = "/delete")
95
-    public Result<String> delete(@RequestBody CostModelVO costModelVO) {
96
-        Boolean aBoolean = costModelService.deleteCostModel(costModelVO);
97
-        if (aBoolean) {
98
-            return Result.OK("删除成功!");
99
-        }
100
-        return Result.error("删除失败!");
101
-    }
102
-
103
-    /**
104
-     * 标准成本模型发布
105
-     */
106
-    @ApiOperation(value = "标准成本模型发布", notes = "标准成本模型发布")
107
-    @PostMapping(value = "/publish")
108
-    public Result<String> publish(@RequestBody CostModelVO costModelVO) {
109
-        Boolean aBoolean = costModelService.publishCostModel(costModelVO);
110
-        if (aBoolean) {
111
-            return Result.OK("发布成功!");
112
-        }
113
-        return Result.error("发布失败!");
114
-    }
115
-}

+ 0
- 26
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/FlowDefinitionController.java Wyświetl plik

@@ -1,26 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.controller;
2
-
3
-import com.zzsmart.qomo.controller.DataFlowDefinitionController;
4
-import org.slf4j.Logger;
5
-import org.slf4j.LoggerFactory;
6
-import org.springframework.web.bind.annotation.RequestMapping;
7
-import org.springframework.web.bind.annotation.RestController;
8
-
9
-@RestController
10
-@RequestMapping
11
-public class FlowDefinitionController {
12
-
13
-    private static final Logger log = LoggerFactory.getLogger(DataFlowDefinitionController.class);
14
-//    @Autowired
15
-//    FlowDefinitionService definitionService;
16
-
17
-//    @GetMapping({"/list"})
18
-//    public Result<IPage<FlowDefinition>> queryPageList(FlowDefinition flowDefinition, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
19
-//        QueryWrapper<FlowDefinition> queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap());
20
-//        Page<FlowDefinition> page = new Page((long) pageNo, (long) pageSize);
21
-//        LambdaQueryWrapper<FlowDefinition> wrapper = queryWrapper.lambda();
22
-//        wrapper.orderByDesc(FlowDefinition::getCreateTime);
23
-//        IPage<FlowDefinition> pageList = definitionService.queryPageList(page, wrapper);
24
-//        return Result.OK(pageList);
25
-//    }
26
-}

+ 85
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java Wyświetl plik

@@ -0,0 +1,85 @@
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.Builder;
12
+import lombok.Data;
13
+import com.fasterxml.jackson.annotation.JsonFormat;
14
+import org.springframework.format.annotation.DateTimeFormat;
15
+import org.jeecgframework.poi.excel.annotation.Excel;
16
+import org.jeecg.common.aspect.annotation.Dict;
17
+import io.swagger.annotations.ApiModel;
18
+import io.swagger.annotations.ApiModelProperty;
19
+import lombok.EqualsAndHashCode;
20
+import lombok.experimental.Accessors;
21
+
22
+/**
23
+ * @Description: app_scene_cost_count
24
+ * @Author: jeecg-boot
25
+ * @Date:   2024-07-29
26
+ * @Version: V1.0
27
+ */
28
+@Data
29
+@TableName("app_scene_cost_count")
30
+@Builder
31
+@Accessors(chain = true)
32
+@EqualsAndHashCode(callSuper = false)
33
+@ApiModel(value="app_scene_cost_count对象", description="app_scene_cost_count")
34
+public class AppSceneCostCount implements Serializable {
35
+    private static final long serialVersionUID = 1L;
36
+
37
+	/**主键*/
38
+	@TableId(type = IdType.ASSIGN_ID)
39
+    @ApiModelProperty(value = "主键")
40
+    private Integer id;
41
+	/**物料编号*/
42
+	@Excel(name = "物料编号", width = 15)
43
+    @ApiModelProperty(value = "物料编号")
44
+    private String materialNo;
45
+	/**图号*/
46
+	@Excel(name = "图号", width = 15)
47
+    @ApiModelProperty(value = "图号")
48
+    private String drawingNo;
49
+	/**stage*/
50
+	@Excel(name = "stage", width = 15)
51
+    @ApiModelProperty(value = "stage")
52
+    private String stage;
53
+	/**标准成本计算流程id*/
54
+	@Excel(name = "标准成本计算流程id", width = 15)
55
+    @ApiModelProperty(value = "标准成本计算流程id")
56
+    private Integer flowDefinitionId;
57
+	/**year*/
58
+	@Excel(name = "year", width = 15)
59
+    @ApiModelProperty(value = "year")
60
+    private String year;
61
+	/**状态*/
62
+	@Excel(name = "状态", width = 15)
63
+    @ApiModelProperty(value = "状态")
64
+    private Integer status;
65
+	/**模型版本*/
66
+	@Excel(name = "模型版本", width = 15)
67
+    @ApiModelProperty(value = "模型版本")
68
+    private String costVersion;
69
+	/**创建人*/
70
+    @ApiModelProperty(value = "创建人")
71
+    private Integer createBy;
72
+	/**创建时间*/
73
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
74
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
75
+    @ApiModelProperty(value = "创建时间")
76
+    private Date createTime;
77
+	/**更新人*/
78
+    @ApiModelProperty(value = "更新人")
79
+    private Integer updateBy;
80
+	/**更新时间*/
81
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
82
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
83
+    @ApiModelProperty(value = "更新时间")
84
+    private Date updateTime;
85
+}

+ 75
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java Wyświetl plik

@@ -0,0 +1,75 @@
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_model
23
+ * @Author: jeecg-boot
24
+ * @Date:   2024-07-29
25
+ * @Version: V1.0
26
+ */
27
+@Data
28
+@TableName("app_scene_cost_model")
29
+@Accessors(chain = true)
30
+@EqualsAndHashCode(callSuper = false)
31
+@ApiModel(value="app_scene_cost_model对象", description="app_scene_cost_model")
32
+public class AppSceneCostModel 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 materialNo;
43
+	/**图号*/
44
+	@Excel(name = "图号", width = 15)
45
+    @ApiModelProperty(value = "图号")
46
+    private String drawingNo;
47
+	/**标准成本计算流程id*/
48
+	@Excel(name = "标准成本计算流程id", width = 15)
49
+    @ApiModelProperty(value = "标准成本计算流程id")
50
+    private Integer flowDefinitionId;
51
+	/**状态*/
52
+	@Excel(name = "状态", width = 15)
53
+    @ApiModelProperty(value = "状态")
54
+    private Integer status;
55
+	/**模型版本*/
56
+	@Excel(name = "模型版本", width = 15)
57
+    @ApiModelProperty(value = "模型版本")
58
+    private String modelVersion;
59
+	/**创建人*/
60
+    @ApiModelProperty(value = "创建人")
61
+    private Integer createBy;
62
+	/**创建时间*/
63
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
64
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
65
+    @ApiModelProperty(value = "创建时间")
66
+    private Date createTime;
67
+	/**更新人*/
68
+    @ApiModelProperty(value = "更新人")
69
+    private Integer updateBy;
70
+	/**更新时间*/
71
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
72
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
73
+    @ApiModelProperty(value = "更新时间")
74
+    private Date updateTime;
75
+}

+ 53
- 30
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java Wyświetl plik

@@ -1,80 +1,103 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.entity;
2 2
 
3
-import java.io.Serializable;
4
-import java.io.UnsupportedEncodingException;
5
-import java.util.Date;
6
-import java.math.BigDecimal;
7 3
 import com.baomidou.mybatisplus.annotation.IdType;
8 4
 import com.baomidou.mybatisplus.annotation.TableId;
9 5
 import com.baomidou.mybatisplus.annotation.TableName;
10
-import com.baomidou.mybatisplus.annotation.TableLogic;
11
-import lombok.Data;
12 6
 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 7
 import io.swagger.annotations.ApiModel;
17 8
 import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Builder;
10
+import lombok.Data;
18 11
 import lombok.EqualsAndHashCode;
19 12
 import lombok.experimental.Accessors;
13
+import org.jeecgframework.poi.excel.annotation.Excel;
14
+import org.springframework.format.annotation.DateTimeFormat;
15
+
16
+import java.io.Serializable;
17
+import java.util.Date;
20 18
 
21 19
 /**
22 20
  * @Description: 标准成本-版本号
23 21
  * @Author: wangqiong
24
- * @Date:   2024-06-13
22
+ * @Date: 2024-06-13
25 23
  * @Version: V1.0
26 24
  */
27 25
 @Data
28 26
 @TableName("app_scene_cost_standard_version")
27
+@Builder
29 28
 @Accessors(chain = true)
30 29
 @EqualsAndHashCode(callSuper = false)
31
-@ApiModel(value="app_scene_cost_standard_version对象", description="app_scene_cost_standard_version")
30
+@ApiModel(value = "app_scene_cost_standard_version对象", description = "app_scene_cost_standard_version")
32 31
 public class CostStandardVersion implements Serializable {
33 32
     private static final long serialVersionUID = 1L;
34 33
 
35
-	/**id*/
36
-	@TableId(type = IdType.ASSIGN_ID)
34
+    /**
35
+     * id
36
+     */
37
+    @TableId(type = IdType.ASSIGN_ID)
37 38
     @ApiModelProperty(value = "id")
38 39
     private String id;
39 40
 
40
-	/**图号*/
41
+    /**
42
+     * 图号
43
+     */
41 44
     @Excel(name = "图号", width = 15)
42 45
     @ApiModelProperty(value = "图号")
43 46
     private String figureNumber;
44
-	/**阶段,A-初始,B-首批,C-量产*/
45
-	@Excel(name = "阶段", width = 15)
47
+    /**
48
+     * 阶段,A-初始,B-首批,C-量产
49
+     */
50
+    @Excel(name = "阶段", width = 15)
46 51
     @ApiModelProperty(value = "阶段")
47 52
     private String stage;
48
-	/**物料号*/
49
-	@Excel(name = "物料号", width = 15)
53
+    /**
54
+     * 物料号
55
+     */
56
+    @Excel(name = "物料号", width = 15)
50 57
     @ApiModelProperty(value = "物料号")
51 58
     private String materialNumber;
52
-	/**版本号*/
59
+    /**
60
+     * 版本号
61
+     */
53 62
     @ApiModelProperty(value = "版本号")
54 63
     private String versionNumber;
55
-	/**版本状态*/
64
+    /**
65
+     * 版本状态
66
+     */
56 67
     @ApiModelProperty(value = "版本状态")
57 68
     private String versionStatus;
58
-	/**创建人*/
69
+    /**
70
+     * 创建人
71
+     */
59 72
     @ApiModelProperty(value = "创建人")
60 73
     private String createBy;
61
-	/**创建时间*/
62
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
63
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
74
+    /**
75
+     * 创建时间
76
+     */
77
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
78
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
64 79
     @ApiModelProperty(value = "创建时间")
65 80
     private Date createTime;
66
-	/**修改人*/
81
+    /**
82
+     * 修改人
83
+     */
67 84
     @ApiModelProperty(value = "修改人")
68 85
     private String updateBy;
69
-	/**修改时间*/
70
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
71
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
86
+    /**
87
+     * 修改时间
88
+     */
89
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
90
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
72 91
     @ApiModelProperty(value = "修改时间")
73 92
     private Date updateTime;
74
-	/**备注*/
93
+    /**
94
+     * 备注
95
+     */
75 96
     @ApiModelProperty(value = "备注")
76 97
     private String remark;
77
-    /**年份*/
98
+    /**
99
+     * 年份
100
+     */
78 101
     @ApiModelProperty(value = "年份")
79 102
     private String versionYear;
80 103
 }

+ 14
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.java Wyświetl plik

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

+ 15
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.java Wyświetl plik

@@ -0,0 +1,15 @@
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.AppSceneCostModel;
6
+
7
+/**
8
+ * @Description: app_scene_cost_model
9
+ * @Author: jeecg-boot
10
+ * @Date:   2024-07-29
11
+ * @Version: V1.0
12
+ */
13
+public interface AppSceneCostModelMapper extends BaseMapper<AppSceneCostModel> {
14
+
15
+}

+ 0
- 18
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostModelMapper.java Wyświetl plik

@@ -1,18 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.mapper;
2
-
3
-import com.zzsmart.qomo.kn.cost.manage.entity.CostModel;
4
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
-import org.apache.ibatis.annotations.Mapper;
6
-
7
-/**
8
- * <p>
9
- *  Mapper 接口
10
- * </p>
11
- *
12
- * @author  
13
- * @since 2024-07-11
14
- */
15
-@Mapper
16
-public interface CostModelMapper extends BaseMapper<CostModel> {
17
-
18
-}

+ 5
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.xml Wyświetl plik

@@ -0,0 +1,5 @@
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.AppSceneCostCountMapper">
4
+
5
+</mapper>

+ 5
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostModelMapper.xml Wyświetl plik

@@ -0,0 +1,5 @@
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.AppSceneCostModelMapper">
4
+
5
+</mapper>

+ 0
- 26
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostModelMapper.xml Wyświetl plik

@@ -1,26 +0,0 @@
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.CostModelMapper">
4
-
5
-    <!-- 通用查询映射结果 -->
6
-    <resultMap id="BaseResultMap" type="com.zzsmart.qomo.kn.cost.manage.entity.CostModel">
7
-        <id column="id" property="id" />
8
-        <result column="model_name" property="modelName" />
9
-        <result column="drawing_no" property="drawingNo" />
10
-        <result column="material_no" property="materialNo" />
11
-        <result column="material_type" property="materialType" />
12
-        <result column="model_version" property="modelVersion" />
13
-        <result column="status" property="status" />
14
-        <result column="create_time" property="createTime" />
15
-        <result column="create_by" property="createBy" />
16
-        <result column="update_time" property="updateTime" />
17
-        <result column="update_by" property="updateBy" />
18
-        <result column="cost_model_detail" property="costModelDetail" />
19
-    </resultMap>
20
-
21
-    <!-- 通用查询结果列 -->
22
-    <sql id="Base_Column_List">
23
-        id, model_name, drawing_no, material_no, material_type, model_version, status, create_time, create_by, update_time, update_by, cost_model_detail
24
-    </sql>
25
-
26
-</mapper>

+ 13
- 5
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java Wyświetl plik

@@ -2,10 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage.plugin;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4 4
 import com.alibaba.fastjson.JSONObject;
5
-import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue;
6
-import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom;
7
-import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours;
8
-import com.zzsmart.qomo.kn.cost.manage.entity.HourRate;
5
+import com.zzsmart.qomo.kn.cost.manage.entity.*;
9 6
 import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum;
10 7
 import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper;
11 8
 import com.zzsmart.qomo.kn.cost.manage.service.*;
@@ -54,11 +51,15 @@ public class StandardCostService {
54 51
     @Autowired
55 52
     IAppSceneCostResultValueService iAppSceneCostResultValueService;
56 53
     public static StandardCostService standardCostService;
54
+    @Autowired
55
+    IAppSceneCostCountService appSceneCostCountService;
56
+
57 57
 
58 58
     @PostConstruct
59 59
     public void init() {
60 60
         standardCostService = this;
61 61
         standardCostService.costMaterialBomMapper = this.costMaterialBomMapper;
62
+        standardCostService.appSceneCostCountService = this.appSceneCostCountService;
62 63
         standardCostService.costMaterialBomService = this.costMaterialBomService;
63 64
         standardCostService.costPurchasePriceService = this.costPurchasePriceService;
64 65
         standardCostService.iHourRateService = this.iHourRateService;
@@ -66,6 +67,13 @@ public class StandardCostService {
66 67
         standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService;
67 68
     }
68 69
 
70
+    /**
71
+     * 更新成本计算模型任务状态
72
+     */
73
+    public static void updateCostCountTaskStatus(Boolean isSuccess, Integer costCountTaskId) {
74
+        log.info("更新成本计算模型任务状态");
75
+        standardCostService.appSceneCostCountService.updateById(AppSceneCostCount.builder().id(costCountTaskId).status(isSuccess != null && isSuccess ? 1 : 0).build());
76
+    }
69 77
 
70 78
     /**
71 79
      * 1.物料编号输入任务
@@ -472,7 +480,7 @@ public class StandardCostService {
472 480
         }
473 481
         //3.计算出所有的单个物料的累计标准成本
474 482
         List<AppSceneCostResultValue> standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId);
475
-      //TODO 优化累计成本的计算
483
+        //TODO 优化累计成本的计算
476 484
         totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId);
477 485
     }
478 486
 

+ 4
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java Wyświetl plik

@@ -59,10 +59,14 @@ public class StandardCostTask extends AbstractTask {
59 59
         try {
60 60
             StandardCostService.standardCostTask(taskRequest);
61 61
         } catch (Exception e) {
62
+            //TODO 更新成本计算模型任务状态
63
+            StandardCostService.updateCostCountTaskStatus(false, 1);
62 64
             //运行失败退出
63 65
             setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE);
64 66
         }
65 67
         //运行成功退出
68
+        //TODO 更新成本计算模型任务状态
69
+        StandardCostService.updateCostCountTaskStatus(true, 1);
66 70
         setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS);
67 71
     }
68 72
 

+ 0
- 49
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostModelService.java Wyświetl plik

@@ -1,49 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.service;
2
-
3
-import com.zzsmart.qomo.kn.cost.manage.entity.CostModel;
4
-import com.baomidou.mybatisplus.extension.service.IService;
5
-import com.zzsmart.qomo.kn.cost.manage.vo.CostModelVO;
6
-
7
-import java.util.List;
8
-
9
-/**
10
- * <p>
11
- *  服务类
12
- * </p>
13
- *
14
- * @author
15
- * @since 2024-07-11
16
- */
17
-public interface CostModelService extends IService<CostModel> {
18
-    /**
19
-     * 查询标准成本模型列表
20
-     * @param materialNumber
21
-     * @return
22
-     */
23
-    List<CostModel> queryListResult(String materialNumber);
24
-
25
-    /**
26
-     * 标准成本模型编辑
27
-     * @param costModelVO
28
-     */
29
-    Boolean updateCostModelInfo(CostModelVO costModelVO);
30
-
31
-    /**
32
-     * 标准成本模型删除
33
-     * @param costModelVO
34
-     */
35
-    Boolean deleteCostModel(CostModelVO costModelVO);
36
-
37
-    /**
38
-     * 标准成本模型发布
39
-     * @param costModelVO
40
-     */
41
-    Boolean publishCostModel(CostModelVO costModelVO);
42
-
43
-    /**
44
-     * 标准成本模型保存
45
-     * @param costModelVO
46
-     * @return
47
-     */
48
-    Boolean saveCostModelInfo(CostModelVO costModelVO);
49
-}

+ 32
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java Wyświetl plik

@@ -0,0 +1,32 @@
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.AppSceneCostCount;
5
+
6
+/**
7
+ * @Description: app_scene_cost_count
8
+ * @Author: jeecg-boot
9
+ * @Date:   2024-07-29
10
+ * @Version: V1.0
11
+ */
12
+public interface IAppSceneCostCountService extends IService<AppSceneCostCount> {
13
+    /**
14
+     * 查看关键缺失部件
15
+     * @param id
16
+     * @return
17
+     */
18
+    AppSceneCostCount queryMissingComponentById(String id);
19
+
20
+    /**
21
+     * 重新计算
22
+     * @param id
23
+     * @return
24
+     */
25
+    AppSceneCostCount recountById(Integer id);
26
+
27
+    /**
28
+     * 添加标准成本计算任务
29
+     * @param appSceneCostCount
30
+     */
31
+    void addCostCountTask(AppSceneCostCount appSceneCostCount);
32
+}

+ 24
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java Wyświetl plik

@@ -0,0 +1,24 @@
1
+package com.zzsmart.qomo.kn.cost.manage.service;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+import com.zzsmart.qomo.dao.entity.FlowDefinition;
6
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * @Description: app_scene_cost_model
12
+ * @Author: jeecg-boot
13
+ * @Date: 2024-07-29
14
+ * @Version: V1.0
15
+ */
16
+public interface IAppSceneCostModelService {
17
+    /**
18
+     * 查询标准成本模型列表
19
+     *
20
+     * @param queryWrapper
21
+     * @return
22
+     */
23
+    List<FlowDefinition> queryListResult(Wrapper<FlowDefinition> queryWrapper);
24
+}

+ 88
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java Wyświetl plik

@@ -0,0 +1,88 @@
1
+package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
5
+import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion;
6
+import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper;
7
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService;
8
+import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService;
9
+import com.zzsmart.qomo.service.IDataFlowInstanceService;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.stereotype.Service;
12
+
13
+import java.util.Date;
14
+
15
+/**
16
+ * @Description: app_scene_cost_count
17
+ * @Author: jeecg-boot
18
+ * @Date: 2024-07-29
19
+ * @Version: V1.0
20
+ */
21
+@Service
22
+public class AppSceneCostCountServiceImpl extends ServiceImpl<AppSceneCostCountMapper, AppSceneCostCount> implements IAppSceneCostCountService {
23
+    @Autowired
24
+    private ICostStandardVersionService costStandardVersionService;
25
+    @Autowired
26
+    private IDataFlowInstanceService flowInstanceService;
27
+
28
+    /**
29
+     * 查看关键缺失部件
30
+     *
31
+     * @param id
32
+     * @return
33
+     */
34
+    @Override
35
+    public AppSceneCostCount queryMissingComponentById(String id) {
36
+        return null;
37
+    }
38
+
39
+    /**
40
+     * 重新计算
41
+     *
42
+     * @param id
43
+     * @return
44
+     */
45
+    @Override
46
+    public AppSceneCostCount recountById(Integer id) {
47
+        if (id != null) {
48
+            AppSceneCostCount appSceneCostCount = getById(id);
49
+            if (appSceneCostCount != null) {
50
+                //执行标准成本计算
51
+                executeStandardCost(id, appSceneCostCount.getFlowDefinitionId());
52
+            }
53
+        }
54
+        return null;
55
+    }
56
+
57
+    /**
58
+     * 执行标准成本计算
59
+     *
60
+     * @param id
61
+     * @param flowDefinitionId
62
+     */
63
+    private void executeStandardCost(Integer id, Integer flowDefinitionId) {
64
+        //TODO 执行标准成本计算(参数传递)
65
+        flowInstanceService.execute(flowDefinitionId, null, null);
66
+    }
67
+
68
+    /**
69
+     * 添加标准成本计算任务
70
+     *
71
+     * @param appSceneCostCount
72
+     */
73
+    @Override
74
+    public void addCostCountTask(AppSceneCostCount appSceneCostCount) {
75
+        //1.新增版本号记录成功后
76
+        CostStandardVersion costStandardVersion = CostStandardVersion.builder().figureNumber(appSceneCostCount.getDrawingNo()).materialNumber(appSceneCostCount.getMaterialNo()).stage(appSceneCostCount.getStage()).versionNumber(appSceneCostCount.getCostVersion()).versionYear(appSceneCostCount.getYear()).build();
77
+        boolean save = costStandardVersionService.save(costStandardVersion);
78
+        //2.新增标准成本计算任务,并立即执行标准成本计算
79
+        if (save) {
80
+            AppSceneCostCount appSceneCostCount1 = AppSceneCostCount.builder().materialNo(appSceneCostCount.getMaterialNo()).drawingNo(appSceneCostCount.getDrawingNo()).stage(appSceneCostCount.getStage()).flowDefinitionId(appSceneCostCount.getFlowDefinitionId()).year(appSceneCostCount.getYear()).costVersion(appSceneCostCount.getCostVersion()).status(0).createTime(new Date()).build();
81
+            boolean flag = save(appSceneCostCount1);
82
+            if (flag) {
83
+                //执行标准成本计算
84
+                executeStandardCost(appSceneCostCount1.getId(), appSceneCostCount1.getFlowDefinitionId());
85
+            }
86
+        }
87
+    }
88
+}

+ 34
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java Wyświetl plik

@@ -0,0 +1,34 @@
1
+package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
4
+import com.zzsmart.qomo.dao.entity.FlowDefinition;
5
+import com.zzsmart.qomo.dao.mapper.FlowDefinitionMapper;
6
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+import java.util.List;
11
+
12
+/**
13
+ * @Description: app_scene_cost_model
14
+ * @Author: jeecg-boot
15
+ * @Date: 2024-07-29
16
+ * @Version: V1.0
17
+ */
18
+@Service
19
+public class AppSceneCostModelServiceImpl implements IAppSceneCostModelService {
20
+    @Autowired
21
+    FlowDefinitionMapper flowDefinitionMapper;
22
+
23
+    /**
24
+     * 查询标准成本模型列表
25
+     *
26
+     * @param queryWrapper
27
+     * @return
28
+     */
29
+    @Override
30
+    public List<FlowDefinition> queryListResult(Wrapper<FlowDefinition> queryWrapper) {
31
+        List list = flowDefinitionMapper.selectList(queryWrapper);
32
+        return list;
33
+    }
34
+}

+ 0
- 120
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostModelServiceImpl.java Wyświetl plik

@@ -1,120 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
-
3
-import cn.hutool.core.util.StrUtil;
4
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
-import com.zzsmart.qomo.kn.cost.manage.entity.CostModel;
7
-import com.zzsmart.qomo.kn.cost.manage.mapper.CostModelMapper;
8
-import com.zzsmart.qomo.kn.cost.manage.service.CostModelService;
9
-import com.zzsmart.qomo.kn.cost.manage.vo.CostModelVO;
10
-import org.springframework.beans.BeanUtils;
11
-import org.springframework.beans.factory.annotation.Autowired;
12
-import org.springframework.stereotype.Service;
13
-
14
-import java.util.List;
15
-
16
-/**
17
- * <p>
18
- * 服务实现类
19
- * </p>
20
- *
21
- * @author
22
- * @since 2024-07-11
23
- */
24
-@Service
25
-public class CostModelServiceImpl extends ServiceImpl<CostModelMapper, CostModel> implements CostModelService {
26
-    @Autowired
27
-    CostModelMapper costModelMapper;
28
-
29
-    /**
30
-     * 查询标准成本模型列表
31
-     *
32
-     * @param materialNumber
33
-     * @return
34
-     */
35
-    @Override
36
-    public List<CostModel> queryListResult(String materialNumber) {
37
-        QueryWrapper queryWrapper = new QueryWrapper();
38
-        if (StrUtil.isNotEmpty(materialNumber)) {
39
-            // 物料号
40
-            queryWrapper.like("material_no", materialNumber);
41
-        }
42
-        List list = costModelMapper.selectList(queryWrapper);
43
-        return list;
44
-    }
45
-
46
-    /**
47
-     * 标准成本模型编辑
48
-     *
49
-     * @param costModelVO
50
-     */
51
-    @Override
52
-    public Boolean updateCostModelInfo(CostModelVO costModelVO) {
53
-        if (costModelVO != null && costModelVO.getId() != null) {
54
-            CostModel costModel = new CostModel();
55
-            BeanUtils.copyProperties(costModelVO, costModel);
56
-            costModel.setId(costModelVO.getId());
57
-            costModel.setCostModelDetail(costModelVO.getCostModelDetail());
58
-            int i = costModelMapper.updateById(costModel);
59
-            if (i > 0) {
60
-                return true;
61
-            }
62
-        }
63
-        return false;
64
-    }
65
-
66
-    /**
67
-     * 标准成本模型删除
68
-     *
69
-     * @param costModelVO
70
-     */
71
-    @Override
72
-    public Boolean deleteCostModel(CostModelVO costModelVO) {
73
-        if (costModelVO != null && costModelVO.getId() != null) {
74
-            int i = costModelMapper.deleteById(costModelVO.getId());
75
-            if (i > 0) {
76
-                return true;
77
-            }
78
-        }
79
-        return false;
80
-    }
81
-
82
-    /**
83
-     * 标准成本模型发布
84
-     *
85
-     * @param costModelVO
86
-     */
87
-    @Override
88
-    public Boolean publishCostModel(CostModelVO costModelVO) {
89
-        if (costModelVO != null && costModelVO.getId() != null) {
90
-            CostModel costModel = new CostModel();
91
-            costModel.setStatus(costModelVO.getStatus());
92
-            costModel.setId(costModelVO.getId());
93
-            int i = costModelMapper.updateById(costModel);
94
-            if (i > 0) {
95
-                return true;
96
-            }
97
-        }
98
-        return false;
99
-    }
100
-
101
-    /**
102
-     * 标准成本模型保存
103
-     *
104
-     * @param costModelVO
105
-     * @return
106
-     */
107
-    @Override
108
-    public Boolean saveCostModelInfo(CostModelVO costModelVO) {
109
-        if (costModelVO != null) {
110
-            CostModel costModel = new CostModel();
111
-            BeanUtils.copyProperties(costModelVO, costModel);
112
-            costModel.setCostModelDetail(costModelVO.getCostModelDetail());
113
-            int i = costModelMapper.insert(costModel);
114
-            if (i > 0) {
115
-                return true;
116
-            }
117
-        }
118
-        return false;
119
-    }
120
-}

+ 0
- 9
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java Wyświetl plik

@@ -63,15 +63,6 @@ public class CostStandardVersionServiceImpl extends ServiceImpl<CostStandardVers
63 63
         }
64 64
         // 保存版本号表
65 65
         boolean save = super.save(costStandardVersion);
66
-        // todo 标准成本计算
67
-//        standard.setMaterialNumber(costStandardVersion.getMaterialNumber());
68
-//        standard.setVersionNumberId(costStandardVersion.getId());
69
-//        if(sysUser!=null){
70
-//            standard.setCreateBy(sysUser.getUsername());
71
-//        }
72
-//        standard.setCreateTime(new Date());
73
-//        // 保存标准成本表
74
-//        costStandardMapper.insert(standard);
75 66
         return save;
76 67
     }
77 68
 

+ 0
- 11
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelVO.java Wyświetl plik

@@ -1,11 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.vo;
2
-
3
-import com.zzsmart.qomo.kn.cost.manage.entity.CostModel;
4
-import io.swagger.annotations.ApiModel;
5
-import lombok.Data;
6
-
7
-@Data
8
-@ApiModel(value = "标准成本模型", description = "标准成本模型")
9
-public class CostModelVO extends CostModel {
10
-
11
-}