#16 修改标准成本计算功能。修改标准成本单行查询功能

Fusionado
bgy fusionados 2 commits de bgy en dev hace 1 año
Se han modificado 46 ficheros con 1484 adiciones y 1791 borrados
  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. 0
    159
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java
  6. 53
    13
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java
  7. 0
    261
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java
  8. 0
    129
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialProcessHours.java
  9. 2
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java
  10. 0
    173
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java
  11. 2
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java
  12. 97
    35
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java
  13. 365
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardResult.java
  14. 25
    4
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java
  15. 3
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java
  16. 0
    34
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java
  17. 0
    14
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java
  18. 0
    14
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java
  19. 15
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardResultMapper.java
  20. 1
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml
  21. 0
    5
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml
  22. 0
    5
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml
  23. 1
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardResultMapper.xml
  24. 409
    332
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java
  25. 15
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java
  26. 2
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java
  27. 6
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java
  28. 0
    28
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java
  29. 0
    22
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java
  30. 8
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java
  31. 0
    22
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java
  32. 8
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java
  33. 14
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardResultService.java
  34. 42
    1
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java
  35. 28
    8
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java
  36. 27
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostHourRateServiceImpl.java
  37. 0
    60
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java
  38. 0
    55
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java
  39. 40
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java
  40. 0
    47
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java
  41. 28
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java
  42. 5
    5
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java
  43. 21
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java
  44. 56
    2
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java
  45. 209
    0
      qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostStandardResultVO.java
  46. 0
    1
      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 Ver fichero

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

+ 1
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java Ver fichero

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

+ 0
- 190
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java Ver fichero

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 Ver fichero

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
-}

+ 0
- 159
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java Ver fichero

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 Ver fichero

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail;
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
 import io.swagger.annotations.Api;
10
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.ApiOperation;
11
 import io.swagger.annotations.ApiOperation;
10
 import lombok.extern.slf4j.Slf4j;
12
 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.api.vo.Result;
13
 import org.jeecg.common.system.base.controller.JeecgController;
14
 import org.jeecg.common.system.base.controller.JeecgController;
14
 import org.jeecg.common.system.query.QueryGenerator;
15
 import org.jeecg.common.system.query.QueryGenerator;
16
+import org.springframework.beans.BeanUtils;
15
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.web.bind.annotation.GetMapping;
18
 import org.springframework.web.bind.annotation.GetMapping;
17
 import org.springframework.web.bind.annotation.RequestMapping;
19
 import org.springframework.web.bind.annotation.RequestMapping;
20
 import org.springframework.web.servlet.ModelAndView;
22
 import org.springframework.web.servlet.ModelAndView;
21
 
23
 
22
 import javax.servlet.http.HttpServletRequest;
24
 import javax.servlet.http.HttpServletRequest;
25
+import java.util.ArrayList;
26
+import java.util.List;
23
 
27
 
24
 /**
28
 /**
25
  * @Description: app_scene_cost_standard_detail
29
  * @Description: app_scene_cost_standard_detail
31
 @RestController
35
 @RestController
32
 @RequestMapping("//costStandardDetail")
36
 @RequestMapping("//costStandardDetail")
33
 @Slf4j
37
 @Slf4j
34
-public class AppSceneCostStandardDetailController extends JeecgController<AppSceneCostStandardDetail, IAppSceneCostStandardDetailService> {
38
+public class AppSceneCostStandardResultController extends JeecgController<AppSceneCostStandardResult, IAppSceneCostStandardResultService> {
35
     @Autowired
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
      * @param pageNo
46
      * @param pageNo
43
      * @param pageSize
47
      * @param pageSize
44
      * @param req
48
      * @param req
47
     //@AutoLog(value = "app_scene_cost_standard_detail-分页列表查询")
51
     //@AutoLog(value = "app_scene_cost_standard_detail-分页列表查询")
48
     @ApiOperation(value = "app_scene_cost_standard_detail-分页列表查询", notes = "app_scene_cost_standard_detail-分页列表查询")
52
     @ApiOperation(value = "app_scene_cost_standard_detail-分页列表查询", notes = "app_scene_cost_standard_detail-分页列表查询")
49
     @GetMapping(value = "/list")
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
      * @param appSceneCostStandardDetail
178
      * @param appSceneCostStandardDetail
139
      */
179
      */
140
 //    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:exportXls")
180
 //    //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:exportXls")
141
-    @RequestMapping(value = "/exportXls")
181
+    @GetMapping(value = "/exportXls")
142
     @ApiOperation(value = "cost-单行查询导出", notes = "cost-单行查询导出")
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 Ver fichero

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 Ver fichero

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
-}

+ 2
- 2
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java Ver fichero

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

+ 0
- 173
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java Ver fichero

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 Ver fichero

61
      */
61
      */
62
     @Excel(name = "数量", width = 15)
62
     @Excel(name = "数量", width = 15)
63
     @ApiModelProperty(value = "数量")
63
     @ApiModelProperty(value = "数量")
64
-    private Integer num;
64
+    private BigDecimal num;
65
     /**
65
     /**
66
      * 单位
66
      * 单位
67
      */
67
      */
85
      */
85
      */
86
     @Excel(name = "流程id", width = 15)
86
     @Excel(name = "流程id", width = 15)
87
     @ApiModelProperty(value = "流程id")
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 Ver fichero

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

+ 365
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardResult.java Ver fichero

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
+}

+ 25
- 4
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java Ver fichero

1
 package com.zzsmart.qomo.kn.cost.manage.mapper;
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
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
6
 import org.apache.ibatis.annotations.Param;
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
  * @Description: app_scene_cost_bom_relevancy
12
  * @Description: app_scene_cost_bom_relevancy
11
  * @Author: jeecg-boot
13
  * @Author: jeecg-boot
12
- * @Date:   2024-09-08
14
+ * @Date: 2024-09-08
13
  * @Version: V1.0
15
  * @Version: V1.0
14
  */
16
  */
15
 public interface AppSceneCostBomRelevancyMapper extends BaseMapper<AppSceneCostBomRelevancy> {
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 Ver fichero

1
 package com.zzsmart.qomo.kn.cost.manage.mapper;
1
 package com.zzsmart.qomo.kn.cost.manage.mapper;
2
 
2
 
3
+import com.alibaba.fastjson.JSONObject;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
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
  * @Description: app_scene_cost_hour_rate
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 Ver fichero

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 Ver fichero

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 Ver fichero

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 Ver fichero

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 Ver fichero

1
 <?xml version="1.0" encoding="UTF-8"?>
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">
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
 </mapper>
5
 </mapper>

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

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 Ver fichero

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 Ver fichero

1
 <?xml version="1.0" encoding="UTF-8"?>
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">
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
 </mapper>
5
 </mapper>

+ 409
- 332
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java Ver fichero

6
 import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum;
6
 import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum;
7
 import com.zzsmart.qomo.kn.cost.manage.enums.HourOrRateTypeEnum;
7
 import com.zzsmart.qomo.kn.cost.manage.enums.HourOrRateTypeEnum;
8
 import com.zzsmart.qomo.kn.cost.manage.enums.TotalCostEnum;
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
 import com.zzsmart.qomo.kn.cost.manage.service.*;
10
 import com.zzsmart.qomo.kn.cost.manage.service.*;
11
 import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO;
11
 import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO;
12
 import com.zzsmart.qomo.kn.cost.manage.vo.TotalResultValue;
12
 import com.zzsmart.qomo.kn.cost.manage.vo.TotalResultValue;
32
      * 物料BOM信息
32
      * 物料BOM信息
33
      */
33
      */
34
     @Autowired
34
     @Autowired
35
-    AppSceneCostMaterialBomMapper costMaterialBomMapper;
35
+    AppSceneCostBomRelevancyMapper appSceneCostBomRelevancyMapper;
36
     @Autowired
36
     @Autowired
37
-    IAppSceneCostMaterialBomService costMaterialBomService;
37
+    IAppSceneCostBomRelevancyService costMaterialBomService;
38
 
38
 
39
     /**
39
     /**
40
      * 小时费率
40
      * 小时费率
45
      * 采购单价
45
      * 采购单价
46
      */
46
      */
47
     @Autowired
47
     @Autowired
48
-    IAppSceneCostPurchasePriceService costPurchasePriceService;
48
+    IAppSceneCostPurchaseRecordService costPurchaseRecordService;
49
     /**
49
     /**
50
      * 工序
50
      * 工序
51
      */
51
      */
52
     @Autowired
52
     @Autowired
53
-    IAppSceneCostMaterialProcessHoursService costMaterialProcessHoursService;
53
+    IAppSceneCostProductProcessMaintenanceService costMaterialProcessHoursService;
54
     /**
54
     /**
55
      * 标准成本计算结果
55
      * 标准成本计算结果
56
      */
56
      */
69
      * 标准成本明细服务(单行查询服务)
69
      * 标准成本明细服务(单行查询服务)
70
      */
70
      */
71
     @Autowired
71
     @Autowired
72
-    private IAppSceneCostStandardDetailService iAppSceneCostStandardDetailService;
72
+    private IAppSceneCostStandardResultService iAppSceneCostStandardResultService;
73
 
73
 
74
     @PostConstruct
74
     @PostConstruct
75
     public void init() {
75
     public void init() {
76
         standardCostService = this;
76
         standardCostService = this;
77
-        standardCostService.costMaterialBomMapper = this.costMaterialBomMapper;
77
+        standardCostService.appSceneCostBomRelevancyMapper = this.appSceneCostBomRelevancyMapper;
78
         standardCostService.appSceneCostCountService = this.appSceneCostCountService;
78
         standardCostService.appSceneCostCountService = this.appSceneCostCountService;
79
         standardCostService.costMaterialBomService = this.costMaterialBomService;
79
         standardCostService.costMaterialBomService = this.costMaterialBomService;
80
-        standardCostService.costPurchasePriceService = this.costPurchasePriceService;
80
+        standardCostService.costPurchaseRecordService = this.costPurchaseRecordService;
81
         standardCostService.iHourRateService = this.iHourRateService;
81
         standardCostService.iHourRateService = this.iHourRateService;
82
         standardCostService.costMaterialProcessHoursService = this.costMaterialProcessHoursService;
82
         standardCostService.costMaterialProcessHoursService = this.costMaterialProcessHoursService;
83
         standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService;
83
         standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService;
84
-        standardCostService.iAppSceneCostStandardDetailService = this.iAppSceneCostStandardDetailService;
84
+        standardCostService.iAppSceneCostStandardResultService = this.iAppSceneCostStandardResultService;
85
     }
85
     }
86
 
86
 
87
     /**
87
     /**
110
             //1.查询出所有满足物料编号的物料(BOM物料)
110
             //1.查询出所有满足物料编号的物料(BOM物料)
111
             String sql = flowTaskInfoVO.getSqlString();
111
             String sql = flowTaskInfoVO.getSqlString();
112
             log.info("传递过来的SQL语句:" + sql);
112
             log.info("传递过来的SQL语句:" + sql);
113
-
113
+            //获取顶部物料下所有的物料信息并存储到新的表中
114
+            getAllMaterialBomInfoByTopMaterialCode(topMaterialCode, taskType, taskCode, flowInstanceId != null ? Integer.valueOf(flowInstanceId) : null);
114
         } catch (Exception e) {
115
         } catch (Exception e) {
115
             throw new RuntimeException(e);
116
             throw new RuntimeException(e);
116
         }
117
         }
117
     }
118
     }
118
 
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
+
119
     /**
507
     /**
120
      * 获取任务流程相关信息
508
      * 获取任务流程相关信息
121
      *
509
      *
182
      */
570
      */
183
     private static FlowTaskInfoVO queryFlowDefinitionByFlowInstanceId(FlowTaskInfoVO flowTaskInfoVO) {
571
     private static FlowTaskInfoVO queryFlowDefinitionByFlowInstanceId(FlowTaskInfoVO flowTaskInfoVO) {
184
         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";
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";
185
-        String blob = standardCostService.costMaterialBomMapper.customSelectBlobModelJson(sql);
573
+        String blob = standardCostService.appSceneCostBomRelevancyMapper.customSelectBlobModelJson(sql);
186
         if (blob != null) {
574
         if (blob != null) {
187
             if (blob != null && blob.contains("topMaterialCode")) {
575
             if (blob != null && blob.contains("topMaterialCode")) {
188
                 JSONObject jsonObject1 = JSON.parseObject(blob);
576
                 JSONObject jsonObject1 = JSON.parseObject(blob);
210
             String flowInstanceId = flowTaskInfoVO.getFlowInstanceId();
598
             String flowInstanceId = flowTaskInfoVO.getFlowInstanceId();
211
             //成本类型
599
             //成本类型
212
             String feeType = FeeTypeEnum.MaterialCost.getCode();
600
             String feeType = FeeTypeEnum.MaterialCost.getCode();
213
-            //1.查询出物料编号对应的下所有的BOM信息
214
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
215
-            //2.计算出所有的单个物料的物料成本
216
-            //2.1查询出物料的单价和采购数量
217
-            List<String> MarterialNoList = new ArrayList<>();
218
-            if (list != null && list.size() > 0) {
219
-                MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
220
-            }
221
-            //查询物料的采购价
222
-            Map<String, BigDecimal> purchasePriceMap = standardCostService.costPurchasePriceService.getMinCostPurchasePriceByMaterialNo(MarterialNoList);
223
-            for (int i = 0; i < list.size(); i++) {
224
-                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
225
-                String marterialNo = appSceneCostResultValue.getMarterialNo();
226
-                Integer num = appSceneCostResultValue.getNum();
227
-                if (marterialNo != null && num != null) {
228
-                    BigDecimal price = purchasePriceMap.get(marterialNo);
229
-                    BigDecimal number = new BigDecimal(num.toString());
230
-                    //单价乘以数量
231
-                    BigDecimal totalCost = price.multiply(number);
232
-                    //2.2计算出人工成本并存储到成本结果数据表中
233
-                    AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").priceOrRate(price).build();
234
-                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
235
-                }
236
-            }
601
+
237
         } catch (Exception e) {
602
         } catch (Exception e) {
238
             throw new RuntimeException(e);
603
             throw new RuntimeException(e);
239
         }
604
         }
260
             log.info("sql1:" + sql1);
625
             log.info("sql1:" + sql1);
261
             String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号
626
             String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号
262
             log.info("sql:" + sql);
627
             log.info("sql:" + sql);
263
-            JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql);
264
-            BigDecimal hourRate = new BigDecimal("0");
265
-            if (jsonObject != null) {
266
-                AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class);
267
-                hourRate = rate.getLaborHourRate();
268
-            }
269
-            //1.查询出物料编号对应的下所有的BOM信息
270
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
271
-            //2.计算出所有的单个物料的人工成本
272
-            //2.1查询出物料的人员工时和人工小时费率(涉及:小时费率表和工序表)
273
-            List<String> MarterialNoList = new ArrayList<>();
274
-            if (list != null && list.size() > 0) {
275
-                MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
276
-            }
277
-            //查询工序工时
278
-            Map<String, List<AppSceneCostMaterialProcessHours>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
279
-            for (int i = 0; i < list.size(); i++) {
280
-                AppSceneCostResultValue appSceneCostResultValue = list.get(i);
281
-                String marterialNo = appSceneCostResultValue.getMarterialNo();
282
-                if (marterialNo != null) {
283
-                    BigDecimal totalCost = new BigDecimal("0.0");
284
-                    BigDecimal laborHours = new BigDecimal("0.0");
285
-                    List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
286
-                    if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
287
-                        for (int j = 0; j < costMaterialProcessHours.size(); j++) {
288
-                            AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
289
-                            laborHours = laborHours.add(processHours.getLaborHours());
290
-                            //计算总人工成本
291
-                            totalCost = totalCost.add(processHours.getLaborHours().multiply(hourRate));
292
-                        }
293
-                    }
294
-                    //2.2计算出人工成本并存储到成本结果数据表中
295
-                    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();
296
-                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
297
-                }
298
-            }
628
+
299
         } catch (Exception e) {
629
         } catch (Exception e) {
300
             throw new RuntimeException(e);
630
             throw new RuntimeException(e);
301
         }
631
         }
328
             log.info("sql1:" + sql1);
658
             log.info("sql1:" + sql1);
329
             String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号
659
             String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号
330
             log.info("sql:" + sql);
660
             log.info("sql:" + sql);
331
-            JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql);
332
-            BigDecimal hourRate = new BigDecimal("0");
333
-            if (jsonObject != null) {
334
-                AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class);
335
-                hourRate = rate.getLaborHourRate();
336
-            }
337
-            //1.查询出物料编号对应的下所有的BOM信息
338
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
339
-            //2.根据费用类型进行不同的费用计算
340
-            //查询工序工时
341
-            List<String> MarterialNoList = new ArrayList<>();
342
-            if (list != null && list.size() > 0) {
343
-                MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
344
-            }
345
-            Map<String, List<AppSceneCostMaterialProcessHours>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
346
-            //2.1机器折旧费(机器工时*费率)
347
-            if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
348
-                for (int i = 0; i < list.size(); i++) {
349
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
350
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
351
-                    if (marterialNo != null) {
352
-                        BigDecimal totalCost = new BigDecimal("0.0");
353
-                        BigDecimal laborHours = new BigDecimal("0.0");
354
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
355
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
356
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
357
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
358
-                                laborHours = laborHours.add(processHours.getDeviceHours());
359
-                                //计算机器成本
360
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
361
-                            }
362
-                        }
363
-                        //2.2计算机器成本并存储到成本结果数据表中
364
-                        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();
365
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
366
-                    }
367
-                }
368
-            } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
369
-                //机物料消耗(辅料工时*费率)
370
-                for (int i = 0; i < list.size(); i++) {
371
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
372
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
373
-                    if (marterialNo != null) {
374
-                        BigDecimal totalCost = new BigDecimal("0.0");
375
-                        BigDecimal laborHours = new BigDecimal("0.0");
376
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
377
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
378
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
379
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
380
-                                //TODO 辅料工时来源
381
-                                laborHours = laborHours.add(processHours.getDeviceHours());
382
-                                //机物料消耗
383
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
384
-                            }
385
-                        }
386
-                        //2.2计算机物料消耗存储到成本结果数据表中
387
-                        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();
388
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
389
-                    }
390
-                }
391
-            } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
392
-                //2.3水电费(燃动力工时*费率)
393
-                for (int i = 0; i < list.size(); i++) {
394
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
395
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
396
-                    if (marterialNo != null) {
397
-                        BigDecimal totalCost = new BigDecimal("0.0");
398
-                        BigDecimal laborHours = new BigDecimal("0.0");
399
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
400
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
401
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
402
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
403
-                                //TODO 燃动力工时来源
404
-                                laborHours = laborHours.add(processHours.getDeviceHours());
405
-                                //水电费(燃动力工时*费率)成本
406
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
407
-                            }
408
-                        }
409
-                        //2.2计算机物料消耗存储到成本结果数据表中
410
-                        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();
411
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
412
-                    }
413
-                }
414
-            } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
415
-                //2.4其他制费(其他工时*费率)
416
-                for (int i = 0; i < list.size(); i++) {
417
-                    AppSceneCostResultValue appSceneCostResultValue = list.get(i);
418
-                    String marterialNo = appSceneCostResultValue.getMarterialNo();
419
-                    if (marterialNo != null) {
420
-                        BigDecimal totalCost = new BigDecimal("0.0");
421
-                        BigDecimal laborHours = new BigDecimal("0.0");
422
-                        List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
423
-                        if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
424
-                            for (int j = 0; j < costMaterialProcessHours.size(); j++) {
425
-                                AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
426
-                                //TODO 其他工时来源
427
-                                laborHours = laborHours.add(processHours.getDeviceHours());
428
-                                //其他制费成本
429
-                                totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
430
-                            }
431
-                        }
432
-                        //2.2计算机物料消耗存储到成本结果数据表中
433
-                        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();
434
-                        standardCostService.iAppSceneCostResultValueService.save(resultValue);
435
-                    }
436
-                }
437
-            } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
438
-                //查出所有的机器折旧费、机物料消耗、水电费、其他制费
439
-                list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "ManufacturingCost", flowInstanceId);
440
-                //2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%)
441
-                //按照物料编号进行分组
442
-                Map<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
443
-                for (String key : materialNoMap.keySet()) {
444
-                    List<AppSceneCostResultValue> appSceneCostResultValues = materialNoMap.get(key);
445
-                    BigDecimal totalCost = new BigDecimal("0.0");
446
-                    for (int j = 0; j < appSceneCostResultValues.size(); j++) {
447
-                        AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j);
448
-                        String countValue = appSceneCostResultValue.getCountValue();
449
-                        if (countValue != null) {
450
-                            totalCost = totalCost.add(new BigDecimal(countValue));
451
-                        }
452
-                    }
453
-                    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();
454
-                    standardCostService.iAppSceneCostResultValueService.save(resultValue);
455
-                }
456
-            }
661
+
457
         } catch (Exception e) {
662
         } catch (Exception e) {
458
             throw new RuntimeException(e);
663
             throw new RuntimeException(e);
459
         }
664
         }
476
             //获取流程id
681
             //获取流程id
477
             String flowInstanceId = flowTaskInfoVO.getFlowInstanceId();
682
             String flowInstanceId = flowTaskInfoVO.getFlowInstanceId();
478
             String costType = FeeTypeEnum.StandardCost.getCode();
683
             String costType = FeeTypeEnum.StandardCost.getCode();
479
-            //1.查询出根物料编号对应的下所有的BOM信息结果值
480
-            List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, flowInstanceId);
481
-            //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用)
482
-            //按照物料编号进行分组
483
-            Map<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
484
-            //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计
485
-            for (String key : materialNoMap.keySet()) {
486
-                List<AppSceneCostResultValue> appSceneCostResultValues = materialNoMap.get(key);
487
-                //按照费用类别进行分组
488
-                Map<String, List<AppSceneCostResultValue>> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType));
489
-                //【本阶标准成本】
490
-                BigDecimal currentCost = new BigDecimal("0.0");
491
-                //1.本阶物料成本
492
-                BigDecimal materialCost = new BigDecimal("0.0");
493
-                //2.本阶人工成本
494
-                BigDecimal laborCost = new BigDecimal("0.0");
495
-                //3.本阶制造费(设备费)
496
-                BigDecimal equipmentCost = new BigDecimal("0.0");
497
-                //4.本阶制造费(辅料费用)
498
-                BigDecimal supplyMaterialCost = new BigDecimal("0.0");
499
-                //5.本阶制造费(水电费、燃动费)
500
-                BigDecimal driveCost = new BigDecimal("0.0");
501
-                //6.本阶制造费(其他制造费用)
502
-                BigDecimal otherCost = new BigDecimal("0.0");
503
-                //7.本阶制造费(物流费)
504
-                BigDecimal logisticsCost = new BigDecimal("0.0");
505
-                //物料单价
506
-                BigDecimal materialUnitPrice = new BigDecimal("0.0");
507
-                //人员工时、小时费率
508
-                BigDecimal laborHour = new BigDecimal("0.0");
509
-                BigDecimal laborHourRate = new BigDecimal("0.0");
510
-                //设备工时、小时费率
511
-                BigDecimal equipmentHour = new BigDecimal("0.0");
512
-                BigDecimal equipmentHourRate = new BigDecimal("0.0");
513
-                //辅料工时、小时费率
514
-                BigDecimal supplyMaterialHour = new BigDecimal("0.0");
515
-                BigDecimal supplyMaterialHourRate = new BigDecimal("0.0");
516
-                //燃动工时、小时费率
517
-                BigDecimal driveHour = new BigDecimal("0.0");
518
-                BigDecimal driveHourRate = new BigDecimal("0.0");
519
-                //其他工时、小时费率
520
-                BigDecimal otherHour = new BigDecimal("0.0");
521
-                BigDecimal otherHourRate = new BigDecimal("0.0");
522
-                AppSceneCostResultValue currentMaterialCost = null;
523
-                //遍历所有费用类别计算本阶标准成本
524
-                for (int j = 0; j < appSceneCostResultValues.size(); j++) {
525
-                    if (j == 0) {
526
-                        currentMaterialCost = appSceneCostResultValues.get(0);
527
-                    }
528
-                    AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j);
529
-                    String countValue = appSceneCostResultValue.getCountValue();
530
-                    if (countValue != null) {
531
-                        currentCost = currentCost.add(new BigDecimal(countValue));
532
-                    }
533
-                }
534
-                //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率
535
-                for (String feeType : costTypeMap.keySet()) {
536
-                    List<AppSceneCostResultValue> appSceneCostResultValues1 = costTypeMap.get(feeType);
537
-                    for (int m = 0; m < appSceneCostResultValues1.size(); m++) {
538
-                        if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) {
539
-                            //物料成本
540
-                            materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
541
-                            //物料单价
542
-                            materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate();
543
-                        } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) {
544
-                            //人工成本
545
-                            laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
546
-                            //人工工时、小时费率
547
-                            laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour());
548
-                            laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
549
-                        } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
550
-                            //设备费用
551
-                            equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
552
-                            //设备工时、小时费率
553
-                            equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour());
554
-                            equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
555
-                        } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
556
-                            //辅料费用
557
-                            supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
558
-                            //辅料工时、小时费率
559
-                            supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour());
560
-                            supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
561
-                        } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
562
-                            //燃动费用
563
-                            driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
564
-                            //燃动工时、小时费率
565
-                            driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour());
566
-                            driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
567
-                        } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
568
-                            //物流费用
569
-                            logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
570
-                        } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
571
-                            //其他费用
572
-                            otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
573
-                            //其他工时、小时费率
574
-                            otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour());
575
-                            otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
576
-                        }
577
-                    }
578
-                }
579
-                //本阶不同费用类别成本统计
580
-                JSONObject currentLevelCostTypeDetail = new JSONObject();
581
-                currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost);
582
-                currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost);
583
-                currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost);
584
-                currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost);
585
-                currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost);
586
-                currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost);
587
-                currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost);
588
-                //统计本阶不同费用类别工时、小时费率
589
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice);
590
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour);
591
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate);
592
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour);
593
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate);
594
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour);
595
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate);
596
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour);
597
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate);
598
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour);
599
-                currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate);
600
-                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();
601
-                standardCostService.iAppSceneCostResultValueService.save(resultValue);
602
-            }
603
-            //3.计算出所有的单个物料的累计标准成本
604
-            List<AppSceneCostResultValue> standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId);
605
-            //【累计成本】的计算
606
-            totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId);
607
         } catch (Exception e) {
684
         } catch (Exception e) {
608
             e.printStackTrace();
685
             e.printStackTrace();
609
             throw new RuntimeException("计算成本失败");
686
             throw new RuntimeException("计算成本失败");
619
      * @param taskCode
696
      * @param taskCode
620
      * @param flowInstanceId
697
      * @param flowInstanceId
621
      */
698
      */
622
-    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) {
623
         try {
700
         try {
624
-            List<AppSceneCostStandardDetail> costStandardDetails = new ArrayList<>();
701
+            List<AppSceneCostStandardResult> costStandardResults = new ArrayList<>();
625
             //父类对应的子节点(除了最上层节点)
702
             //父类对应的子节点(除了最上层节点)
626
             Map<String, List<AppSceneCostResultValue>> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo));
703
             Map<String, List<AppSceneCostResultValue>> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo));
627
             for (int i = 0; i < standardCostList.size(); i++) {
704
             for (int i = 0; i < standardCostList.size(); i++) {
652
                 oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString());
729
                 oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString());
653
                 standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue);
730
                 standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue);
654
                 //构造单行成本查询记录
731
                 //构造单行成本查询记录
655
-                AppSceneCostStandardDetail costStandardDetail = AppSceneCostStandardDetail.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).materialName(oldAppSceneCostResultValue.getMarterialNo()).parentMaterialNumber(oldAppSceneCostResultValue.getParentMarterialNo())
656
-//                    .versionNumber()
732
+                AppSceneCostStandardResult costStandardResultValue = AppSceneCostStandardResult.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).parentMatnr(oldAppSceneCostResultValue.getParentMarterialNo()).versionNumber(versionNumber)
657
 //                    .level()
733
 //                    .level()
658
 //                    .sort()
734
 //                    .sort()
659
 //                    .figureNumber()
735
 //                    .figureNumber()
660
-                        .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();
661
-                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);
662
             }
739
             }
663
             //更新结果集到标准成本单行查询中去
740
             //更新结果集到标准成本单行查询中去
664
-            standardCostService.iAppSceneCostStandardDetailService.saveBatch(costStandardDetails);
741
+            standardCostService.iAppSceneCostStandardResultService.saveBatch(costStandardResults);
665
         } catch (Exception e) {
742
         } catch (Exception e) {
666
             e.printStackTrace();
743
             e.printStackTrace();
667
         }
744
         }

+ 15
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java Ver fichero

3
 import com.baomidou.mybatisplus.extension.service.IService;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
5
 
5
 
6
+import java.util.List;
7
+
6
 /**
8
 /**
7
  * @Description: app_scene_cost_bom_relevancy
9
  * @Description: app_scene_cost_bom_relevancy
8
  * @Author: jeecg-boot
10
  * @Author: jeecg-boot
10
  * @Version: V1.0
12
  * @Version: V1.0
11
  */
13
  */
12
 public interface IAppSceneCostBomRelevancyService extends IService<AppSceneCostBomRelevancy> {
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 Ver fichero

2
 
2
 
3
 import com.baomidou.mybatisplus.extension.service.IService;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
5
+import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostCountVO;
5
 import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
6
 import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
6
 
7
 
7
 import java.util.List;
8
 import java.util.List;
31
      * 添加标准成本计算任务
32
      * 添加标准成本计算任务
32
      * @param appSceneCostCount
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 Ver fichero

10
  * @Version: V1.0
10
  * @Version: V1.0
11
  */
11
  */
12
 public interface IAppSceneCostHourRateService extends IService<AppSceneCostHourRate> {
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 Ver fichero

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 Ver fichero

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 Ver fichero

3
 import com.baomidou.mybatisplus.extension.service.IService;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance;
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
  * @Description: app_scene_cost_product_process_maintenance
10
  * @Description: app_scene_cost_product_process_maintenance
8
  * @Author: jeecg-boot
11
  * @Author: jeecg-boot
9
- * @Date:   2024-09-08
12
+ * @Date: 2024-09-08
10
  * @Version: V1.0
13
  * @Version: V1.0
11
  */
14
  */
12
 public interface IAppSceneCostProductProcessMaintenanceService extends IService<AppSceneCostProductProcessMaintenance> {
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 Ver fichero

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 Ver fichero

3
 import com.baomidou.mybatisplus.extension.service.IService;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord;
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
  * @Description: app_scene_cost_purchase_record
11
  * @Description: app_scene_cost_purchase_record
8
  * @Author: jeecg-boot
12
  * @Author: jeecg-boot
10
  * @Version: V1.0
14
  * @Version: V1.0
11
  */
15
  */
12
 public interface IAppSceneCostPurchaseRecordService extends IService<AppSceneCostPurchaseRecord> {
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 Ver fichero

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 Ver fichero

1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
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
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy;
4
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper;
6
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper;
5
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService;
7
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService;
8
+import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.stereotype.Service;
9
 import org.springframework.stereotype.Service;
7
 
10
 
8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
 
12
 
13
+import java.util.List;
14
+
10
 /**
15
 /**
11
  * @Description: app_scene_cost_bom_relevancy
16
  * @Description: app_scene_cost_bom_relevancy
12
  * @Author: jeecg-boot
17
  * @Author: jeecg-boot
13
- * @Date:   2024-09-08
18
+ * @Date: 2024-09-08
14
  * @Version: V1.0
19
  * @Version: V1.0
15
  */
20
  */
16
 @Service
21
 @Service
17
 public class AppSceneCostBomRelevancyServiceImpl extends ServiceImpl<AppSceneCostBomRelevancyMapper, AppSceneCostBomRelevancy> implements IAppSceneCostBomRelevancyService {
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
 }

+ 28
- 8
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java Ver fichero

7
 import com.zzsmart.qomo.dao.entity.FlowInstance;
7
 import com.zzsmart.qomo.dao.entity.FlowInstance;
8
 import com.zzsmart.qomo.dao.entity.FlowInstanceParameter;
8
 import com.zzsmart.qomo.dao.entity.FlowInstanceParameter;
9
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
9
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
10
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
10
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo;
11
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo;
11
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion;
12
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion;
12
 import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum;
13
 import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum;
14
+import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum;
13
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper;
15
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper;
14
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper;
16
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper;
15
 import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService;
17
 import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService;
16
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService;
18
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService;
17
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService;
19
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService;
20
+import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostCountVO;
18
 import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
21
 import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
19
 import com.zzsmart.qomo.service.IDataFlowInstanceService;
22
 import com.zzsmart.qomo.service.IDataFlowInstanceService;
20
 import com.zzsmart.qomo.service.IFlowInstanceParameterService;
23
 import com.zzsmart.qomo.service.IFlowInstanceParameterService;
24
 import java.util.ArrayList;
27
 import java.util.ArrayList;
25
 import java.util.Date;
28
 import java.util.Date;
26
 import java.util.List;
29
 import java.util.List;
30
+import java.util.Random;
27
 
31
 
28
 /**
32
 /**
29
  * @Description: app_scene_cost_count
33
  * @Description: app_scene_cost_count
41
     private IFlowInstanceParameterService flowInstanceParameterService;
45
     private IFlowInstanceParameterService flowInstanceParameterService;
42
     @Autowired
46
     @Autowired
43
     private AppSceneCostPartMissingInfoMapper costPartMissingInfoMapper;
47
     private AppSceneCostPartMissingInfoMapper costPartMissingInfoMapper;
44
-    @Autowired
45
-    StandardCostService standardCostService;
48
+
46
 
49
 
47
     /**
50
     /**
48
      * 查看关键缺失部件
51
      * 查看关键缺失部件
122
      * @param appSceneCostCount
125
      * @param appSceneCostCount
123
      */
126
      */
124
     @Override
127
     @Override
125
-    public void addCostCountTask(AppSceneCostCount appSceneCostCount) {
128
+    public void addCostCountTask(AppSceneCostCountVO appSceneCostCount) {
126
         //1.新增版本号记录成功后
129
         //1.新增版本号记录成功后
130
+        appSceneCostCount.setCostVersion("Version"+String.valueOf(new Random().nextInt(100000)));
127
         AppSceneCostStandardVersion costStandardVersion = AppSceneCostStandardVersion.builder().graphicnumber(appSceneCostCount.getDrawingNo()).matnr(appSceneCostCount.getMaterialNo()).stage(appSceneCostCount.getStage()).version(appSceneCostCount.getCostVersion()).versionYear(appSceneCostCount.getYear()).build();
131
         AppSceneCostStandardVersion costStandardVersion = AppSceneCostStandardVersion.builder().graphicnumber(appSceneCostCount.getDrawingNo()).matnr(appSceneCostCount.getMaterialNo()).stage(appSceneCostCount.getStage()).version(appSceneCostCount.getCostVersion()).versionYear(appSceneCostCount.getYear()).build();
128
         boolean save = costStandardVersionService.save(costStandardVersion);
132
         boolean save = costStandardVersionService.save(costStandardVersion);
129
         //2.新增标准成本计算任务,并立即执行标准成本计算
133
         //2.新增标准成本计算任务,并立即执行标准成本计算
142
 //            }
146
 //            }
143
 
147
 
144
             // 方案二:直接执行标准成本计算
148
             // 方案二:直接执行标准成本计算
145
-            countStandardCost(appSceneCostCount1);
149
+            countStandardCost(appSceneCostCount, (new Random().nextInt(1000)) + (new Random().nextInt(100)));
146
         }
150
         }
147
     }
151
     }
148
 
152
 
151
      *
155
      *
152
      * @param appSceneCostCount1
156
      * @param appSceneCostCount1
153
      */
157
      */
154
-    private void countStandardCost(AppSceneCostCount appSceneCostCount1) {
158
+    private void countStandardCost(AppSceneCostCountVO appSceneCostCount1, Integer flowInstanceId) {
155
         //0.获取物料下所有的子物料
159
         //0.获取物料下所有的子物料
156
-
160
+        StandardCostService.getAllMaterialBomInfoByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "MaterialInput", "MaterialInput001", flowInstanceId);
157
         //1.物料成本计算
161
         //1.物料成本计算
158
-
162
+        StandardCostService.countMaterialCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "MaterialCost", "MaterialCost002", flowInstanceId, FeeTypeEnum.MaterialCost.getCode());
159
         //2.人工成本计算
163
         //2.人工成本计算
160
-        //3.制造计算(各种费用)
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);
161
         //4.标准成本本计算
180
         //4.标准成本本计算
181
+        StandardCostService.countStandardCostByTopMaterialCode(appSceneCostCount1.getMaterialNo(), "StandardCost", "StandardCost009", flowInstanceId, FeeTypeEnum.StandardCost.getCode(),appSceneCostCount1.getCostVersion());
162
     }
182
     }
163
 }
183
 }

+ 27
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostHourRateServiceImpl.java Ver fichero

1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
6
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
5
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostHourRateMapper;
7
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostHourRateMapper;
6
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostHourRateService;
8
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostHourRateService;
9
+import org.jeecg.common.system.query.QueryGenerator;
7
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
8
 
11
 
9
 /**
12
 /**
15
 @Service
18
 @Service
16
 public class AppSceneCostHourRateServiceImpl extends ServiceImpl<AppSceneCostHourRateMapper, AppSceneCostHourRate> implements IAppSceneCostHourRateService {
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 Ver fichero

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 Ver fichero

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 Ver fichero

1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
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
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance;
5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance;
4
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostProductProcessMaintenanceMapper;
6
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostProductProcessMaintenanceMapper;
5
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostProductProcessMaintenanceService;
7
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostProductProcessMaintenanceService;
8
+import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.stereotype.Service;
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
  * @Description: app_scene_cost_product_process_maintenance
17
  * @Description: app_scene_cost_product_process_maintenance
12
  * @Author: jeecg-boot
18
  * @Author: jeecg-boot
13
- * @Date:   2024-09-08
19
+ * @Date: 2024-09-08
14
  * @Version: V1.0
20
  * @Version: V1.0
15
  */
21
  */
16
 @Service
22
 @Service
17
 public class AppSceneCostProductProcessMaintenanceServiceImpl extends ServiceImpl<AppSceneCostProductProcessMaintenanceMapper, AppSceneCostProductProcessMaintenance> implements IAppSceneCostProductProcessMaintenanceService {
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 Ver fichero

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 Ver fichero

1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
1
 package com.zzsmart.qomo.kn.cost.manage.service.impl;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord;
5
 import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord;
5
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseRecordMapper;
6
 import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseRecordMapper;
6
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService;
7
 import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService;
8
+import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.stereotype.Service;
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
  * @Description: app_scene_cost_purchase_record
17
  * @Description: app_scene_cost_purchase_record
11
  * @Author: jeecg-boot
18
  * @Author: jeecg-boot
14
  */
21
  */
15
 @Service
22
 @Service
16
 public class AppSceneCostPurchaseRecordServiceImpl extends ServiceImpl<AppSceneCostPurchaseRecordMapper, AppSceneCostPurchaseRecord> implements IAppSceneCostPurchaseRecordService {
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 Ver fichero

28
      * 根据顶级物料编码查询满足条件的结果值
28
      * 根据顶级物料编码查询满足条件的结果值
29
      *
29
      *
30
      * @param topMaterialCode
30
      * @param topMaterialCode
31
-     * @param lastTaskType
31
+     * @param taskType
32
      * @param flowInstanceId
32
      * @param flowInstanceId
33
      * @return
33
      * @return
34
      */
34
      */
35
     @Override
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
         List<AppSceneCostResultValue> result = new ArrayList<>();
37
         List<AppSceneCostResultValue> result = new ArrayList<>();
38
         QueryWrapper<AppSceneCostResultValue> queryWrapper = new QueryWrapper<>();
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
             result = appSceneCostResultValueMapper.selectList(queryWrapper);
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
             //查询BOM物料所有的树节点信息
44
             //查询BOM物料所有的树节点信息
45
             queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("flow_instance_id", flowInstanceId).isNull("task_type");
45
             queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("flow_instance_id", flowInstanceId).isNull("task_type");
46
             result = appSceneCostResultValueMapper.selectList(queryWrapper);
46
             result = appSceneCostResultValueMapper.selectList(queryWrapper);

+ 21
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java Ver fichero

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 Ver fichero

1
 package com.zzsmart.qomo.kn.cost.manage.vo;
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
 import lombok.Data;
6
 import lombok.Data;
7
+import lombok.NoArgsConstructor;
5
 
8
 
6
 @Data
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
     public String statusName;
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 Ver fichero

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
+}

+ 0
- 1
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java Ver fichero

12
  * 模型信息封装
12
  * 模型信息封装
13
  */
13
  */
14
 @Data
14
 @Data
15
-@Builder
16
 @AllArgsConstructor
15
 @AllArgsConstructor
17
 @NoArgsConstructor
16
 @NoArgsConstructor
18
 public class CostModelDefinitionVO extends AppSceneCostModel {
17
 public class CostModelDefinitionVO extends AppSceneCostModel {