Pārlūkot izejas kodu

Merge branch 'bgy' of kn-cost/cost-backend into master

bgy 1 gadu atpakaļ
vecāks
revīzija
578cd48dcc
49 mainītis faili ar 1753 papildinājumiem un 1858 dzēšanām
  1. 1
    1
      qomo-kn-cost-manage-start/src/main/resources/application-dev.yml
  2. 1
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java
  3. 0
    190
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java
  4. 0
    159
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java
  5. 54
    8
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java
  6. 0
    159
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java
  7. 53
    13
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java
  8. 0
    261
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java
  9. 0
    129
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialProcessHours.java
  10. 58
    45
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java
  11. 2
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java
  12. 0
    173
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java
  13. 2
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java
  14. 97
    35
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java
  15. 365
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardResult.java
  16. 65
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java
  17. 25
    4
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java
  18. 3
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java
  19. 0
    34
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java
  20. 0
    14
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java
  21. 0
    14
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java
  22. 15
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardResultMapper.java
  23. 1
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml
  24. 0
    5
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml
  25. 0
    5
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml
  26. 1
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardResultMapper.xml
  27. 409
    340
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java
  28. 15
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java
  29. 2
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java
  30. 6
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java
  31. 0
    28
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java
  32. 0
    22
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java
  33. 8
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java
  34. 0
    22
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java
  35. 8
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java
  36. 14
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardResultService.java
  37. 42
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java
  38. 76
    15
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java
  39. 27
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostHourRateServiceImpl.java
  40. 0
    60
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java
  41. 0
    55
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java
  42. 40
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java
  43. 0
    47
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java
  44. 28
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java
  45. 5
    5
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java
  46. 21
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java
  47. 56
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java
  48. 209
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostStandardResultVO.java
  49. 44
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java

+ 1
- 1
qomo-kn-cost-manage-start/src/main/resources/application-dev.yml Parādīt failu

@@ -297,7 +297,7 @@ jeecg:
297 297
     webapp: /opt/webapp
298 298
   shiro:
299 299
     excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/**
300
-  #    excludeUrls: /**/**,/**/**/**
300
+#      excludeUrls: /**/**,/**/**/**
301 301
 
302 302
   #阿里云oss存储和大鱼短信秘钥配置
303 303
   oss:

+ 1
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java Parādīt failu

@@ -81,7 +81,7 @@ public class AppSceneCostCountController extends JeecgController<AppSceneCostCou
81 81
     @ApiOperation(value = "添加标准成本计算任务", notes = "添加标准成本计算任务")
82 82
 //    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:addCostCountTask")
83 83
     @PostMapping(value = "/addCostCountTask")
84
-    public Result<String> addCostCountTask(@RequestBody AppSceneCostCount appSceneCostCount) {
84
+    public Result<String> addCostCountTask(@RequestBody AppSceneCostCountVO appSceneCostCount) {
85 85
         appSceneCostCountService.addCostCountTask(appSceneCostCount);
86 86
         return Result.OK("添加成功!");
87 87
     }

+ 0
- 190
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java Parādīt failu

@@ -1,190 +0,0 @@
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.AppSceneCostMaterialBom;
7
-import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialBomService;
8
-import io.swagger.annotations.Api;
9
-import io.swagger.annotations.ApiOperation;
10
-import lombok.extern.slf4j.Slf4j;
11
-import org.jeecg.common.api.vo.Result;
12
-import org.jeecg.common.system.base.controller.JeecgController;
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
- * @Description: app_scene_cost_material_bom
22
- * @Author: jeecg-boot
23
- * @Date: 2024-08-02
24
- * @Version: V1.0
25
- */
26
-@RequestMapping("//cost-material-bom")
27
-@Api(tags="cost-标准成本-bom信息")
28
-@RestController
29
-@Slf4j
30
-public class AppSceneCostMaterialBomController extends JeecgController<AppSceneCostMaterialBom, IAppSceneCostMaterialBomService> {
31
-    @Autowired
32
-    private IAppSceneCostMaterialBomService costMaterialBomService;
33
-    /**
34
-     * 分页列表查询
35
-     *
36
-     * @param costMaterialBom
37
-     * @param pageNo
38
-     * @param pageSize
39
-     * @param req
40
-     * @return
41
-     */
42
-    //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询")
43
-    @ApiOperation(value="物料bom分页列表查询", notes="物料bom分页列表查询")
44
-    @GetMapping(value = "/pageList")
45
-    public Result<IPage<AppSceneCostMaterialBom>> queryPageList(AppSceneCostMaterialBom costMaterialBom,
46
-                                                        @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
47
-                                                        @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
48
-                                                        HttpServletRequest req) {
49
-        QueryWrapper<AppSceneCostMaterialBom> queryWrapper = QueryGenerator.initQueryWrapper(costMaterialBom, req.getParameterMap());
50
-        Page<AppSceneCostMaterialBom> page = new Page<AppSceneCostMaterialBom>(pageNo, pageSize);
51
-        IPage<AppSceneCostMaterialBom> pageList = costMaterialBomService.page(page, queryWrapper);
52
-        return Result.OK(pageList);
53
-    }
54
-    /**
55
-     * 列表查询
56
-     *
57
-     * @return
58
-     */
59
-    @ApiOperation(value="物料bom列表查询", notes="物料bom列表查询")
60
-    @GetMapping(value = "/list")
61
-    public Result<List<AppSceneCostMaterialBom>> queryList(@RequestParam(name = "materialNumber",required = false) String materialNumber) {
62
-        List<AppSceneCostMaterialBom> list = costMaterialBomService.queryListResult(materialNumber);
63
-        return Result.OK(list);
64
-    }
65
-
66
-//    /**
67
-//     * 分页列表查询
68
-//     *
69
-//     * @param appSceneCostMaterialBom
70
-//     * @param pageNo
71
-//     * @param pageSize
72
-//     * @param req
73
-//     * @return
74
-//     */
75
-//    //@AutoLog(value = "app_scene_cost_material_bom-分页列表查询")
76
-//    @ApiOperation(value = "app_scene_cost_material_bom-分页列表查询", notes = "app_scene_cost_material_bom-分页列表查询")
77
-//    @GetMapping(value = "/list")
78
-//    public Result<IPage<AppSceneCostMaterialBom>> queryPageList(AppSceneCostMaterialBom appSceneCostMaterialBom,
79
-//                                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
80
-//                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
81
-//                                                                HttpServletRequest req) {
82
-//        QueryWrapper<AppSceneCostMaterialBom> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialBom, req.getParameterMap());
83
-//        Page<AppSceneCostMaterialBom> page = new Page<AppSceneCostMaterialBom>(pageNo, pageSize);
84
-//        IPage<AppSceneCostMaterialBom> pageList = appSceneCostMaterialBomService.page(page, queryWrapper);
85
-//        return Result.OK(pageList);
86
-//    }
87
-//
88
-//    /**
89
-//     * 添加
90
-//     *
91
-//     * @param appSceneCostMaterialBom
92
-//     * @return
93
-//     */
94
-//    @AutoLog(value = "app_scene_cost_material_bom-添加")
95
-//    @ApiOperation(value = "app_scene_cost_material_bom-添加", notes = "app_scene_cost_material_bom-添加")
96
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:add")
97
-//    @PostMapping(value = "/add")
98
-//    public Result<String> add(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) {
99
-//        appSceneCostMaterialBomService.save(appSceneCostMaterialBom);
100
-//        return Result.OK("添加成功!");
101
-//    }
102
-//
103
-//    /**
104
-//     * 编辑
105
-//     *
106
-//     * @param appSceneCostMaterialBom
107
-//     * @return
108
-//     */
109
-//    @AutoLog(value = "app_scene_cost_material_bom-编辑")
110
-//    @ApiOperation(value = "app_scene_cost_material_bom-编辑", notes = "app_scene_cost_material_bom-编辑")
111
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:edit")
112
-//    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
113
-//    public Result<String> edit(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) {
114
-//        appSceneCostMaterialBomService.updateById(appSceneCostMaterialBom);
115
-//        return Result.OK("编辑成功!");
116
-//    }
117
-//
118
-//    /**
119
-//     * 通过id删除
120
-//     *
121
-//     * @param id
122
-//     * @return
123
-//     */
124
-//    @AutoLog(value = "app_scene_cost_material_bom-通过id删除")
125
-//    @ApiOperation(value = "app_scene_cost_material_bom-通过id删除", notes = "app_scene_cost_material_bom-通过id删除")
126
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:delete")
127
-//    @DeleteMapping(value = "/delete")
128
-//    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
129
-//        appSceneCostMaterialBomService.removeById(id);
130
-//        return Result.OK("删除成功!");
131
-//    }
132
-//
133
-//    /**
134
-//     * 批量删除
135
-//     *
136
-//     * @param ids
137
-//     * @return
138
-//     */
139
-//    @AutoLog(value = "app_scene_cost_material_bom-批量删除")
140
-//    @ApiOperation(value = "app_scene_cost_material_bom-批量删除", notes = "app_scene_cost_material_bom-批量删除")
141
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:deleteBatch")
142
-//    @DeleteMapping(value = "/deleteBatch")
143
-//    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
144
-//        this.appSceneCostMaterialBomService.removeByIds(Arrays.asList(ids.split(",")));
145
-//        return Result.OK("批量删除成功!");
146
-//    }
147
-//
148
-//    /**
149
-//     * 通过id查询
150
-//     *
151
-//     * @param id
152
-//     * @return
153
-//     */
154
-//    //@AutoLog(value = "app_scene_cost_material_bom-通过id查询")
155
-//    @ApiOperation(value = "app_scene_cost_material_bom-通过id查询", notes = "app_scene_cost_material_bom-通过id查询")
156
-//    @GetMapping(value = "/queryById")
157
-//    public Result<AppSceneCostMaterialBom> queryById(@RequestParam(name = "id", required = true) String id) {
158
-//        AppSceneCostMaterialBom appSceneCostMaterialBom = appSceneCostMaterialBomService.getById(id);
159
-//        if (appSceneCostMaterialBom == null) {
160
-//            return Result.error("未找到对应数据");
161
-//        }
162
-//        return Result.OK(appSceneCostMaterialBom);
163
-//    }
164
-//
165
-//    /**
166
-//     * 导出excel
167
-//     *
168
-//     * @param request
169
-//     * @param appSceneCostMaterialBom
170
-//     */
171
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:exportXls")
172
-//    @RequestMapping(value = "/exportXls")
173
-//    public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialBom appSceneCostMaterialBom) {
174
-//        return super.exportXls(request, appSceneCostMaterialBom, AppSceneCostMaterialBom.class, "app_scene_cost_material_bom");
175
-//    }
176
-//
177
-//    /**
178
-//     * 通过excel导入数据
179
-//     *
180
-//     * @param request
181
-//     * @param response
182
-//     * @return
183
-//     */
184
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:importExcel")
185
-//    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
186
-//    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
187
-//        return super.importExcel(request, response, AppSceneCostMaterialBom.class);
188
-//    }
189
-
190
-}

+ 0
- 159
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java Parādīt failu

@@ -1,159 +0,0 @@
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.AppSceneCostMaterialProcessHours;
7
-import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialProcessHoursService;
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_material_process_hours
26
- * @Author: jeecg-boot
27
- * @Date: 2024-08-02
28
- * @Version: V1.0
29
- */
30
-@Api(tags = "cost-工序工时")
31
-@RestController
32
-@RequestMapping("//processHours")
33
-@Slf4j
34
-public class AppSceneCostMaterialProcessHoursController extends JeecgController<AppSceneCostMaterialProcessHours, IAppSceneCostMaterialProcessHoursService> {
35
-    @Autowired
36
-    private IAppSceneCostMaterialProcessHoursService appSceneCostMaterialProcessHoursService;
37
-
38
-    /**
39
-     * 分页列表查询
40
-     *
41
-     * @param appSceneCostMaterialProcessHours
42
-     * @param pageNo
43
-     * @param pageSize
44
-     * @param req
45
-     * @return
46
-     */
47
-    //@AutoLog(value = "app_scene_cost_material_process_hours-分页列表查询")
48
-    @ApiOperation(value = "app_scene_cost_material_process_hours-分页列表查询", notes = "app_scene_cost_material_process_hours-分页列表查询")
49
-    @GetMapping(value = "/list")
50
-    public Result<IPage<AppSceneCostMaterialProcessHours>> queryPageList(AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
51
-        QueryWrapper<AppSceneCostMaterialProcessHours> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialProcessHours, req.getParameterMap());
52
-        Page<AppSceneCostMaterialProcessHours> page = new Page<AppSceneCostMaterialProcessHours>(pageNo, pageSize);
53
-        IPage<AppSceneCostMaterialProcessHours> pageList = appSceneCostMaterialProcessHoursService.page(page, queryWrapper);
54
-        return Result.OK(pageList);
55
-    }
56
-
57
-    /**
58
-     * 添加
59
-     *
60
-     * @param appSceneCostMaterialProcessHours
61
-     * @return
62
-     */
63
-    @AutoLog(value = "app_scene_cost_material_process_hours-添加")
64
-    @ApiOperation(value = "app_scene_cost_material_process_hours-添加", notes = "app_scene_cost_material_process_hours-添加")
65
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:add")
66
-    @PostMapping(value = "/add")
67
-    public Result<String> add(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) {
68
-        appSceneCostMaterialProcessHoursService.save(appSceneCostMaterialProcessHours);
69
-        return Result.OK("添加成功!");
70
-    }
71
-
72
-    /**
73
-     * 编辑
74
-     *
75
-     * @param appSceneCostMaterialProcessHours
76
-     * @return
77
-     */
78
-    @AutoLog(value = "app_scene_cost_material_process_hours-编辑")
79
-    @ApiOperation(value = "app_scene_cost_material_process_hours-编辑", notes = "app_scene_cost_material_process_hours-编辑")
80
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:edit")
81
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
82
-    public Result<String> edit(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) {
83
-        appSceneCostMaterialProcessHoursService.updateById(appSceneCostMaterialProcessHours);
84
-        return Result.OK("编辑成功!");
85
-    }
86
-
87
-    /**
88
-     * 通过id删除
89
-     *
90
-     * @param id
91
-     * @return
92
-     */
93
-    @AutoLog(value = "app_scene_cost_material_process_hours-通过id删除")
94
-    @ApiOperation(value = "app_scene_cost_material_process_hours-通过id删除", notes = "app_scene_cost_material_process_hours-通过id删除")
95
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:delete")
96
-    @DeleteMapping(value = "/delete")
97
-    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
98
-        appSceneCostMaterialProcessHoursService.removeById(id);
99
-        return Result.OK("删除成功!");
100
-    }
101
-
102
-//    /**
103
-//     * 批量删除
104
-//     *
105
-//     * @param ids
106
-//     * @return
107
-//     */
108
-//    @AutoLog(value = "app_scene_cost_material_process_hours-批量删除")
109
-//    @ApiOperation(value = "app_scene_cost_material_process_hours-批量删除", notes = "app_scene_cost_material_process_hours-批量删除")
110
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:deleteBatch")
111
-//    @DeleteMapping(value = "/deleteBatch")
112
-//    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
113
-//        this.appSceneCostMaterialProcessHoursService.removeByIds(Arrays.asList(ids.split(",")));
114
-//        return Result.OK("批量删除成功!");
115
-//    }
116
-
117
-    /**
118
-     * 通过id查询
119
-     *
120
-     * @param id
121
-     * @return
122
-     */
123
-    //@AutoLog(value = "app_scene_cost_material_process_hours-通过id查询")
124
-    @ApiOperation(value = "app_scene_cost_material_process_hours-通过id查询", notes = "app_scene_cost_material_process_hours-通过id查询")
125
-    @GetMapping(value = "/queryById")
126
-    public Result<AppSceneCostMaterialProcessHours> queryById(@RequestParam(name = "id", required = true) String id) {
127
-        AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours = appSceneCostMaterialProcessHoursService.getById(id);
128
-        if (appSceneCostMaterialProcessHours == null) {
129
-            return Result.error("未找到对应数据");
130
-        }
131
-        return Result.OK(appSceneCostMaterialProcessHours);
132
-    }
133
-
134
-//    /**
135
-//     * 导出excel
136
-//     *
137
-//     * @param request
138
-//     * @param appSceneCostMaterialProcessHours
139
-//     */
140
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:exportXls")
141
-//    @RequestMapping(value = "/exportXls")
142
-//    public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) {
143
-//        return super.exportXls(request, appSceneCostMaterialProcessHours, AppSceneCostMaterialProcessHours.class, "app_scene_cost_material_process_hours");
144
-//    }
145
-
146
-//    /**
147
-//     * 通过excel导入数据
148
-//     *
149
-//     * @param request
150
-//     * @param response
151
-//     * @return
152
-//     */
153
-//    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:importExcel")
154
-//    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
155
-//    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
156
-//        return super.importExcel(request, response, AppSceneCostMaterialProcessHours.class);
157
-//    }
158
-
159
-}

+ 54
- 8
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java Parādīt failu

@@ -5,12 +5,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7
 import com.zzsmart.qomo.dao.entity.FlowDefinition;
8
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
9
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel;
10
+import com.zzsmart.qomo.kn.cost.manage.enums.CostModelStatusEnum;
11
+import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper;
12
+import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostModelMapper;
8 13
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService;
14
+import com.zzsmart.qomo.kn.cost.manage.vo.CostModelDefinitionVO;
9 15
 import com.zzsmart.qomo.service.IDataFlowDefinitionService;
10 16
 import io.swagger.annotations.Api;
11 17
 import io.swagger.annotations.ApiOperation;
12 18
 import lombok.extern.slf4j.Slf4j;
13
-import org.apache.shiro.authz.annotation.RequiresPermissions;
14 19
 import org.jeecg.common.api.vo.Result;
15 20
 import org.jeecg.common.aspect.annotation.AutoLog;
16 21
 import org.jeecg.common.system.query.QueryGenerator;
@@ -20,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
20 25
 import javax.servlet.http.HttpServletRequest;
21 26
 import java.util.Date;
22 27
 import java.util.List;
28
+import java.util.Random;
23 29
 
24 30
 /**
25 31
  * @Description: app_scene_cost_model
@@ -36,7 +42,10 @@ public class AppSceneCostModelController {
36 42
     private IAppSceneCostModelService appSceneCostModelService;
37 43
     @Autowired
38 44
     private IDataFlowDefinitionService flowDefinitionService;
39
-
45
+    @Autowired
46
+    private AppSceneCostCountMapper appSceneCostCountMapper;
47
+    @Autowired
48
+    private AppSceneCostModelMapper costModelMapper;
40 49
     /**
41 50
      * 标准成本模型分页列表查询
42 51
      *
@@ -71,17 +80,41 @@ public class AppSceneCostModelController {
71 80
     /**
72 81
      * 添加标准成本模型
73 82
      *
74
-     * @param flowDefinition
83
+     * @param modelDefinitionVO
75 84
      * @return
76 85
      */
77 86
     @AutoLog(value = "app_scene_cost_model-添加")
78 87
     @ApiOperation(value = "app_scene_cost_model-添加", notes = "app_scene_cost_model-添加")
79 88
     @PostMapping(value = "/add")
80
-    public Result<FlowDefinition> add(@RequestBody FlowDefinition flowDefinition) {
81
-        flowDefinition.setCreateTime(new Date());
82
-        flowDefinition.setUpdateTime(new Date());
83
-        FlowDefinition definition = flowDefinitionService.add(flowDefinition);
84
-        return Result.OK(definition);
89
+    public Result<FlowDefinition> add(@RequestBody CostModelDefinitionVO modelDefinitionVO) {
90
+        try {
91
+            FlowDefinition flowDefinition = new FlowDefinition();
92
+            //TODO 新增平台层模型定义记录
93
+            String flowCode = "FLOW_" + System.currentTimeMillis() + new Random(10000).nextInt();
94
+            flowDefinition.setUpdateTime(new Date());
95
+            flowDefinition.setCreateTime(new Date());
96
+            flowDefinition.setCode(flowCode);
97
+            flowDefinition.setProjectId(modelDefinitionVO.getProjectId());
98
+            flowDefinition.setUserId("1744546658109349889");
99
+            flowDefinition.setUserName("系统管理员");
100
+            flowDefinition.setTenantId(-1);
101
+            flowDefinition.setEnvironmentId(1);
102
+            flowDefinition.setName(modelDefinitionVO.getModelName());
103
+            FlowDefinition definition = flowDefinitionService.add(flowDefinition);
104
+            AppSceneCostModel forecastModel = new AppSceneCostModel();
105
+            forecastModel.setModelType(modelDefinitionVO.getModelType());
106
+            forecastModel.setModelName(modelDefinitionVO.getModelName());
107
+            forecastModel.setStatus(CostModelStatusEnum.Draft.getCode());
108
+            //2.新模型记录
109
+            forecastModel.setFlowDefinitionId(definition.getId());
110
+            forecastModel.setUpdateTime(new Date());
111
+            forecastModel.setCreateTime(new Date());
112
+            costModelMapper.insert(forecastModel);
113
+
114
+        } catch (Exception e) {
115
+            return Result.error("新增失败");
116
+        }
117
+        return Result.OK("新增成功");
85 118
     }
86 119
 
87 120
     /**
@@ -108,6 +141,19 @@ public class AppSceneCostModelController {
108 141
     @ApiOperation(value = "app_scene_cost_model-通过id删除", notes = "app_scene_cost_model-通过id删除")
109 142
     @DeleteMapping(value = "/delete")
110 143
     public Result<String> delete(@RequestParam(name = "id", required = true) Integer id) {
144
+        //检查模型是否被引用或挂载
145
+        if (id != null) {
146
+            FlowDefinition flowDefinition = flowDefinitionService.getById(id);
147
+            if (flowDefinition != null) {
148
+                Integer id1 = flowDefinition.getId();
149
+                QueryWrapper<AppSceneCostCount> queryWrapper = new QueryWrapper<>();
150
+                queryWrapper.eq("flow_definition_id", id1);
151
+                Long aLong = appSceneCostCountMapper.selectCount(queryWrapper);
152
+                if (aLong > 0) {
153
+                    return Result.error("该模型正在被引用,无法删除!");
154
+                }
155
+            }
156
+        }
111 157
         flowDefinitionService.delete(id);
112 158
         return Result.OK("删除成功!");
113 159
     }

+ 0
- 159
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java Parādīt failu

@@ -1,159 +0,0 @@
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.AppSceneCostPurchasePrice;
7
-import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchasePriceService;
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_purchase_price
26
- * @Author: jeecg-boot
27
- * @Date: 2024-08-02
28
- * @Version: V1.0
29
- */
30
-@Api(tags = "cost-采购价")
31
-@RestController
32
-@RequestMapping("//purchasePrice")
33
-@Slf4j
34
-public class AppSceneCostPurchasePriceController extends JeecgController<AppSceneCostPurchasePrice, IAppSceneCostPurchasePriceService> {
35
-    @Autowired
36
-    private IAppSceneCostPurchasePriceService appSceneCostPurchasePriceService;
37
-
38
-    /**
39
-     * 分页列表查询
40
-     *
41
-     * @param appSceneCostPurchasePrice
42
-     * @param pageNo
43
-     * @param pageSize
44
-     * @param req
45
-     * @return
46
-     */
47
-    //@AutoLog(value = "app_scene_cost_purchase_price-分页列表查询")
48
-    @ApiOperation(value = "app_scene_cost_purchase_price-分页列表查询", notes = "app_scene_cost_purchase_price-分页列表查询")
49
-    @GetMapping(value = "/list")
50
-    public Result<IPage<AppSceneCostPurchasePrice>> queryPageList(AppSceneCostPurchasePrice appSceneCostPurchasePrice, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
51
-        QueryWrapper<AppSceneCostPurchasePrice> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchasePrice, req.getParameterMap());
52
-        Page<AppSceneCostPurchasePrice> page = new Page<AppSceneCostPurchasePrice>(pageNo, pageSize);
53
-        IPage<AppSceneCostPurchasePrice> pageList = appSceneCostPurchasePriceService.page(page, queryWrapper);
54
-        return Result.OK(pageList);
55
-    }
56
-
57
-    /**
58
-     * 添加
59
-     *
60
-     * @param appSceneCostPurchasePrice
61
-     * @return
62
-     */
63
-    @AutoLog(value = "app_scene_cost_purchase_price-添加")
64
-    @ApiOperation(value = "app_scene_cost_purchase_price-添加", notes = "app_scene_cost_purchase_price-添加")
65
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:add")
66
-    @PostMapping(value = "/add")
67
-    public Result<String> add(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) {
68
-        appSceneCostPurchasePriceService.save(appSceneCostPurchasePrice);
69
-        return Result.OK("添加成功!");
70
-    }
71
-
72
-    /**
73
-     * 编辑
74
-     *
75
-     * @param appSceneCostPurchasePrice
76
-     * @return
77
-     */
78
-    @AutoLog(value = "app_scene_cost_purchase_price-编辑")
79
-    @ApiOperation(value = "app_scene_cost_purchase_price-编辑", notes = "app_scene_cost_purchase_price-编辑")
80
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:edit")
81
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
82
-    public Result<String> edit(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) {
83
-        appSceneCostPurchasePriceService.updateById(appSceneCostPurchasePrice);
84
-        return Result.OK("编辑成功!");
85
-    }
86
-
87
-    /**
88
-     * 通过id删除
89
-     *
90
-     * @param id
91
-     * @return
92
-     */
93
-    @AutoLog(value = "app_scene_cost_purchase_price-通过id删除")
94
-    @ApiOperation(value = "app_scene_cost_purchase_price-通过id删除", notes = "app_scene_cost_purchase_price-通过id删除")
95
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:delete")
96
-    @DeleteMapping(value = "/delete")
97
-    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
98
-        appSceneCostPurchasePriceService.removeById(id);
99
-        return Result.OK("删除成功!");
100
-    }
101
-
102
-    /**
103
-     * 批量删除
104
-     *
105
-     * @param ids
106
-     * @return
107
-     */
108
-    @AutoLog(value = "app_scene_cost_purchase_price-批量删除")
109
-    @ApiOperation(value = "app_scene_cost_purchase_price-批量删除", notes = "app_scene_cost_purchase_price-批量删除")
110
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:deleteBatch")
111
-    @DeleteMapping(value = "/deleteBatch")
112
-    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
113
-        this.appSceneCostPurchasePriceService.removeByIds(Arrays.asList(ids.split(",")));
114
-        return Result.OK("批量删除成功!");
115
-    }
116
-
117
-    /**
118
-     * 通过id查询
119
-     *
120
-     * @param id
121
-     * @return
122
-     */
123
-    //@AutoLog(value = "app_scene_cost_purchase_price-通过id查询")
124
-    @ApiOperation(value = "app_scene_cost_purchase_price-通过id查询", notes = "app_scene_cost_purchase_price-通过id查询")
125
-    @GetMapping(value = "/queryById")
126
-    public Result<AppSceneCostPurchasePrice> queryById(@RequestParam(name = "id", required = true) String id) {
127
-        AppSceneCostPurchasePrice appSceneCostPurchasePrice = appSceneCostPurchasePriceService.getById(id);
128
-        if (appSceneCostPurchasePrice == null) {
129
-            return Result.error("未找到对应数据");
130
-        }
131
-        return Result.OK(appSceneCostPurchasePrice);
132
-    }
133
-
134
-    /**
135
-     * 导出excel
136
-     *
137
-     * @param request
138
-     * @param appSceneCostPurchasePrice
139
-     */
140
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:exportXls")
141
-    @RequestMapping(value = "/exportXls")
142
-    public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchasePrice appSceneCostPurchasePrice) {
143
-        return super.exportXls(request, appSceneCostPurchasePrice, AppSceneCostPurchasePrice.class, "app_scene_cost_purchase_price");
144
-    }
145
-
146
-    /**
147
-     * 通过excel导入数据
148
-     *
149
-     * @param request
150
-     * @param response
151
-     * @return
152
-     */
153
-    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:importExcel")
154
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
155
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
156
-        return super.importExcel(request, response, AppSceneCostPurchasePrice.class);
157
-    }
158
-
159
-}

qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java → qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java Parādīt failu

@@ -4,14 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail;
7
-import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardDetailService;
7
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardResult;
8
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardResultService;
9
+import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostStandardResultVO;
8 10
 import io.swagger.annotations.Api;
9 11
 import io.swagger.annotations.ApiOperation;
10 12
 import lombok.extern.slf4j.Slf4j;
11
-import org.apache.shiro.authz.annotation.RequiresPermissions;
12 13
 import org.jeecg.common.api.vo.Result;
13 14
 import org.jeecg.common.system.base.controller.JeecgController;
14 15
 import org.jeecg.common.system.query.QueryGenerator;
16
+import org.springframework.beans.BeanUtils;
15 17
 import org.springframework.beans.factory.annotation.Autowired;
16 18
 import org.springframework.web.bind.annotation.GetMapping;
17 19
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
20 22
 import org.springframework.web.servlet.ModelAndView;
21 23
 
22 24
 import javax.servlet.http.HttpServletRequest;
25
+import java.util.ArrayList;
26
+import java.util.List;
23 27
 
24 28
 /**
25 29
  * @Description: app_scene_cost_standard_detail
@@ -31,14 +35,14 @@ import javax.servlet.http.HttpServletRequest;
31 35
 @RestController
32 36
 @RequestMapping("//costStandardDetail")
33 37
 @Slf4j
34
-public class AppSceneCostStandardDetailController extends JeecgController<AppSceneCostStandardDetail, IAppSceneCostStandardDetailService> {
38
+public class AppSceneCostStandardResultController extends JeecgController<AppSceneCostStandardResult, IAppSceneCostStandardResultService> {
35 39
     @Autowired
36
-    private IAppSceneCostStandardDetailService appSceneCostStandardDetailService;
40
+    private IAppSceneCostStandardResultService appSceneCostStandardResultService;
37 41
 
38 42
     /**
39 43
      * 分页列表查询
40 44
      *
41
-     * @param appSceneCostStandardDetail
45
+     * @param appSceneCostStandardResult
42 46
      * @param pageNo
43 47
      * @param pageSize
44 48
      * @param req
@@ -47,11 +51,47 @@ public class AppSceneCostStandardDetailController extends JeecgController<AppSce
47 51
     //@AutoLog(value = "app_scene_cost_standard_detail-分页列表查询")
48 52
     @ApiOperation(value = "app_scene_cost_standard_detail-分页列表查询", notes = "app_scene_cost_standard_detail-分页列表查询")
49 53
     @GetMapping(value = "/list")
50
-    public Result<IPage<AppSceneCostStandardDetail>> queryPageList(AppSceneCostStandardDetail appSceneCostStandardDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
51
-        QueryWrapper<AppSceneCostStandardDetail> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardDetail, req.getParameterMap());
52
-        Page<AppSceneCostStandardDetail> page = new Page<AppSceneCostStandardDetail>(pageNo, pageSize);
53
-        IPage<AppSceneCostStandardDetail> pageList = appSceneCostStandardDetailService.page(page, queryWrapper);
54
-        return Result.OK(pageList);
54
+    public Result<IPage<AppSceneCostStandardResultVO>> queryPageList(AppSceneCostStandardResult appSceneCostStandardResult, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
55
+        QueryWrapper<AppSceneCostStandardResult> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardResult, req.getParameterMap());
56
+        Page<AppSceneCostStandardResult> page = new Page<AppSceneCostStandardResult>(pageNo, pageSize);
57
+        IPage<AppSceneCostStandardResult> pageList = appSceneCostStandardResultService.page(page, queryWrapper);
58
+        IPage<AppSceneCostStandardResultVO> newpageList = new Page<>();
59
+        BeanUtils.copyProperties(pageList, newpageList);
60
+        List<AppSceneCostStandardResult> list = pageList.getRecords();
61
+        List<AppSceneCostStandardResultVO> newList = new ArrayList<>();
62
+        for (int i = 0; i < list.size(); i++) {
63
+            AppSceneCostStandardResult result = list.get(i);
64
+            AppSceneCostStandardResultVO costStandardDetail = AppSceneCostStandardResultVO.builder()
65
+                    .materialNumber(result.getMaterialNumber())
66
+//                    .materialName(oldAppSceneCostResultValue.getMarterialNo())
67
+                    .parentMaterialNumber(result.getParentMatnr())
68
+                    .versionNumber(result.getVersionNumber())
69
+//                    .level()
70
+//                    .sort()
71
+//                    .figureNumber()
72
+//                    .dosage(oldAppSceneCostResultValue.getNum() != null ? new Double(oldAppSceneCostResultValue.getNum()) : 0)
73
+//                    .unit(oldAppSceneCostResultValue.getUnit())
74
+                    .materialCost(result.getMaterialCostStage())
75
+                    .laborCost(result.getLaborCostStage())
76
+                    .equipmentCost(result.getEquipCostStage())
77
+                    .supplyMaterialCost(result.getAuxiliaryCostStage())
78
+                    .driveCost(result.getBurningCostStage())
79
+                    .logisticsCost(result.getStageLogisticsCost())
80
+                    .otherCost(result.getOtherCostStage())
81
+                    .currentStandardCost(result.getTotalStandardCostInter())
82
+                    .totalMaterialCost(result.getMaterialCostAccumulated())
83
+                    .totalLaborCost(result.getLaborCostAccumulated())
84
+                    .totalEquipmentCost(result.getEquipCostAccumulated())
85
+                    .totalSupplyMaterialCost(result.getAuxiliaryCostAccumulated())
86
+                    .totalDriveCost(result.getBurningCostAccumulated())
87
+                    .totalLogisticsCost(result.getTotalLogisticsCost())
88
+                    .totalOtherCost(result.getOtherCostAccumulated())
89
+                    .totalStandardCost(result.getTotalStandardCost())
90
+                    .createTime(result.getCreatedTime()).build();
91
+            newList.add(costStandardDetail);
92
+        }
93
+        newpageList.setRecords(newList);
94
+        return Result.OK(newpageList);
55 95
     }
56 96
 //
57 97
 //    /**
@@ -138,10 +178,10 @@ public class AppSceneCostStandardDetailController extends JeecgController<AppSce
138 178
      * @param appSceneCostStandardDetail
139 179
      */
140 180
 //    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:exportXls")
141
-    @RequestMapping(value = "/exportXls")
181
+    @GetMapping(value = "/exportXls")
142 182
     @ApiOperation(value = "cost-单行查询导出", notes = "cost-单行查询导出")
143
-    public ModelAndView exportXls(HttpServletRequest request, AppSceneCostStandardDetail appSceneCostStandardDetail) {
144
-        return super.exportXls(request, appSceneCostStandardDetail, AppSceneCostStandardDetail.class, "app_scene_cost_standard_detail");
183
+    public ModelAndView exportXls(HttpServletRequest request, AppSceneCostStandardResult appSceneCostStandardDetail) {
184
+        return super.exportXls(request, appSceneCostStandardDetail, AppSceneCostStandardResult.class, "标准成本单行导出");
145 185
     }
146 186
 
147 187
 //    /**

+ 0
- 261
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java Parādīt failu

@@ -1,261 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.entity;
2
-
3
-import com.baomidou.mybatisplus.annotation.IdType;
4
-import com.baomidou.mybatisplus.annotation.TableId;
5
-import com.baomidou.mybatisplus.annotation.TableName;
6
-import com.fasterxml.jackson.annotation.JsonFormat;
7
-import io.swagger.annotations.ApiModel;
8
-import io.swagger.annotations.ApiModelProperty;
9
-import lombok.Data;
10
-import lombok.EqualsAndHashCode;
11
-import lombok.experimental.Accessors;
12
-import org.jeecgframework.poi.excel.annotation.Excel;
13
-import org.springframework.format.annotation.DateTimeFormat;
14
-
15
-import java.io.Serializable;
16
-import java.math.BigDecimal;
17
-import java.util.Date;
18
-
19
-/**
20
- * @Description: app_scene_cost_material_bom
21
- * @Author: jeecg-boot
22
- * @Date: 2024-08-02
23
- * @Version: V1.0
24
- */
25
-@Data
26
-@TableName("app_scene_cost_material_bom")
27
-@Accessors(chain = true)
28
-@EqualsAndHashCode(callSuper = false)
29
-@ApiModel(value = "app_scene_cost_material_bom对象", description = "app_scene_cost_material_bom")
30
-public class AppSceneCostMaterialBom implements Serializable {
31
-    private static final long serialVersionUID = 1L;
32
-
33
-    /**
34
-     * id
35
-     */
36
-    @TableId(type = IdType.ASSIGN_ID)
37
-    @ApiModelProperty(value = "id")
38
-    private String id;
39
-    /**
40
-     * 物料编码
41
-     */
42
-    @Excel(name = "物料编码", width = 15)
43
-    @ApiModelProperty(value = "物料编码")
44
-    private String materialCode;
45
-    /**
46
-     * 物料名称
47
-     */
48
-    @Excel(name = "物料名称", width = 15)
49
-    @ApiModelProperty(value = "物料名称")
50
-    private String materialName;
51
-    /**
52
-     * 父级物料编码
53
-     */
54
-    @Excel(name = "父级物料编码", width = 15)
55
-    @ApiModelProperty(value = "父级物料编码")
56
-    private String parentMaterialCode;
57
-    /**
58
-     * 级别
59
-     */
60
-    @Excel(name = "级别", width = 15)
61
-    @ApiModelProperty(value = "级别")
62
-    private String level;
63
-    /**
64
-     * 排序
65
-     */
66
-    @Excel(name = "排序", width = 15)
67
-    @ApiModelProperty(value = "排序")
68
-    private Integer sort;
69
-    /**
70
-     * 计量单位
71
-     */
72
-    @Excel(name = "计量单位", width = 15)
73
-    @ApiModelProperty(value = "计量单位")
74
-    private String unit;
75
-    /**
76
-     * 数量
77
-     */
78
-    @Excel(name = "数量", width = 15)
79
-    @ApiModelProperty(value = "数量")
80
-    private Integer number;
81
-    /**
82
-     * 人工工时(分钟)
83
-     */
84
-    @Excel(name = "人工工时(分钟)", width = 15)
85
-    @ApiModelProperty(value = "人工工时(分钟)")
86
-    private BigDecimal laborHours;
87
-    /**
88
-     * 设备工时
89
-     */
90
-    @Excel(name = "设备工时", width = 15)
91
-    @ApiModelProperty(value = "设备工时")
92
-    private BigDecimal deviceHours;
93
-    /**
94
-     * 借用物料编码
95
-     */
96
-    @Excel(name = "借用物料编码", width = 15)
97
-    @ApiModelProperty(value = "借用物料编码")
98
-    private String borrowMaterialCode;
99
-    /**
100
-     * 参考物料编码
101
-     */
102
-    @Excel(name = "参考物料编码", width = 15)
103
-    @ApiModelProperty(value = "参考物料编码")
104
-    private String referMaterialCode;
105
-    /**
106
-     * 采购类型
107
-     */
108
-    @Excel(name = "采购类型", width = 15)
109
-    @ApiModelProperty(value = "采购类型")
110
-    private String purchaseType;
111
-    /**
112
-     * 特殊采购类型
113
-     */
114
-    @Excel(name = "特殊采购类型", width = 15)
115
-    @ApiModelProperty(value = "特殊采购类型")
116
-    private String specialPurchaseType;
117
-    /**
118
-     * 说明
119
-     */
120
-    @Excel(name = "说明", width = 15)
121
-    @ApiModelProperty(value = "说明")
122
-    private String explanation;
123
-    /**
124
-     * 单位数量
125
-     */
126
-    @Excel(name = "单位数量", width = 15)
127
-    @ApiModelProperty(value = "单位数量")
128
-    private BigDecimal quantity;
129
-    /**
130
-     * 重量(g)
131
-     */
132
-    @Excel(name = "重量(g)", width = 15)
133
-    @ApiModelProperty(value = "重量(g)")
134
-    private String weight;
135
-    /**
136
-     * 材料/牌号
137
-     */
138
-    @Excel(name = "材料/牌号", width = 15)
139
-    @ApiModelProperty(value = "材料/牌号")
140
-    private String materialAndBrand;
141
-    /**
142
-     * 表面处理,材料
143
-     */
144
-    @Excel(name = "表面处理,材料", width = 15)
145
-    @ApiModelProperty(value = "表面处理,材料")
146
-    private String surfaceMaterial;
147
-    /**
148
-     * 厚度(mm)
149
-     */
150
-    @Excel(name = "厚度(mm)", width = 15)
151
-    @ApiModelProperty(value = "厚度(mm)")
152
-    private String surfaceThickness;
153
-    /**
154
-     * 表面积(mm²)
155
-     */
156
-    @Excel(name = "表面积(mm²)", width = 15)
157
-    @ApiModelProperty(value = "表面积(mm²)")
158
-    private String surfaceArea;
159
-    /**
160
-     * 长(mm)
161
-     */
162
-    @Excel(name = "长(mm)", width = 15)
163
-    @ApiModelProperty(value = "长(mm)")
164
-    private String length;
165
-    /**
166
-     * 宽(mm)
167
-     */
168
-    @Excel(name = "宽(mm)", width = 15)
169
-    @ApiModelProperty(value = "宽(mm)")
170
-    private String width;
171
-    /**
172
-     * 高(mm)
173
-     */
174
-    @Excel(name = "高(mm)", width = 15)
175
-    @ApiModelProperty(value = "高(mm)")
176
-    private String height;
177
-    /**
178
-     * 图示/图档/文档 文件ID
179
-     */
180
-    @Excel(name = "图示/图档/文档 文件ID", width = 15)
181
-    @ApiModelProperty(value = "图示/图档/文档 文件ID")
182
-    private Integer figureFileId;
183
-    /**
184
-     * 是否新摸具(0否 1是)
185
-     */
186
-    @Excel(name = "是否新摸具(0否 1是)", width = 15)
187
-    @ApiModelProperty(value = "是否新摸具(0否 1是)")
188
-    private Integer newTooling;
189
-    /**
190
-     * 成型方式(枚举)
191
-     */
192
-    @Excel(name = "成型方式(枚举)", width = 15)
193
-    @ApiModelProperty(value = "成型方式(枚举)")
194
-    private String shapingMethod;
195
-    /**
196
-     * 作业内容
197
-     */
198
-    @Excel(name = "作业内容", width = 15)
199
-    @ApiModelProperty(value = "作业内容")
200
-    private String workContent;
201
-    /**
202
-     * 加工地点
203
-     */
204
-    @Excel(name = "加工地点", width = 15)
205
-    @ApiModelProperty(value = "加工地点")
206
-    private String processLocation;
207
-    /**
208
-     * 成本中心
209
-     */
210
-    @Excel(name = "成本中心", width = 15)
211
-    @ApiModelProperty(value = "成本中心")
212
-    private String costCenter;
213
-    /**
214
-     * 单价(未税)
215
-     */
216
-    @Excel(name = "单价(未税)", width = 15)
217
-    @ApiModelProperty(value = "单价(未税)")
218
-    private BigDecimal unitPrice;
219
-    /**
220
-     * 总价(未税)
221
-     */
222
-    @Excel(name = "总价(未税)", width = 15)
223
-    @ApiModelProperty(value = "总价(未税)")
224
-    private BigDecimal totalPrice;
225
-    /**
226
-     * 摸具费(未税)
227
-     */
228
-    @Excel(name = "摸具费(未税)", width = 15)
229
-    @ApiModelProperty(value = "摸具费(未税)")
230
-    private BigDecimal mouldPrice;
231
-    /**
232
-     * 创建人
233
-     */
234
-    @ApiModelProperty(value = "创建人")
235
-    private String createBy;
236
-    /**
237
-     * 创建时间
238
-     */
239
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
240
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
241
-    @ApiModelProperty(value = "创建时间")
242
-    private Date createTime;
243
-    /**
244
-     * 修改人
245
-     */
246
-    @ApiModelProperty(value = "修改人")
247
-    private String updateBy;
248
-    /**
249
-     * 修改时间
250
-     */
251
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
252
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
253
-    @ApiModelProperty(value = "修改时间")
254
-    private Date updateTime;
255
-    /**
256
-     * 备注(特殊技术信息)
257
-     */
258
-    @Excel(name = "备注(特殊技术信息)", width = 15)
259
-    @ApiModelProperty(value = "备注(特殊技术信息)")
260
-    private String remark;
261
-}

+ 0
- 129
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialProcessHours.java Parādīt failu

@@ -1,129 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.entity;
2
-
3
-import com.baomidou.mybatisplus.annotation.IdType;
4
-import com.baomidou.mybatisplus.annotation.TableId;
5
-import com.baomidou.mybatisplus.annotation.TableName;
6
-import com.fasterxml.jackson.annotation.JsonFormat;
7
-import io.swagger.annotations.ApiModel;
8
-import io.swagger.annotations.ApiModelProperty;
9
-import lombok.Data;
10
-import lombok.EqualsAndHashCode;
11
-import lombok.experimental.Accessors;
12
-import org.jeecgframework.poi.excel.annotation.Excel;
13
-import org.springframework.format.annotation.DateTimeFormat;
14
-
15
-import java.io.Serializable;
16
-import java.math.BigDecimal;
17
-import java.util.Date;
18
-
19
-/**
20
- * @Description: app_scene_cost_material_process_hours
21
- * @Author: jeecg-boot
22
- * @Date: 2024-08-02
23
- * @Version: V1.0
24
- */
25
-@Data
26
-@TableName("app_scene_cost_material_process_hours")
27
-@Accessors(chain = true)
28
-@EqualsAndHashCode(callSuper = false)
29
-@ApiModel(value = "app_scene_cost_material_process_hours对象", description = "app_scene_cost_material_process_hours")
30
-public class AppSceneCostMaterialProcessHours implements Serializable {
31
-    private static final long serialVersionUID = 1L;
32
-
33
-    /**
34
-     * 主键
35
-     */
36
-    @TableId(type = IdType.ASSIGN_ID)
37
-    @ApiModelProperty(value = "主键")
38
-    private String id;
39
-    /**
40
-     * 物料编码
41
-     */
42
-    @Excel(name = "物料编码", width = 15)
43
-    @ApiModelProperty(value = "物料编码")
44
-    private String materialCode;
45
-    /**
46
-     * 物料名称
47
-     */
48
-    @Excel(name = "物料名称", width = 15)
49
-    @ApiModelProperty(value = "物料名称")
50
-    private String materialName;
51
-    /**
52
-     * 层级
53
-     */
54
-    @Excel(name = "层级", width = 15)
55
-    @ApiModelProperty(value = "层级")
56
-    private String level;
57
-    /**
58
-     * 数量
59
-     */
60
-    @Excel(name = "数量", width = 15)
61
-    @ApiModelProperty(value = "数量")
62
-    private BigDecimal quantity;
63
-    /**
64
-     * 采购类型
65
-     */
66
-    @Excel(name = "采购类型", width = 15)
67
-    @ApiModelProperty(value = "采购类型")
68
-    private String purchaseType;
69
-    /**
70
-     * 工序
71
-     */
72
-    @Excel(name = "工序", width = 15)
73
-    @ApiModelProperty(value = "工序")
74
-    private String workProcess;
75
-    /**
76
-     * 描述
77
-     */
78
-    @Excel(name = "描述", width = 15)
79
-    @ApiModelProperty(value = "描述")
80
-    private String described;
81
-    /**
82
-     * 人工工时
83
-     */
84
-    @Excel(name = "人工工时", width = 15)
85
-    @ApiModelProperty(value = "人工工时")
86
-    private BigDecimal laborHours;
87
-    /**
88
-     * 设备工时
89
-     */
90
-    @Excel(name = "设备工时", width = 15)
91
-    @ApiModelProperty(value = "设备工时")
92
-    private BigDecimal deviceHours;
93
-    /**
94
-     * 工作中心
95
-     */
96
-    @Excel(name = "工作中心", width = 15)
97
-    @ApiModelProperty(value = "工作中心")
98
-    private String workCenter;
99
-    /**
100
-     * 创建人
101
-     */
102
-    @ApiModelProperty(value = "创建人")
103
-    private String createBy;
104
-    /**
105
-     * 创建时间
106
-     */
107
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
108
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
109
-    @ApiModelProperty(value = "创建时间")
110
-    private Date createTime;
111
-    /**
112
-     * 修改人
113
-     */
114
-    @ApiModelProperty(value = "修改人")
115
-    private String updateBy;
116
-    /**
117
-     * 修改时间
118
-     */
119
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
120
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
121
-    @ApiModelProperty(value = "修改时间")
122
-    private Date updateTime;
123
-    /**
124
-     * 备注
125
-     */
126
-    @Excel(name = "备注", width = 15)
127
-    @ApiModelProperty(value = "备注")
128
-    private String remark;
129
-}

+ 58
- 45
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java Parādīt failu

@@ -1,75 +1,88 @@
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;
18
-import lombok.EqualsAndHashCode;
9
+import lombok.*;
19 10
 import lombok.experimental.Accessors;
11
+import org.jeecgframework.poi.excel.annotation.Excel;
12
+import org.springframework.format.annotation.DateTimeFormat;
13
+
14
+import java.io.Serializable;
15
+import java.util.Date;
20 16
 
21 17
 /**
22 18
  * @Description: app_scene_cost_model
23 19
  * @Author: jeecg-boot
24
- * @Date:   2024-07-29
20
+ * @Date: 2024-09-09
25 21
  * @Version: V1.0
26 22
  */
27 23
 @Data
24
+@Builder
25
+@AllArgsConstructor
26
+@NoArgsConstructor
28 27
 @TableName("app_scene_cost_model")
29 28
 @Accessors(chain = true)
30 29
 @EqualsAndHashCode(callSuper = false)
31
-@ApiModel(value="app_scene_cost_model对象", description="app_scene_cost_model")
30
+@ApiModel(value = "app_scene_cost_model对象", description = "app_scene_cost_model")
32 31
 public class AppSceneCostModel implements Serializable {
33 32
     private static final long serialVersionUID = 1L;
34 33
 
35
-	/**主键*/
36
-	@TableId(type = IdType.ASSIGN_ID)
34
+    /**
35
+     * 主键
36
+     */
37
+    @TableId(type = IdType.ASSIGN_ID)
37 38
     @ApiModelProperty(value = "主键")
38 39
     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")
40
+    /**
41
+     * 模型名称
42
+     */
43
+    @Excel(name = "模型名称", width = 15)
44
+    @ApiModelProperty(value = "模型名称")
45
+    private String modelName;
46
+    /**
47
+     * 模型类型(标准成本、成本挖掘)
48
+     */
49
+    @Excel(name = "模型类型(标准成本、成本挖掘)", width = 15)
50
+    @ApiModelProperty(value = "模型类型(标准成本、成本挖掘)")
51
+    private String modelType;
52
+    /**
53
+     * 模型定义id
54
+     */
55
+    @Excel(name = "模型定义id", width = 15)
56
+    @ApiModelProperty(value = "模型定义id")
50 57
     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")
58
+    /**
59
+     * 状态(草稿、已发布、已作废)
60
+     */
61
+    @Excel(name = "状态(草稿、已发布、已作废)", width = 15)
62
+    @ApiModelProperty(value = "状态(草稿、已发布、已作废)")
63
+    private String status;
64
+    /**
65
+     * 创建时间
66
+     */
67
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
68
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
65 69
     @ApiModelProperty(value = "创建时间")
66 70
     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")
71
+    /**
72
+     * 创建人
73
+     */
74
+    @ApiModelProperty(value = "创建人")
75
+    private String createBy;
76
+    /**
77
+     * 更新时间
78
+     */
79
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
80
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
73 81
     @ApiModelProperty(value = "更新时间")
74 82
     private Date updateTime;
83
+    /**
84
+     * 更新人
85
+     */
86
+    @ApiModelProperty(value = "更新人")
87
+    private String updateBy;
75 88
 }

+ 2
- 2
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java Parādīt failu

@@ -99,11 +99,11 @@ public class AppSceneCostProductProcessMaintenance implements Serializable {
99 99
 	/**reserve1*/
100 100
 	@Excel(name = "reserve1", width = 15)
101 101
     @ApiModelProperty(value = "reserve1")
102
-    private String reserve1;
102
+    private String reserveOne;
103 103
 	/**reserve2*/
104 104
 	@Excel(name = "reserve2", width = 15)
105 105
     @ApiModelProperty(value = "reserve2")
106
-    private BigDecimal reserve2;
106
+    private BigDecimal reserveTwo;
107 107
 	/**jobCode*/
108 108
 	@Excel(name = "jobCode", width = 15)
109 109
     @ApiModelProperty(value = "jobCode")

+ 0
- 173
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java Parādīt failu

@@ -1,173 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.entity;
2
-
3
-import com.baomidou.mybatisplus.annotation.IdType;
4
-import com.baomidou.mybatisplus.annotation.TableId;
5
-import com.baomidou.mybatisplus.annotation.TableName;
6
-import com.fasterxml.jackson.annotation.JsonFormat;
7
-import io.swagger.annotations.ApiModel;
8
-import io.swagger.annotations.ApiModelProperty;
9
-import lombok.Data;
10
-import lombok.EqualsAndHashCode;
11
-import lombok.experimental.Accessors;
12
-import org.jeecgframework.poi.excel.annotation.Excel;
13
-import org.springframework.format.annotation.DateTimeFormat;
14
-
15
-import java.io.Serializable;
16
-import java.math.BigDecimal;
17
-import java.util.Date;
18
-
19
-/**
20
- * @Description: app_scene_cost_purchase_price
21
- * @Author: jeecg-boot
22
- * @Date: 2024-08-02
23
- * @Version: V1.0
24
- */
25
-@Data
26
-@TableName("app_scene_cost_purchase_price")
27
-@Accessors(chain = true)
28
-@EqualsAndHashCode(callSuper = false)
29
-@ApiModel(value = "app_scene_cost_purchase_price对象", description = "app_scene_cost_purchase_price")
30
-public class AppSceneCostPurchasePrice implements Serializable {
31
-    private static final long serialVersionUID = 1L;
32
-
33
-    /**
34
-     * 主键
35
-     */
36
-    @TableId(type = IdType.ASSIGN_ID)
37
-    @ApiModelProperty(value = "主键")
38
-    private String id;
39
-    /**
40
-     * 物料编码
41
-     */
42
-    @Excel(name = "物料编码", width = 15)
43
-    @ApiModelProperty(value = "物料编码")
44
-    private String materialCode;
45
-    /**
46
-     * 物料名称
47
-     */
48
-    @Excel(name = "物料名称", width = 15)
49
-    @ApiModelProperty(value = "物料名称")
50
-    private String materialName;
51
-    /**
52
-     * 规格型号
53
-     */
54
-    @Excel(name = "规格型号", width = 15)
55
-    @ApiModelProperty(value = "规格型号")
56
-    private String specification;
57
-    /**
58
-     * 采购类型
59
-     */
60
-    @Excel(name = "采购类型", width = 15)
61
-    @ApiModelProperty(value = "采购类型")
62
-    private String purchaseType;
63
-    /**
64
-     * 供应商代码
65
-     */
66
-    @Excel(name = "供应商代码", width = 15)
67
-    @ApiModelProperty(value = "供应商代码")
68
-    private String supplierCode;
69
-    /**
70
-     * 供应商名称
71
-     */
72
-    @Excel(name = "供应商名称", width = 15)
73
-    @ApiModelProperty(value = "供应商名称")
74
-    private String supplierName;
75
-    /**
76
-     * 采购价时间
77
-     */
78
-    @Excel(name = "采购价时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
79
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
80
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
81
-    @ApiModelProperty(value = "采购价时间")
82
-    private Date purchasePriceTime;
83
-    /**
84
-     * 采购价合计
85
-     */
86
-    @Excel(name = "采购价合计", width = 15)
87
-    @ApiModelProperty(value = "采购价合计")
88
-    private BigDecimal purchasePriceSum;
89
-    /**
90
-     * 最低采购单价
91
-     */
92
-    @Excel(name = "最低采购单价", width = 15)
93
-    @ApiModelProperty(value = "最低采购单价")
94
-    private BigDecimal minPurchasePrice;
95
-    /**
96
-     * 最新采购单价
97
-     */
98
-    @Excel(name = "最新采购单价", width = 15)
99
-    @ApiModelProperty(value = "最新采购单价")
100
-    private BigDecimal lastPurchasePrice;
101
-    /**
102
-     * 平均采购价
103
-     */
104
-    @Excel(name = "平均采购价", width = 15)
105
-    @ApiModelProperty(value = "平均采购价")
106
-    private BigDecimal purchasePriceAvg;
107
-    /**
108
-     * 直接材料费
109
-     */
110
-    @Excel(name = "直接材料费", width = 15)
111
-    @ApiModelProperty(value = "直接材料费")
112
-    private BigDecimal directMaterialCost;
113
-    /**
114
-     * 工艺加工费用
115
-     */
116
-    @Excel(name = "工艺加工费用", width = 15)
117
-    @ApiModelProperty(value = "工艺加工费用")
118
-    private BigDecimal processCost;
119
-    /**
120
-     * 运输费用
121
-     */
122
-    @Excel(name = "运输费用", width = 15)
123
-    @ApiModelProperty(value = "运输费用")
124
-    private BigDecimal transportCost;
125
-    /**
126
-     * 模具费用
127
-     */
128
-    @Excel(name = "模具费用", width = 15)
129
-    @ApiModelProperty(value = "模具费用")
130
-    private BigDecimal mouldCost;
131
-    /**
132
-     * 其他费用
133
-     */
134
-    @Excel(name = "其他费用", width = 15)
135
-    @ApiModelProperty(value = "其他费用")
136
-    private BigDecimal ortherCost;
137
-    /**
138
-     * 税率
139
-     */
140
-    @Excel(name = "税率", width = 15)
141
-    @ApiModelProperty(value = "税率")
142
-    private BigDecimal taxTate;
143
-    /**
144
-     * 创建人
145
-     */
146
-    @ApiModelProperty(value = "创建人")
147
-    private String createBy;
148
-    /**
149
-     * 创建时间
150
-     */
151
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
152
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
153
-    @ApiModelProperty(value = "创建时间")
154
-    private Date createTime;
155
-    /**
156
-     * 修改人
157
-     */
158
-    @ApiModelProperty(value = "修改人")
159
-    private String updateBy;
160
-    /**
161
-     * 修改时间
162
-     */
163
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
164
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
165
-    @ApiModelProperty(value = "修改时间")
166
-    private Date updateTime;
167
-    /**
168
-     * 备注
169
-     */
170
-    @Excel(name = "备注", width = 15)
171
-    @ApiModelProperty(value = "备注")
172
-    private String remark;
173
-}

+ 2
- 2
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java Parādīt failu

@@ -61,7 +61,7 @@ public class AppSceneCostResultValue implements Serializable {
61 61
      */
62 62
     @Excel(name = "数量", width = 15)
63 63
     @ApiModelProperty(value = "数量")
64
-    private Integer num;
64
+    private BigDecimal num;
65 65
     /**
66 66
      * 单位
67 67
      */
@@ -85,7 +85,7 @@ public class AppSceneCostResultValue implements Serializable {
85 85
      */
86 86
     @Excel(name = "流程id", width = 15)
87 87
     @ApiModelProperty(value = "流程id")
88
-    private String flowInstanceId;
88
+    private Integer flowInstanceId;
89 89
     /**
90 90
      * 本阶成本
91 91
      */

+ 97
- 35
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java Parādīt failu

@@ -32,127 +32,189 @@ import java.util.Date;
32 32
 public class AppSceneCostStandardDetail implements Serializable {
33 33
     private static final long serialVersionUID = 1L;
34 34
 
35
-    /**id*/
35
+    /**
36
+     * id
37
+     */
36 38
     @TableId(type = IdType.ASSIGN_ID)
37 39
     @ApiModelProperty(value = "id")
38 40
     private String id;
39
-    /**图号*/
41
+    /**
42
+     * 图号
43
+     */
40 44
     @Excel(name = "图号", width = 15)
41 45
     @ApiModelProperty(value = "图号")
42 46
     private String figureNumber;
43
-    /**物料号,关联kn_new_sap_mara表matnr字段*/
47
+    /**
48
+     * 物料号,关联kn_new_sap_mara表matnr字段
49
+     */
44 50
     @Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15)
45 51
     @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段")
46 52
     private String materialNumber;
47
-    /**物料名称*/
53
+    /**
54
+     * 物料名称
55
+     */
48 56
     @Excel(name = "物料名称", width = 15)
49 57
     @ApiModelProperty(value = "物料名称")
50 58
     private String materialName;
51
-    /**父类物料号*/
59
+    /**
60
+     * 父类物料号
61
+     */
52 62
     @Excel(name = "父类物料号", width = 15)
53 63
     @ApiModelProperty(value = "父类物料号")
54 64
     private String parentMaterialNumber;
55
-    /**版本号*/
65
+    /**
66
+     * 版本号
67
+     */
56 68
     @Excel(name = "版本号", width = 15)
57 69
     @ApiModelProperty(value = "版本号")
58 70
     private String versionNumber;
59
-    /**层级*/
71
+    /**
72
+     * 层级
73
+     */
60 74
     @Excel(name = "层级", width = 15)
61 75
     @ApiModelProperty(value = "层级")
62 76
     private Integer level;
63
-    /**序号*/
77
+    /**
78
+     * 序号
79
+     */
64 80
     @Excel(name = "序号", width = 15)
65 81
     @ApiModelProperty(value = "序号")
66 82
     private Integer sort;
67
-    /**用量*/
83
+    /**
84
+     * 用量
85
+     */
68 86
     @Excel(name = "用量", width = 15)
69 87
     @ApiModelProperty(value = "用量")
70 88
     private Double dosage;
71
-    /**单位*/
89
+    /**
90
+     * 单位
91
+     */
72 92
     @Excel(name = "单位", width = 15)
73 93
     @ApiModelProperty(value = "单位")
74 94
     private String unit;
75
-    /**本阶材料费*/
95
+    /**
96
+     * 本阶材料费
97
+     */
76 98
     @Excel(name = "本阶材料费", width = 15)
77 99
     @ApiModelProperty(value = "本阶材料费")
78 100
     private BigDecimal materialCost;
79
-    /**本阶人工费*/
101
+    /**
102
+     * 本阶人工费
103
+     */
80 104
     @Excel(name = "本阶人工陈本", width = 15)
81 105
     @ApiModelProperty(value = "本阶人工成本")
82 106
     private BigDecimal laborCost;
83
-    /**本阶辅料费*/
107
+    /**
108
+     * 本阶辅料费
109
+     */
84 110
     @Excel(name = "本阶辅料费", width = 15)
85 111
     @ApiModelProperty(value = "本阶辅料费")
86 112
     private BigDecimal supplyMaterialCost;
87
-    /**本阶机器折旧费*/
113
+    /**
114
+     * 本阶机器折旧费
115
+     */
88 116
     @Excel(name = "本阶机器折旧费", width = 15)
89 117
     @ApiModelProperty(value = "本阶机器折旧费")
90 118
     private BigDecimal equipmentCost;
91
-    /**本阶水电费(燃动费)*/
119
+    /**
120
+     * 本阶水电费(燃动费)
121
+     */
92 122
     @Excel(name = "本阶水电费(燃动费)", width = 15)
93 123
     @ApiModelProperty(value = "本阶水电费(燃动费)")
94 124
     private BigDecimal driveCost;
95
-    /**本阶其他制造费*/
125
+    /**
126
+     * 本阶其他制造费
127
+     */
96 128
     @Excel(name = "本阶其他费用", width = 15)
97 129
     @ApiModelProperty(value = "本阶其他费用")
98 130
     private BigDecimal otherCost;
99
-    /**本阶物流费*/
131
+    /**
132
+     * 本阶物流费
133
+     */
100 134
     @Excel(name = "本阶物流费", width = 15)
101 135
     @ApiModelProperty(value = "本阶物流费")
102 136
     private BigDecimal logisticsCost;
103
-    /**累计物料成本*/
137
+    /**
138
+     * 累计物料成本
139
+     */
104 140
     @Excel(name = "累计物料成本", width = 15)
105 141
     @ApiModelProperty(value = "累计物料成本")
106 142
     private BigDecimal totalMaterialCost;
107
-    /**累计人工成本*/
143
+    /**
144
+     * 累计人工成本
145
+     */
108 146
     @Excel(name = "累计人工成本", width = 15)
109 147
     @ApiModelProperty(value = "累计人工成本")
110 148
     private BigDecimal totalLaborCost;
111
-    /**累计辅料费*/
149
+    /**
150
+     * 累计辅料费
151
+     */
112 152
     @Excel(name = "累计辅料费", width = 15)
113 153
     @ApiModelProperty(value = "累计辅料费")
114 154
     private BigDecimal totalSupplyMaterialCost;
115
-    /**累计机器折旧费*/
155
+    /**
156
+     * 累计机器折旧费
157
+     */
116 158
     @Excel(name = "累计机器折旧费", width = 15)
117 159
     @ApiModelProperty(value = "累计机器折旧费")
118 160
     private BigDecimal totalEquipmentCost;
119
-    /**累计水电费(燃动费)*/
161
+    /**
162
+     * 累计水电费(燃动费)
163
+     */
120 164
     @Excel(name = "累计水电费(燃动费)", width = 15)
121 165
     @ApiModelProperty(value = "累计水电费(燃动费)")
122 166
     private BigDecimal totalDriveCost;
123
-    /**累计其他费用*/
167
+    /**
168
+     * 累计其他费用
169
+     */
124 170
     @Excel(name = "累计其他费用", width = 15)
125 171
     @ApiModelProperty(value = "累计其他费用")
126 172
     private BigDecimal totalOtherCost;
127
-    /**累计物流费用*/
173
+    /**
174
+     * 累计物流费用
175
+     */
128 176
     @Excel(name = "累计物流费用", width = 15)
129 177
     @ApiModelProperty(value = "累计物流费用")
130 178
     private BigDecimal totalLogisticsCost;
131
-    /**本阶标准成本*/
179
+    /**
180
+     * 本阶标准成本
181
+     */
132 182
     @Excel(name = "本阶标准成本", width = 15)
133 183
     @ApiModelProperty(value = "本阶标准成本")
134 184
     private BigDecimal currentStandardCost;
135
-    /**累计标准成本*/
185
+    /**
186
+     * 累计标准成本
187
+     */
136 188
     @Excel(name = "累计标准成本", width = 15)
137 189
     @ApiModelProperty(value = "累计标准成本")
138 190
     private BigDecimal totalStandardCost;
139
-    /**创建人*/
191
+    /**
192
+     * 创建人
193
+     */
140 194
     @ApiModelProperty(value = "创建人")
141 195
     private String createBy;
142
-    /**创建日期*/
143
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
144
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
196
+    /**
197
+     * 创建日期
198
+     */
199
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
200
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
145 201
     @ApiModelProperty(value = "创建日期")
146 202
     private Date createTime;
147
-    /**修改人*/
203
+    /**
204
+     * 修改人
205
+     */
148 206
     @ApiModelProperty(value = "修改人")
149 207
     private String updateBy;
150
-    /**修改日期*/
151
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
152
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
208
+    /**
209
+     * 修改日期
210
+     */
211
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
212
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
153 213
     @ApiModelProperty(value = "修改日期")
154 214
     private Date updateTime;
155
-    /**备注*/
215
+    /**
216
+     * 备注
217
+     */
156 218
     @Excel(name = "备注", width = 15)
157 219
     @ApiModelProperty(value = "备注")
158 220
     private String remark;

+ 365
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardResult.java Parādīt failu

@@ -0,0 +1,365 @@
1
+package com.zzsmart.qomo.kn.cost.manage.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import com.fasterxml.jackson.annotation.JsonFormat;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Builder;
10
+import lombok.Data;
11
+import lombok.EqualsAndHashCode;
12
+import lombok.experimental.Accessors;
13
+import org.springframework.format.annotation.DateTimeFormat;
14
+
15
+import javax.persistence.Column;
16
+import java.io.Serializable;
17
+import java.math.BigDecimal;
18
+import java.util.Date;
19
+
20
+
21
+@Data
22
+@Builder
23
+@TableName("app_scene_cost_standard_result")
24
+@Accessors(chain = true)
25
+@EqualsAndHashCode(callSuper = false)
26
+@ApiModel(value = "标准成本单行", description = "标准成本单行")
27
+public class AppSceneCostStandardResult implements Serializable {
28
+
29
+    private static final long serialVersionUID = 1L;
30
+
31
+
32
+    /**
33
+     * 主键
34
+     */
35
+    @TableId(type = IdType.AUTO)
36
+    @ApiModelProperty(value = "id")
37
+    private Integer id;
38
+
39
+    /**
40
+     * 工厂
41
+     */
42
+    @Column(name = "factory")
43
+    private String factory;
44
+
45
+    /**
46
+     * 物料号
47
+     */
48
+    @Column(name = "material_number")
49
+    private String materialNumber;
50
+
51
+    /**
52
+     * 父物料号
53
+     */
54
+    @Column(name = "parent_matnr")
55
+    private String parentMatnr;
56
+
57
+    /**
58
+     * 阶段
59
+     */
60
+    @Column(name = "stage")
61
+    private String stage;
62
+
63
+    /**
64
+     * 版本号
65
+     */
66
+    @Column(name = "version_number")
67
+    private String versionNumber;
68
+
69
+    /**
70
+     * 层级
71
+     */
72
+    @Column(name = "layer")
73
+    private String layer;
74
+
75
+    /**
76
+     * 价格类型
77
+     */
78
+    @Column(name = "pricetype")
79
+    private String pricetype;
80
+
81
+    /**
82
+     * 会计期间
83
+     */
84
+    @Column(name = "ymonth")
85
+    private String ymonth;
86
+
87
+    /**
88
+     * 本阶标准成本
89
+     */
90
+    @Column(name = "total_standard_cost_inter")
91
+    private BigDecimal totalStandardCostInter;
92
+
93
+    /**
94
+     * 累计标准成本
95
+     */
96
+    @Column(name = "total_standard_cost")
97
+    private BigDecimal totalStandardCost;
98
+
99
+    /**
100
+     * material_cost_stage_inter
101
+     */
102
+    @Column(name = "material_cost_stage_inter")
103
+    private BigDecimal materialCostStageInter;
104
+
105
+    /**
106
+     * 本阶物料成本
107
+     */
108
+    @Column(name = "material_cost_stage")
109
+    private BigDecimal materialCostStage;
110
+
111
+    /**
112
+     * 本阶人工成本
113
+     */
114
+    @Column(name = "labor_cost_stage")
115
+    private BigDecimal laborCostStage;
116
+
117
+    /**
118
+     * 本阶设备费
119
+     */
120
+    @Column(name = "equip_cost_stage")
121
+    private BigDecimal equipCostStage;
122
+
123
+    /**
124
+     * 本阶燃动费
125
+     */
126
+    @Column(name = "burning_cost_stage")
127
+    private BigDecimal burningCostStage;
128
+
129
+    /**
130
+     * 本阶辅料费
131
+     */
132
+    @Column(name = "auxiliary_cost_stage")
133
+    private BigDecimal auxiliaryCostStage;
134
+
135
+    /**
136
+     * 本阶其他费
137
+     */
138
+    @Column(name = "other_cost_stage")
139
+    private BigDecimal otherCostStage;
140
+
141
+    /**
142
+     * 本阶物流费
143
+     */
144
+    @Column(name = "stage_logistics_cost")
145
+    private BigDecimal stageLogisticsCost;
146
+
147
+    /**
148
+     * material_cost_accumulated_inter
149
+     */
150
+    @Column(name = "material_cost_accumulated_inter")
151
+    private BigDecimal materialCostAccumulatedInter;
152
+
153
+    /**
154
+     * 累计物料
155
+     */
156
+    @Column(name = "material_cost_accumulated")
157
+    private BigDecimal materialCostAccumulated;
158
+
159
+    /**
160
+     * 累计人工成本
161
+     */
162
+    @Column(name = "labor_cost_accumulated")
163
+    private BigDecimal laborCostAccumulated;
164
+
165
+    /**
166
+     * 累计设备费
167
+     */
168
+    @Column(name = "equip_cost_accumulated")
169
+    private BigDecimal equipCostAccumulated;
170
+
171
+    /**
172
+     * 累计燃动费
173
+     */
174
+    @Column(name = "burning_cost_accumulated")
175
+    private BigDecimal burningCostAccumulated;
176
+
177
+    /**
178
+     * 累计辅料费
179
+     */
180
+    @Column(name = "auxiliary_cost_accumulated")
181
+    private BigDecimal auxiliaryCostAccumulated;
182
+
183
+    /**
184
+     * 累计其他费
185
+     */
186
+    @Column(name = "other_cost_accumulated")
187
+    private BigDecimal otherCostAccumulated;
188
+
189
+    /**
190
+     * 累计物流费
191
+     */
192
+    @Column(name = "total_logistics_cost")
193
+    private BigDecimal totalLogisticsCost;
194
+
195
+    /**
196
+     * material_cost_total_inter
197
+     */
198
+    @Column(name = "material_cost_total_inter")
199
+    private BigDecimal materialCostTotalInter;
200
+
201
+    /**
202
+     * material_cost_total
203
+     */
204
+    @Column(name = "material_cost_total")
205
+    private BigDecimal materialCostTotal;
206
+
207
+    /**
208
+     * labor_cost_total
209
+     */
210
+    @Column(name = "labor_cost_total")
211
+    private BigDecimal laborCostTotal;
212
+
213
+    /**
214
+     * equip_cost_total
215
+     */
216
+    @Column(name = "equip_cost_total")
217
+    private BigDecimal equipCostTotal;
218
+
219
+    /**
220
+     * burning_cost_total
221
+     */
222
+    @Column(name = "burning_cost_total")
223
+    private BigDecimal burningCostTotal;
224
+
225
+    /**
226
+     * auxiliary_cost_total
227
+     */
228
+    @Column(name = "auxiliary_cost_total")
229
+    private BigDecimal auxiliaryCostTotal;
230
+
231
+    /**
232
+     * other_cost_total
233
+     */
234
+    @Column(name = "other_cost_total")
235
+    private BigDecimal otherCostTotal;
236
+
237
+    /**
238
+     * low_order_code
239
+     */
240
+    @Column(name = "low_order_code")
241
+    private String lowOrderCode;
242
+
243
+    /**
244
+     * relative_dosage
245
+     */
246
+    @Column(name = "relative_dosage")
247
+    private BigDecimal relativeDosage;
248
+
249
+    /**
250
+     * material_cost_relative
251
+     */
252
+    @Column(name = "material_cost_relative")
253
+    private BigDecimal materialCostRelative;
254
+
255
+    /**
256
+     * material_cost_relative_inter
257
+     */
258
+    @Column(name = "material_cost_relative_inter")
259
+    private BigDecimal materialCostRelativeInter;
260
+
261
+    /**
262
+     * labor_cost_relative
263
+     */
264
+    @Column(name = "labor_cost_relative")
265
+    private BigDecimal laborCostRelative;
266
+
267
+    /**
268
+     * manufacture_cost_relative
269
+     */
270
+    @Column(name = "manufacture_cost_relative")
271
+    private BigDecimal manufactureCostRelative;
272
+
273
+    /**
274
+     * total_cost_relative
275
+     */
276
+    @Column(name = "total_cost_relative")
277
+    private BigDecimal totalCostRelative;
278
+
279
+    /**
280
+     * total_cost_relative_inter
281
+     */
282
+    @Column(name = "total_cost_relative_inter")
283
+    private BigDecimal totalCostRelativeInter;
284
+
285
+    /**
286
+     * material_cost_stage_material
287
+     */
288
+    @Column(name = "material_cost_stage_material")
289
+    private BigDecimal materialCostStageMaterial;
290
+
291
+    /**
292
+     * material_cost_stage_edcu
293
+     */
294
+    @Column(name = "material_cost_stage_edcu")
295
+    private BigDecimal materialCostStageEdcu;
296
+
297
+    /**
298
+     * material_cost_stage_em
299
+     */
300
+    @Column(name = "material_cost_stage_em")
301
+    private BigDecimal materialCostStageEm;
302
+
303
+    /**
304
+     * material_cost_stage_inter_material
305
+     */
306
+    @Column(name = "material_cost_stage_inter_material")
307
+    private BigDecimal materialCostStageInterMaterial;
308
+
309
+    /**
310
+     * material_cost_stage_inter_edcu
311
+     */
312
+    @Column(name = "material_cost_stage_inter_edcu")
313
+    private BigDecimal materialCostStageInterEdcu;
314
+
315
+    /**
316
+     * material_cost_stage_inter_em
317
+     */
318
+    @Column(name = "material_cost_stage_inter_em")
319
+    private BigDecimal materialCostStageInterEm;
320
+
321
+    /**
322
+     * material_cost_accumulated_material
323
+     */
324
+    @Column(name = "material_cost_accumulated_material")
325
+    private BigDecimal materialCostAccumulatedMaterial;
326
+
327
+    /**
328
+     * material_cost_accumulated_edcu
329
+     */
330
+    @Column(name = "material_cost_accumulated_edcu")
331
+    private BigDecimal materialCostAccumulatedEdcu;
332
+
333
+    /**
334
+     * material_cost_accumulated_em
335
+     */
336
+    @Column(name = "material_cost_accumulated_em")
337
+    private BigDecimal materialCostAccumulatedEm;
338
+
339
+    /**
340
+     * material_cost_accumulated_inter_material
341
+     */
342
+    @Column(name = "material_cost_accumulated_inter_material")
343
+    private BigDecimal materialCostAccumulatedInterMaterial;
344
+
345
+    /**
346
+     * material_cost_accumulated_inter_edcu
347
+     */
348
+    @Column(name = "material_cost_accumulated_inter_edcu")
349
+    private BigDecimal materialCostAccumulatedInterEdcu;
350
+
351
+    /**
352
+     * material_cost_accumulated_inter_em
353
+     */
354
+    @Column(name = "material_cost_accumulated_inter_em")
355
+    private BigDecimal materialCostAccumulatedInterEm;
356
+
357
+    /**
358
+     * 创建时间
359
+     */
360
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
361
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
362
+    @ApiModelProperty(value = "修改日期")
363
+    private Date createdTime;
364
+
365
+}

+ 65
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java Parādīt failu

@@ -0,0 +1,65 @@
1
+package com.zzsmart.qomo.kn.cost.manage.enums;
2
+
3
+/**
4
+ * 预测模型状态枚举
5
+ */
6
+public enum CostModelStatusEnum {
7
+    /**
8
+     * 草稿
9
+     */
10
+    Draft("Draft", "草稿"),
11
+    /**
12
+     * 已删除
13
+     */
14
+    Delete("Deleted", "已删除"),
15
+    /**
16
+     * 已发布
17
+     */
18
+    Published("Published", "已发布");
19
+
20
+    private final String code;
21
+    private final String name;
22
+
23
+    CostModelStatusEnum(String code, String name) {
24
+        this.code = code;
25
+        this.name = name;
26
+    }
27
+
28
+    public String getCode() {
29
+        return code;
30
+    }
31
+
32
+    public String getName() {
33
+        return name;
34
+    }
35
+
36
+    /**
37
+     * 根据code获取text
38
+     *
39
+     * @param codeNo
40
+     * @return
41
+     */
42
+    public static String getTextByCode(String codeNo) {
43
+        for (CostModelStatusEnum value : CostModelStatusEnum.values()) {
44
+            if (value.getCode().equals(codeNo)) {
45
+                return value.name();
46
+            }
47
+        }
48
+        return codeNo.toString();
49
+    }
50
+
51
+    /**
52
+     * 根据text获取code
53
+     *
54
+     * @param name
55
+     * @return
56
+     */
57
+    public static String getCodeByName(String name) {
58
+        for (CostModelStatusEnum value : CostModelStatusEnum.values()) {
59
+            if (value.name().equals(name)) {
60
+                return value.name();
61
+            }
62
+        }
63
+        return name;
64
+    }
65
+}

+ 25
- 4
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java Parādīt failu

@@ -1,17 +1,38 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.mapper;
2 2
 
3
-import java.util.List;
4
-
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
6 6
 import org.apache.ibatis.annotations.Param;
7
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
7
+import org.apache.ibatis.annotations.Select;
8
+
9
+import java.util.List;
8 10
 
9 11
 /**
10 12
  * @Description: app_scene_cost_bom_relevancy
11 13
  * @Author: jeecg-boot
12
- * @Date:   2024-09-08
14
+ * @Date: 2024-09-08
13 15
  * @Version: V1.0
14 16
  */
15 17
 public interface AppSceneCostBomRelevancyMapper extends BaseMapper<AppSceneCostBomRelevancy> {
18
+    @Select("WITH RECURSIVE BOM_Tree AS (\n" +
19
+            "    SELECT  matnr, idnrk, meins, 0 AS depth\n" +
20
+                    "    FROM app_scene_cost_bom_relevancy\n" +
21
+                    "    WHERE matnr = #{parentId}\n" +
22
+                    "    UNION ALL\n" +
23
+                    "    SELECT b.matnr, b.idnrk, b.meins, BOM_Tree.depth + 1\n" +
24
+                    "    FROM app_scene_cost_bom_relevancy b\n" +
25
+                    "    JOIN BOM_Tree ON b.matnr = BOM_Tree.idnrk\n" +
26
+                    ")\n" +
27
+                    "SELECT matnr, idnrk, meins, depth FROM BOM_Tree")
28
+    List<AppSceneCostBomRelevancy> findChildrenByParentId(String parentId);
29
+
30
+
31
+    @Select("${selectSql}")
32
+    JSONObject customSelectOne(@Param("selectSql") String selectSql);
33
+
34
+    @Select("${SelectBlobModel}")
35
+    String customSelectBlobModelJson(@Param("SelectBlobModel") String SelectBlobModel);
36
+
16 37
 
17 38
 }

+ 3
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java Parādīt failu

@@ -1,7 +1,10 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.mapper;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.Select;
5 8
 
6 9
 /**
7 10
  * @Description: app_scene_cost_hour_rate

+ 0
- 34
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java Parādīt failu

@@ -1,34 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.mapper;
2
-
3
-import com.alibaba.fastjson.JSONObject;
4
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
-import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom;
6
-import org.apache.ibatis.annotations.Param;
7
-import org.apache.ibatis.annotations.Select;
8
-
9
-import java.util.List;
10
-
11
-/**
12
- * @Description: app_scene_cost_material_bom
13
- * @Author: jeecg-boot
14
- * @Date: 2024-08-02
15
- * @Version: V1.0
16
- */
17
-public interface AppSceneCostMaterialBomMapper extends BaseMapper<AppSceneCostMaterialBom> {
18
-    /**
19
-     * 根据动态SQL语句查询物料BOM表
20
-     *
21
-     * @param selectCommand
22
-     * @return
23
-     */
24
-    @Select("${selectCommand}")
25
-    List<AppSceneCostMaterialBom> customSelect(@Param("selectCommand") String selectCommand);
26
-
27
-
28
-    @Select("${selectSql}")
29
-    JSONObject customSelectOne(@Param("selectSql") String selectSql);
30
-
31
-    @Select("${SelectBlobModel}")
32
-    String customSelectBlobModelJson(@Param("SelectBlobModel") String SelectBlobModel);
33
-
34
-}

+ 0
- 14
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java Parādīt failu

@@ -1,14 +0,0 @@
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.AppSceneCostMaterialProcessHours;
5
-
6
-/**
7
- * @Description: app_scene_cost_material_process_hours
8
- * @Author: jeecg-boot
9
- * @Date: 2024-08-02
10
- * @Version: V1.0
11
- */
12
-public interface AppSceneCostMaterialProcessHoursMapper extends BaseMapper<AppSceneCostMaterialProcessHours> {
13
-
14
-}

+ 0
- 14
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java Parādīt failu

@@ -1,14 +0,0 @@
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.AppSceneCostPurchasePrice;
5
-
6
-/**
7
- * @Description: app_scene_cost_purchase_price
8
- * @Author: jeecg-boot
9
- * @Date: 2024-08-02
10
- * @Version: V1.0
11
- */
12
-public interface AppSceneCostPurchasePriceMapper extends BaseMapper<AppSceneCostPurchasePrice> {
13
-
14
-}

+ 15
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardResultMapper.java Parādīt failu

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

+ 1
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml Parādīt failu

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 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.modules.demo.com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper">
3
+<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper">
4 4
 
5 5
 </mapper>

+ 0
- 5
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml Parādīt failu

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

+ 0
- 5
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml Parādīt failu

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

qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchasePriceMapper.xml → qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardResultMapper.xml Parādīt failu

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 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.AppSceneCostPurchasePriceMapper">
3
+<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardResultMapper">
4 4
 
5 5
 </mapper>

+ 409
- 340
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java Parādīt failu

@@ -6,7 +6,7 @@ import com.zzsmart.qomo.kn.cost.manage.entity.*;
6 6
 import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum;
7 7
 import com.zzsmart.qomo.kn.cost.manage.enums.HourOrRateTypeEnum;
8 8
 import com.zzsmart.qomo.kn.cost.manage.enums.TotalCostEnum;
9
-import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialBomMapper;
9
+import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper;
10 10
 import com.zzsmart.qomo.kn.cost.manage.service.*;
11 11
 import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO;
12 12
 import com.zzsmart.qomo.kn.cost.manage.vo.TotalResultValue;
@@ -32,9 +32,9 @@ public class StandardCostService {
32 32
      * 物料BOM信息
33 33
      */
34 34
     @Autowired
35
-    AppSceneCostMaterialBomMapper costMaterialBomMapper;
35
+    AppSceneCostBomRelevancyMapper appSceneCostBomRelevancyMapper;
36 36
     @Autowired
37
-    IAppSceneCostMaterialBomService costMaterialBomService;
37
+    IAppSceneCostBomRelevancyService costMaterialBomService;
38 38
 
39 39
     /**
40 40
      * 小时费率
@@ -45,12 +45,12 @@ public class StandardCostService {
45 45
      * 采购单价
46 46
      */
47 47
     @Autowired
48
-    IAppSceneCostPurchasePriceService costPurchasePriceService;
48
+    IAppSceneCostPurchaseRecordService costPurchaseRecordService;
49 49
     /**
50 50
      * 工序
51 51
      */
52 52
     @Autowired
53
-    IAppSceneCostMaterialProcessHoursService costMaterialProcessHoursService;
53
+    IAppSceneCostProductProcessMaintenanceService costMaterialProcessHoursService;
54 54
     /**
55 55
      * 标准成本计算结果
56 56
      */
@@ -69,19 +69,19 @@ public class StandardCostService {
69 69
      * 标准成本明细服务(单行查询服务)
70 70
      */
71 71
     @Autowired
72
-    private IAppSceneCostStandardDetailService iAppSceneCostStandardDetailService;
72
+    private IAppSceneCostStandardResultService iAppSceneCostStandardResultService;
73 73
 
74 74
     @PostConstruct
75 75
     public void init() {
76 76
         standardCostService = this;
77
-        standardCostService.costMaterialBomMapper = this.costMaterialBomMapper;
77
+        standardCostService.appSceneCostBomRelevancyMapper = this.appSceneCostBomRelevancyMapper;
78 78
         standardCostService.appSceneCostCountService = this.appSceneCostCountService;
79 79
         standardCostService.costMaterialBomService = this.costMaterialBomService;
80
-        standardCostService.costPurchasePriceService = this.costPurchasePriceService;
80
+        standardCostService.costPurchaseRecordService = this.costPurchaseRecordService;
81 81
         standardCostService.iHourRateService = this.iHourRateService;
82 82
         standardCostService.costMaterialProcessHoursService = this.costMaterialProcessHoursService;
83 83
         standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService;
84
-        standardCostService.iAppSceneCostStandardDetailService = this.iAppSceneCostStandardDetailService;
84
+        standardCostService.iAppSceneCostStandardResultService = this.iAppSceneCostStandardResultService;
85 85
     }
86 86
 
87 87
     /**
@@ -110,20 +110,400 @@ public class StandardCostService {
110 110
             //1.查询出所有满足物料编号的物料(BOM物料)
111 111
             String sql = flowTaskInfoVO.getSqlString();
112 112
             log.info("传递过来的SQL语句:" + sql);
113
-            //TODO 查询最顶部的BOM物料编号下所有的物料并进行层级排序
114
-            List<AppSceneCostMaterialBom> list = standardCostService.costMaterialBomService.queryAllBomInfoBytopMaterialCode(topMaterialCode);
115
-            log.info("Full EmptyTask list: {}", list);
116
-            //2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code)
117
-            for (int i = 0; list != null && i < list.size(); i++) {
118
-                AppSceneCostMaterialBom material = list.get(i);
119
-                AppSceneCostResultValue appSceneCostResultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(material.getMaterialCode()).parentMarterialNo(material.getParentMaterialCode()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).num(material.getNumber()).build();
120
-                standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue);
121
-            }
113
+            //获取顶部物料下所有的物料信息并存储到新的表中
114
+            getAllMaterialBomInfoByTopMaterialCode(topMaterialCode, taskType, taskCode, flowInstanceId != null ? Integer.valueOf(flowInstanceId) : null);
122 115
         } catch (Exception e) {
123 116
             throw new RuntimeException(e);
124 117
         }
125 118
     }
126 119
 
120
+    /**
121
+     * 【1.成本参数查询】查询最顶部的BOM物料编号下所有的物料并进行层级排序
122
+     * * 获取顶部物料下所有的物料信息并存储到新的表中
123
+     *
124
+     * @param topMaterialCode 顶部物料编号
125
+     * @param taskType        任务类型
126
+     * @param taskCode        任务编号
127
+     * @param flowInstanceId  流程实例id
128
+     */
129
+    public static void getAllMaterialBomInfoByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId) {
130
+        List<AppSceneCostBomRelevancy> list = standardCostService.costMaterialBomService.queryAllBomInfoByTopMaterialCode(topMaterialCode);
131
+        log.info("Full ParamTask list: {}", list);
132
+        //TODO material.getMeins()领用量??为什么是ST字母
133
+        for (int i = 0; list != null && i < list.size(); i++) {
134
+            AppSceneCostBomRelevancy material = list.get(i);
135
+            //TODO  物料领用数据
136
+            BigDecimal num1 = BigDecimal.ONE;
137
+            AppSceneCostResultValue appSceneCostResultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(material.getIdnrk()).parentMarterialNo(material.getMatnr()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).num(num1).build();
138
+            standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue);
139
+        }
140
+    }
141
+
142
+    /**
143
+     * 【2.物料成本计算】计算物料成本
144
+     *
145
+     * @param topMaterialCode 顶部物料编号
146
+     * @param taskType        任务类型
147
+     * @param taskCode        任务编号
148
+     * @param flowInstanceId  流程实例id
149
+     */
150
+    public static void countMaterialCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String feeType) {
151
+        //1.查询出物料编号对应的下所有的BOM信息
152
+        List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", String.valueOf(flowInstanceId));
153
+        //2.计算出所有的单个物料的物料成本
154
+        //2.1查询出物料的单价和采购数量
155
+        List<String> MarterialNoList = new ArrayList<>();
156
+        if (list != null && list.size() > 0) {
157
+            MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
158
+        }
159
+        //查询物料的采购价
160
+        Map<String, BigDecimal> purchasePriceMap = standardCostService.costPurchaseRecordService.getMinCostPurchasePriceByMaterialNo(MarterialNoList);
161
+        for (int i = 0; i < list.size(); i++) {
162
+            AppSceneCostResultValue appSceneCostResultValue = list.get(i);
163
+            String marterialNo = appSceneCostResultValue.getMarterialNo();
164
+            BigDecimal num = appSceneCostResultValue.getNum();
165
+            if (marterialNo != null && num != null && (new BigDecimal(num.toString()).compareTo(BigDecimal.ZERO)) != 0) {
166
+                BigDecimal price = purchasePriceMap.get(marterialNo);
167
+                if (price == null) {
168
+                    price = BigDecimal.ZERO;
169
+                }
170
+                BigDecimal number = new BigDecimal(num.toString());
171
+                //单价乘以数量
172
+                BigDecimal totalCost = price.multiply(number);
173
+                //2.2计算出人工成本并存储到成本结果数据表中
174
+                AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").priceOrRate(price).num(num).build();
175
+                standardCostService.iAppSceneCostResultValueService.save(resultValue);
176
+            }
177
+        }
178
+    }
179
+
180
+    /**
181
+     * 【3.人工成本计算】
182
+     *
183
+     * @param topMaterialCode 顶部物料编号
184
+     * @param taskType        任务类型
185
+     * @param taskCode        任务编号
186
+     * @param flowInstanceId  流程实例id
187
+     */
188
+    public static void countLaborCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String feeType, AppSceneCostHourRate appSceneCostHourRate) {
189
+        //1.查询出人员工时费率
190
+        AppSceneCostHourRate hourRateInfo = standardCostService.iHourRateService.getOneHourRateInfo(appSceneCostHourRate);
191
+        BigDecimal hourRate = new BigDecimal("0");
192
+        if (hourRateInfo != null) {
193
+            hourRate = hourRateInfo.getLaborHourRate();
194
+        }
195
+        //1.查询出物料编号对应的下所有的BOM信息
196
+        List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", String.valueOf(flowInstanceId));
197
+        //2.计算出所有的单个物料的人工成本
198
+        //2.1查询出物料的人员工时和人工小时费率(涉及:小时费率表和工序表)
199
+        List<String> MarterialNoList = new ArrayList<>();
200
+        if (list != null && list.size() > 0) {
201
+            MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
202
+        }
203
+        //查询工序工时
204
+        Map<String, List<AppSceneCostProductProcessMaintenance>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
205
+        for (int i = 0; i < list.size(); i++) {
206
+            AppSceneCostResultValue appSceneCostResultValue = list.get(i);
207
+            String marterialNo = appSceneCostResultValue.getMarterialNo();
208
+            if (marterialNo != null) {
209
+                BigDecimal totalCost = new BigDecimal("0.0");
210
+                BigDecimal laborHours = new BigDecimal("0.0");
211
+                List<AppSceneCostProductProcessMaintenance> costMaterialProcessHours = processHoursMap.get(marterialNo);
212
+                if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
213
+                    for (int j = 0; j < costMaterialProcessHours.size(); j++) {
214
+                        AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j);
215
+                        laborHours = laborHours.add(processHours.getLaborHour());
216
+                        //计算总人工成本
217
+                        totalCost = totalCost.add(processHours.getLaborHour().multiply(hourRate));
218
+                    }
219
+                }
220
+                //2.2计算出人工成本并存储到成本结果数据表中
221
+                AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
222
+                standardCostService.iAppSceneCostResultValueService.save(resultValue);
223
+            }
224
+        }
225
+    }
226
+
227
+    /**
228
+     * 【4.制造费用】
229
+     *
230
+     * @param topMaterialCode 顶部物料编号
231
+     * @param taskType        任务类型
232
+     * @param taskCode        任务编号
233
+     * @param flowInstanceId  流程实例id
234
+     */
235
+    public static void countManufacturingCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String feeType, AppSceneCostHourRate appSceneCostHourRate) {
236
+        //1.查询出人员工时费率
237
+        AppSceneCostHourRate hourRateInfo = standardCostService.iHourRateService.getOneHourRateInfo(appSceneCostHourRate);
238
+        BigDecimal hourRate = new BigDecimal("0");
239
+        if (hourRateInfo != null) {
240
+            hourRate = hourRateInfo.getLaborHourRate();
241
+        }
242
+        //1.查询出物料编号对应的下所有的BOM信息
243
+        List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", String.valueOf(flowInstanceId));
244
+        //2.根据费用类型进行不同的费用计算
245
+        //查询工序工时
246
+        List<String> MarterialNoList = new ArrayList<>();
247
+        if (list != null && list.size() > 0) {
248
+            MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
249
+        }
250
+        Map<String, List<AppSceneCostProductProcessMaintenance>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
251
+        //2.1机器折旧费(机器工时*费率)
252
+        if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
253
+            for (int i = 0; i < list.size(); i++) {
254
+                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
255
+                String marterialNo = appSceneCostResultValue.getMarterialNo();
256
+                if (marterialNo != null) {
257
+                    BigDecimal totalCost = new BigDecimal("0.0");
258
+                    BigDecimal laborHours = new BigDecimal("0.0");
259
+                    List<AppSceneCostProductProcessMaintenance> costMaterialProcessHours = processHoursMap.get(marterialNo);
260
+                    if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
261
+                        for (int j = 0; j < costMaterialProcessHours.size(); j++) {
262
+                            AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j);
263
+                            laborHours = laborHours.add(processHours.getMachineHour());
264
+                            //计算机器成本
265
+                            totalCost = totalCost.add(processHours.getMachineHour().multiply(hourRate));
266
+                        }
267
+                    }
268
+                    //2.2计算机器成本并存储到成本结果数据表中
269
+                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
270
+                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
271
+                }
272
+            }
273
+        } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
274
+            //机物料消耗(辅料工时*费率)
275
+            for (int i = 0; i < list.size(); i++) {
276
+                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
277
+                String marterialNo = appSceneCostResultValue.getMarterialNo();
278
+                if (marterialNo != null) {
279
+                    BigDecimal totalCost = new BigDecimal("0.0");
280
+                    BigDecimal laborHours = new BigDecimal("0.0");
281
+                    List<AppSceneCostProductProcessMaintenance> costMaterialProcessHours = processHoursMap.get(marterialNo);
282
+                    if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
283
+                        for (int j = 0; j < costMaterialProcessHours.size(); j++) {
284
+                            AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j);
285
+                            //辅料工时
286
+                            laborHours = laborHours.add(processHours.getAuxiliaryHour());
287
+                            //机物料消耗
288
+                            totalCost = totalCost.add(processHours.getAuxiliaryHour().multiply(hourRate));
289
+                        }
290
+                    }
291
+                    //2.2计算机物料消耗存储到成本结果数据表中
292
+                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
293
+                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
294
+                }
295
+            }
296
+        } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
297
+            //2.3水电费(燃动力工时*费率)
298
+            for (int i = 0; i < list.size(); i++) {
299
+                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
300
+                String marterialNo = appSceneCostResultValue.getMarterialNo();
301
+                if (marterialNo != null) {
302
+                    BigDecimal totalCost = new BigDecimal("0.0");
303
+                    BigDecimal laborHours = new BigDecimal("0.0");
304
+                    List<AppSceneCostProductProcessMaintenance> costMaterialProcessHours = processHoursMap.get(marterialNo);
305
+                    if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
306
+                        for (int j = 0; j < costMaterialProcessHours.size(); j++) {
307
+                            AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j);
308
+                            //燃动力工时来源
309
+                            laborHours = laborHours.add(processHours.getBurningHour());
310
+                            //水电费(燃动力工时*费率)成本
311
+                            totalCost = totalCost.add(processHours.getBurningHour().multiply(hourRate));
312
+                        }
313
+                    }
314
+                    //2.2计算机物料消耗存储到成本结果数据表中
315
+                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
316
+                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
317
+                }
318
+            }
319
+        } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
320
+            //2.4其他制费(其他工时*费率)
321
+            for (int i = 0; i < list.size(); i++) {
322
+                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
323
+                String marterialNo = appSceneCostResultValue.getMarterialNo();
324
+                if (marterialNo != null) {
325
+                    BigDecimal totalCost = new BigDecimal("0.0");
326
+                    BigDecimal laborHours = new BigDecimal("0.0");
327
+                    List<AppSceneCostProductProcessMaintenance> costMaterialProcessHours = processHoursMap.get(marterialNo);
328
+                    if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
329
+                        for (int j = 0; j < costMaterialProcessHours.size(); j++) {
330
+                            AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j);
331
+                            //其他工时来源
332
+                            laborHours = laborHours.add(processHours.getOtherHour());
333
+                            //其他制费成本
334
+                            totalCost = totalCost.add(processHours.getOtherHour().multiply(hourRate));
335
+                        }
336
+                    }
337
+                    //2.2计算机物料消耗存储到成本结果数据表中
338
+                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
339
+                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
340
+                }
341
+            }
342
+        } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
343
+            //查出所有的机器折旧费、机物料消耗、水电费、其他制费
344
+            list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "ManufacturingCost", String.valueOf(flowInstanceId));
345
+            //2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%)
346
+            //按照物料编号进行分组
347
+            Map<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
348
+            for (String key : materialNoMap.keySet()) {
349
+                List<AppSceneCostResultValue> appSceneCostResultValues = materialNoMap.get(key);
350
+                BigDecimal totalCost = new BigDecimal("0.0");
351
+                for (int j = 0; j < appSceneCostResultValues.size(); j++) {
352
+                    AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j);
353
+                    String countValue = appSceneCostResultValue.getCountValue();
354
+                    if (countValue != null) {
355
+                        totalCost = totalCost.add(new BigDecimal(countValue));
356
+                    }
357
+                }
358
+                AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(appSceneCostResultValues.get(0).getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost.multiply(new BigDecimal("0.1016")).toString()).costType(feeType).build();
359
+                standardCostService.iAppSceneCostResultValueService.save(resultValue);
360
+            }
361
+        }
362
+    }
363
+
364
+    /**
365
+     * 【5.制造费用】
366
+     *
367
+     * @param topMaterialCode 顶部物料编号
368
+     * @param taskType        任务类型
369
+     * @param taskCode        任务编号
370
+     * @param flowInstanceId  流程实例id
371
+     * @param costType        流程实例id
372
+     */
373
+    public static void countStandardCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String costType, String versionNumber) {
374
+        //1.查询出根物料编号对应的下所有的BOM信息结果值
375
+        List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, String.valueOf(flowInstanceId));
376
+        //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用)
377
+        //按照物料编号进行分组
378
+        Map<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
379
+        //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计
380
+        for (String key : materialNoMap.keySet()) {
381
+            List<AppSceneCostResultValue> appSceneCostResultValues = materialNoMap.get(key);
382
+            //按照费用类别进行分组
383
+            Map<String, List<AppSceneCostResultValue>> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType));
384
+            //【本阶标准成本】
385
+            BigDecimal currentCost = new BigDecimal("0.0");
386
+            //1.本阶物料成本
387
+            BigDecimal materialCost = new BigDecimal("0.0");
388
+            //2.本阶人工成本
389
+            BigDecimal laborCost = new BigDecimal("0.0");
390
+            //3.本阶制造费(设备费)
391
+            BigDecimal equipmentCost = new BigDecimal("0.0");
392
+            //4.本阶制造费(辅料费用)
393
+            BigDecimal supplyMaterialCost = new BigDecimal("0.0");
394
+            //5.本阶制造费(水电费、燃动费)
395
+            BigDecimal driveCost = new BigDecimal("0.0");
396
+            //6.本阶制造费(其他制造费用)
397
+            BigDecimal otherCost = new BigDecimal("0.0");
398
+            //7.本阶制造费(物流费)
399
+            BigDecimal logisticsCost = new BigDecimal("0.0");
400
+            //物料单价
401
+            BigDecimal materialUnitPrice = new BigDecimal("0.0");
402
+            //人员工时、小时费率
403
+            BigDecimal laborHour = new BigDecimal("0.0");
404
+            BigDecimal laborHourRate = new BigDecimal("0.0");
405
+            //设备工时、小时费率
406
+            BigDecimal equipmentHour = new BigDecimal("0.0");
407
+            BigDecimal equipmentHourRate = new BigDecimal("0.0");
408
+            //辅料工时、小时费率
409
+            BigDecimal supplyMaterialHour = new BigDecimal("0.0");
410
+            BigDecimal supplyMaterialHourRate = new BigDecimal("0.0");
411
+            //燃动工时、小时费率
412
+            BigDecimal driveHour = new BigDecimal("0.0");
413
+            BigDecimal driveHourRate = new BigDecimal("0.0");
414
+            //其他工时、小时费率
415
+            BigDecimal otherHour = new BigDecimal("0.0");
416
+            BigDecimal otherHourRate = new BigDecimal("0.0");
417
+            AppSceneCostResultValue currentMaterialCost = null;
418
+            //遍历所有费用类别计算本阶标准成本
419
+            for (int j = 0; j < appSceneCostResultValues.size(); j++) {
420
+                if (j == 0) {
421
+                    //初始化当前物料成本信息
422
+                    currentMaterialCost = appSceneCostResultValues.get(0);
423
+                }
424
+                AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j);
425
+                String countValue = appSceneCostResultValue.getCountValue();
426
+                if (countValue != null) {
427
+                    currentCost = currentCost.add(new BigDecimal(countValue));
428
+                }
429
+            }
430
+            //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率
431
+            for (String feeType : costTypeMap.keySet()) {
432
+                List<AppSceneCostResultValue> appSceneCostResultValues1 = costTypeMap.get(feeType);
433
+                for (int m = 0; m < appSceneCostResultValues1.size(); m++) {
434
+                    if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) {
435
+                        //物料成本
436
+                        materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
437
+                        //物料单价
438
+                        materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate();
439
+                        //TODO 数量
440
+                        currentMaterialCost.setNum(appSceneCostResultValues1.get(m).getNum());
441
+                    } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) {
442
+                        //人工成本
443
+                        laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
444
+                        //人工工时、小时费率
445
+                        laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour());
446
+                        laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
447
+                    } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
448
+                        //设备费用
449
+                        equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
450
+                        //设备工时、小时费率
451
+                        equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour());
452
+                        equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
453
+                    } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
454
+                        //辅料费用
455
+                        supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
456
+                        //辅料工时、小时费率
457
+                        supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour());
458
+                        supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
459
+                    } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
460
+                        //燃动费用
461
+                        driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
462
+                        //燃动工时、小时费率
463
+                        driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour());
464
+                        driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
465
+                    } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
466
+                        //物流费用
467
+                        logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
468
+                    } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
469
+                        //其他费用
470
+                        otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
471
+                        //其他工时、小时费率
472
+                        otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour());
473
+                        otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
474
+                    }
475
+                }
476
+            }
477
+            //本阶不同费用类别成本统计
478
+            JSONObject currentLevelCostTypeDetail = new JSONObject();
479
+            currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost);
480
+            currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost);
481
+            currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost);
482
+            currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost);
483
+            currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost);
484
+            currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost);
485
+            currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost);
486
+            //统计本阶不同费用类别工时、小时费率
487
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice);
488
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour);
489
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate);
490
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour);
491
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate);
492
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour);
493
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate);
494
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour);
495
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate);
496
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour);
497
+            currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate);
498
+            AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(currentMaterialCost.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(currentCost.toString()).costDetail(JSON.toJSONString(currentLevelCostTypeDetail)).costType(costType).num(currentMaterialCost.getNum()).build();
499
+            standardCostService.iAppSceneCostResultValueService.save(resultValue);
500
+        }
501
+        //3.计算出所有的单个物料的累计标准成本
502
+        List<AppSceneCostResultValue> standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, String.valueOf(flowInstanceId));
503
+        //【累计成本】的计算
504
+        totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, String.valueOf(flowInstanceId), versionNumber);
505
+    }
506
+
127 507
     /**
128 508
      * 获取任务流程相关信息
129 509
      *
@@ -190,7 +570,7 @@ public class StandardCostService {
190 570
      */
191 571
     private static FlowTaskInfoVO queryFlowDefinitionByFlowInstanceId(FlowTaskInfoVO flowTaskInfoVO) {
192 572
         String sql = "SELECT A.model_json from qomo_flow_definition as A LEFT JOIN   qomo_flow_instance AS B ON A.`code`=B.flow_definition_code  WHERE B.id=" + flowTaskInfoVO.getFlowInstanceId() + " limit 1";
193
-        String blob = standardCostService.costMaterialBomMapper.customSelectBlobModelJson(sql);
573
+        String blob = standardCostService.appSceneCostBomRelevancyMapper.customSelectBlobModelJson(sql);
194 574
         if (blob != null) {
195 575
             if (blob != null && blob.contains("topMaterialCode")) {
196 576
                 JSONObject jsonObject1 = JSON.parseObject(blob);
@@ -218,30 +598,7 @@ public class StandardCostService {
218 598
             String flowInstanceId = flowTaskInfoVO.getFlowInstanceId();
219 599
             //成本类型
220 600
             String feeType = FeeTypeEnum.MaterialCost.getCode();
221
-            //1.查询出物料编号对应的下所有的BOM信息
222
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
223
-            //2.计算出所有的单个物料的物料成本
224
-            //2.1查询出物料的单价和采购数量
225
-            List<String> MarterialNoList = new ArrayList<>();
226
-            if (list != null && list.size() > 0) {
227
-                MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
228
-            }
229
-            //查询物料的采购价
230
-            Map<String, BigDecimal> purchasePriceMap = standardCostService.costPurchasePriceService.getMinCostPurchasePriceByMaterialNo(MarterialNoList);
231
-            for (int i = 0; i < list.size(); i++) {
232
-                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
233
-                String marterialNo = appSceneCostResultValue.getMarterialNo();
234
-                Integer num = appSceneCostResultValue.getNum();
235
-                if (marterialNo != null && num != null) {
236
-                    BigDecimal price = purchasePriceMap.get(marterialNo);
237
-                    BigDecimal number = new BigDecimal(num.toString());
238
-                    //单价乘以数量
239
-                    BigDecimal totalCost = price.multiply(number);
240
-                    //2.2计算出人工成本并存储到成本结果数据表中
241
-                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").priceOrRate(price).build();
242
-                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
243
-                }
244
-            }
601
+
245 602
         } catch (Exception e) {
246 603
             throw new RuntimeException(e);
247 604
         }
@@ -268,42 +625,7 @@ public class StandardCostService {
268 625
             log.info("sql1:" + sql1);
269 626
             String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号
270 627
             log.info("sql:" + sql);
271
-            JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql);
272
-            BigDecimal hourRate = new BigDecimal("0");
273
-            if (jsonObject != null) {
274
-                AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class);
275
-                hourRate = rate.getLaborHourRate();
276
-            }
277
-            //1.查询出物料编号对应的下所有的BOM信息
278
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
279
-            //2.计算出所有的单个物料的人工成本
280
-            //2.1查询出物料的人员工时和人工小时费率(涉及:小时费率表和工序表)
281
-            List<String> MarterialNoList = new ArrayList<>();
282
-            if (list != null && list.size() > 0) {
283
-                MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
284
-            }
285
-            //查询工序工时
286
-            Map<String, List<AppSceneCostMaterialProcessHours>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
287
-            for (int i = 0; i < list.size(); i++) {
288
-                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
289
-                String marterialNo = appSceneCostResultValue.getMarterialNo();
290
-                if (marterialNo != null) {
291
-                    BigDecimal totalCost = new BigDecimal("0.0");
292
-                    BigDecimal laborHours = new BigDecimal("0.0");
293
-                    List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
294
-                    if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
295
-                        for (int j = 0; j < costMaterialProcessHours.size(); j++) {
296
-                            AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
297
-                            laborHours = laborHours.add(processHours.getLaborHours());
298
-                            //计算总人工成本
299
-                            totalCost = totalCost.add(processHours.getLaborHours().multiply(hourRate));
300
-                        }
301
-                    }
302
-                    //2.2计算出人工成本并存储到成本结果数据表中
303
-                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
304
-                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
305
-                }
306
-            }
628
+
307 629
         } catch (Exception e) {
308 630
             throw new RuntimeException(e);
309 631
         }
@@ -336,132 +658,7 @@ public class StandardCostService {
336 658
             log.info("sql1:" + sql1);
337 659
             String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号
338 660
             log.info("sql:" + sql);
339
-            JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql);
340
-            BigDecimal hourRate = new BigDecimal("0");
341
-            if (jsonObject != null) {
342
-                AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class);
343
-                hourRate = rate.getLaborHourRate();
344
-            }
345
-            //1.查询出物料编号对应的下所有的BOM信息
346
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
347
-            //2.根据费用类型进行不同的费用计算
348
-            //查询工序工时
349
-            List<String> MarterialNoList = new ArrayList<>();
350
-            if (list != null && list.size() > 0) {
351
-                MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
352
-            }
353
-            Map<String, List<AppSceneCostMaterialProcessHours>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
354
-            //2.1机器折旧费(机器工时*费率)
355
-            if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
356
-                for (int i = 0; i < list.size(); i++) {
357
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
358
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
359
-                    if (marterialNo != null) {
360
-                        BigDecimal totalCost = new BigDecimal("0.0");
361
-                        BigDecimal laborHours = new BigDecimal("0.0");
362
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
363
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
364
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
365
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
366
-                                laborHours = laborHours.add(processHours.getDeviceHours());
367
-                                //计算机器成本
368
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
369
-                            }
370
-                        }
371
-                        //2.2计算机器成本并存储到成本结果数据表中
372
-                        AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
373
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
374
-                    }
375
-                }
376
-            } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
377
-                //机物料消耗(辅料工时*费率)
378
-                for (int i = 0; i < list.size(); i++) {
379
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
380
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
381
-                    if (marterialNo != null) {
382
-                        BigDecimal totalCost = new BigDecimal("0.0");
383
-                        BigDecimal laborHours = new BigDecimal("0.0");
384
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
385
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
386
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
387
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
388
-                                //TODO 辅料工时来源
389
-                                laborHours = laborHours.add(processHours.getDeviceHours());
390
-                                //机物料消耗
391
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
392
-                            }
393
-                        }
394
-                        //2.2计算机物料消耗存储到成本结果数据表中
395
-                        AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
396
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
397
-                    }
398
-                }
399
-            } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
400
-                //2.3水电费(燃动力工时*费率)
401
-                for (int i = 0; i < list.size(); i++) {
402
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
403
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
404
-                    if (marterialNo != null) {
405
-                        BigDecimal totalCost = new BigDecimal("0.0");
406
-                        BigDecimal laborHours = new BigDecimal("0.0");
407
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
408
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
409
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
410
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
411
-                                //TODO 燃动力工时来源
412
-                                laborHours = laborHours.add(processHours.getDeviceHours());
413
-                                //水电费(燃动力工时*费率)成本
414
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
415
-                            }
416
-                        }
417
-                        //2.2计算机物料消耗存储到成本结果数据表中
418
-                        AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
419
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
420
-                    }
421
-                }
422
-            } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
423
-                //2.4其他制费(其他工时*费率)
424
-                for (int i = 0; i < list.size(); i++) {
425
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
426
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
427
-                    if (marterialNo != null) {
428
-                        BigDecimal totalCost = new BigDecimal("0.0");
429
-                        BigDecimal laborHours = new BigDecimal("0.0");
430
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
431
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
432
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
433
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
434
-                                //TODO 其他工时来源
435
-                                laborHours = laborHours.add(processHours.getDeviceHours());
436
-                                //其他制费成本
437
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
438
-                            }
439
-                        }
440
-                        //2.2计算机物料消耗存储到成本结果数据表中
441
-                        AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
442
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
443
-                    }
444
-                }
445
-            } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
446
-                //查出所有的机器折旧费、机物料消耗、水电费、其他制费
447
-                list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "ManufacturingCost", flowInstanceId);
448
-                //2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%)
449
-                //按照物料编号进行分组
450
-                Map<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
451
-                for (String key : materialNoMap.keySet()) {
452
-                    List<AppSceneCostResultValue> appSceneCostResultValues = materialNoMap.get(key);
453
-                    BigDecimal totalCost = new BigDecimal("0.0");
454
-                    for (int j = 0; j < appSceneCostResultValues.size(); j++) {
455
-                        AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j);
456
-                        String countValue = appSceneCostResultValue.getCountValue();
457
-                        if (countValue != null) {
458
-                            totalCost = totalCost.add(new BigDecimal(countValue));
459
-                        }
460
-                    }
461
-                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(appSceneCostResultValues.get(0).getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost.multiply(new BigDecimal("0.1016")).toString()).costType(feeType).build();
462
-                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
463
-                }
464
-            }
661
+
465 662
         } catch (Exception e) {
466 663
             throw new RuntimeException(e);
467 664
         }
@@ -484,134 +681,6 @@ public class StandardCostService {
484 681
             //获取流程id
485 682
             String flowInstanceId = flowTaskInfoVO.getFlowInstanceId();
486 683
             String costType = FeeTypeEnum.StandardCost.getCode();
487
-            //1.查询出根物料编号对应的下所有的BOM信息结果值
488
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, flowInstanceId);
489
-            //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用)
490
-            //按照物料编号进行分组
491
-            Map<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
492
-            //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计
493
-            for (String key : materialNoMap.keySet()) {
494
-                List<AppSceneCostResultValue> appSceneCostResultValues = materialNoMap.get(key);
495
-                //按照费用类别进行分组
496
-                Map<String, List<AppSceneCostResultValue>> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType));
497
-                //【本阶标准成本】
498
-                BigDecimal currentCost = new BigDecimal("0.0");
499
-                //1.本阶物料成本
500
-                BigDecimal materialCost = new BigDecimal("0.0");
501
-                //2.本阶人工成本
502
-                BigDecimal laborCost = new BigDecimal("0.0");
503
-                //3.本阶制造费(设备费)
504
-                BigDecimal equipmentCost = new BigDecimal("0.0");
505
-                //4.本阶制造费(辅料费用)
506
-                BigDecimal supplyMaterialCost = new BigDecimal("0.0");
507
-                //5.本阶制造费(水电费、燃动费)
508
-                BigDecimal driveCost = new BigDecimal("0.0");
509
-                //6.本阶制造费(其他制造费用)
510
-                BigDecimal otherCost = new BigDecimal("0.0");
511
-                //7.本阶制造费(物流费)
512
-                BigDecimal logisticsCost = new BigDecimal("0.0");
513
-                //物料单价
514
-                BigDecimal materialUnitPrice = new BigDecimal("0.0");
515
-                //人员工时、小时费率
516
-                BigDecimal laborHour = new BigDecimal("0.0");
517
-                BigDecimal laborHourRate = new BigDecimal("0.0");
518
-                //设备工时、小时费率
519
-                BigDecimal equipmentHour = new BigDecimal("0.0");
520
-                BigDecimal equipmentHourRate = new BigDecimal("0.0");
521
-                //辅料工时、小时费率
522
-                BigDecimal supplyMaterialHour = new BigDecimal("0.0");
523
-                BigDecimal supplyMaterialHourRate = new BigDecimal("0.0");
524
-                //燃动工时、小时费率
525
-                BigDecimal driveHour = new BigDecimal("0.0");
526
-                BigDecimal driveHourRate = new BigDecimal("0.0");
527
-                //其他工时、小时费率
528
-                BigDecimal otherHour = new BigDecimal("0.0");
529
-                BigDecimal otherHourRate = new BigDecimal("0.0");
530
-                AppSceneCostResultValue currentMaterialCost = null;
531
-                //遍历所有费用类别计算本阶标准成本
532
-                for (int j = 0; j < appSceneCostResultValues.size(); j++) {
533
-                    if (j == 0) {
534
-                        currentMaterialCost = appSceneCostResultValues.get(0);
535
-                    }
536
-                    AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j);
537
-                    String countValue = appSceneCostResultValue.getCountValue();
538
-                    if (countValue != null) {
539
-                        currentCost = currentCost.add(new BigDecimal(countValue));
540
-                    }
541
-                }
542
-                //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率
543
-                for (String feeType : costTypeMap.keySet()) {
544
-                    List<AppSceneCostResultValue> appSceneCostResultValues1 = costTypeMap.get(feeType);
545
-                    for (int m = 0; m < appSceneCostResultValues1.size(); m++) {
546
-                        if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) {
547
-                            //物料成本
548
-                            materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
549
-                            //物料单价
550
-                            materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate();
551
-                        } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) {
552
-                            //人工成本
553
-                            laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
554
-                            //人工工时、小时费率
555
-                            laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour());
556
-                            laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
557
-                        } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
558
-                            //设备费用
559
-                            equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
560
-                            //设备工时、小时费率
561
-                            equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour());
562
-                            equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
563
-                        } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
564
-                            //辅料费用
565
-                            supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
566
-                            //辅料工时、小时费率
567
-                            supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour());
568
-                            supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
569
-                        } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
570
-                            //燃动费用
571
-                            driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
572
-                            //燃动工时、小时费率
573
-                            driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour());
574
-                            driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
575
-                        } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
576
-                            //物流费用
577
-                            logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
578
-                        } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
579
-                            //其他费用
580
-                            otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
581
-                            //其他工时、小时费率
582
-                            otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour());
583
-                            otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
584
-                        }
585
-                    }
586
-                }
587
-                //本阶不同费用类别成本统计
588
-                JSONObject currentLevelCostTypeDetail = new JSONObject();
589
-                currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost);
590
-                currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost);
591
-                currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost);
592
-                currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost);
593
-                currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost);
594
-                currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost);
595
-                currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost);
596
-                //统计本阶不同费用类别工时、小时费率
597
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice);
598
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour);
599
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate);
600
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour);
601
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate);
602
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour);
603
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate);
604
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour);
605
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate);
606
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour);
607
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate);
608
-                AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(currentMaterialCost.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(currentCost.toString()).costDetail(JSON.toJSONString(currentLevelCostTypeDetail)).costType(costType).build();
609
-                standardCostService.iAppSceneCostResultValueService.save(resultValue);
610
-            }
611
-            //3.计算出所有的单个物料的累计标准成本
612
-            List<AppSceneCostResultValue> standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId);
613
-            //【累计成本】的计算
614
-            totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId);
615 684
         } catch (Exception e) {
616 685
             e.printStackTrace();
617 686
             throw new RuntimeException("计算成本失败");
@@ -627,9 +696,9 @@ public class StandardCostService {
627 696
      * @param taskCode
628 697
      * @param flowInstanceId
629 698
      */
630
-    private static void totalCountCost(List<AppSceneCostResultValue> standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId) {
699
+    private static void totalCountCost(List<AppSceneCostResultValue> standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId, String versionNumber) {
631 700
         try {
632
-            List<AppSceneCostStandardDetail> costStandardDetails = new ArrayList<>();
701
+            List<AppSceneCostStandardResult> costStandardResults = new ArrayList<>();
633 702
             //父类对应的子节点(除了最上层节点)
634 703
             Map<String, List<AppSceneCostResultValue>> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo));
635 704
             for (int i = 0; i < standardCostList.size(); i++) {
@@ -660,16 +729,16 @@ public class StandardCostService {
660 729
                 oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString());
661 730
                 standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue);
662 731
                 //构造单行成本查询记录
663
-                AppSceneCostStandardDetail costStandardDetail = AppSceneCostStandardDetail.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).materialName(oldAppSceneCostResultValue.getMarterialNo()).parentMaterialNumber(oldAppSceneCostResultValue.getParentMarterialNo())
664
-//                    .versionNumber()
732
+                AppSceneCostStandardResult costStandardResultValue = AppSceneCostStandardResult.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).parentMatnr(oldAppSceneCostResultValue.getParentMarterialNo()).versionNumber(versionNumber)
665 733
 //                    .level()
666 734
 //                    .sort()
667 735
 //                    .figureNumber()
668
-                        .dosage(oldAppSceneCostResultValue.getNum() != null ? new Double(oldAppSceneCostResultValue.getNum()) : 0).unit(oldAppSceneCostResultValue.getUnit()).materialCost(costDetailJson.getBigDecimal(FeeTypeEnum.MaterialCost.getCode())).laborCost(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode())).equipmentCost(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode())).supplyMaterialCost(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode())).driveCost(costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode())).logisticsCost(costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode())).otherCost(costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode())).currentStandardCost(new BigDecimal(oldAppSceneCostResultValue.getCountValue())).totalMaterialCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalMaterialCost.getCode())).totalLaborCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLaborCost.getCode())).totalEquipmentCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalEquipmentFee.getCode())).totalSupplyMaterialCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalSupplyMaterialFee.getCode())).totalDriveCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalDriverFee.getCode())).totalLogisticsCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLogisticsFee.getCode())).totalOtherCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalOtherFee.getCode())).totalStandardCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalStandardCost.getCode())).createTime(new Date()).build();
669
-                costStandardDetails.add(costStandardDetail);
736
+//                        .dosage(oldAppSceneCostResultValue.getNum() != null ? oldAppSceneCostResultValue.getNum().doubleValue() : 0).unit(oldAppSceneCostResultValue.getUnit())
737
+                        .materialCostStageInter(costDetailJson.getBigDecimal(FeeTypeEnum.MaterialCost.getCode())).laborCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode())).equipCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode())).auxiliaryCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode())).burningCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode())).stageLogisticsCost(costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode())).otherCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode())).totalStandardCostInter(new BigDecimal(oldAppSceneCostResultValue.getCountValue())).materialCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalMaterialCost.getCode())).laborCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalLaborCost.getCode())).equipCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalEquipmentFee.getCode())).auxiliaryCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalSupplyMaterialFee.getCode())).burningCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalDriverFee.getCode())).totalLogisticsCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLogisticsFee.getCode())).otherCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalOtherFee.getCode())).totalStandardCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalStandardCost.getCode())).createdTime(new Date()).build();
738
+                costStandardResults.add(costStandardResultValue);
670 739
             }
671 740
             //更新结果集到标准成本单行查询中去
672
-            standardCostService.iAppSceneCostStandardDetailService.saveBatch(costStandardDetails);
741
+            standardCostService.iAppSceneCostStandardResultService.saveBatch(costStandardResults);
673 742
         } catch (Exception e) {
674 743
             e.printStackTrace();
675 744
         }

+ 15
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java Parādīt failu

@@ -3,6 +3,8 @@ package com.zzsmart.qomo.kn.cost.manage.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * @Description: app_scene_cost_bom_relevancy
8 10
  * @Author: jeecg-boot
@@ -10,5 +12,18 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
10 12
  * @Version: V1.0
11 13
  */
12 14
 public interface IAppSceneCostBomRelevancyService extends IService<AppSceneCostBomRelevancy> {
15
+    /**
16
+     * 分页查询
17
+     * @param
18
+     * @return
19
+     */
20
+    List<AppSceneCostBomRelevancy> queryListResult(String materialNumber);
21
+
22
+    /**
23
+     * 查询最顶层物料编号下所有的物料
24
+     * @param topMaterialCode
25
+     * @return
26
+     */
27
+    List<AppSceneCostBomRelevancy> queryAllBomInfoByTopMaterialCode(String topMaterialCode);
13 28
 
14 29
 }

+ 2
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java Parādīt failu

@@ -2,6 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
5
+import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostCountVO;
5 6
 import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
6 7
 
7 8
 import java.util.List;
@@ -31,5 +32,5 @@ public interface IAppSceneCostCountService extends IService<AppSceneCostCount> {
31 32
      * 添加标准成本计算任务
32 33
      * @param appSceneCostCount
33 34
      */
34
-    void addCostCountTask(AppSceneCostCount appSceneCostCount);
35
+    void addCostCountTask(AppSceneCostCountVO appSceneCostCount);
35 36
 }

+ 6
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java Parādīt failu

@@ -10,5 +10,10 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
10 10
  * @Version: V1.0
11 11
  */
12 12
 public interface IAppSceneCostHourRateService extends IService<AppSceneCostHourRate> {
13
-
13
+    /**
14
+     * 查询满足条件的一条小时费率信息
15
+     * @param appSceneCostHourRate
16
+     * @return
17
+     */
18
+    AppSceneCostHourRate getOneHourRateInfo(AppSceneCostHourRate appSceneCostHourRate);
14 19
 }

+ 0
- 28
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java Parādīt failu

@@ -1,28 +0,0 @@
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.AppSceneCostMaterialBom;
5
-
6
-import java.util.List;
7
-
8
-/**
9
- * @Description: app_scene_cost_material_bom
10
- * @Author: jeecg-boot
11
- * @Date:   2024-08-02
12
- * @Version: V1.0
13
- */
14
-public interface IAppSceneCostMaterialBomService extends IService<AppSceneCostMaterialBom> {
15
-    /**
16
-     * 分页查询
17
-     * @param
18
-     * @return
19
-     */
20
-    List<AppSceneCostMaterialBom> queryListResult(String materialNumber);
21
-
22
-    /**
23
-     * 查询最顶层物料编号下所有的物料
24
-     * @param topMaterialCode
25
-     * @return
26
-     */
27
-    List<AppSceneCostMaterialBom> queryAllBomInfoBytopMaterialCode(String topMaterialCode);
28
-}

+ 0
- 22
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java Parādīt failu

@@ -1,22 +0,0 @@
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.AppSceneCostMaterialProcessHours;
5
-import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialProcessHoursMapper;
6
-
7
-import java.util.List;
8
-import java.util.Map;
9
-
10
-/**
11
- * @Description: app_scene_cost_material_process_hours
12
- * @Author: jeecg-boot
13
- * @Date:   2024-08-02
14
- * @Version: V1.0
15
- */
16
-public interface IAppSceneCostMaterialProcessHoursService extends IService<AppSceneCostMaterialProcessHours> {
17
-    /**
18
-     * 查询满足物料编号的工时工序
19
-     */
20
-    Map<String, List<AppSceneCostMaterialProcessHours>> getProcessHoursByMaterialNo(List<String> materialNos);
21
-
22
-}

+ 8
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java Parādīt failu

@@ -3,12 +3,19 @@ package com.zzsmart.qomo.kn.cost.manage.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance;
5 5
 
6
+import java.util.List;
7
+import java.util.Map;
8
+
6 9
 /**
7 10
  * @Description: app_scene_cost_product_process_maintenance
8 11
  * @Author: jeecg-boot
9
- * @Date:   2024-09-08
12
+ * @Date: 2024-09-08
10 13
  * @Version: V1.0
11 14
  */
12 15
 public interface IAppSceneCostProductProcessMaintenanceService extends IService<AppSceneCostProductProcessMaintenance> {
16
+    /**
17
+     * 查询满足物料编号的工时工序
18
+     */
19
+    Map<String, List<AppSceneCostProductProcessMaintenance>> getProcessHoursByMaterialNo(List<String> materialNos);
13 20
 
14 21
 }

+ 0
- 22
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java Parādīt failu

@@ -1,22 +0,0 @@
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.AppSceneCostPurchasePrice;
5
-
6
-import java.math.BigDecimal;
7
-import java.util.List;
8
-import java.util.Map;
9
-
10
-/**
11
- * @Description: app_scene_cost_purchase_price
12
- * @Author: jeecg-boot
13
- * @Date:   2024-08-02
14
- * @Version: V1.0
15
- */
16
-public interface IAppSceneCostPurchasePriceService extends IService<AppSceneCostPurchasePrice> {
17
-    /**
18
-     * 查询满足物料编号的最低采购价
19
-     */
20
-    Map<String, BigDecimal> getMinCostPurchasePriceByMaterialNo(List<String> materialNos);
21
-
22
-}

+ 8
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java Parādīt failu

@@ -3,6 +3,10 @@ package com.zzsmart.qomo.kn.cost.manage.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord;
5 5
 
6
+import java.math.BigDecimal;
7
+import java.util.List;
8
+import java.util.Map;
9
+
6 10
 /**
7 11
  * @Description: app_scene_cost_purchase_record
8 12
  * @Author: jeecg-boot
@@ -10,5 +14,9 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord;
10 14
  * @Version: V1.0
11 15
  */
12 16
 public interface IAppSceneCostPurchaseRecordService extends IService<AppSceneCostPurchaseRecord> {
17
+    /**
18
+     * 查询满足物料编号的最低采购价
19
+     */
20
+    Map<String, BigDecimal> getMinCostPurchasePriceByMaterialNo(List<String> materialNos);
13 21
 
14 22
 }

+ 14
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardResultService.java Parādīt failu

@@ -0,0 +1,14 @@
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.AppSceneCostStandardResult;
5
+
6
+/**
7
+ * @Description: app_scene_cost_standard_detail
8
+ * @Author: jeecg-boot
9
+ * @Date: 2024-07-31
10
+ * @Version: V1.0
11
+ */
12
+public interface IAppSceneCostStandardResultService extends IService<AppSceneCostStandardResult> {
13
+
14
+}

+ 42
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java Parādīt failu

@@ -1,19 +1,60 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
2 2
 
3
+import cn.hutool.core.util.StrUtil;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
4 6
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper;
5 7
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService;
8
+import org.springframework.beans.factory.annotation.Autowired;
6 9
 import org.springframework.stereotype.Service;
7 10
 
8 11
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 12
 
13
+import java.util.List;
14
+
10 15
 /**
11 16
  * @Description: app_scene_cost_bom_relevancy
12 17
  * @Author: jeecg-boot
13
- * @Date:   2024-09-08
18
+ * @Date: 2024-09-08
14 19
  * @Version: V1.0
15 20
  */
16 21
 @Service
17 22
 public class AppSceneCostBomRelevancyServiceImpl extends ServiceImpl<AppSceneCostBomRelevancyMapper, AppSceneCostBomRelevancy> implements IAppSceneCostBomRelevancyService {
23
+    /**
24
+     * 物料BOM信息
25
+     */
26
+    @Autowired
27
+    AppSceneCostBomRelevancyMapper costMaterialBomMapper;
28
+
29
+
30
+    /**
31
+     * 分页查询
32
+     *
33
+     * @param materialNumber
34
+     * @return
35
+     */
36
+    @Override
37
+    public List<AppSceneCostBomRelevancy> queryListResult(String materialNumber) {
38
+        QueryWrapper queryWrapper = new QueryWrapper();
39
+        if (StrUtil.isNotEmpty(materialNumber)) {
40
+            // 物料号
41
+            queryWrapper.like("material_code", materialNumber);
42
+        }
43
+        List list = costMaterialBomMapper.selectList(queryWrapper);
44
+        return list;
45
+    }
18 46
 
47
+    /**
48
+     * 查询最顶层物料编号下所有的物料
49
+     *
50
+     * @param topMaterialCode
51
+     * @return
52
+     */
53
+    @Override
54
+    public List<AppSceneCostBomRelevancy> queryAllBomInfoByTopMaterialCode(String topMaterialCode) {
55
+        List<AppSceneCostBomRelevancy> childrens = costMaterialBomMapper.findChildrenByParentId(topMaterialCode);
56
+        //TODO 循环遍历查出所有的物料下的物料(包含最上层的物料)
57
+        //TODO 所有的物料并进行层级排序
58
+        return childrens;
59
+    }
19 60
 }

+ 76
- 15
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java Parādīt failu

@@ -1,25 +1,33 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.JSONObject;
3 5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
-import com.zzsmart.qomo.dao.entity.FlowDefinition;
7
+import com.zzsmart.qomo.dao.entity.FlowInstance;
8
+import com.zzsmart.qomo.dao.entity.FlowInstanceParameter;
6 9
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
10
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
7 11
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo;
8 12
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion;
9 13
 import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum;
14
+import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum;
10 15
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper;
11 16
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper;
17
+import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService;
12 18
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService;
13 19
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService;
20
+import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostCountVO;
14 21
 import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
15
-import com.zzsmart.qomo.service.IDataFlowDefinitionService;
16 22
 import com.zzsmart.qomo.service.IDataFlowInstanceService;
23
+import com.zzsmart.qomo.service.IFlowInstanceParameterService;
17 24
 import org.springframework.beans.factory.annotation.Autowired;
18 25
 import org.springframework.stereotype.Service;
19 26
 
20 27
 import java.util.ArrayList;
21 28
 import java.util.Date;
22 29
 import java.util.List;
30
+import java.util.Random;
23 31
 
24 32
 /**
25 33
  * @Description: app_scene_cost_count
@@ -34,8 +42,11 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl<AppSceneCostCountM
34 42
     @Autowired
35 43
     private IDataFlowInstanceService flowInstanceService;
36 44
     @Autowired
45
+    private IFlowInstanceParameterService flowInstanceParameterService;
46
+    @Autowired
37 47
     private AppSceneCostPartMissingInfoMapper costPartMissingInfoMapper;
38 48
 
49
+
39 50
     /**
40 51
      * 查看关键缺失部件
41 52
      *
@@ -77,7 +88,7 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl<AppSceneCostCountM
77 88
             AppSceneCostCount appSceneCostCount = getById(id);
78 89
             if (appSceneCostCount != null) {
79 90
                 //执行标准成本计算
80
-                executeStandardCost(id, appSceneCostCount.getFlowDefinitionId());
91
+                executeStandardCost(id, appSceneCostCount.getFlowDefinitionId(), appSceneCostCount.getMaterialNo());
81 92
             }
82 93
         }
83 94
         return null;
@@ -89,9 +100,23 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl<AppSceneCostCountM
89 100
      * @param id
90 101
      * @param flowDefinitionId
91 102
      */
92
-    private void executeStandardCost(Integer id, Integer flowDefinitionId) {
93
-        //TODO 执行标准成本计算(参数传递)
94
-        flowInstanceService.execute(flowDefinitionId, null, null);
103
+    private void executeStandardCost(Integer id, Integer flowDefinitionId, String meterialNo) {
104
+        boolean isSuccess = false;
105
+        JSONObject parameter = new JSONObject();
106
+        parameter.put("materialNo", meterialNo);
107
+        String parameters = JSON.toJSONString(parameter);
108
+        //执行标准成本计算(参数传递)
109
+        FlowInstance flowInstance = ((IDataFlowInstanceService) flowInstanceService).execute(flowDefinitionId, (String) null, (String) null);
110
+        if (flowInstance != null) {
111
+            FlowInstanceParameter flowInstanceParameter = new FlowInstanceParameter();
112
+            flowInstanceParameter.setFlowInstanceId(flowInstance.getId());
113
+            flowInstanceParameter.setParameters(parameters);
114
+            boolean save = flowInstanceParameterService.save(flowInstanceParameter);
115
+            if (save) {
116
+                isSuccess = true;
117
+            }
118
+        }
119
+//        flowInstanceService.execute(flowDefinitionId, null, null);
95 120
     }
96 121
 
97 122
     /**
@@ -100,23 +125,59 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl<AppSceneCostCountM
100 125
      * @param appSceneCostCount
101 126
      */
102 127
     @Override
103
-    public void addCostCountTask(AppSceneCostCount appSceneCostCount) {
128
+    public void addCostCountTask(AppSceneCostCountVO appSceneCostCount) {
104 129
         //1.新增版本号记录成功后
130
+        appSceneCostCount.setCostVersion("Version"+String.valueOf(new Random().nextInt(100000)));
105 131
         AppSceneCostStandardVersion costStandardVersion = AppSceneCostStandardVersion.builder().graphicnumber(appSceneCostCount.getDrawingNo()).matnr(appSceneCostCount.getMaterialNo()).stage(appSceneCostCount.getStage()).version(appSceneCostCount.getCostVersion()).versionYear(appSceneCostCount.getYear()).build();
106 132
         boolean save = costStandardVersionService.save(costStandardVersion);
107 133
         //2.新增标准成本计算任务,并立即执行标准成本计算
108 134
         if (save) {
109 135
             AppSceneCostCount appSceneCostCount1 = AppSceneCostCount.builder().materialNo(appSceneCostCount.getMaterialNo()).drawingNo(appSceneCostCount.getDrawingNo()).stage(appSceneCostCount.getStage()).flowDefinitionId(appSceneCostCount.getFlowDefinitionId()).year(appSceneCostCount.getYear()).costVersion(costStandardVersion.getVersion()).status(CostCountStatusEnum.Executing.getValue()).createTime(new Date()).build();
110 136
             boolean flag = save(appSceneCostCount1);
111
-            if (flag) {
112
-                //发送更新成本计算状态的队列消息(队列名:updateCostCountStatus)
137
+            //方案一:模型组件运行
138
+//            if (flag) {
139
+//                //发送更新成本计算状态的队列消息(队列名:updateCostCountStatus)
140
+//
141
+//                //执行标准成本计算
142
+//                executeStandardCost(appSceneCostCount1.getId(), appSceneCostCount1.getFlowDefinitionId(), appSceneCostCount.getMaterialNo());
143
+//                //TODO 新增部件缺失信息记录
144
+//                AppSceneCostPartMissingInfo costPartMissingInfo = AppSceneCostPartMissingInfo.builder().costStandardId(appSceneCostCount1.getId().toString()).materialNumber(appSceneCostCount1.getMaterialNo()).versionNumber(appSceneCostCount1.getCostVersion()).missingInfo("电源线;绝缘层涂料").build();
145
+//                costPartMissingInfoMapper.insert(costPartMissingInfo);
146
+//            }
113 147
 
114
-                //执行标准成本计算
115
-                executeStandardCost(appSceneCostCount1.getId(), appSceneCostCount1.getFlowDefinitionId());
116
-                //TODO 新增部件缺失信息记录
117
-                AppSceneCostPartMissingInfo costPartMissingInfo = AppSceneCostPartMissingInfo.builder().costStandardId(appSceneCostCount1.getId().toString()).materialNumber(appSceneCostCount1.getMaterialNo()).versionNumber(appSceneCostCount1.getCostVersion()).missingInfo("电源线;绝缘层涂料").build();
118
-                costPartMissingInfoMapper.insert(costPartMissingInfo);
119
-            }
148
+            // 方案二:直接执行标准成本计算
149
+            countStandardCost(appSceneCostCount, (new Random().nextInt(1000)) + (new Random().nextInt(100)));
120 150
         }
121 151
     }
152
+
153
+    /**
154
+     * 执行标准成本计算
155
+     *
156
+     * @param appSceneCostCount1
157
+     */
158
+    private void countStandardCost(AppSceneCostCountVO appSceneCostCount1, Integer flowInstanceId) {
159
+        //0.获取物料下所有的子物料
160
+        StandardCostService.getAllMaterialBomInfoByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "MaterialInput", "MaterialInput001", flowInstanceId);
161
+        //1.物料成本计算
162
+        StandardCostService.countMaterialCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "MaterialCost", "MaterialCost002", flowInstanceId, FeeTypeEnum.MaterialCost.getCode());
163
+        //2.人工成本计算
164
+        AppSceneCostHourRate hourRate = new AppSceneCostHourRate();
165
+        hourRate.setYear(appSceneCostCount1.getYear());
166
+        hourRate.setCostCenterCode(appSceneCostCount1.getCostCenter());
167
+        hourRate.setFactory(appSceneCostCount1.getFactory()==null?"8100":appSceneCostCount1.getFactory());
168
+        StandardCostService.countLaborCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "LaborCost", "LaborCost003", flowInstanceId, FeeTypeEnum.LaborCost.getCode(), hourRate);
169
+        //3.制造计算(各种费用)MaterialCost("MaterialCost", "物料成本"), EquipmentFee("EquipmentFee", "设备费"), SupplyMaterialFee("SupplyMaterialFee", "辅料费"), DriverFee("DriverFee", "水电费"), OtherFee("OtherFee", "其他费用"), LogisticsFee("LogisticsFee", "物流费")
170
+       //3.1设备费计算
171
+        StandardCostService.countManufacturingCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "ManufacturingCost", "ManufacturingCost004", flowInstanceId, FeeTypeEnum.EquipmentFee.getCode(), hourRate);
172
+       //3.2辅料费计算
173
+        StandardCostService.countManufacturingCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "ManufacturingCost", "ManufacturingCost005", flowInstanceId, FeeTypeEnum.SupplyMaterialFee.getCode(), hourRate);
174
+        //3.3水电费
175
+        StandardCostService.countManufacturingCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "ManufacturingCost", "ManufacturingCost006", flowInstanceId, FeeTypeEnum.DriverFee.getCode(), hourRate);
176
+       //3.4其他费用
177
+        StandardCostService.countManufacturingCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "ManufacturingCost", "ManufacturingCost007", flowInstanceId, FeeTypeEnum.OtherFee.getCode(), hourRate);
178
+        //3.5物流费
179
+        StandardCostService.countManufacturingCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "ManufacturingCost", "ManufacturingCost008", flowInstanceId, FeeTypeEnum.LogisticsFee.getCode(), hourRate);
180
+        //4.标准成本本计算
181
+        StandardCostService.countStandardCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "StandardCost", "StandardCost009", flowInstanceId, FeeTypeEnum.StandardCost.getCode(),appSceneCostCount1.getCostVersion());
182
+    }
122 183
 }

+ 27
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostHourRateServiceImpl.java Parādīt failu

@@ -1,9 +1,12 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
4 6
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
5 7
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostHourRateMapper;
6 8
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostHourRateService;
9
+import org.jeecg.common.system.query.QueryGenerator;
7 10
 import org.springframework.stereotype.Service;
8 11
 
9 12
 /**
@@ -15,4 +18,28 @@ import org.springframework.stereotype.Service;
15 18
 @Service
16 19
 public class AppSceneCostHourRateServiceImpl extends ServiceImpl<AppSceneCostHourRateMapper, AppSceneCostHourRate> implements IAppSceneCostHourRateService {
17 20
 
21
+    /**
22
+     * 查询满足条件的一条小时费率信息
23
+     *
24
+     * @param appSceneCostHourRate
25
+     * @return
26
+     */
27
+    @Override
28
+    public AppSceneCostHourRate getOneHourRateInfo(AppSceneCostHourRate appSceneCostHourRate) {
29
+        QueryWrapper<AppSceneCostHourRate> queryWrapper = new QueryWrapper<>();
30
+        if(appSceneCostHourRate!=null){
31
+            if(appSceneCostHourRate.getYear()!=null){
32
+                queryWrapper.eq("year",appSceneCostHourRate.getYear());
33
+            }
34
+            if(appSceneCostHourRate.getCostCenterCode()!=null){
35
+                queryWrapper.eq("cost_center_code",appSceneCostHourRate.getCostCenterCode());
36
+            }
37
+            if(appSceneCostHourRate.getFactory()!=null){
38
+                queryWrapper.eq("factory",appSceneCostHourRate.getFactory());
39
+            }
40
+            queryWrapper.last("limit 1");
41
+            return this.getOne(queryWrapper);
42
+        }
43
+        return null;
44
+    }
18 45
 }

+ 0
- 60
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java Parādīt failu

@@ -1,60 +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.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom;
6
-import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialBomMapper;
7
-import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialBomService;
8
-import org.springframework.beans.factory.annotation.Autowired;
9
-import org.springframework.stereotype.Service;
10
-
11
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
12
-
13
-import java.util.List;
14
-
15
-/**
16
- * @Description: app_scene_cost_material_bom
17
- * @Author: jeecg-boot
18
- * @Date: 2024-08-02
19
- * @Version: V1.0
20
- */
21
-@Service
22
-public class AppSceneCostMaterialBomServiceImpl extends ServiceImpl<AppSceneCostMaterialBomMapper, AppSceneCostMaterialBom> implements IAppSceneCostMaterialBomService {
23
-    @Autowired
24
-    AppSceneCostMaterialBomMapper costMaterialBomMapper;
25
-
26
-    /**
27
-     * 分页查询
28
-     *
29
-     * @param materialNumber
30
-     * @return
31
-     */
32
-    @Override
33
-    public List<AppSceneCostMaterialBom> queryListResult(String materialNumber) {
34
-        QueryWrapper queryWrapper = new QueryWrapper();
35
-        if (StrUtil.isNotEmpty(materialNumber)) {
36
-            // 物料号
37
-            queryWrapper.like("material_code", materialNumber);
38
-        }
39
-        List list = costMaterialBomMapper.selectList(queryWrapper);
40
-        return list;
41
-    }
42
-
43
-    /**
44
-     * 查询最顶层物料编号下所有的物料
45
-     *
46
-     * @param topMaterialCode
47
-     * @return
48
-     */
49
-    @Override
50
-    public List<AppSceneCostMaterialBom> queryAllBomInfoBytopMaterialCode(String topMaterialCode) {
51
-        QueryWrapper queryWrapper = new QueryWrapper();
52
-        //TODO 循环遍历查出所有的物料下的物料(包含最上层的物料)
53
-//        if (StrUtil.isNotEmpty(topMaterialCode)) {
54
-//            // 物料号
55
-//            queryWrapper.like("material_code", topMaterialCode);
56
-//        }
57
-        List list = costMaterialBomMapper.selectList(queryWrapper);
58
-        return list;
59
-    }
60
-}

+ 0
- 55
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java Parādīt failu

@@ -1,55 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
-
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
-import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours;
6
-import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialProcessHoursMapper;
7
-import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialProcessHoursService;
8
-import org.springframework.beans.factory.annotation.Autowired;
9
-import org.springframework.stereotype.Service;
10
-
11
-import java.util.ArrayList;
12
-import java.util.HashMap;
13
-import java.util.List;
14
-import java.util.Map;
15
-
16
-/**
17
- * @Description: app_scene_cost_material_process_hours
18
- * @Author: jeecg-boot
19
- * @Date: 2024-08-02
20
- * @Version: V1.0
21
- */
22
-@Service
23
-public class AppSceneCostMaterialProcessHoursServiceImpl extends ServiceImpl<AppSceneCostMaterialProcessHoursMapper, AppSceneCostMaterialProcessHours> implements IAppSceneCostMaterialProcessHoursService {
24
-    @Autowired
25
-    AppSceneCostMaterialProcessHoursMapper costMaterialProcessHoursMapper;
26
-
27
-    /**
28
-     * 查询满足物料编号的工时工序
29
-     *
30
-     * @param materialNos
31
-     */
32
-    @Override
33
-    public Map<String, List<AppSceneCostMaterialProcessHours>> getProcessHoursByMaterialNo(List<String> materialNos) {
34
-        Map<String, List<AppSceneCostMaterialProcessHours>> map = new HashMap<>();
35
-        QueryWrapper<AppSceneCostMaterialProcessHours> queryWrapper = new QueryWrapper();
36
-        if (materialNos != null && materialNos.size() > 0) {
37
-            queryWrapper.in("material_code", materialNos);
38
-            List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = costMaterialProcessHoursMapper.selectList(queryWrapper);
39
-            for (int i = 0; i < costMaterialProcessHours.size(); i++) {
40
-                AppSceneCostMaterialProcessHours costMaterialProcessHours1 = costMaterialProcessHours.get(i);
41
-                String materialCode = costMaterialProcessHours1.getMaterialCode();
42
-                if (map.containsKey(materialCode)) {
43
-                    List<AppSceneCostMaterialProcessHours> list = map.get(materialCode);
44
-                    list.add(costMaterialProcessHours1);
45
-                    map.put(materialCode, list);
46
-                } else {
47
-                    List<AppSceneCostMaterialProcessHours> list = new ArrayList<>();
48
-                    list.add(costMaterialProcessHours1);
49
-                    map.put(materialCode, list);
50
-                }
51
-            }
52
-        }
53
-        return map;
54
-    }
55
-}

+ 40
- 2
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java Parādīt failu

@@ -1,19 +1,57 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
3 5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance;
4 6
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostProductProcessMaintenanceMapper;
5 7
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostProductProcessMaintenanceService;
8
+import org.springframework.beans.factory.annotation.Autowired;
6 9
 import org.springframework.stereotype.Service;
7 10
 
8
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11
+import java.util.ArrayList;
12
+import java.util.HashMap;
13
+import java.util.List;
14
+import java.util.Map;
9 15
 
10 16
 /**
11 17
  * @Description: app_scene_cost_product_process_maintenance
12 18
  * @Author: jeecg-boot
13
- * @Date:   2024-09-08
19
+ * @Date: 2024-09-08
14 20
  * @Version: V1.0
15 21
  */
16 22
 @Service
17 23
 public class AppSceneCostProductProcessMaintenanceServiceImpl extends ServiceImpl<AppSceneCostProductProcessMaintenanceMapper, AppSceneCostProductProcessMaintenance> implements IAppSceneCostProductProcessMaintenanceService {
18 24
 
25
+    @Autowired
26
+    AppSceneCostProductProcessMaintenanceMapper costMaterialProcessHoursMapper;
27
+
28
+    /**
29
+     * 查询满足物料编号的工时工序
30
+     *
31
+     * @param materialNos
32
+     */
33
+    @Override
34
+    public Map<String, List<AppSceneCostProductProcessMaintenance>> getProcessHoursByMaterialNo(List<String> materialNos) {
35
+        Map<String, List<AppSceneCostProductProcessMaintenance>> map = new HashMap<>();
36
+        QueryWrapper<AppSceneCostProductProcessMaintenance> queryWrapper = new QueryWrapper();
37
+        if (materialNos != null && materialNos.size() > 0) {
38
+            queryWrapper.in("main_part_number", materialNos);
39
+            queryWrapper.orderByAsc("serial_number");
40
+            List<AppSceneCostProductProcessMaintenance> costMaterialProcessHours = costMaterialProcessHoursMapper.selectList(queryWrapper);
41
+            for (int i = 0; i < costMaterialProcessHours.size(); i++) {
42
+                AppSceneCostProductProcessMaintenance costMaterialProcessHours1 = costMaterialProcessHours.get(i);
43
+                String materialCode = costMaterialProcessHours1.getMainPartNumber();
44
+                if (map.containsKey(materialCode)) {
45
+                    List<AppSceneCostProductProcessMaintenance> list = map.get(materialCode);
46
+                    list.add(costMaterialProcessHours1);
47
+                    map.put(materialCode, list);
48
+                } else {
49
+                    List<AppSceneCostProductProcessMaintenance> list = new ArrayList<>();
50
+                    list.add(costMaterialProcessHours1);
51
+                    map.put(materialCode, list);
52
+                }
53
+            }
54
+        }
55
+        return map;
56
+    }
19 57
 }

+ 0
- 47
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java Parādīt failu

@@ -1,47 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
-
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice;
5
-import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchasePriceMapper;
6
-import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchasePriceService;
7
-import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.stereotype.Service;
9
-
10
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11
-
12
-import java.math.BigDecimal;
13
-import java.util.HashMap;
14
-import java.util.List;
15
-import java.util.Map;
16
-
17
-/**
18
- * @Description: app_scene_cost_purchase_price
19
- * @Author: jeecg-boot
20
- * @Date:   2024-08-02
21
- * @Version: V1.0
22
- */
23
-@Service
24
-public class AppSceneCostPurchasePriceServiceImpl extends ServiceImpl<AppSceneCostPurchasePriceMapper, AppSceneCostPurchasePrice> implements IAppSceneCostPurchasePriceService {
25
-    @Autowired
26
-    AppSceneCostPurchasePriceMapper costPurchasePriceMapper;
27
-
28
-    /**
29
-     * 查询满足物料编号的最低采购价
30
-     *
31
-     * @param materialNos
32
-     */
33
-    @Override
34
-    public Map<String, BigDecimal> getMinCostPurchasePriceByMaterialNo(List<String> materialNos) {
35
-        Map<String, BigDecimal> map = new HashMap<>();
36
-        QueryWrapper<AppSceneCostPurchasePrice> queryWrapper = new QueryWrapper();
37
-        if (materialNos != null && materialNos.size() > 0) {
38
-            queryWrapper.in("material_code", materialNos);
39
-            List<AppSceneCostPurchasePrice> costPurchasePrices = costPurchasePriceMapper.selectList(queryWrapper);
40
-            for (int i = 0; i < costPurchasePrices.size(); i++) {
41
-                AppSceneCostPurchasePrice costPurchasePrice = costPurchasePrices.get(i);
42
-                map.put(costPurchasePrice.getMaterialCode(), costPurchasePrice.getMinPurchasePrice());
43
-            }
44
-        }
45
-        return map;
46
-    }
47
-}

+ 28
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java Parādīt failu

@@ -1,11 +1,18 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord;
5 6
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseRecordMapper;
6 7
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService;
8
+import org.springframework.beans.factory.annotation.Autowired;
7 9
 import org.springframework.stereotype.Service;
8 10
 
11
+import java.math.BigDecimal;
12
+import java.util.HashMap;
13
+import java.util.List;
14
+import java.util.Map;
15
+
9 16
 /**
10 17
  * @Description: app_scene_cost_purchase_record
11 18
  * @Author: jeecg-boot
@@ -14,5 +21,26 @@ import org.springframework.stereotype.Service;
14 21
  */
15 22
 @Service
16 23
 public class AppSceneCostPurchaseRecordServiceImpl extends ServiceImpl<AppSceneCostPurchaseRecordMapper, AppSceneCostPurchaseRecord> implements IAppSceneCostPurchaseRecordService {
24
+    @Autowired
25
+    AppSceneCostPurchaseRecordMapper appSceneCostPurchaseRecordMapper;
17 26
 
27
+    /**
28
+     * 查询满足物料编号的最低采购价
29
+     *
30
+     * @param materialNos
31
+     */
32
+    @Override
33
+    public Map<String, BigDecimal> getMinCostPurchasePriceByMaterialNo(List<String> materialNos) {
34
+        Map<String, BigDecimal> map = new HashMap<>();
35
+        QueryWrapper<AppSceneCostPurchaseRecord> queryWrapper = new QueryWrapper();
36
+        if (materialNos != null && materialNos.size() > 0) {
37
+            queryWrapper.in("INFNR", materialNos);
38
+            List<AppSceneCostPurchaseRecord> costPurchasePrices = appSceneCostPurchaseRecordMapper.selectList(queryWrapper);
39
+            for (int i = 0; i < costPurchasePrices.size(); i++) {
40
+                AppSceneCostPurchaseRecord costPurchasePrice = costPurchasePrices.get(i);
41
+                map.put(costPurchasePrice.getInfnr(), costPurchasePrice.getNetpr());
42
+            }
43
+        }
44
+        return map;
45
+    }
18 46
 }

+ 5
- 5
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java Parādīt failu

@@ -28,19 +28,19 @@ public class AppSceneCostResultValueServiceImpl extends ServiceImpl<AppSceneCost
28 28
      * 根据顶级物料编码查询满足条件的结果值
29 29
      *
30 30
      * @param topMaterialCode
31
-     * @param lastTaskType
31
+     * @param taskType
32 32
      * @param flowInstanceId
33 33
      * @return
34 34
      */
35 35
     @Override
36
-    public List<AppSceneCostResultValue> getResultValueByTopMaterialNo(String topMaterialCode, String lastTaskType, String flowInstanceId) {
36
+    public List<AppSceneCostResultValue> getResultValueByTopMaterialNo(String topMaterialCode, String taskType, String flowInstanceId) {
37 37
         List<AppSceneCostResultValue> result = new ArrayList<>();
38 38
         QueryWrapper<AppSceneCostResultValue> queryWrapper = new QueryWrapper<>();
39
-        if (topMaterialCode != null && !topMaterialCode.equals("") && lastTaskType != null && !lastTaskType.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) {
39
+        if (topMaterialCode != null && !topMaterialCode.equals("") && taskType != null && !taskType.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) {
40 40
             //查询某个流程节点(即执行任务)的结果值
41
-            queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("task_type", lastTaskType).eq("flow_instance_id", flowInstanceId);
41
+            queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("task_type", taskType).eq("flow_instance_id", flowInstanceId);
42 42
             result = appSceneCostResultValueMapper.selectList(queryWrapper);
43
-        } else if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("") && lastTaskType == null) {
43
+        } else if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("") && taskType == null) {
44 44
             //查询BOM物料所有的树节点信息
45 45
             queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("flow_instance_id", flowInstanceId).isNull("task_type");
46 46
             result = appSceneCostResultValueMapper.selectList(queryWrapper);

+ 21
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java Parādīt failu

@@ -0,0 +1,21 @@
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.AppSceneCostStandardDetail;
5
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardResult;
6
+import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardDetailMapper;
7
+import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardResultMapper;
8
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardDetailService;
9
+import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardResultService;
10
+import org.springframework.stereotype.Service;
11
+
12
+/**
13
+ * @Description: app_scene_cost_standard_detail
14
+ * @Author: jeecg-boot
15
+ * @Date:   2024-07-31
16
+ * @Version: V1.0
17
+ */
18
+@Service
19
+public class AppSceneCostStandardResultServiceImpl extends ServiceImpl<AppSceneCostStandardResultMapper, AppSceneCostStandardResult> implements IAppSceneCostStandardResultService {
20
+
21
+}

+ 56
- 2
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java Parādīt failu

@@ -1,12 +1,66 @@
1 1
 package com.zzsmart.qomo.kn.cost.manage.vo;
2 2
 
3
-import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
3
+import io.swagger.annotations.ApiModelProperty;
4
+import lombok.AllArgsConstructor;
5
+import lombok.Builder;
4 6
 import lombok.Data;
7
+import lombok.NoArgsConstructor;
5 8
 
6 9
 @Data
7
-public class AppSceneCostCountVO extends AppSceneCostCount {
10
+@Builder
11
+@NoArgsConstructor
12
+@AllArgsConstructor
13
+public class AppSceneCostCountVO {
14
+    /**
15
+     * 主键
16
+     */
17
+    @ApiModelProperty(value = "主键")
18
+    private Integer id;
19
+    /**
20
+     * 物料编号
21
+     */
22
+    @ApiModelProperty(value = "物料编号")
23
+    private String materialNo;
24
+    /**
25
+     * 图号
26
+     */
27
+    @ApiModelProperty(value = "图号")
28
+    private String drawingNo;
29
+    /**
30
+     * stage
31
+     */
32
+    @ApiModelProperty(value = "stage")
33
+    private String stage;
34
+    /**
35
+     * 标准成本计算流程id
36
+     */
37
+    @ApiModelProperty(value = "标准成本计算流程id")
38
+    private Integer flowDefinitionId;
39
+    /**
40
+     * year
41
+     */
42
+    @ApiModelProperty(value = "year")
43
+    private String year;
44
+    /**
45
+     * 状态
46
+     */
47
+    @ApiModelProperty(value = "状态")
48
+    private Integer status;
49
+    /**
50
+     * 模型版本
51
+     */
52
+    @ApiModelProperty(value = "标准成本版本")
53
+    private String costVersion;
8 54
     /**
9 55
      * 状态名称
10 56
      */
11 57
     public String statusName;
58
+    /**
59
+     * 成本中心
60
+     */
61
+    public String costCenter;
62
+    /**
63
+     * 工厂
64
+     */
65
+    public String factory;
12 66
 }

+ 209
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostStandardResultVO.java Parādīt failu

@@ -0,0 +1,209 @@
1
+package com.zzsmart.qomo.kn.cost.manage.vo;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.fasterxml.jackson.annotation.JsonFormat;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.AllArgsConstructor;
8
+import lombok.Builder;
9
+import lombok.Data;
10
+import lombok.NoArgsConstructor;
11
+import org.jeecgframework.poi.excel.annotation.Excel;
12
+import org.springframework.format.annotation.DateTimeFormat;
13
+
14
+import java.math.BigDecimal;
15
+import java.util.Date;
16
+
17
+@Data
18
+@NoArgsConstructor
19
+@AllArgsConstructor
20
+@Builder
21
+public class AppSceneCostStandardResultVO {
22
+
23
+    /**
24
+     * id
25
+     */
26
+    @TableId(type = IdType.ASSIGN_ID)
27
+    @ApiModelProperty(value = "id")
28
+    private String id;
29
+    /**
30
+     * 图号
31
+     */
32
+    @Excel(name = "图号", width = 15)
33
+    @ApiModelProperty(value = "图号")
34
+    private String figureNumber;
35
+    /**
36
+     * 物料号,关联kn_new_sap_mara表matnr字段
37
+     */
38
+    @Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15)
39
+    @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段")
40
+    private String materialNumber;
41
+    /**
42
+     * 物料名称
43
+     */
44
+    @Excel(name = "物料名称", width = 15)
45
+    @ApiModelProperty(value = "物料名称")
46
+    private String materialName;
47
+    /**
48
+     * 父类物料号
49
+     */
50
+    @Excel(name = "父类物料号", width = 15)
51
+    @ApiModelProperty(value = "父类物料号")
52
+    private String parentMaterialNumber;
53
+    /**
54
+     * 版本号
55
+     */
56
+    @Excel(name = "版本号", width = 15)
57
+    @ApiModelProperty(value = "版本号")
58
+    private String versionNumber;
59
+    /**
60
+     * 层级
61
+     */
62
+    @Excel(name = "层级", width = 15)
63
+    @ApiModelProperty(value = "层级")
64
+    private Integer level;
65
+    /**
66
+     * 序号
67
+     */
68
+    @Excel(name = "序号", width = 15)
69
+    @ApiModelProperty(value = "序号")
70
+    private Integer sort;
71
+    /**
72
+     * 用量
73
+     */
74
+    @Excel(name = "用量", width = 15)
75
+    @ApiModelProperty(value = "用量")
76
+    private Double dosage;
77
+    /**
78
+     * 单位
79
+     */
80
+    @Excel(name = "单位", width = 15)
81
+    @ApiModelProperty(value = "单位")
82
+    private String unit;
83
+    /**
84
+     * 本阶材料费
85
+     */
86
+    @Excel(name = "本阶材料费", width = 15)
87
+    @ApiModelProperty(value = "本阶材料费")
88
+    private BigDecimal materialCost;
89
+    /**
90
+     * 本阶人工费
91
+     */
92
+    @Excel(name = "本阶人工陈本", width = 15)
93
+    @ApiModelProperty(value = "本阶人工成本")
94
+    private BigDecimal laborCost;
95
+    /**
96
+     * 本阶辅料费
97
+     */
98
+    @Excel(name = "本阶辅料费", width = 15)
99
+    @ApiModelProperty(value = "本阶辅料费")
100
+    private BigDecimal supplyMaterialCost;
101
+    /**
102
+     * 本阶机器折旧费
103
+     */
104
+    @Excel(name = "本阶机器折旧费", width = 15)
105
+    @ApiModelProperty(value = "本阶机器折旧费")
106
+    private BigDecimal equipmentCost;
107
+    /**
108
+     * 本阶水电费(燃动费)
109
+     */
110
+    @Excel(name = "本阶水电费(燃动费)", width = 15)
111
+    @ApiModelProperty(value = "本阶水电费(燃动费)")
112
+    private BigDecimal driveCost;
113
+    /**
114
+     * 本阶其他制造费
115
+     */
116
+    @Excel(name = "本阶其他费用", width = 15)
117
+    @ApiModelProperty(value = "本阶其他费用")
118
+    private BigDecimal otherCost;
119
+    /**
120
+     * 本阶物流费
121
+     */
122
+    @Excel(name = "本阶物流费", width = 15)
123
+    @ApiModelProperty(value = "本阶物流费")
124
+    private BigDecimal logisticsCost;
125
+    /**
126
+     * 累计物料成本
127
+     */
128
+    @Excel(name = "累计物料成本", width = 15)
129
+    @ApiModelProperty(value = "累计物料成本")
130
+    private BigDecimal totalMaterialCost;
131
+    /**
132
+     * 累计人工成本
133
+     */
134
+    @Excel(name = "累计人工成本", width = 15)
135
+    @ApiModelProperty(value = "累计人工成本")
136
+    private BigDecimal totalLaborCost;
137
+    /**
138
+     * 累计辅料费
139
+     */
140
+    @Excel(name = "累计辅料费", width = 15)
141
+    @ApiModelProperty(value = "累计辅料费")
142
+    private BigDecimal totalSupplyMaterialCost;
143
+    /**
144
+     * 累计机器折旧费
145
+     */
146
+    @Excel(name = "累计机器折旧费", width = 15)
147
+    @ApiModelProperty(value = "累计机器折旧费")
148
+    private BigDecimal totalEquipmentCost;
149
+    /**
150
+     * 累计水电费(燃动费)
151
+     */
152
+    @Excel(name = "累计水电费(燃动费)", width = 15)
153
+    @ApiModelProperty(value = "累计水电费(燃动费)")
154
+    private BigDecimal totalDriveCost;
155
+    /**
156
+     * 累计其他费用
157
+     */
158
+    @Excel(name = "累计其他费用", width = 15)
159
+    @ApiModelProperty(value = "累计其他费用")
160
+    private BigDecimal totalOtherCost;
161
+    /**
162
+     * 累计物流费用
163
+     */
164
+    @Excel(name = "累计物流费用", width = 15)
165
+    @ApiModelProperty(value = "累计物流费用")
166
+    private BigDecimal totalLogisticsCost;
167
+    /**
168
+     * 本阶标准成本
169
+     */
170
+    @Excel(name = "本阶标准成本", width = 15)
171
+    @ApiModelProperty(value = "本阶标准成本")
172
+    private BigDecimal currentStandardCost;
173
+    /**
174
+     * 累计标准成本
175
+     */
176
+    @Excel(name = "累计标准成本", width = 15)
177
+    @ApiModelProperty(value = "累计标准成本")
178
+    private BigDecimal totalStandardCost;
179
+    /**
180
+     * 创建人
181
+     */
182
+    @ApiModelProperty(value = "创建人")
183
+    private String createBy;
184
+    /**
185
+     * 创建日期
186
+     */
187
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
188
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
189
+    @ApiModelProperty(value = "创建日期")
190
+    private Date createTime;
191
+    /**
192
+     * 修改人
193
+     */
194
+    @ApiModelProperty(value = "修改人")
195
+    private String updateBy;
196
+    /**
197
+     * 修改日期
198
+     */
199
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
200
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
201
+    @ApiModelProperty(value = "修改日期")
202
+    private Date updateTime;
203
+    /**
204
+     * 备注
205
+     */
206
+    @Excel(name = "备注", width = 15)
207
+    @ApiModelProperty(value = "备注")
208
+    private String remark;
209
+}

+ 44
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java Parādīt failu

@@ -0,0 +1,44 @@
1
+package com.zzsmart.qomo.kn.cost.manage.vo;
2
+
3
+import com.zzsmart.qomo.common.enums.ReleaseState;
4
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import lombok.AllArgsConstructor;
7
+import lombok.Builder;
8
+import lombok.Data;
9
+import lombok.NoArgsConstructor;
10
+
11
+/**
12
+ * 模型信息封装
13
+ */
14
+@Data
15
+@AllArgsConstructor
16
+@NoArgsConstructor
17
+public class CostModelDefinitionVO extends AppSceneCostModel {
18
+    @ApiModelProperty("encoding")
19
+    private String code;
20
+    @ApiModelProperty("flow definition name")
21
+    private String name;
22
+    @ApiModelProperty("flow definition version")
23
+    private Integer version;
24
+    @ApiModelProperty("flow definition release state: 0:offline,1:online")
25
+    private ReleaseState releaseState;
26
+    @ApiModelProperty("定时调度表达式")
27
+    private String scheduleCron;
28
+    @ApiModelProperty("任务调度模式(1任务队列领取模式(推荐) 2所有集群服务器均可同时运行 3只有主服务器可运行(主服务器失败时其他服务器接管) 4由调度服务器统一调度)")
29
+    private Integer scheduleMode;
30
+    @ApiModelProperty("依赖周期(分钟)")
31
+    private Integer dependencyCycle;
32
+    @ApiModelProperty("在任务队列模式下可以根据任务重要性来领取任务(10为最高)")
33
+    private Integer taskImportance;
34
+    @ApiModelProperty("运行方式(0 禁用 1手动触发 2定时自动调度 3依赖上级流程)")
35
+    private Integer runMode;
36
+    @ApiModelProperty("project id")
37
+    private Integer projectId;
38
+    @ApiModelProperty("project code")
39
+    private String projectCode;
40
+    @ApiModelProperty("环境配置ID")
41
+    private Integer environmentId;
42
+    @ApiModelProperty("租户ID")
43
+    private Integer tenantId;
44
+}