From b070f6b55b99c78a8a399e117fad4451e128503d Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Tue, 30 Jul 2024 17:04:14 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=BB=9F=E8=AE=A1=E7=9A=84=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 5 +- .../AppSceneCostCountController.java | 15 ++-- .../cost/manage/entity/AppSceneCostCount.java | 4 +- .../entity/AppSceneCostResultValue.java | 6 ++ .../manage/entity/CostPartMissingInfo.java | 2 + .../kn/cost/manage/enums/FeeTypeEnum.java | 26 ++++--- .../manage/plugin/StandardCostService.java | 71 +++++++++++++++++-- .../service/IAppSceneCostCountService.java | 5 +- .../IAppSceneCostResultValueService.java | 14 +++- .../impl/AppSceneCostCountServiceImpl.java | 35 ++++++++- .../AppSceneCostResultValueServiceImpl.java | 23 +++++- .../kn/cost/manage/vo/MissingComponentVO.java | 30 ++++++++ 12 files changed, 196 insertions(+), 40 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/MissingComponentVO.java diff --git a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml index ffffd3c..839dcd4 100644 --- a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml +++ b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml @@ -282,9 +282,8 @@ jeecg: #webapp文件路径 webapp: /opt/webapp shiro: -# excludeUrls: /api/**,/api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** -# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** - excludeUrls: /**/**,/**/**/** + excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** +# excludeUrls: /**/**,/**/**/** #阿里云oss存储和大鱼短信秘钥配置 oss: diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java index 7078a5c..c30a3e5 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; +import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -20,6 +21,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.List; /** * @Description: app_scene_cost_count @@ -47,10 +49,7 @@ public class AppSceneCostCountController extends JeecgController> queryPageList(AppSceneCostCount appSceneCostCount, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + public Result> queryPageList(AppSceneCostCount appSceneCostCount, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostCount, req.getParameterMap()); Page page = new Page(pageNo, pageSize); IPage pageList = appSceneCostCountService.page(page, queryWrapper); @@ -129,12 +128,12 @@ public class AppSceneCostCountController extends JeecgController queryMissingComponentById(@RequestParam(name = "id", required = true) String id) { - AppSceneCostCount appSceneCostCount = appSceneCostCountService.queryMissingComponentById(id); - if (appSceneCostCount == null) { + public Result> queryMissingComponentById(@RequestParam(name = "id", required = true) String id) { + List result = appSceneCostCountService.queryMissingComponentById(id); + if (result == null) { return Result.error("未找到对应数据"); } - return Result.OK(appSceneCostCount); + return Result.OK(result); } /** diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java index 60707fb..2a00bc3 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java @@ -63,8 +63,8 @@ public class AppSceneCostCount implements Serializable { @ApiModelProperty(value = "状态") private Integer status; /**模型版本*/ - @Excel(name = "模型版本", width = 15) - @ApiModelProperty(value = "模型版本") + @Excel(name = "标准成本版本", width = 15) + @ApiModelProperty(value = "标准成本版本") private String costVersion; /**创建人*/ @ApiModelProperty(value = "创建人") diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java index b431044..99b2454 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java @@ -115,4 +115,10 @@ public class AppSceneCostResultValue implements Serializable { @Excel(name = "成本类别", width = 15) @ApiModelProperty(value = "成本类别") private String costType; + /** + * 成本明细 + */ + @Excel(name = "成本明细", width = 15) + @ApiModelProperty(value = "成本明细") + private String costDetail; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java index dfeb6f2..a167b45 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Builder; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; @@ -25,6 +26,7 @@ import lombok.experimental.Accessors; * @Version: V1.0 */ @Data +@Builder @TableName("app_scene_cost_part_missing_info") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/FeeTypeEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/FeeTypeEnum.java index 2d22189..a1ad269 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/FeeTypeEnum.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/FeeTypeEnum.java @@ -9,24 +9,22 @@ package com.zzsmart.qomo.kn.cost.manage.enums; */ public enum FeeTypeEnum { - LaborCost("LaborCost", "人工成本"), - MaterialCost("MaterialCost", "物料成本"), - EquipmentFee("EquipmentFee", "设备费"), SupplyMaterialFee("SupplyMaterialFee", "辅料费"), DriverFee("DriverFee", "水电费"), OtherFee("OtherFee", "其他费用"), LogisticsFee("LogisticsFee", "物流费"); + LaborCost("LaborCost", "人工成本"), MaterialCost("MaterialCost", "物料成本"), EquipmentFee("EquipmentFee", "设备费"), SupplyMaterialFee("SupplyMaterialFee", "辅料费"), DriverFee("DriverFee", "水电费"), OtherFee("OtherFee", "其他费用"), LogisticsFee("LogisticsFee", "物流费"), StandardCost("StandardCost", "标准成本"); private final String code; - private final String text; + private final String name; - FeeTypeEnum(String code, String text) { + FeeTypeEnum(String code, String name) { this.code = code; - this.text = text; + this.name = name; } public String getCode() { return code; } - public String getText() { - return text; + public String getName() { + return name; } /** @@ -38,7 +36,7 @@ public enum FeeTypeEnum { public static String getTextByCode(String codeNo) { for (FeeTypeEnum value : FeeTypeEnum.values()) { if (value.getCode().equals(codeNo)) { - return value.getText(); + return value.name(); } } return codeNo.toString(); @@ -47,15 +45,15 @@ public enum FeeTypeEnum { /** * 根据text获取code * - * @param textStr + * @param name * @return */ - public static String getCodeByText(String textStr) { + public static String getCodeByName(String name) { for (FeeTypeEnum value : FeeTypeEnum.values()) { - if (value.getText().equals(textStr)) { - return value.getText(); + if (value.name().equals(name)) { + return value.name(); } } - return textStr; + return name; } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index d09caca..5c16008 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -220,7 +220,7 @@ public class StandardCostService { //单价乘以数量 BigDecimal totalCost = price.multiply(number); //2.2计算出人工成本并存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").build(); + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").build(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } } @@ -459,23 +459,74 @@ public class StandardCostService { String taskCode = flowTaskInfoVO.getTaskCode(); //获取流程id String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); - //1.查询出物料编号对应的下所有的BOM信息 - List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, null, flowInstanceId); + String costType = FeeTypeEnum.StandardCost.getCode(); + //1.查询出根物料编号对应的下所有的BOM信息结果值 + List list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, flowInstanceId); //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) //按照物料编号进行分组 Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); for (String key : materialNoMap.keySet()) { List appSceneCostResultValues = materialNoMap.get(key); - //本阶成本 + //按照费用类别进行分组 + Map> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType)); + //本阶标准成本 BigDecimal currentCost = new BigDecimal("0.0"); + //1.本阶物料成本 + BigDecimal materialCost = new BigDecimal("0.0"); + //2.本阶人工成本 + BigDecimal laborCost = new BigDecimal("0.0"); + //3.本阶制造费(设备费) + BigDecimal equipmentCost = new BigDecimal("0.0"); + //4.本阶制造费(辅料费用) + BigDecimal supplyMaterialCost = new BigDecimal("0.0"); + //5.本阶制造费(水电费、燃动费) + BigDecimal driveCost = new BigDecimal("0.0"); + //6.本阶制造费(其他制造费用) + BigDecimal otherCost = new BigDecimal("0.0"); + //7.本阶制造费(物流费) + BigDecimal logisticsCost = new BigDecimal("0.0"); + AppSceneCostResultValue currentMaterialCost = null; + //遍历所有费用类别计算本阶标准成本 for (int j = 0; j < appSceneCostResultValues.size(); j++) { + if (j == 0) { + currentMaterialCost = appSceneCostResultValues.get(0); + } AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); String countValue = appSceneCostResultValue.getCountValue(); if (countValue != null) { currentCost = currentCost.add(new BigDecimal(countValue)); } } - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(appSceneCostResultValues.get(0).getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(currentCost.toString()).build(); + //计算本阶各个费用类别费用 + for (String feeType : costTypeMap.keySet()) { + List appSceneCostResultValues1 = costTypeMap.get(feeType); + for (int m = 0; m < appSceneCostResultValues1.size(); m++) { + if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) { + materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) { + laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { + equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { + supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { + driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { + logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { + otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } + } + } + JSONObject costTypeDetail = new JSONObject(); + costTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost.toString()); + costTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost.toString()); + costTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost.toString()); + costTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost.toString()); + costTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost.toString()); + costTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost.toString()); + costTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost.toString()); + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(currentMaterialCost.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(currentCost.toString()).costDetail(JSON.toJSONString(costTypeDetail)).costType(costType).build(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } //3.计算出所有的单个物料的累计标准成本 @@ -494,10 +545,13 @@ public class StandardCostService { * @param flowInstanceId */ private static void totalCountCost(List standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId) { + //父类对应的子节点(除了最上层节点) Map> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo)); for (int i = 0; i < standardCostList.size(); i++) { + //当前节点及其对应的本阶成本 AppSceneCostResultValue oldAppSceneCostResultValue = standardCostList.get(i); BigDecimal totalCost = new BigDecimal(oldAppSceneCostResultValue.getCountValue()); + //循环计算出当前节点的累计成本 totalCost = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, topMaterialCode, taskType, taskCode, flowInstanceId, totalCost); oldAppSceneCostResultValue.setTotalValue(totalCost.toString()); standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue); @@ -519,6 +573,7 @@ public class StandardCostService { private static BigDecimal loopCount(AppSceneCostResultValue appSceneCostResultValue, Map> parentMaterialNoMap, String topMaterialCode, String taskType, String taskCode, String flowInstanceId, BigDecimal totalCost) { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (parentMaterialNoMap.containsKey(marterialNo)) { + //获取当前节点的子节点并遍历 List appSceneCostResultValues = parentMaterialNoMap.get(marterialNo); for (int j = 0; j < appSceneCostResultValues.size(); j++) { AppSceneCostResultValue appSceneCostResultValue1 = appSceneCostResultValues.get(j); @@ -526,7 +581,11 @@ public class StandardCostService { if (countValue != null) { totalCost = totalCost.add(new BigDecimal(countValue)); } - loopCount(appSceneCostResultValue1, parentMaterialNoMap, topMaterialCode, taskType, taskCode, flowInstanceId, totalCost); + //判断当前子节点是否还有子节点 + if (parentMaterialNoMap.containsKey(appSceneCostResultValue1.getMarterialNo())) { + //如果还有子节点则继续递归 + loopCount(appSceneCostResultValue1, parentMaterialNoMap, topMaterialCode, taskType, taskCode, flowInstanceId, totalCost); + } } } return totalCost; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java index 865605e..c986fef 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java @@ -2,6 +2,9 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; + +import java.util.List; /** * @Description: app_scene_cost_count @@ -15,7 +18,7 @@ public interface IAppSceneCostCountService extends IService { * @param id * @return */ - AppSceneCostCount queryMissingComponentById(String id); + List queryMissingComponentById(String id); /** * 重新计算 diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java index b2474e3..131a529 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java @@ -8,14 +8,24 @@ import java.util.List; /** * @Description: app_scene_cost_result_value * @Author: jeecg-boot - * @Date: 2024-07-22 + * @Date: 2024-07-22 * @Version: V1.0 */ public interface IAppSceneCostResultValueService extends IService { /** * 根据顶级物料编码查询满足条件的结果值 + * * @param topMaterialCode * @return */ - List getResultValueByTopMaterialNo(String topMaterialCode,String taskType,String flowInstanceId); + List getResultValueByTopMaterialNo(String topMaterialCode, String taskType, String flowInstanceId); + + /** + * 查询根物料的某次成本计算流程下的所有结果值 + * + * @param topMaterialCode + * @param flowInstanceId + * @return + */ + List getAllResultValueByTopMaterialNo(String topMaterialCode, String flowInstanceId); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java index b05627b..4da1102 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -1,16 +1,22 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.entity.CostPartMissingInfo; import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; +import com.zzsmart.qomo.kn.cost.manage.mapper.CostPartMissingInfoMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; +import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; import com.zzsmart.qomo.service.IDataFlowInstanceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @Description: app_scene_cost_count @@ -24,6 +30,8 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl queryMissingComponentById(String id) { + List list = new ArrayList<>(); + if (id != null) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("costStandardId", id); + List costPartMissingInfos = costPartMissingInfoMapper.selectList(queryWrapper); + if (costPartMissingInfos != null && costPartMissingInfos.size() > 0) { + for (int i = 0; i < costPartMissingInfos.size(); i++) { + CostPartMissingInfo costPartMissingInfo = costPartMissingInfos.get(i); + if (costPartMissingInfo.getMissingInfo() != null) { + String[] split = costPartMissingInfo.getMissingInfo().split(";"); + for (int j = 0; j < split.length; j++) { + MissingComponentVO temp = MissingComponentVO.builder().materialNumber(costPartMissingInfo.getMaterialNumber()).missingInfo(split[j]).versionNumber(costPartMissingInfo.getVersionNumber()).build(); + list.add(temp); + } + } + } + } + } + return list; } /** @@ -77,11 +103,14 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl result = new ArrayList<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); if (topMaterialCode != null && !topMaterialCode.equals("") && lastTaskType != null && !lastTaskType.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) { + //查询某个流程节点(即执行任务)的结果值 queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("task_type", lastTaskType).eq("flow_instance_id", flowInstanceId); result = appSceneCostResultValueMapper.selectList(queryWrapper); - } else if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) { + } else if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("") && lastTaskType == null) { + //查询BOM物料所有的树节点信息 + queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("flow_instance_id", flowInstanceId).isNull("task_type"); + result = appSceneCostResultValueMapper.selectList(queryWrapper); + } + return result; + } + + /** + * 查询根物料的某次成本计算流程下的所有结果值 + * + * @param topMaterialCode + * @param flowInstanceId + * @return + */ + @Override + public List getAllResultValueByTopMaterialNo(String topMaterialCode, String flowInstanceId) { + List result = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) { + //查询某个流程节点(即执行任务)的结果值 queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("flow_instance_id", flowInstanceId); result = appSceneCostResultValueMapper.selectList(queryWrapper); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/MissingComponentVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/MissingComponentVO.java new file mode 100644 index 0000000..c874e3f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/MissingComponentVO.java @@ -0,0 +1,30 @@ +package com.zzsmart.qomo.kn.cost.manage.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MissingComponentVO { + /** + * 物料编号 + */ + + private String materialNumber; + + /** + * 版本号 + */ + + private String versionNumber; + /** + * 缺失信息 + */ + + private String missingInfo; + +} From 137e83a126f3e74d5c20abfdf450aff1b4420ee1 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Tue, 30 Jul 2024 17:46:54 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=92=8C=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/controller/AppSceneCostModelController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java index 8652f67..fc5d5e4 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzsmart.qomo.dao.entity.FlowDefinition; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService; import com.zzsmart.qomo.service.IDataFlowDefinitionService; import io.swagger.annotations.Api; @@ -14,12 +13,12 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; -import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.Date; import java.util.List; /** @@ -32,7 +31,7 @@ import java.util.List; @RestController @RequestMapping("//cost-model") @Slf4j -public class AppSceneCostModelController { +public class AppSceneCostModelController { @Autowired private IAppSceneCostModelService appSceneCostModelService; @Autowired @@ -79,6 +78,8 @@ public class AppSceneCostModelController { @ApiOperation(value = "app_scene_cost_model-添加", notes = "app_scene_cost_model-添加") @PostMapping(value = "/add") public Result add(@RequestBody FlowDefinition flowDefinition) { + flowDefinition.setCreateTime(new Date()); + flowDefinition.setUpdateTime(new Date()); FlowDefinition definition = flowDefinitionService.add(flowDefinition); return Result.OK(definition); } @@ -91,9 +92,9 @@ public class AppSceneCostModelController { */ @AutoLog(value = "app_scene_cost_model-编辑") @ApiOperation(value = "app_scene_cost_model-编辑", notes = "app_scene_cost_model-编辑") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_model:edit") @PostMapping(value = "/edit") public Result edit(@RequestBody FlowDefinition flowDefinition) { + flowDefinition.setUpdateTime(new Date()); return Result.OK(flowDefinitionService.edit(flowDefinition)); } @@ -105,7 +106,6 @@ public class AppSceneCostModelController { */ @AutoLog(value = "app_scene_cost_model-通过id删除") @ApiOperation(value = "app_scene_cost_model-通过id删除", notes = "app_scene_cost_model-通过id删除") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_model:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name = "id", required = true) Integer id) { flowDefinitionService.delete(id); From ddc7772381b17ee3650eb141583b391d7d5981d0 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Wed, 31 Jul 2024 17:10:18 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=87=E5=87=86?= =?UTF-8?q?=E6=88=90=E6=9C=AC=E8=AE=A1=E7=AE=97=E5=90=8E=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=88=B0=E6=A0=87=E5=87=86=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E8=A1=A8=E4=B8=AD=EF=BC=88=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=A1=A8=E4=B8=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppSceneCostStandardDetailController.java | 159 ++++++++++ .../CostStandardDetailController.java | 70 ----- .../entity/AppSceneCostResultValue.java | 13 + .../entity/AppSceneCostStandardDetail.java | 159 ++++++++++ .../manage/entity/CostStandardDetail.java | 273 ------------------ .../cost/manage/enums/HourOrRateTypeEnum.java | 69 +++++ .../kn/cost/manage/enums/TotalCostEnum.java | 61 ++++ .../AppSceneCostStandardDetailMapper.java | 15 + .../mapper/CostStandardDetailMapper.java | 2 - .../xml/AppSceneCostStandardDetailMapper.xml | 5 + .../manage/plugin/StandardCostService.java | 200 ++++++++++--- .../service/CostStandardDetailService.java | 41 --- .../IAppSceneCostStandardDetailService.java | 14 + ...AppSceneCostStandardDetailServiceImpl.java | 19 ++ .../service/impl/BomTreeServiceImpl.java | 2 - .../impl/CostStandardDetailServiceImpl.java | 84 ------ .../kn/cost/manage/util/BomTreeBuilder.java | 2 - .../kn/cost/manage/util/EasyExcelUtil.java | 1 - .../manage/vo/CostStandardDetailSearch.java | 19 -- .../cost/manage/vo/CostStandardDetailVO.java | 30 -- .../kn/cost/manage/vo/TotalResultValue.java | 51 ++++ 21 files changed, 726 insertions(+), 563 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/HourOrRateTypeEnum.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/TotalCostEnum.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardDetailMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardDetailService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardDetailServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardDetailServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailSearch.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java new file mode 100644 index 0000000..e081205 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardDetailService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +@Api(tags = "cost-标准成本单行查询") +@RestController +@RequestMapping("//costStandardDetail") +@Slf4j +public class AppSceneCostStandardDetailController extends JeecgController { + @Autowired + private IAppSceneCostStandardDetailService appSceneCostStandardDetailService; + + /** + * 分页列表查询 + * + * @param appSceneCostStandardDetail + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_standard_detail-分页列表查询") + @ApiOperation(value = "app_scene_cost_standard_detail-分页列表查询", notes = "app_scene_cost_standard_detail-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostStandardDetail appSceneCostStandardDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardDetail, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostStandardDetailService.page(page, queryWrapper); + return Result.OK(pageList); + } +// +// /** +// * 添加 +// * +// * @param appSceneCostStandardDetail +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_detail-添加") +// @ApiOperation(value = "app_scene_cost_standard_detail-添加", notes = "app_scene_cost_standard_detail-添加") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) { +// appSceneCostStandardDetailService.save(appSceneCostStandardDetail); +// return Result.OK("添加成功!"); +// } + +// /** +// * 编辑 +// * +// * @param appSceneCostStandardDetail +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_detail-编辑") +// @ApiOperation(value = "app_scene_cost_standard_detail-编辑", notes = "app_scene_cost_standard_detail-编辑") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:edit") +// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) +// public Result edit(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) { +// appSceneCostStandardDetailService.updateById(appSceneCostStandardDetail); +// return Result.OK("编辑成功!"); +// } +// +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_detail-通过id删除") +// @ApiOperation(value = "app_scene_cost_standard_detail-通过id删除", notes = "app_scene_cost_standard_detail-通过id删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:delete") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name = "id", required = true) String id) { +// appSceneCostStandardDetailService.removeById(id); +// return Result.OK("删除成功!"); +// } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_detail-批量删除") +// @ApiOperation(value = "app_scene_cost_standard_detail-批量删除", notes = "app_scene_cost_standard_detail-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostStandardDetailService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } + +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "app_scene_cost_standard_detail-通过id查询") +// @ApiOperation(value = "app_scene_cost_standard_detail-通过id查询", notes = "app_scene_cost_standard_detail-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name = "id", required = true) String id) { +// AppSceneCostStandardDetail appSceneCostStandardDetail = appSceneCostStandardDetailService.getById(id); +// if (appSceneCostStandardDetail == null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(appSceneCostStandardDetail); +// } + + /** + * 导出excel + * + * @param request + * @param appSceneCostStandardDetail + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostStandardDetail appSceneCostStandardDetail) { + return super.exportXls(request, appSceneCostStandardDetail, AppSceneCostStandardDetail.class, "app_scene_cost_standard_detail"); + } + +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppSceneCostStandardDetail.class); +// } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java deleted file mode 100644 index 2b7586e..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; -import com.zzsmart.qomo.kn.cost.manage.service.CostStandardDetailService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailSearch; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - *

- * 标准成本明细表 前端控制器 - *

- * - * @author app_scene_cost_purchase_price - * @since 2024-06-19 - */ -@Api(tags = "cost-标准成本单行查询") -@RestController -@RequestMapping("//costStandardDetail") -@Slf4j -public class CostStandardDetailController extends JeecgController { - @Autowired - private CostStandardDetailService costStandardDetailService; - - /** - * 分页列表查询 - * - * @param costStandard - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "标准成本单行列表查询") - @ApiOperation(value = "标准成本单行列表查询", notes = "标准成本单行列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(CostStandardDetailVO costStandard, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { - - Page page = new Page(pageNo, pageSize); - IPage pageList = costStandardDetailService.pageList(page, costStandard); - return Result.OK(pageList); - } - - /** - * 导出excel - * - * @param request - * @param costStandardDetailSearch - */ - @RequestMapping(value = "/exportXls", method = RequestMethod.GET) - @ApiOperation(value = "单行查询导出", notes = "单行查询导出") - public Result exportXls(HttpServletRequest request, HttpServletResponse response, CostStandardDetailSearch costStandardDetailSearch) throws IOException { - JSONObject result = costStandardDetailService.exportExcel(request, response, costStandardDetailSearch); - return Result.OK(result); - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java index 99b2454..8d14ca3 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java @@ -14,6 +14,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -121,4 +122,16 @@ public class AppSceneCostResultValue implements Serializable { @Excel(name = "成本明细", width = 15) @ApiModelProperty(value = "成本明细") private String costDetail; + /** + * 单价或费率 + */ + @Excel(name = "单价或费率", width = 15) + @ApiModelProperty(value = "单价或费率") + private BigDecimal priceOrRate; + /** + * 工时 + */ + @Excel(name = "工时", width = 15) + @ApiModelProperty(value = "工时") + private BigDecimal hour; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java new file mode 100644 index 0000000..c6ed1d0 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +@Data +@Builder +@TableName("app_scene_cost_standard_detail") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_standard_detail对象", description = "app_scene_cost_standard_detail") +public class AppSceneCostStandardDetail implements Serializable { + private static final long serialVersionUID = 1L; + + /**id*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private String id; + /**图号*/ + @Excel(name = "图号", width = 15) + @ApiModelProperty(value = "图号") + private String figureNumber; + /**物料号,关联kn_new_sap_mara表matnr字段*/ + @Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15) + @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段") + private String materialNumber; + /**物料名称*/ + @Excel(name = "物料名称", width = 15) + @ApiModelProperty(value = "物料名称") + private String materialName; + /**父类物料号*/ + @Excel(name = "父类物料号", width = 15) + @ApiModelProperty(value = "父类物料号") + private String parentMaterialNumber; + /**版本号*/ + @Excel(name = "版本号", width = 15) + @ApiModelProperty(value = "版本号") + private String versionNumber; + /**层级*/ + @Excel(name = "层级", width = 15) + @ApiModelProperty(value = "层级") + private Integer level; + /**序号*/ + @Excel(name = "序号", width = 15) + @ApiModelProperty(value = "序号") + private Integer sort; + /**用量*/ + @Excel(name = "用量", width = 15) + @ApiModelProperty(value = "用量") + private Double dosage; + /**单位*/ + @Excel(name = "单位", width = 15) + @ApiModelProperty(value = "单位") + private String unit; + /**本阶材料费*/ + @Excel(name = "本阶材料费", width = 15) + @ApiModelProperty(value = "本阶材料费") + private BigDecimal materialCost; + /**本阶人工费*/ + @Excel(name = "本阶人工费", width = 15) + @ApiModelProperty(value = "本阶人工费") + private BigDecimal laborCost; + /**本阶辅料费*/ + @Excel(name = "本阶辅料费", width = 15) + @ApiModelProperty(value = "本阶辅料费") + private BigDecimal supplyMaterialCost; + /**本阶机器折旧费*/ + @Excel(name = "本阶机器折旧费", width = 15) + @ApiModelProperty(value = "本阶机器折旧费") + private BigDecimal equipmentCost; + /**本阶水电费(燃动费)*/ + @Excel(name = "本阶水电费(燃动费)", width = 15) + @ApiModelProperty(value = "本阶水电费(燃动费)") + private BigDecimal driveCost; + /**本阶其他制造费*/ + @Excel(name = "本阶其他制造费", width = 15) + @ApiModelProperty(value = "本阶其他制造费") + private BigDecimal otherCost; + /**本阶物流费*/ + @Excel(name = "本阶物流费", width = 15) + @ApiModelProperty(value = "本阶物流费") + private BigDecimal logisticsCost; + /**累计人工费*/ + @Excel(name = "累计人工费", width = 15) + @ApiModelProperty(value = "累计人工费") + private BigDecimal totalMaterialCost; + /**累计机器消耗费*/ + @Excel(name = "累计机器消耗费", width = 15) + @ApiModelProperty(value = "累计机器消耗费") + private BigDecimal totalLaborCost; + /**累计机器折旧费*/ + @Excel(name = "累计机器折旧费", width = 15) + @ApiModelProperty(value = "累计机器折旧费") + private BigDecimal totalSupplyMaterialCost; + /**累计水电费*/ + @Excel(name = "累计水电费", width = 15) + @ApiModelProperty(value = "累计水电费") + private BigDecimal totalEquipmentCost; + /**累计其它费用*/ + @Excel(name = "累计其它费用", width = 15) + @ApiModelProperty(value = "累计其它费用") + private BigDecimal totalDriveCost; + /**累计其他费用*/ + @Excel(name = "累计其他费用", width = 15) + @ApiModelProperty(value = "累计其他费用") + private BigDecimal totalOtherCost; + /**累计物流费用*/ + @Excel(name = "累计物流费用", width = 15) + @ApiModelProperty(value = "累计物流费用") + private BigDecimal totalLogisticsCost; + /**本阶标准成本*/ + @Excel(name = "本阶标准成本", width = 15) + @ApiModelProperty(value = "本阶标准成本") + private BigDecimal currentStandardCost; + /**累计标准成本*/ + @Excel(name = "累计标准成本", width = 15) + @ApiModelProperty(value = "累计标准成本") + private BigDecimal totalStandardCost; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private Date createTime; + /**修改人*/ + @ApiModelProperty(value = "修改人") + private String updateBy; + /**修改日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "修改日期") + private Date updateTime; + /**备注*/ + @Excel(name = "备注", width = 15) + @ApiModelProperty(value = "备注") + private String remark; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java deleted file mode 100644 index 7318f6f..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java +++ /dev/null @@ -1,273 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; -import org.jeecgframework.poi.excel.annotation.Excel; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - *

- * 标准成本明细表 - *

- * - * @author - * @since 2024-06-20 - */ -@Data -@Accessors(chain = true) -@TableName("app_scene_cost_standard_detail") -@EqualsAndHashCode -public class CostStandardDetail implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * id - */ - @TableId(value = "id", type = IdType.AUTO) - private String id; - - /** - * 物料号,关联kn_new_sap_mara表matnr字段 - */ - @TableField("material_number") - @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段") - @Excel(name = "物料号") - private String materialNumber; - - /** - * 物料名称 - */ - @TableField("material_name") - @ApiModelProperty(value = "物料名称") - @Excel(name = "物料名称") - private String materialName; - - /** - * 父类物料号 - */ - @TableField("parent_material_number") - @ApiModelProperty(value = "父类物料号") - @Excel(name = "父类物料号") - private String parentMaterialNumber; - - /** - * 版本号id - */ - @TableField("version_number_id") - @ApiModelProperty(value = "版本号id") - private String versionNumberId; - - /** - * 层级 - */ - @TableField("level") - @ApiModelProperty(value = "层级") - @Excel(name = "层级") - private Integer level; - - /** - * 图号 - */ - @TableField("figure_number") - @ApiModelProperty(value = "图号") - @Excel(name = "图号") - private String figureNumber; - - /** - * 用量 - */ - @TableField("dosage") - @ApiModelProperty(value = "用量") - @Excel(name = "用量") - private Double dosage; - - /** - * 单位 - */ - @TableField("unit") - @ApiModelProperty(value = "单位") - @Excel(name = "单位") - private String unit; - - /** - * 规格 - */ - @TableField("specification") - @ApiModelProperty(value = "规格") - @Excel(name = "规格") - private String specification; - - /** - * bom材料费 - */ - @TableField("bom_cost") - @ApiModelProperty(value = "bom材料费") - @Excel(name = "bom材料费") - private BigDecimal bomCost; - - /** - * 包装费 - */ - @TableField("packing_cost") - @ApiModelProperty(value = "包装费") - @Excel(name = "包装费") - private BigDecimal packingCost; - - /** - * 本阶辅料费 - */ - @TableField("auxiliary_cost") - @ApiModelProperty(value = "本阶辅料费") - @Excel(name = "本阶辅料费") - private BigDecimal auxiliaryCost; - - /** - * 本阶人工费 - */ - @TableField("labor_cost") - @ApiModelProperty(value = "本阶人工费") - @Excel(name = "本阶人工费") - private BigDecimal laborCost; - - /** - * 机器折旧费 - */ - @TableField("euip_depreciation_cost") - @ApiModelProperty(value = "机器折旧费") - @Excel(name = "机器折旧费") - private BigDecimal euipDepreciationCost; - - /** - * 机物料消耗费 - */ - @TableField("equip_consume_cost") - @ApiModelProperty(value = "机物料消耗费") - @Excel(name = "机物料消耗费") - private BigDecimal equipConsumeCost; - - /** - * 水电费 - */ - @TableField("hydroelectricity_cost") - @ApiModelProperty(value = "水电费") - @Excel(name = "水电费") - private BigDecimal hydroelectricityCost; - - /** - * 其他制造费 - */ - @TableField("other_cost") - @ApiModelProperty(value = "其他制造费") - @Excel(name = "其他制造费") - private BigDecimal otherCost; - - /** - * 物流费 - */ - @TableField("trail_cost") - @ApiModelProperty(value = "物流费") - @Excel(name = "物流费") - private BigDecimal trailCost; - - /** - * 制造成本 - */ - @TableField("manufacture_cost") - @ApiModelProperty(value = "制造成本") - @Excel(name = "制造成本") - private BigDecimal manufactureCost; - - /** - * 累计人工费 - */ - @TableField("total_labor_cost") - @ApiModelProperty(value = "累计人工费") - @Excel(name = "累计人工费") - private BigDecimal totalLaborCost; - - /** - * 累计机器消耗费 - */ - @TableField("total_equip_consume_cost") - @ApiModelProperty(value = "累计机器消耗费") - @Excel(name = "累计机器消耗费") - private BigDecimal totalEquipConsumeCost; - - /** - * 累计机器折旧费 - */ - @TableField("total_euip_depreciation_cost") - @ApiModelProperty(value = "累计机器折旧费") - @Excel(name = "累计机器折旧费") - private BigDecimal totalEuipDepreciationCost; - - /** - * 累计水电费 - */ - @TableField("total_hydroelectricity_cost") - @ApiModelProperty(value = "累计水电费") - @Excel(name = "累计水电费") - private BigDecimal totalHydroelectricityCost; - - /** - * 累计其它费用 - */ - @TableField("total_other_cost") - @ApiModelProperty(value = "累计其它费用") - @Excel(name = "累计其它费用") - private BigDecimal totalOtherCost; - - /** - * 创建人 - */ - @TableField("create_by") - @ApiModelProperty(value = "创建人") - private String createBy; - - /** - * 创建日期 - */ - @TableField("create_time") - @ApiModelProperty(value = "创建日期") - private LocalDateTime createTime; - - /** - * 修改人 - */ - @TableField("update_by") - @ApiModelProperty(value = "修改人") - private String updateBy; - - /** - * 修改日期 - */ - @TableField("update_time") - @ApiModelProperty(value = "修改日期") - private LocalDateTime updateTime; - - /** - * 备注 - */ - @TableField("remark") - @ApiModelProperty(value = "备注") - private String remark; - - /** - * 序号 - */ - @TableField("sort") - @ApiModelProperty(value = "序号") - @Excel(name = "序号") - private Integer sort; - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/HourOrRateTypeEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/HourOrRateTypeEnum.java new file mode 100644 index 0000000..a7a40a5 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/HourOrRateTypeEnum.java @@ -0,0 +1,69 @@ +package com.zzsmart.qomo.kn.cost.manage.enums; + +/** + * @Classname StandardStageEnum + * @Description 阶段枚举 + * @Version 1.0.0 + * @Date 2024/6/18 9:51 + * @Created wangqiong + */ +public enum HourOrRateTypeEnum { + + LaborHour("LaborHour", "人员工时"), + LaborHourRate("LaborHourRate", "人员小时费率"), + MaterialUnitPrice("MaterialUnitPrice", "物料采购单价"), + EquipmentHour("EquipmentHour", "设备工时"), + EquipmentHourRate("EquipmentHourRate", "设备小时费率"), + SupplyMaterialHour("SupplyMaterialHour", "辅料工时"), + SupplyMaterialHourRate("SupplyMaterialHourRate", "辅料小时费率"), + DriverHour("DriverHour", "燃动工时"), + DriverHourRate("DriverHourRate", "燃动小时费率"), + OtherHour("OtherHour", "其他工时"), + OtherHourRate("OtherHourRate", "其他小时费率"); + + private final String code; + private final String name; + + HourOrRateTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + /** + * 根据code获取text + * + * @param codeNo + * @return + */ + public static String getTextByCode(String codeNo) { + for (HourOrRateTypeEnum value : HourOrRateTypeEnum.values()) { + if (value.getCode().equals(codeNo)) { + return value.name(); + } + } + return codeNo.toString(); + } + + /** + * 根据text获取code + * + * @param name + * @return + */ + public static String getCodeByName(String name) { + for (HourOrRateTypeEnum value : HourOrRateTypeEnum.values()) { + if (value.name().equals(name)) { + return value.name(); + } + } + return name; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/TotalCostEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/TotalCostEnum.java new file mode 100644 index 0000000..f854c1a --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/TotalCostEnum.java @@ -0,0 +1,61 @@ +package com.zzsmart.qomo.kn.cost.manage.enums; + +/** + * @Classname StandardStageEnum + * @Description 阶段枚举 + * @Version 1.0.0 + * @Date 2024/6/18 9:51 + * @Created wangqiong + */ +public enum TotalCostEnum { + + + TotalLaborCost("TotalLaborCost", "总人工成本"), TotalMaterialCost("TotalMaterialCost", "总物料成本"), TotalEquipmentFee("TotalEquipmentFee", "总设备费"), TotalSupplyMaterialFee("TotalSupplyMaterialFee", "总辅料费"), TotalDriverFee("TotalDriverFee", "总水电费"), TotalOtherFee("TotalOtherFee", "总其他费用"), TotalLogisticsFee("TotalLogisticsFee", "总物流费"), TotalStandardCost("TotalStandardCost", "总标准成本"); + + + private final String code; + private final String name; + + TotalCostEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + /** + * 根据code获取text + * + * @param codeNo + * @return + */ + public static String getTextByCode(String codeNo) { + for (TotalCostEnum value : TotalCostEnum.values()) { + if (value.getCode().equals(codeNo)) { + return value.name(); + } + } + return codeNo.toString(); + } + + /** + * 根据text获取code + * + * @param name + * @return + */ + public static String getCodeByName(String name) { + for (TotalCostEnum value : TotalCostEnum.values()) { + if (value.name().equals(name)) { + return value.name(); + } + } + return name; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardDetailMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardDetailMapper.java new file mode 100644 index 0000000..6c2b055 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardDetailMapper.java @@ -0,0 +1,15 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +public interface AppSceneCostStandardDetailMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java index d3b927a..3e6a8d3 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java @@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml new file mode 100644 index 0000000..de4b57b --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 5c16008..8769669 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -4,9 +4,12 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.zzsmart.qomo.kn.cost.manage.entity.*; import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum; +import com.zzsmart.qomo.kn.cost.manage.enums.HourOrRateTypeEnum; +import com.zzsmart.qomo.kn.cost.manage.enums.TotalCostEnum; import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; import com.zzsmart.qomo.kn.cost.manage.service.*; import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO; +import com.zzsmart.qomo.kn.cost.manage.vo.TotalResultValue; import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -50,10 +53,20 @@ public class StandardCostService { */ @Autowired IAppSceneCostResultValueService iAppSceneCostResultValueService; + /** + * 标准成本服务 + */ public static StandardCostService standardCostService; + /** + * 成本计算服务 + */ @Autowired IAppSceneCostCountService appSceneCostCountService; - + /** + * 标准成本明细服务(单行查询服务) + */ + @Autowired + private IAppSceneCostStandardDetailService iAppSceneCostStandardDetailService; @PostConstruct public void init() { @@ -65,6 +78,7 @@ public class StandardCostService { standardCostService.iHourRateService = this.iHourRateService; standardCostService.costMaterialProcessHoursService = this.costMaterialProcessHoursService; standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService; + standardCostService.iAppSceneCostStandardDetailService = this.iAppSceneCostStandardDetailService; } /** @@ -93,6 +107,7 @@ public class StandardCostService { //1.查询出所有满足物料编号的物料(BOM物料) String sql = flowTaskInfoVO.getSqlString(); log.info("传递过来的SQL语句:" + sql); + //TODO 查询最顶部的BOM物料编号下所有的物料并进行层级排序 List list = standardCostService.costMaterialBomService.queryAllBomInfoBytopMaterialCode(topMaterialCode); log.info("Full EmptyTask list: {}", list); //2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code) @@ -220,7 +235,7 @@ public class StandardCostService { //单价乘以数量 BigDecimal totalCost = price.multiply(number); //2.2计算出人工成本并存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").build(); + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").priceOrRate(price).build(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } } @@ -271,17 +286,18 @@ public class StandardCostService { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); - BigDecimal laborHours = processHours.getLaborHours(); + laborHours = laborHours.add(processHours.getLaborHours()); //计算总人工成本 - totalCost = totalCost.add(laborHours.multiply(hourRate)); + totalCost = totalCost.add(processHours.getLaborHours().multiply(hourRate)); } } //2.2计算出人工成本并存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).build(); + 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(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } } @@ -339,17 +355,18 @@ public class StandardCostService { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); - BigDecimal laborHours = processHours.getDeviceHours(); + laborHours = laborHours.add(processHours.getDeviceHours()); //计算机器成本 - totalCost = totalCost.add(laborHours.multiply(hourRate)); + totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); } } //2.2计算机器成本并存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).build(); + 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(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } } @@ -360,18 +377,19 @@ public class StandardCostService { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); //TODO 辅料工时来源 - BigDecimal laborHours = processHours.getLaborHours(); + laborHours = laborHours.add(processHours.getDeviceHours()); //机物料消耗 - totalCost = totalCost.add(laborHours.multiply(hourRate)); + totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); } } //2.2计算机物料消耗存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).build(); + 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(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } } @@ -382,18 +400,19 @@ public class StandardCostService { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); //TODO 燃动力工时来源 - BigDecimal laborHours = processHours.getLaborHours(); - //机物料消耗 - totalCost = totalCost.add(laborHours.multiply(hourRate)); + laborHours = laborHours.add(processHours.getDeviceHours()); + //水电费(燃动力工时*费率)成本 + totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); } } //2.2计算机物料消耗存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).build(); + 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(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } } @@ -404,18 +423,19 @@ public class StandardCostService { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); //TODO 其他工时来源 - BigDecimal laborHours = processHours.getLaborHours(); - //机物料消耗 - totalCost = totalCost.add(laborHours.multiply(hourRate)); + laborHours = laborHours.add(processHours.getDeviceHours()); + //其他制费成本 + totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); } } //2.2计算机物料消耗存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).build(); + 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(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } } @@ -465,6 +485,7 @@ public class StandardCostService { //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) //按照物料编号进行分组 Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); + //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计 for (String key : materialNoMap.keySet()) { List appSceneCostResultValues = materialNoMap.get(key); //按照费用类别进行分组 @@ -485,6 +506,23 @@ public class StandardCostService { BigDecimal otherCost = new BigDecimal("0.0"); //7.本阶制造费(物流费) BigDecimal logisticsCost = new BigDecimal("0.0"); + //物料单价 + BigDecimal materialUnitPrice = new BigDecimal("0.0"); + //人员工时、小时费率 + BigDecimal laborHour = new BigDecimal("0.0"); + BigDecimal laborHourRate = new BigDecimal("0.0"); + //设备工时、小时费率 + BigDecimal equipmentHour = new BigDecimal("0.0"); + BigDecimal equipmentHourRate = new BigDecimal("0.0"); + //辅料工时、小时费率 + BigDecimal supplyMaterialHour = new BigDecimal("0.0"); + BigDecimal supplyMaterialHourRate = new BigDecimal("0.0"); + //燃动工时、小时费率 + BigDecimal driveHour = new BigDecimal("0.0"); + BigDecimal driveHourRate = new BigDecimal("0.0"); + //其他工时、小时费率 + BigDecimal otherHour = new BigDecimal("0.0"); + BigDecimal otherHourRate = new BigDecimal("0.0"); AppSceneCostResultValue currentMaterialCost = null; //遍历所有费用类别计算本阶标准成本 for (int j = 0; j < appSceneCostResultValues.size(); j++) { @@ -497,36 +535,73 @@ public class StandardCostService { currentCost = currentCost.add(new BigDecimal(countValue)); } } - //计算本阶各个费用类别费用 + //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率 for (String feeType : costTypeMap.keySet()) { List appSceneCostResultValues1 = costTypeMap.get(feeType); for (int m = 0; m < appSceneCostResultValues1.size(); m++) { if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) { + //物料成本 materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //物料单价 + materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate(); } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) { + //人工成本 laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //人工工时、小时费率 + laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour()); + laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { + //设备费用 equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //设备工时、小时费率 + equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour()); + equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { + //辅料费用 supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //辅料工时、小时费率 + supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour()); + supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { + //燃动费用 driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //燃动工时、小时费率 + driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour()); + driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { + //物流费用 logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { + //其他费用 otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //其他工时、小时费率 + otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour()); + otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); } } } - JSONObject costTypeDetail = new JSONObject(); - costTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost.toString()); - costTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost.toString()); - costTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost.toString()); - costTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost.toString()); - costTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost.toString()); - costTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost.toString()); - costTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost.toString()); - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(currentMaterialCost.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(currentCost.toString()).costDetail(JSON.toJSONString(costTypeDetail)).costType(costType).build(); + //本阶不同费用类别成本统计 + JSONObject currentLevelCostTypeDetail = new JSONObject(); + currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost); + //统计本阶不同费用类别工时、小时费率 + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate); + 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(); standardCostService.iAppSceneCostResultValueService.save(resultValue); } //3.计算出所有的单个物料的累计标准成本 @@ -545,6 +620,8 @@ public class StandardCostService { * @param flowInstanceId */ private static void totalCountCost(List standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId) { + + List costStandardDetails = new ArrayList<>(); //父类对应的子节点(除了最上层节点) Map> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo)); for (int i = 0; i < standardCostList.size(); i++) { @@ -552,11 +629,45 @@ public class StandardCostService { AppSceneCostResultValue oldAppSceneCostResultValue = standardCostList.get(i); BigDecimal totalCost = new BigDecimal(oldAppSceneCostResultValue.getCountValue()); //循环计算出当前节点的累计成本 - totalCost = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, topMaterialCode, taskType, taskCode, flowInstanceId, totalCost); - oldAppSceneCostResultValue.setTotalValue(totalCost.toString()); + String costDetail = oldAppSceneCostResultValue.getCostDetail(); + //查询当前节点各个类型的成本 + BigDecimal totalLabourCost = new BigDecimal(0); + BigDecimal totalEquipmentCost = new BigDecimal(0); + BigDecimal totalSupplyMaterialCost = new BigDecimal(0); + BigDecimal totalDriveCost = new BigDecimal(0); + BigDecimal totalLogisticsCost = new BigDecimal(0); + BigDecimal totalOtherCost = new BigDecimal(0); + JSONObject costDetailJson = JSON.parseObject(costDetail); + if (costDetailJson != null) { + totalLabourCost = costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode()); + totalEquipmentCost = costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode()); + totalSupplyMaterialCost = costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode()); + totalDriveCost = costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode()); + totalLogisticsCost = costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode()); + totalOtherCost = costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode()); + } + TotalResultValue hourOrRateResultValue = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); + costDetailJson.put(TotalCostEnum.TotalLaborCost.getCode(), hourOrRateResultValue.getTotalLabourCost()); + costDetailJson.put(TotalCostEnum.TotalEquipmentFee.getCode(), hourOrRateResultValue.getTotalEquipmentCost()); + costDetailJson.put(TotalCostEnum.TotalSupplyMaterialFee.getCode(), hourOrRateResultValue.getTotalSupplyMaterialCost()); + costDetailJson.put(TotalCostEnum.TotalDriverFee.getCode(), hourOrRateResultValue.getTotalDriveCost()); + costDetailJson.put(TotalCostEnum.TotalLogisticsFee.getCode(), hourOrRateResultValue.getTotalLogisticsCost()); + costDetailJson.put(TotalCostEnum.TotalOtherFee.getCode(), hourOrRateResultValue.getTotalOtherCost()); + costDetailJson.put(TotalCostEnum.TotalStandardCost.getCode(), hourOrRateResultValue.getTotalCost()); + oldAppSceneCostResultValue.setCostDetail(costDetailJson.toJSONString()); + oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString()); standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue); - //TODO 更新结果集到标准成本单行查询中去 + //构造单行成本查询记录 + AppSceneCostStandardDetail costStandardDetail = AppSceneCostStandardDetail.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).materialName(oldAppSceneCostResultValue.getMarterialNo()).parentMaterialNumber(oldAppSceneCostResultValue.getParentMarterialNo()) +// .versionNumber() +// .level() +// .sort() +// .figureNumber() + .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())).build(); + costStandardDetails.add(costStandardDetail); } + //更新结果集到标准成本单行查询中去 + standardCostService.iAppSceneCostStandardDetailService.saveBatch(costStandardDetails); } /** @@ -565,12 +676,8 @@ public class StandardCostService { * * @param appSceneCostResultValue * @param parentMaterialNoMap - * @param topMaterialCode - * @param taskType - * @param taskCode - * @param flowInstanceId */ - private static BigDecimal loopCount(AppSceneCostResultValue appSceneCostResultValue, Map> parentMaterialNoMap, String topMaterialCode, String taskType, String taskCode, String flowInstanceId, BigDecimal totalCost) { + private static TotalResultValue loopCount(AppSceneCostResultValue appSceneCostResultValue, Map> parentMaterialNoMap, BigDecimal totalLabourCost, BigDecimal totalEquipmentCost, BigDecimal totalSupplyMaterialCost, BigDecimal totalDriveCost, BigDecimal totalLogisticsCost, BigDecimal totalOtherCost, BigDecimal totalCost) { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (parentMaterialNoMap.containsKey(marterialNo)) { //获取当前节点的子节点并遍历 @@ -578,16 +685,31 @@ public class StandardCostService { for (int j = 0; j < appSceneCostResultValues.size(); j++) { AppSceneCostResultValue appSceneCostResultValue1 = appSceneCostResultValues.get(j); String countValue = appSceneCostResultValue1.getCountValue(); + //标准成本累计 if (countValue != null) { totalCost = totalCost.add(new BigDecimal(countValue)); } + //各个费用类别成本累计 + if (appSceneCostResultValue1.getCostDetail() != null) { + JSONObject costDetailJson = JSON.parseObject(appSceneCostResultValue1.getCostDetail()); + if (costDetailJson != null) { + totalLabourCost = totalLabourCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode())); + totalEquipmentCost = totalEquipmentCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode())); + totalSupplyMaterialCost = totalSupplyMaterialCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode())); + totalDriveCost = totalDriveCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode())); + totalLogisticsCost = totalLogisticsCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode())); + totalOtherCost = totalOtherCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode())); + } + } //判断当前子节点是否还有子节点 if (parentMaterialNoMap.containsKey(appSceneCostResultValue1.getMarterialNo())) { //如果还有子节点则继续递归 - loopCount(appSceneCostResultValue1, parentMaterialNoMap, topMaterialCode, taskType, taskCode, flowInstanceId, totalCost); + loopCount(appSceneCostResultValue1, parentMaterialNoMap, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); } } } - return totalCost; + TotalResultValue hourOrRateResultValue = TotalResultValue.builder().totalLabourCost(totalLabourCost).totalEquipmentCost(totalEquipmentCost).totalSupplyMaterialCost(totalSupplyMaterialCost).totalDriveCost(totalDriveCost).totalLogisticsCost(totalLogisticsCost).totalOtherCost(totalOtherCost).totalCost(totalCost).build(); + appSceneCostResultValue.setTotalValue(totalCost.toString()); + return hourOrRateResultValue; } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java deleted file mode 100644 index 7395b14..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailSearch; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - *

- * 标准成本明细表 服务类 - *

- * - * @author app_scene_cost_purchase_price - * @since 2024-06-19 - */ -public interface CostStandardDetailService extends IService { - /** - * 分页查询 - * - * @param page - * @param - * @return - */ - IPage pageList(Page page, CostStandardDetailVO costStandard); - - /** - * 导出列表信息为Excel文件 - * - * @param request - * @param response - * @param costStandardDetailSearch - * @return - */ - JSONObject exportExcel(HttpServletRequest request, HttpServletResponse response, CostStandardDetailSearch costStandardDetailSearch); -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardDetailService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardDetailService.java new file mode 100644 index 0000000..03d688d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardDetailService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +public interface IAppSceneCostStandardDetailService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardDetailServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardDetailServiceImpl.java new file mode 100644 index 0000000..6b8de3e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardDetailServiceImpl.java @@ -0,0 +1,19 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardDetailMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardDetailService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +@Service +public class AppSceneCostStandardDetailServiceImpl extends ServiceImpl implements IAppSceneCostStandardDetailService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java index cb3daf1..ba24225 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java @@ -2,12 +2,10 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardDetailMapper; import com.zzsmart.qomo.kn.cost.manage.service.BomTreeService; import com.zzsmart.qomo.kn.cost.manage.util.BomTreeBuilder; import com.zzsmart.qomo.kn.cost.manage.vo.BomTreeInfoVO; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardDetailServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardDetailServiceImpl.java deleted file mode 100644 index e7cce2e..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardDetailServiceImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - -import cn.hutool.core.util.StrUtil; -import com.alibaba.excel.EasyExcel; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardDetailMapper; -import com.zzsmart.qomo.kn.cost.manage.service.CostStandardDetailService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailSearch; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; -import org.jeecg.common.system.query.QueryGenerator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Set; - -import static com.zzsmart.qomo.kn.cost.manage.util.EasyExcelUtil.getIncludeFields; - -/** - *

- * 标准成本明细表 服务实现类 - *

- * - * @author app_scene_cost_purchase_price - * @since 2024-06-19 - */ -@Service -public class CostStandardDetailServiceImpl extends ServiceImpl implements CostStandardDetailService { - - @Autowired - CostStandardDetailMapper costStandardDetailMapper; - - /** - * 分页查询 - * - * @param page - * @param costStandard - * @return - */ - @Override - public IPage pageList(Page page, CostStandardDetailVO costStandard) { - // 查询条件组装 - QueryWrapper queryWrapper = new QueryWrapper(); - - if (costStandard != null) { - - if (StrUtil.isNotEmpty(costStandard.getMaterialNumber())) { - // 物料号 - queryWrapper.like("c1.material_number", costStandard.getMaterialNumber()); - } - if (StrUtil.isNotEmpty(costStandard.getVersionNumber())) { - // 版本号 - queryWrapper.like("c2.version_number", costStandard.getVersionNumber()); - } - - } - return (IPage) costStandardDetailMapper.pageList(page, queryWrapper); - } - - @Override - public JSONObject exportExcel(HttpServletRequest request, HttpServletResponse response, CostStandardDetailSearch costStandardDetailSearch) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costStandardDetailSearch, request.getParameterMap()); - if (costStandardDetailSearch != null && costStandardDetailSearch.getSelections() != null && costStandardDetailSearch.getSelections().size() > 0) { - queryWrapper.in("id", costStandardDetailSearch.getSelections()); - } - List exportList = list(queryWrapper); -// EasyExcelUtil.export(response, "D:/WorkDoc/PHM/单机部署/单行查询.xls", null, exportList,CostStandardDetail.class); - // 根据用户传入字段 假设我们要忽略 date - Set includeFields = getIncludeFields(CostStandardDetail.class); - EasyExcel.write("D:/WorkDoc/PHM/单机部署/单行查询.xls", CostStandardDetail.class).includeColumnFieldNames(includeFields).sheet("模板").doWrite(exportList); - // return super.exportXls(request, costStandardDetail, CostStandardDetail.class, "单行查询"); - JSONObject result = new JSONObject(); - result.put("filePath", "D:/WorkDoc/PHM/单机部署/单行查询.xls"); - return result; - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java index fad41e6..a1a51bf 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java @@ -1,8 +1,6 @@ package com.zzsmart.qomo.kn.cost.manage.util; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; import com.zzsmart.qomo.kn.cost.manage.vo.BomTreeInfoVO; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; import java.util.ArrayList; import java.util.Comparator; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java index f774a26..584d03f 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java @@ -5,7 +5,6 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; import org.apache.poi.ss.usermodel.*; import javax.servlet.http.HttpServletResponse; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailSearch.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailSearch.java deleted file mode 100644 index 30e7812..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailSearch.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.vo; - -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@ApiModel(value = "bom结构树", description = "bom结构树") -public class CostStandardDetailSearch extends CostStandardDetailVO { - /** - * 选择行的id - */ - private List selections; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java deleted file mode 100644 index efc6184..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.vo; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - *

- * 标准成本明细表 - *

- * - * @author app_scene_cost_purchase_price - * @since 2024-06-19 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class CostStandardDetailVO extends CostStandardDetail implements Serializable { - /** - * 版本号 - */ - @ApiModelProperty(value = "版本号") - private String versionNumber; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java new file mode 100644 index 0000000..fe80d9e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java @@ -0,0 +1,51 @@ +package com.zzsmart.qomo.kn.cost.manage.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +/** + * @ClassName: HourOrRateResultValue + * @Description: 人工费率成本结果值 + * @Author: zzsmart + * @Date: 2020/5/26 14:06 + * @Version: 1.0 + */ +public class TotalResultValue { + /** + * 总人工成本 + */ + private BigDecimal totalLabourCost; + /** + * 总设备成本 + */ + private BigDecimal totalEquipmentCost; + /** + * 总采购成本 + */ + + private BigDecimal totalSupplyMaterialCost; + /** + * 总运输成本 + */ + private BigDecimal totalDriveCost; + /** + * 总物流成本 + */ + private BigDecimal totalLogisticsCost; + /** + * 总其他成本 + */ + private BigDecimal totalOtherCost; + /** + * 总成本 + */ + private BigDecimal totalCost; +} From 339cf044a8de6b2c20488d4ec7dff9aedea9def9 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Wed, 31 Jul 2024 17:44:39 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=87=E5=87=86?= =?UTF-8?q?=E6=88=90=E6=9C=AC=E8=AE=A1=E7=AE=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/CostStandardDetailMapper.java | 37 ------------ .../mapper/xml/CostStandardDetailMapper.xml | 59 ------------------- .../manage/plugin/StandardCostService.java | 23 +++----- .../service/impl/BomTreeServiceImpl.java | 53 +++++++++-------- .../kn/cost/manage/util/BomTreeBuilder.java | 29 ++++----- .../kn/cost/manage/util/EasyExcelUtil.java | 3 +- .../kn/cost/manage/vo/TotalResultValue.java | 4 ++ 7 files changed, 58 insertions(+), 150 deletions(-) delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardDetailMapper.xml diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java deleted file mode 100644 index 3e6a8d3..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardDetailMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Constants; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - *

- * 标准成本明细表 Mapper 接口 - *

- * - * @author - * @since 2024-06-20 - */ -@Mapper -public interface CostStandardDetailMapper extends BaseMapper { - /** - * 分页查询 - * @param page - * @param wrapper - * @return - */ - IPage pageList(@Param("page") Page page , @Param(Constants.WRAPPER) Wrapper wrapper); - /** - * 查询列表 - * @param wrapper - * @return - */ - List queryListResult(@Param(Constants.WRAPPER) Wrapper wrapper); - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardDetailMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardDetailMapper.xml deleted file mode 100644 index cc5c7cf..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardDetailMapper.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 8769669..47e352a 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -490,7 +490,7 @@ public class StandardCostService { List appSceneCostResultValues = materialNoMap.get(key); //按照费用类别进行分组 Map> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType)); - //本阶标准成本 + //【本阶标准成本】 BigDecimal currentCost = new BigDecimal("0.0"); //1.本阶物料成本 BigDecimal materialCost = new BigDecimal("0.0"); @@ -606,7 +606,7 @@ public class StandardCostService { } //3.计算出所有的单个物料的累计标准成本 List standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId); - //TODO 优化累计成本的计算 + //【累计成本】的计算 totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId); } @@ -631,6 +631,7 @@ public class StandardCostService { //循环计算出当前节点的累计成本 String costDetail = oldAppSceneCostResultValue.getCostDetail(); //查询当前节点各个类型的成本 + BigDecimal totalMaterialCost = new BigDecimal(0); BigDecimal totalLabourCost = new BigDecimal(0); BigDecimal totalEquipmentCost = new BigDecimal(0); BigDecimal totalSupplyMaterialCost = new BigDecimal(0); @@ -638,15 +639,8 @@ public class StandardCostService { BigDecimal totalLogisticsCost = new BigDecimal(0); BigDecimal totalOtherCost = new BigDecimal(0); JSONObject costDetailJson = JSON.parseObject(costDetail); - if (costDetailJson != null) { - totalLabourCost = costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode()); - totalEquipmentCost = costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode()); - totalSupplyMaterialCost = costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode()); - totalDriveCost = costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode()); - totalLogisticsCost = costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode()); - totalOtherCost = costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode()); - } - TotalResultValue hourOrRateResultValue = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); + TotalResultValue hourOrRateResultValue = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, totalMaterialCost, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); + costDetailJson.put(TotalCostEnum.TotalMaterialCost.getCode(), hourOrRateResultValue.getTotalMaterialCost()); costDetailJson.put(TotalCostEnum.TotalLaborCost.getCode(), hourOrRateResultValue.getTotalLabourCost()); costDetailJson.put(TotalCostEnum.TotalEquipmentFee.getCode(), hourOrRateResultValue.getTotalEquipmentCost()); costDetailJson.put(TotalCostEnum.TotalSupplyMaterialFee.getCode(), hourOrRateResultValue.getTotalSupplyMaterialCost()); @@ -677,7 +671,7 @@ public class StandardCostService { * @param appSceneCostResultValue * @param parentMaterialNoMap */ - private static TotalResultValue loopCount(AppSceneCostResultValue appSceneCostResultValue, Map> parentMaterialNoMap, BigDecimal totalLabourCost, BigDecimal totalEquipmentCost, BigDecimal totalSupplyMaterialCost, BigDecimal totalDriveCost, BigDecimal totalLogisticsCost, BigDecimal totalOtherCost, BigDecimal totalCost) { + private static TotalResultValue loopCount(AppSceneCostResultValue appSceneCostResultValue, Map> parentMaterialNoMap, BigDecimal totalMaterialCost, BigDecimal totalLabourCost, BigDecimal totalEquipmentCost, BigDecimal totalSupplyMaterialCost, BigDecimal totalDriveCost, BigDecimal totalLogisticsCost, BigDecimal totalOtherCost, BigDecimal totalCost) { String marterialNo = appSceneCostResultValue.getMarterialNo(); if (parentMaterialNoMap.containsKey(marterialNo)) { //获取当前节点的子节点并遍历 @@ -693,6 +687,7 @@ public class StandardCostService { if (appSceneCostResultValue1.getCostDetail() != null) { JSONObject costDetailJson = JSON.parseObject(appSceneCostResultValue1.getCostDetail()); if (costDetailJson != null) { + totalMaterialCost = totalMaterialCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.MaterialCost.getCode())); totalLabourCost = totalLabourCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode())); totalEquipmentCost = totalEquipmentCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode())); totalSupplyMaterialCost = totalSupplyMaterialCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode())); @@ -704,11 +699,11 @@ public class StandardCostService { //判断当前子节点是否还有子节点 if (parentMaterialNoMap.containsKey(appSceneCostResultValue1.getMarterialNo())) { //如果还有子节点则继续递归 - loopCount(appSceneCostResultValue1, parentMaterialNoMap, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); + loopCount(appSceneCostResultValue1, parentMaterialNoMap, totalMaterialCost, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); } } } - TotalResultValue hourOrRateResultValue = TotalResultValue.builder().totalLabourCost(totalLabourCost).totalEquipmentCost(totalEquipmentCost).totalSupplyMaterialCost(totalSupplyMaterialCost).totalDriveCost(totalDriveCost).totalLogisticsCost(totalLogisticsCost).totalOtherCost(totalOtherCost).totalCost(totalCost).build(); + TotalResultValue hourOrRateResultValue = TotalResultValue.builder().totalMaterialCost(totalMaterialCost).totalLabourCost(totalLabourCost).totalEquipmentCost(totalEquipmentCost).totalSupplyMaterialCost(totalSupplyMaterialCost).totalDriveCost(totalDriveCost).totalLogisticsCost(totalLogisticsCost).totalOtherCost(totalOtherCost).totalCost(totalCost).build(); appSceneCostResultValue.setTotalValue(totalCost.toString()); return hourOrRateResultValue; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java index ba24225..fba0566 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java @@ -2,7 +2,8 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardDetailMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardDetailMapper; import com.zzsmart.qomo.kn.cost.manage.service.BomTreeService; import com.zzsmart.qomo.kn.cost.manage.util.BomTreeBuilder; import com.zzsmart.qomo.kn.cost.manage.vo.BomTreeInfoVO; @@ -21,7 +22,7 @@ import java.util.stream.Collectors; @Transactional public class BomTreeServiceImpl implements BomTreeService { @Autowired - CostStandardDetailMapper costStandardDetailMapper; + AppSceneCostStandardDetailMapper costStandardDetailMapper; /** * 根据物料号查询物料树 @@ -31,35 +32,35 @@ public class BomTreeServiceImpl implements BomTreeService { */ @Override public List getBomTreeByMaterialNumber(String materialNumber, String version_number) { - QueryWrapper wrapper = new QueryWrapper<>(); + QueryWrapper wrapper = new QueryWrapper<>(); //设置条件 if (StrUtil.isNotEmpty(materialNumber)) { // 物料号 - wrapper.like("c1.material_number", materialNumber); + wrapper.like("material_number", materialNumber); } if (StrUtil.isNotEmpty(version_number)) { // 版本号 - wrapper.like("c2.version_number", version_number); + wrapper.like("version_number", version_number); } //查询所有满足条件的父节点 - List parentNodeList = costStandardDetailMapper.queryListResult(wrapper); + List parentNodeList = costStandardDetailMapper.selectList(wrapper); //所有子类节点 - List childrenNodeList = new ArrayList<>(); - Map parentDataMap = new TreeMap<>(); + List childrenNodeList = new ArrayList<>(); + Map parentDataMap = new TreeMap<>(); if (parentNodeList.size() > 0) { //父类结果只有1个 if (parentNodeList.size() == 1) { - parentDataMap = parentNodeList.stream().collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + parentDataMap = parentNodeList.stream().collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); } else { //父类结果有多个(找出最上级节点) - Map> levelGroupMap = parentNodeList.stream().collect(Collectors.groupingBy(CostStandardDetailVO::getLevel)); - TreeMap> levelTreeMap = new TreeMap<>(levelGroupMap); - parentDataMap = levelTreeMap.firstEntry().getValue().stream().collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + Map> levelGroupMap = parentNodeList.stream().collect(Collectors.groupingBy(AppSceneCostStandardDetail::getLevel)); + TreeMap> levelTreeMap = new TreeMap<>(levelGroupMap); + parentDataMap = levelTreeMap.firstEntry().getValue().stream().collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); } //查询所有父节点下的子节点(即第二层叶子节点) - List costStandardDetails = new ArrayList<>(); + List costStandardDetails = new ArrayList<>(); if (parentDataMap.size() > 0) { - QueryWrapper wrapper1 = new QueryWrapper<>(); + QueryWrapper wrapper1 = new QueryWrapper<>(); int num = 0; for (String materialNumber1 : parentDataMap.keySet()) { num = num + 1; @@ -72,26 +73,28 @@ public class BomTreeServiceImpl implements BomTreeService { costStandardDetails = costStandardDetailMapper.selectList(wrapper1); } //第三层叶子节点 - List threeNodes = new ArrayList<>(); + List threeNodes = new ArrayList<>(); if (costStandardDetails != null && costStandardDetails.size() > 0) { - List materialNoList = costStandardDetails.stream().map(CostStandardDetail::getMaterialNumber).collect(Collectors.toList()); - QueryWrapper wrapper2 = new QueryWrapper<>(); + List materialNoList = costStandardDetails.stream().map(AppSceneCostStandardDetail::getMaterialNumber).collect(Collectors.toList()); + QueryWrapper wrapper2 = new QueryWrapper<>(); wrapper2.in("parent_material_number", materialNoList); threeNodes = costStandardDetailMapper.selectList(wrapper2); } //把第二层叶子节点转化为bomtreeinfoVO对象集合 for (int i = 0; i < costStandardDetails.size(); i++) { - CostStandardDetail costStandardDetail = costStandardDetails.get(i); - CostStandardDetailVO vo = new CostStandardDetailVO(); - BeanUtils.copyProperties(costStandardDetail, vo); - childrenNodeList.add(vo); + AppSceneCostStandardDetail costStandardDetail = costStandardDetails.get(i); +// AppSceneCostStandardDetail vo = new AppSceneCostStandardDetail(); +// BeanUtils.copyProperties(costStandardDetail, vo); +// childrenNodeList.add(vo); + childrenNodeList.add(costStandardDetail); } //把第三层叶子节点转化为bomtreeinfoVO对象集合 for (int i = 0; i < threeNodes.size(); i++) { - CostStandardDetail costStandardDetail = threeNodes.get(i); - CostStandardDetailVO vo = new CostStandardDetailVO(); - BeanUtils.copyProperties(costStandardDetail, vo); - childrenNodeList.add(vo); + AppSceneCostStandardDetail costStandardDetail = threeNodes.get(i); +// CostStandardDetailVO vo = new CostStandardDetailVO(); +// BeanUtils.copyProperties(costStandardDetail, vo); +// childrenNodeList.add(vo); + childrenNodeList.add(costStandardDetail); } } List bomTreeInfoVOS = BomTreeBuilder.buildBomTree(childrenNodeList, parentDataMap); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java index a1a51bf..864b679 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java @@ -1,5 +1,6 @@ package com.zzsmart.qomo.kn.cost.manage.util; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; import com.zzsmart.qomo.kn.cost.manage.vo.BomTreeInfoVO; import java.util.ArrayList; @@ -9,32 +10,32 @@ import java.util.Map; import java.util.stream.Collectors; public class BomTreeBuilder { - public static List buildBomTree(List sourceData, Map parentDataMap) { + public static List buildBomTree(List sourceData, Map parentDataMap) { List result = new ArrayList<>(); if ((sourceData == null || (sourceData != null && sourceData.size() < 1)) && (parentDataMap == null || (parentDataMap != null && parentDataMap.size() < 1))) { return result; } //1.把BOM信息分成按照物料号分组 - Map materialMap = sourceData.stream().filter(s -> s.getMaterialNumber() != null).collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + Map materialMap = sourceData.stream().filter(s -> s.getMaterialNumber() != null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); //查找最顶端的父类节点 if (parentDataMap == null || (parentDataMap != null && parentDataMap.size() < 1)) { - parentDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() == null).collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + parentDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() == null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); } //查找有父节点的子节点 - Map> childDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() != null).collect(Collectors.groupingBy(CostStandardDetailVO::getParentMaterialNumber)); + Map> childDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() != null).collect(Collectors.groupingBy(AppSceneCostStandardDetail::getParentMaterialNumber)); //查找有父节点的子节点 // //1.把BOM信息分成按照层级分组 -// Map> levelMap = sourceData.stream().filter(s -> s.getLevel() != null).collect(Collectors.groupingBy(CostStandardDetail::getLevel)); +// Map> levelMap = sourceData.stream().filter(s -> s.getLevel() != null).collect(Collectors.groupingBy(CostStandardDetail::getLevel)); // //2.对每层进行排序 // for (Integer level : levelMap.keySet()) { -// List levelList = levelMap.get(level); -// List sortedCostDetails = levelList.stream().sorted(Comparator.comparing(CostStandardDetailVO::getSort)).collect(Collectors.toList()); +// List levelList = levelMap.get(level); +// List sortedCostDetails = levelList.stream().sorted(Comparator.comparing(AppSceneCostStandardDetail::getSort)).collect(Collectors.toList()); // levelMap.put(level, sortedCostDetails); // } -// TreeMap> levelTreeMap = new TreeMap<>(levelMap); +// TreeMap> levelTreeMap = new TreeMap<>(levelMap); //3.构建BOM树 if (parentDataMap.size() > 0) { - for (CostStandardDetailVO parent : parentDataMap.values()) { + for (AppSceneCostStandardDetail parent : parentDataMap.values()) { BomTreeInfoVO parentBomTreeInfoVO = costStandardDetailChangeToBomTreeInfoVO(parent); parentBomTreeInfoVO = loopFindChildrenBuild(parentBomTreeInfoVO, materialMap, childDataMap, result); if (parentBomTreeInfoVO != null) { @@ -48,10 +49,10 @@ public class BomTreeBuilder { return result; } - private static BomTreeInfoVO loopFindChildrenBuild(BomTreeInfoVO parentBomTreeInfoVO, Map materialMap, Map> childDataMap, List result) { + private static BomTreeInfoVO loopFindChildrenBuild(BomTreeInfoVO parentBomTreeInfoVO, Map materialMap, Map> childDataMap, List result) { if (parentBomTreeInfoVO != null) { //4.根据物料号查找子节点 - List childs = childDataMap.get(parentBomTreeInfoVO.getMaterialNumber()); + List childs = childDataMap.get(parentBomTreeInfoVO.getMaterialNumber()); if (childs != null && childs.size() > 0) { parentBomTreeInfoVO.setHasChildren(true); } else { @@ -60,7 +61,7 @@ public class BomTreeBuilder { //构造父节点下的bomtree结构数据 List children = new ArrayList<>(); for (int j = 0; childs != null && childs.size() > 0 && j < childs.size(); j++) { - CostStandardDetailVO child = childs.get(j); + AppSceneCostStandardDetail child = childs.get(j); BomTreeInfoVO childBomTreeInfoVO = costStandardDetailChangeToBomTreeInfoVO(child); childBomTreeInfoVO = loopFindChildrenBuild(childBomTreeInfoVO, materialMap, childDataMap, result); children.add(childBomTreeInfoVO); @@ -78,8 +79,8 @@ public class BomTreeBuilder { * @param parent * @return */ - static BomTreeInfoVO costStandardDetailChangeToBomTreeInfoVO(CostStandardDetail parent) { - BomTreeInfoVO bomTreeInfoVO = BomTreeInfoVO.builder().materialNumber(parent.getMaterialNumber()).materialName(parent.getMaterialName()).level(parent.getLevel()).parentMaterialNumber(parent.getParentMaterialNumber()).quantity(parent.getDosage()).unit(parent.getUnit()).auxiliaryCost(parent.getAuxiliaryCost()).equipCost(parent.getEquipConsumeCost()).otherCost(parent.getOtherCost()).laborCost(parent.getLaborCost()).accumulatedEquipCost(parent.getTotalEquipConsumeCost()).accumulatedOtherCost(parent.getTotalOtherCost()).accumulatedLaborCost(parent.getTotalLaborCost()).accumulatedMaterialCost(parent.getAuxiliaryCost()).accumulatedFuelCost(parent.getTotalEuipDepreciationCost()).sort(parent.getSort()).build(); + static BomTreeInfoVO costStandardDetailChangeToBomTreeInfoVO(AppSceneCostStandardDetail parent) { + BomTreeInfoVO bomTreeInfoVO = BomTreeInfoVO.builder().materialNumber(parent.getMaterialNumber()).materialName(parent.getMaterialName()).level(parent.getLevel()).parentMaterialNumber(parent.getParentMaterialNumber()).quantity(parent.getDosage()).unit(parent.getUnit()).auxiliaryCost(parent.getSupplyMaterialCost()).equipCost(parent.getEquipmentCost()).otherCost(parent.getOtherCost()).laborCost(parent.getLaborCost()).accumulatedEquipCost(parent.getTotalEquipmentCost()).accumulatedOtherCost(parent.getTotalOtherCost()).accumulatedLaborCost(parent.getTotalLaborCost()).accumulatedMaterialCost(parent.getTotalMaterialCost()).accumulatedFuelCost(parent.getTotalDriveCost()).sort(parent.getSort()).build(); return bomTreeInfoVO; } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java index 584d03f..ce9b4eb 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; import org.apache.poi.ss.usermodel.*; import javax.servlet.http.HttpServletResponse; @@ -124,7 +125,7 @@ public class EasyExcelUtil { * @return */ public static Set getIncludeFields(Class clazz) { - Field[] excelPropertyAnnotatedFields = getExcelPropertyAnnotatedFields(CostStandardDetail.class); + Field[] excelPropertyAnnotatedFields = getExcelPropertyAnnotatedFields(AppSceneCostStandardDetail.class); Set includeColumnFiledNames = new HashSet(); for (int i = 0; i < excelPropertyAnnotatedFields.length; i++) { includeColumnFiledNames.add(excelPropertyAnnotatedFields[i].getName()); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java index fe80d9e..f0300c2 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/TotalResultValue.java @@ -19,6 +19,10 @@ import java.math.BigDecimal; * @Version: 1.0 */ public class TotalResultValue { + /** + * 总物料成本 + */ + private BigDecimal totalMaterialCost; /** * 总人工成本 */ From 1a2dee14e48e07501c82e034c75a0381962dabf2 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Fri, 2 Aug 2024 08:59:09 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppSceneCostCountController.java | 21 +- .../cost/manage/entity/AppSceneCostCount.java | 95 +++-- .../entity/AppSceneCostResultValue.java | 2 +- .../entity/AppSceneCostStandardDetail.java | 34 +- .../manage/enums/CostCountStatusEnum.java | 73 ++++ .../manage/plugin/StandardCostService.java | 355 +++++++++--------- .../cost/manage/vo/AppSceneCostCountVO.java | 14 + 7 files changed, 364 insertions(+), 230 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostCountStatusEnum.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java index c30a3e5..a0fe483 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; +import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostCountVO; import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -14,12 +16,14 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -49,11 +53,22 @@ public class AppSceneCostCountController extends JeecgController> queryPageList(AppSceneCostCount appSceneCostCount, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + public Result> queryPageList(AppSceneCostCount appSceneCostCount, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostCount, req.getParameterMap()); Page page = new Page(pageNo, pageSize); IPage pageList = appSceneCostCountService.page(page, queryWrapper); - return Result.OK(pageList); + IPage pageList1 = new Page<>(); + BeanUtils.copyProperties(pageList, pageList1); + Listlist=new ArrayList<>(); + for(int i=0;i addCostCountTask(@RequestBody AppSceneCostCount appSceneCostCount) { appSceneCostCountService.addCostCountTask(appSceneCostCount); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java index 2a00bc3..4437de9 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java @@ -1,85 +1,106 @@ package com.zzsmart.qomo.kn.cost.manage.entity; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableLogic; -import lombok.Builder; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; +import lombok.*; import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; /** * @Description: app_scene_cost_count * @Author: jeecg-boot - * @Date: 2024-07-29 + * @Date: 2024-07-29 * @Version: V1.0 */ @Data @TableName("app_scene_cost_count") @Builder +@NoArgsConstructor +@AllArgsConstructor @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="app_scene_cost_count对象", description="app_scene_cost_count") +@ApiModel(value = "app_scene_cost_count对象", description = "app_scene_cost_count") public class AppSceneCostCount implements Serializable { private static final long serialVersionUID = 1L; - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键") private Integer id; - /**物料编号*/ - @Excel(name = "物料编号", width = 15) + /** + * 物料编号 + */ + @Excel(name = "物料编号", width = 15) @ApiModelProperty(value = "物料编号") private String materialNo; - /**图号*/ - @Excel(name = "图号", width = 15) + /** + * 图号 + */ + @Excel(name = "图号", width = 15) @ApiModelProperty(value = "图号") private String drawingNo; - /**stage*/ - @Excel(name = "stage", width = 15) + /** + * stage + */ + @Excel(name = "阶段", width = 15) @ApiModelProperty(value = "stage") private String stage; - /**标准成本计算流程id*/ - @Excel(name = "标准成本计算流程id", width = 15) + /** + * 标准成本计算流程id + */ + @Excel(name = "标准成本计算流程id", width = 15) @ApiModelProperty(value = "标准成本计算流程id") private Integer flowDefinitionId; - /**year*/ - @Excel(name = "year", width = 15) + /** + * year + */ + @Excel(name = "年份", width = 15) @ApiModelProperty(value = "year") private String year; - /**状态*/ - @Excel(name = "状态", width = 15) + /** + * 状态 + */ + @Excel(name = "状态", width = 15) @ApiModelProperty(value = "状态") private Integer status; - /**模型版本*/ - @Excel(name = "标准成本版本", width = 15) + /** + * 模型版本 + */ + @Excel(name = "标准成本版本", width = 15) @ApiModelProperty(value = "标准成本版本") private String costVersion; - /**创建人*/ + /** + * 创建人 + */ @ApiModelProperty(value = "创建人") private Integer createBy; - /**创建时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") private Date createTime; - /**更新人*/ + /** + * 更新人 + */ @ApiModelProperty(value = "更新人") private Integer updateBy; - /**更新时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 更新时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新时间") private Date updateTime; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java index 8d14ca3..3cd6588 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java @@ -35,7 +35,7 @@ public class AppSceneCostResultValue implements Serializable { /** * 主键 */ - @TableId(type = IdType.ASSIGN_ID) + @TableId(type = IdType.AUTO) @ApiModelProperty(value = "主键") private Integer id; /** diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java index c6ed1d0..b4a1432 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardDetail.java @@ -77,8 +77,8 @@ public class AppSceneCostStandardDetail implements Serializable { @ApiModelProperty(value = "本阶材料费") private BigDecimal materialCost; /**本阶人工费*/ - @Excel(name = "本阶人工费", width = 15) - @ApiModelProperty(value = "本阶人工费") + @Excel(name = "本阶人工陈本", width = 15) + @ApiModelProperty(value = "本阶人工成本") private BigDecimal laborCost; /**本阶辅料费*/ @Excel(name = "本阶辅料费", width = 15) @@ -93,32 +93,32 @@ public class AppSceneCostStandardDetail implements Serializable { @ApiModelProperty(value = "本阶水电费(燃动费)") private BigDecimal driveCost; /**本阶其他制造费*/ - @Excel(name = "本阶其他制造费", width = 15) - @ApiModelProperty(value = "本阶其他制造费") + @Excel(name = "本阶其他费用", width = 15) + @ApiModelProperty(value = "本阶其他费用") private BigDecimal otherCost; /**本阶物流费*/ @Excel(name = "本阶物流费", width = 15) @ApiModelProperty(value = "本阶物流费") private BigDecimal logisticsCost; - /**累计人工费*/ - @Excel(name = "累计人工费", width = 15) - @ApiModelProperty(value = "累计人工费") + /**累计物料成本*/ + @Excel(name = "累计物料成本", width = 15) + @ApiModelProperty(value = "累计物料成本") private BigDecimal totalMaterialCost; - /**累计机器消耗费*/ - @Excel(name = "累计机器消耗费", width = 15) - @ApiModelProperty(value = "累计机器消耗费") + /**累计人工成本*/ + @Excel(name = "累计人工成本", width = 15) + @ApiModelProperty(value = "累计人工成本") private BigDecimal totalLaborCost; + /**累计辅料费*/ + @Excel(name = "累计辅料费", width = 15) + @ApiModelProperty(value = "累计辅料费") + private BigDecimal totalSupplyMaterialCost; /**累计机器折旧费*/ @Excel(name = "累计机器折旧费", width = 15) @ApiModelProperty(value = "累计机器折旧费") - private BigDecimal totalSupplyMaterialCost; - /**累计水电费*/ - @Excel(name = "累计水电费", width = 15) - @ApiModelProperty(value = "累计水电费") private BigDecimal totalEquipmentCost; - /**累计其它费用*/ - @Excel(name = "累计其它费用", width = 15) - @ApiModelProperty(value = "累计其它费用") + /**累计水电费(燃动费)*/ + @Excel(name = "累计水电费(燃动费)", width = 15) + @ApiModelProperty(value = "累计水电费(燃动费)") private BigDecimal totalDriveCost; /**累计其他费用*/ @Excel(name = "累计其他费用", width = 15) diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostCountStatusEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostCountStatusEnum.java new file mode 100644 index 0000000..64ceedd --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostCountStatusEnum.java @@ -0,0 +1,73 @@ +package com.zzsmart.qomo.kn.cost.manage.enums; + +/** + * @Classname StandardStageEnum + * @Description 阶段枚举 + * @Version 1.0.0 + * @Date 2024/6/18 9:51 + * @Created wangqiong + */ +public enum CostCountStatusEnum { + + NotExecute("NotExecute", "未执行", 0), Executing("Executing", "计算中", 1), ExecutedFinished("ExecutedFinished", "计算完成", 2), ExecutedError("ExecutedError", "出错中止", 3); + private final String code; + private final String name; + private final Integer value; + + CostCountStatusEnum(String code, String name, Integer value) { + this.code = code; + this.name = name; + this.value = value; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public Integer getValue() { + return value; + } + + /** + * 根据code获取text + * + * @param codeNo + * @return + */ + public static String getTextByCode(String codeNo) { + for (CostCountStatusEnum value : CostCountStatusEnum.values()) { + if (value.getCode().equals(codeNo)) { + return value.name(); + } + } + return codeNo.toString(); + } + + public static String getTextByValue(Integer indexNo) { + for (CostCountStatusEnum value : CostCountStatusEnum.values()) { + if (value.getValue().equals(indexNo)) { + return value.name(); + } + } + return indexNo.toString(); + } + + /** + * 根据text获取code + * + * @param name + * @return + */ + public static String getCodeByName(String name) { + for (CostCountStatusEnum value : CostCountStatusEnum.values()) { + if (value.name().equals(name)) { + return value.name(); + } + } + return name; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 47e352a..cbbfc8a 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -14,16 +14,19 @@ import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @Service @Slf4j +@Transactional public class StandardCostService { /** * 物料BOM信息 @@ -469,145 +472,150 @@ public class StandardCostService { * 5.标准成本计算任务 */ public static void standardCostTask(TaskExecutionContext parameters) { - //获取任务流程相关信息 - FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters); - //获取最上层的物料号 - String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); - //获取任务类型 - String taskType = parameters.getTaskType(); - //获取任务代码 - String taskCode = flowTaskInfoVO.getTaskCode(); - //获取流程id - String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); - String costType = FeeTypeEnum.StandardCost.getCode(); - //1.查询出根物料编号对应的下所有的BOM信息结果值 - List list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, flowInstanceId); - //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) - //按照物料编号进行分组 - Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); - //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计 - for (String key : materialNoMap.keySet()) { - List appSceneCostResultValues = materialNoMap.get(key); - //按照费用类别进行分组 - Map> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType)); - //【本阶标准成本】 - BigDecimal currentCost = new BigDecimal("0.0"); - //1.本阶物料成本 - BigDecimal materialCost = new BigDecimal("0.0"); - //2.本阶人工成本 - BigDecimal laborCost = new BigDecimal("0.0"); - //3.本阶制造费(设备费) - BigDecimal equipmentCost = new BigDecimal("0.0"); - //4.本阶制造费(辅料费用) - BigDecimal supplyMaterialCost = new BigDecimal("0.0"); - //5.本阶制造费(水电费、燃动费) - BigDecimal driveCost = new BigDecimal("0.0"); - //6.本阶制造费(其他制造费用) - BigDecimal otherCost = new BigDecimal("0.0"); - //7.本阶制造费(物流费) - BigDecimal logisticsCost = new BigDecimal("0.0"); - //物料单价 - BigDecimal materialUnitPrice = new BigDecimal("0.0"); - //人员工时、小时费率 - BigDecimal laborHour = new BigDecimal("0.0"); - BigDecimal laborHourRate = new BigDecimal("0.0"); - //设备工时、小时费率 - BigDecimal equipmentHour = new BigDecimal("0.0"); - BigDecimal equipmentHourRate = new BigDecimal("0.0"); - //辅料工时、小时费率 - BigDecimal supplyMaterialHour = new BigDecimal("0.0"); - BigDecimal supplyMaterialHourRate = new BigDecimal("0.0"); - //燃动工时、小时费率 - BigDecimal driveHour = new BigDecimal("0.0"); - BigDecimal driveHourRate = new BigDecimal("0.0"); - //其他工时、小时费率 - BigDecimal otherHour = new BigDecimal("0.0"); - BigDecimal otherHourRate = new BigDecimal("0.0"); - AppSceneCostResultValue currentMaterialCost = null; - //遍历所有费用类别计算本阶标准成本 - for (int j = 0; j < appSceneCostResultValues.size(); j++) { - if (j == 0) { - currentMaterialCost = appSceneCostResultValues.get(0); - } - AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); - String countValue = appSceneCostResultValue.getCountValue(); - if (countValue != null) { - currentCost = currentCost.add(new BigDecimal(countValue)); - } - } - //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率 - for (String feeType : costTypeMap.keySet()) { - List appSceneCostResultValues1 = costTypeMap.get(feeType); - for (int m = 0; m < appSceneCostResultValues1.size(); m++) { - if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) { - //物料成本 - materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //物料单价 - materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate(); - } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) { - //人工成本 - laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //人工工时、小时费率 - laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour()); - laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { - //设备费用 - equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //设备工时、小时费率 - equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour()); - equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { - //辅料费用 - supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //辅料工时、小时费率 - supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour()); - supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { - //燃动费用 - driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //燃动工时、小时费率 - driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour()); - driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { - //物流费用 - logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { - //其他费用 - otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //其他工时、小时费率 - otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour()); - otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + try { + //获取任务流程相关信息 + FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters); + //获取最上层的物料号 + String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); + //获取任务类型 + String taskType = parameters.getTaskType(); + //获取任务代码 + String taskCode = flowTaskInfoVO.getTaskCode(); + //获取流程id + String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); + String costType = FeeTypeEnum.StandardCost.getCode(); + //1.查询出根物料编号对应的下所有的BOM信息结果值 + List list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, flowInstanceId); + //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) + //按照物料编号进行分组 + Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); + //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计 + for (String key : materialNoMap.keySet()) { + List appSceneCostResultValues = materialNoMap.get(key); + //按照费用类别进行分组 + Map> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType)); + //【本阶标准成本】 + BigDecimal currentCost = new BigDecimal("0.0"); + //1.本阶物料成本 + BigDecimal materialCost = new BigDecimal("0.0"); + //2.本阶人工成本 + BigDecimal laborCost = new BigDecimal("0.0"); + //3.本阶制造费(设备费) + BigDecimal equipmentCost = new BigDecimal("0.0"); + //4.本阶制造费(辅料费用) + BigDecimal supplyMaterialCost = new BigDecimal("0.0"); + //5.本阶制造费(水电费、燃动费) + BigDecimal driveCost = new BigDecimal("0.0"); + //6.本阶制造费(其他制造费用) + BigDecimal otherCost = new BigDecimal("0.0"); + //7.本阶制造费(物流费) + BigDecimal logisticsCost = new BigDecimal("0.0"); + //物料单价 + BigDecimal materialUnitPrice = new BigDecimal("0.0"); + //人员工时、小时费率 + BigDecimal laborHour = new BigDecimal("0.0"); + BigDecimal laborHourRate = new BigDecimal("0.0"); + //设备工时、小时费率 + BigDecimal equipmentHour = new BigDecimal("0.0"); + BigDecimal equipmentHourRate = new BigDecimal("0.0"); + //辅料工时、小时费率 + BigDecimal supplyMaterialHour = new BigDecimal("0.0"); + BigDecimal supplyMaterialHourRate = new BigDecimal("0.0"); + //燃动工时、小时费率 + BigDecimal driveHour = new BigDecimal("0.0"); + BigDecimal driveHourRate = new BigDecimal("0.0"); + //其他工时、小时费率 + BigDecimal otherHour = new BigDecimal("0.0"); + BigDecimal otherHourRate = new BigDecimal("0.0"); + AppSceneCostResultValue currentMaterialCost = null; + //遍历所有费用类别计算本阶标准成本 + for (int j = 0; j < appSceneCostResultValues.size(); j++) { + if (j == 0) { + currentMaterialCost = appSceneCostResultValues.get(0); + } + AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); + String countValue = appSceneCostResultValue.getCountValue(); + if (countValue != null) { + currentCost = currentCost.add(new BigDecimal(countValue)); } } + //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率 + for (String feeType : costTypeMap.keySet()) { + List appSceneCostResultValues1 = costTypeMap.get(feeType); + for (int m = 0; m < appSceneCostResultValues1.size(); m++) { + if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) { + //物料成本 + materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //物料单价 + materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate(); + } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) { + //人工成本 + laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //人工工时、小时费率 + laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour()); + laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { + //设备费用 + equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //设备工时、小时费率 + equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour()); + equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { + //辅料费用 + supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //辅料工时、小时费率 + supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour()); + supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { + //燃动费用 + driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //燃动工时、小时费率 + driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour()); + driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { + //物流费用 + logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { + //其他费用 + otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //其他工时、小时费率 + otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour()); + otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } + } + } + //本阶不同费用类别成本统计 + JSONObject currentLevelCostTypeDetail = new JSONObject(); + currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost); + //统计本阶不同费用类别工时、小时费率 + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate); + 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(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); } - //本阶不同费用类别成本统计 - JSONObject currentLevelCostTypeDetail = new JSONObject(); - currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost); - //统计本阶不同费用类别工时、小时费率 - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate); - 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(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); + //3.计算出所有的单个物料的累计标准成本 + List standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId); + //【累计成本】的计算 + totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId); + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("计算成本失败"); } - //3.计算出所有的单个物料的累计标准成本 - List standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId); - //【累计成本】的计算 - totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId); } /** @@ -620,48 +628,51 @@ public class StandardCostService { * @param flowInstanceId */ private static void totalCountCost(List standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId) { - - List costStandardDetails = new ArrayList<>(); - //父类对应的子节点(除了最上层节点) - Map> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo)); - for (int i = 0; i < standardCostList.size(); i++) { - //当前节点及其对应的本阶成本 - AppSceneCostResultValue oldAppSceneCostResultValue = standardCostList.get(i); - BigDecimal totalCost = new BigDecimal(oldAppSceneCostResultValue.getCountValue()); - //循环计算出当前节点的累计成本 - String costDetail = oldAppSceneCostResultValue.getCostDetail(); - //查询当前节点各个类型的成本 - BigDecimal totalMaterialCost = new BigDecimal(0); - BigDecimal totalLabourCost = new BigDecimal(0); - BigDecimal totalEquipmentCost = new BigDecimal(0); - BigDecimal totalSupplyMaterialCost = new BigDecimal(0); - BigDecimal totalDriveCost = new BigDecimal(0); - BigDecimal totalLogisticsCost = new BigDecimal(0); - BigDecimal totalOtherCost = new BigDecimal(0); - JSONObject costDetailJson = JSON.parseObject(costDetail); - TotalResultValue hourOrRateResultValue = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, totalMaterialCost, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); - costDetailJson.put(TotalCostEnum.TotalMaterialCost.getCode(), hourOrRateResultValue.getTotalMaterialCost()); - costDetailJson.put(TotalCostEnum.TotalLaborCost.getCode(), hourOrRateResultValue.getTotalLabourCost()); - costDetailJson.put(TotalCostEnum.TotalEquipmentFee.getCode(), hourOrRateResultValue.getTotalEquipmentCost()); - costDetailJson.put(TotalCostEnum.TotalSupplyMaterialFee.getCode(), hourOrRateResultValue.getTotalSupplyMaterialCost()); - costDetailJson.put(TotalCostEnum.TotalDriverFee.getCode(), hourOrRateResultValue.getTotalDriveCost()); - costDetailJson.put(TotalCostEnum.TotalLogisticsFee.getCode(), hourOrRateResultValue.getTotalLogisticsCost()); - costDetailJson.put(TotalCostEnum.TotalOtherFee.getCode(), hourOrRateResultValue.getTotalOtherCost()); - costDetailJson.put(TotalCostEnum.TotalStandardCost.getCode(), hourOrRateResultValue.getTotalCost()); - oldAppSceneCostResultValue.setCostDetail(costDetailJson.toJSONString()); - oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString()); - standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue); - //构造单行成本查询记录 - AppSceneCostStandardDetail costStandardDetail = AppSceneCostStandardDetail.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).materialName(oldAppSceneCostResultValue.getMarterialNo()).parentMaterialNumber(oldAppSceneCostResultValue.getParentMarterialNo()) + try { + List costStandardDetails = new ArrayList<>(); + //父类对应的子节点(除了最上层节点) + Map> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo)); + for (int i = 0; i < standardCostList.size(); i++) { + //当前节点及其对应的本阶成本 + AppSceneCostResultValue oldAppSceneCostResultValue = standardCostList.get(i); + BigDecimal totalCost = new BigDecimal(oldAppSceneCostResultValue.getCountValue()); + //循环计算出当前节点的累计成本 + String costDetail = oldAppSceneCostResultValue.getCostDetail(); + //查询当前节点各个类型的成本 + BigDecimal totalMaterialCost = new BigDecimal(0); + BigDecimal totalLabourCost = new BigDecimal(0); + BigDecimal totalEquipmentCost = new BigDecimal(0); + BigDecimal totalSupplyMaterialCost = new BigDecimal(0); + BigDecimal totalDriveCost = new BigDecimal(0); + BigDecimal totalLogisticsCost = new BigDecimal(0); + BigDecimal totalOtherCost = new BigDecimal(0); + JSONObject costDetailJson = JSON.parseObject(costDetail); + TotalResultValue hourOrRateResultValue = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, totalMaterialCost, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost); + costDetailJson.put(TotalCostEnum.TotalMaterialCost.getCode(), hourOrRateResultValue.getTotalMaterialCost()); + costDetailJson.put(TotalCostEnum.TotalLaborCost.getCode(), hourOrRateResultValue.getTotalLabourCost()); + costDetailJson.put(TotalCostEnum.TotalEquipmentFee.getCode(), hourOrRateResultValue.getTotalEquipmentCost()); + costDetailJson.put(TotalCostEnum.TotalSupplyMaterialFee.getCode(), hourOrRateResultValue.getTotalSupplyMaterialCost()); + costDetailJson.put(TotalCostEnum.TotalDriverFee.getCode(), hourOrRateResultValue.getTotalDriveCost()); + costDetailJson.put(TotalCostEnum.TotalLogisticsFee.getCode(), hourOrRateResultValue.getTotalLogisticsCost()); + costDetailJson.put(TotalCostEnum.TotalOtherFee.getCode(), hourOrRateResultValue.getTotalOtherCost()); + costDetailJson.put(TotalCostEnum.TotalStandardCost.getCode(), hourOrRateResultValue.getTotalCost()); + oldAppSceneCostResultValue.setCostDetail(costDetailJson.toJSONString()); + oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString()); + standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue); + //构造单行成本查询记录 + AppSceneCostStandardDetail costStandardDetail = AppSceneCostStandardDetail.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).materialName(oldAppSceneCostResultValue.getMarterialNo()).parentMaterialNumber(oldAppSceneCostResultValue.getParentMarterialNo()) // .versionNumber() // .level() // .sort() // .figureNumber() - .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())).build(); - costStandardDetails.add(costStandardDetail); + .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(); + costStandardDetails.add(costStandardDetail); + } + //更新结果集到标准成本单行查询中去 + standardCostService.iAppSceneCostStandardDetailService.saveBatch(costStandardDetails); + } catch (Exception e) { + e.printStackTrace(); } - //更新结果集到标准成本单行查询中去 - standardCostService.iAppSceneCostStandardDetailService.saveBatch(costStandardDetails); } /** diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java new file mode 100644 index 0000000..66c2209 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.vo; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class AppSceneCostCountVO extends AppSceneCostCount { + /** + * 状态名称 + */ + private String statusName; +} From b9f7d0380d599223b467a1952aef2a6212ca3caa Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Fri, 2 Aug 2024 11:01:26 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=EF=BC=88=E5=B0=8F=E6=97=B6=E8=B4=B9=E7=8E=87?= =?UTF-8?q?=E3=80=81=E9=87=87=E8=B4=AD=E4=BB=B7=E3=80=81=E5=B7=A5=E5=BA=8F?= =?UTF-8?q?=E5=B7=A5=E6=97=B6=E3=80=81=E7=89=A9=E6=96=99BOM=E3=80=81?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E3=80=81=E9=83=A8=E4=BB=B6=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E4=BF=A1=E6=81=AF=EF=BC=89=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppSceneCostCountController.java | 28 +- .../AppSceneCostHourRateController.java | 162 +++++++++ .../AppSceneCostMaterialBomController.java | 190 ++++++++++ ...eneCostMaterialProcessHoursController.java | 159 +++++++++ ...AppSceneCostPartMissingInfoController.java | 159 +++++++++ .../AppSceneCostPurchasePriceController.java | 159 +++++++++ ...AppSceneCostStandardVersionController.java | 157 ++++++++ .../controller/CostMaterialBomController.java | 70 ---- .../CostMaterialProcessHoursController.java | 20 -- .../CostPartMissingInfoController.java | 179 ---------- .../CostPurchasePriceController.java | 20 -- .../CostStandardVersionController.java | 178 ---------- .../manage/controller/HourRateController.java | 162 --------- .../manage/entity/AppSceneCostHourRate.java | 127 +++++++ .../entity/AppSceneCostMaterialBom.java | 261 ++++++++++++++ ... => AppSceneCostMaterialProcessHours.java} | 127 +++---- ....java => AppSceneCostPartMissingInfo.java} | 60 ++-- .../entity/AppSceneCostPurchasePrice.java | 173 +++++++++ ....java => AppSceneCostStandardVersion.java} | 25 +- .../cost/manage/entity/CostMaterialBom.java | 335 ------------------ .../qomo/kn/cost/manage/entity/CostModel.java | 135 ------- .../cost/manage/entity/CostPurchasePrice.java | 215 ----------- .../qomo/kn/cost/manage/entity/HourRate.java | 99 ------ .../mapper/AppSceneCostHourRateMapper.java | 14 + ...ava => AppSceneCostMaterialBomMapper.java} | 21 +- ...ppSceneCostMaterialProcessHoursMapper.java | 14 + .../AppSceneCostPartMissingInfoMapper.java | 14 + .../AppSceneCostPurchasePriceMapper.java | 14 + .../AppSceneCostStandardVersionMapper.java | 17 + .../CostMaterialProcessHoursMapper.java | 18 - .../mapper/CostPartMissingInfoMapper.java | 18 - .../mapper/CostPurchasePriceMapper.java | 18 - .../mapper/CostStandardVersionMapper.java | 18 - .../kn/cost/manage/mapper/HourRateMapper.java | 14 - ...per.xml => AppSceneCostHourRateMapper.xml} | 2 +- ....xml => AppSceneCostMaterialBomMapper.xml} | 2 +- ...AppSceneCostMaterialProcessHoursMapper.xml | 5 + .../xml/AppSceneCostPartMissingInfoMapper.xml | 5 + ...ml => AppSceneCostPurchasePriceMapper.xml} | 2 +- .../xml/AppSceneCostStandardDetailMapper.xml | 2 +- .../xml/AppSceneCostStandardVersionMapper.xml | 5 + .../mapper/xml/CostMaterialBomMapper.xml | 52 --- .../xml/CostMaterialProcessHoursMapper.xml | 30 -- .../mapper/xml/CostPurchasePriceMapper.xml | 37 -- .../manage/plugin/StandardCostService.java | 44 +-- .../service/CostMaterialBomService.java | 30 -- .../CostMaterialProcessHoursService.java | 22 -- .../service/IAppSceneCostHourRateService.java | 14 + .../IAppSceneCostMaterialBomService.java | 28 ++ ...pSceneCostMaterialProcessHoursService.java | 22 ++ .../IAppSceneCostPartMissingInfoService.java | 14 + ...=> IAppSceneCostPurchasePriceService.java} | 16 +- .../IAppSceneCostStandardVersionService.java | 14 + .../service/ICostPartMissingInfoService.java | 14 - .../service/ICostStandardVersionService.java | 35 -- .../cost/manage/service/IHourRateService.java | 15 - .../impl/AppSceneCostCountServiceImpl.java | 22 +- .../impl/AppSceneCostHourRateServiceImpl.java | 18 + ...> AppSceneCostMaterialBomServiceImpl.java} | 27 +- ...neCostMaterialProcessHoursServiceImpl.java | 55 +++ ...ppSceneCostPartMissingInfoServiceImpl.java | 18 + ...AppSceneCostPurchasePriceServiceImpl.java} | 32 +- ...ppSceneCostStandardVersionServiceImpl.java | 19 + .../CostMaterialProcessHoursServiceImpl.java | 57 --- .../impl/CostPartMissingInfoServiceImpl.java | 20 -- .../impl/CostStandardVersionServiceImpl.java | 214 ----------- .../service/impl/HourRateServiceImpl.java | 19 - .../cost/manage/vo/AppSceneCostCountVO.java | 4 +- 68 files changed, 2019 insertions(+), 2276 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialProcessHoursController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPurchasePriceController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostHourRate.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/{CostMaterialProcessHours.java => AppSceneCostMaterialProcessHours.java} (51%) rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/{CostPartMissingInfo.java => AppSceneCostPartMissingInfo.java} (55%) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/{CostStandardVersion.java => AppSceneCostStandardVersion.java} (78%) delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostModel.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/{CostMaterialBomMapper.java => AppSceneCostMaterialBomMapper.java} (62%) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPartMissingInfoMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialProcessHoursMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPartMissingInfoMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPurchasePriceMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardVersionMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/HourRateMapper.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/{CostStandardVersionMapper.xml => AppSceneCostHourRateMapper.xml} (64%) rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/{CostPartMissingInfoMapper.xml => AppSceneCostMaterialBomMapper.xml} (63%) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPartMissingInfoMapper.xml rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/{HourRateMapper.xml => AppSceneCostPurchasePriceMapper.xml} (63%) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardVersionMapper.xml delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialBomMapper.xml delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialProcessHoursMapper.xml delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostPurchasePriceMapper.xml delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialProcessHoursService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPartMissingInfoService.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/{CostPurchasePriceService.java => IAppSceneCostPurchasePriceService.java} (54%) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardVersionService.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostPartMissingInfoService.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IHourRateService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostHourRateServiceImpl.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/{CostMaterialBomServiceImpl.java => AppSceneCostMaterialBomServiceImpl.java} (64%) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPartMissingInfoServiceImpl.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/{CostPurchasePriceServiceImpl.java => AppSceneCostPurchasePriceServiceImpl.java} (53%) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardVersionServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialProcessHoursServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPartMissingInfoServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/HourRateServiceImpl.java diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java index a0fe483..9616664 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java @@ -102,20 +102,20 @@ public class AppSceneCostCountController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { - this.appSceneCostCountService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_count-批量删除") +// @ApiOperation(value = "app_scene_cost_count-批量删除", notes = "app_scene_cost_count-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostCountService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } /** * 重新计算 diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java new file mode 100644 index 0000000..8cd1407 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java @@ -0,0 +1,162 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostHourRateService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_hour_rate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Api(tags="cost-小时费率") +@RestController +@RequestMapping("//hourRate") +@Slf4j +public class AppSceneCostHourRateController extends JeecgController { + @Autowired + private IAppSceneCostHourRateService appSceneCostHourRateService; + + /** + * 分页列表查询 + * + * @param appSceneCostHourRate + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_hour_rate-分页列表查询") + @ApiOperation(value = "app_scene_cost_hour_rate-分页列表查询", notes = "app_scene_cost_hour_rate-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostHourRate appSceneCostHourRate, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostHourRate, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostHourRateService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostHourRate + * @return + */ + @AutoLog(value = "app_scene_cost_hour_rate-添加") + @ApiOperation(value = "app_scene_cost_hour_rate-添加", notes = "app_scene_cost_hour_rate-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostHourRate appSceneCostHourRate) { + appSceneCostHourRateService.save(appSceneCostHourRate); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostHourRate + * @return + */ + @AutoLog(value = "app_scene_cost_hour_rate-编辑") + @ApiOperation(value = "app_scene_cost_hour_rate-编辑", notes = "app_scene_cost_hour_rate-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostHourRate appSceneCostHourRate) { + appSceneCostHourRateService.updateById(appSceneCostHourRate); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_hour_rate-通过id删除") + @ApiOperation(value = "app_scene_cost_hour_rate-通过id删除", notes = "app_scene_cost_hour_rate-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostHourRateService.removeById(id); + return Result.OK("删除成功!"); + } + +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_hour_rate-批量删除") +// @ApiOperation(value = "app_scene_cost_hour_rate-批量删除", notes = "app_scene_cost_hour_rate-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostHourRateService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_hour_rate-通过id查询") + @ApiOperation(value = "app_scene_cost_hour_rate-通过id查询", notes = "app_scene_cost_hour_rate-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostHourRate appSceneCostHourRate = appSceneCostHourRateService.getById(id); + if (appSceneCostHourRate == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostHourRate); + } + +// /** +// * 导出excel +// * +// * @param request +// * @param appSceneCostHourRate +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostHourRate appSceneCostHourRate) { +// return super.exportXls(request, appSceneCostHourRate, AppSceneCostHourRate.class, "app_scene_cost_hour_rate"); +// } + +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppSceneCostHourRate.class); +// } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java new file mode 100644 index 0000000..a2018ac --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java @@ -0,0 +1,190 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialBomService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @Description: app_scene_cost_material_bom + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@RequestMapping("//cost-material-bom") +@Api(tags="cost-标准成本-bom信息") +@RestController +@Slf4j +public class AppSceneCostMaterialBomController extends JeecgController { + @Autowired + private IAppSceneCostMaterialBomService costMaterialBomService; + /** + * 分页列表查询 + * + * @param costMaterialBom + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询") + @ApiOperation(value="物料bom分页列表查询", notes="物料bom分页列表查询") + @GetMapping(value = "/pageList") + public Result> queryPageList(AppSceneCostMaterialBom costMaterialBom, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costMaterialBom, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = costMaterialBomService.page(page, queryWrapper); + return Result.OK(pageList); + } + /** + * 列表查询 + * + * @return + */ + @ApiOperation(value="物料bom列表查询", notes="物料bom列表查询") + @GetMapping(value = "/list") + public Result> queryList(@RequestParam(name = "materialNumber",required = false) String materialNumber) { + List list = costMaterialBomService.queryListResult(materialNumber); + return Result.OK(list); + } + +// /** +// * 分页列表查询 +// * +// * @param appSceneCostMaterialBom +// * @param pageNo +// * @param pageSize +// * @param req +// * @return +// */ +// //@AutoLog(value = "app_scene_cost_material_bom-分页列表查询") +// @ApiOperation(value = "app_scene_cost_material_bom-分页列表查询", notes = "app_scene_cost_material_bom-分页列表查询") +// @GetMapping(value = "/list") +// public Result> queryPageList(AppSceneCostMaterialBom appSceneCostMaterialBom, +// @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, +// @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, +// HttpServletRequest req) { +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialBom, req.getParameterMap()); +// Page page = new Page(pageNo, pageSize); +// IPage pageList = appSceneCostMaterialBomService.page(page, queryWrapper); +// return Result.OK(pageList); +// } +// +// /** +// * 添加 +// * +// * @param appSceneCostMaterialBom +// * @return +// */ +// @AutoLog(value = "app_scene_cost_material_bom-添加") +// @ApiOperation(value = "app_scene_cost_material_bom-添加", notes = "app_scene_cost_material_bom-添加") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { +// appSceneCostMaterialBomService.save(appSceneCostMaterialBom); +// return Result.OK("添加成功!"); +// } +// +// /** +// * 编辑 +// * +// * @param appSceneCostMaterialBom +// * @return +// */ +// @AutoLog(value = "app_scene_cost_material_bom-编辑") +// @ApiOperation(value = "app_scene_cost_material_bom-编辑", notes = "app_scene_cost_material_bom-编辑") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:edit") +// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) +// public Result edit(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { +// appSceneCostMaterialBomService.updateById(appSceneCostMaterialBom); +// return Result.OK("编辑成功!"); +// } +// +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @AutoLog(value = "app_scene_cost_material_bom-通过id删除") +// @ApiOperation(value = "app_scene_cost_material_bom-通过id删除", notes = "app_scene_cost_material_bom-通过id删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:delete") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name = "id", required = true) String id) { +// appSceneCostMaterialBomService.removeById(id); +// return Result.OK("删除成功!"); +// } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_material_bom-批量删除") +// @ApiOperation(value = "app_scene_cost_material_bom-批量删除", notes = "app_scene_cost_material_bom-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostMaterialBomService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } +// +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "app_scene_cost_material_bom-通过id查询") +// @ApiOperation(value = "app_scene_cost_material_bom-通过id查询", notes = "app_scene_cost_material_bom-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name = "id", required = true) String id) { +// AppSceneCostMaterialBom appSceneCostMaterialBom = appSceneCostMaterialBomService.getById(id); +// if (appSceneCostMaterialBom == null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(appSceneCostMaterialBom); +// } +// +// /** +// * 导出excel +// * +// * @param request +// * @param appSceneCostMaterialBom +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialBom appSceneCostMaterialBom) { +// return super.exportXls(request, appSceneCostMaterialBom, AppSceneCostMaterialBom.class, "app_scene_cost_material_bom"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppSceneCostMaterialBom.class); +// } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java new file mode 100644 index 0000000..da07942 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialProcessHoursService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_material_process_hours + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Api(tags = "cost-工序工时") +@RestController +@RequestMapping("//processHours") +@Slf4j +public class AppSceneCostMaterialProcessHoursController extends JeecgController { + @Autowired + private IAppSceneCostMaterialProcessHoursService appSceneCostMaterialProcessHoursService; + + /** + * 分页列表查询 + * + * @param appSceneCostMaterialProcessHours + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_material_process_hours-分页列表查询") + @ApiOperation(value = "app_scene_cost_material_process_hours-分页列表查询", notes = "app_scene_cost_material_process_hours-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialProcessHours, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostMaterialProcessHoursService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostMaterialProcessHours + * @return + */ + @AutoLog(value = "app_scene_cost_material_process_hours-添加") + @ApiOperation(value = "app_scene_cost_material_process_hours-添加", notes = "app_scene_cost_material_process_hours-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { + appSceneCostMaterialProcessHoursService.save(appSceneCostMaterialProcessHours); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostMaterialProcessHours + * @return + */ + @AutoLog(value = "app_scene_cost_material_process_hours-编辑") + @ApiOperation(value = "app_scene_cost_material_process_hours-编辑", notes = "app_scene_cost_material_process_hours-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { + appSceneCostMaterialProcessHoursService.updateById(appSceneCostMaterialProcessHours); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_material_process_hours-通过id删除") + @ApiOperation(value = "app_scene_cost_material_process_hours-通过id删除", notes = "app_scene_cost_material_process_hours-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostMaterialProcessHoursService.removeById(id); + return Result.OK("删除成功!"); + } + +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_material_process_hours-批量删除") +// @ApiOperation(value = "app_scene_cost_material_process_hours-批量删除", notes = "app_scene_cost_material_process_hours-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostMaterialProcessHoursService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_material_process_hours-通过id查询") + @ApiOperation(value = "app_scene_cost_material_process_hours-通过id查询", notes = "app_scene_cost_material_process_hours-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours = appSceneCostMaterialProcessHoursService.getById(id); + if (appSceneCostMaterialProcessHours == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostMaterialProcessHours); + } + +// /** +// * 导出excel +// * +// * @param request +// * @param appSceneCostMaterialProcessHours +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { +// return super.exportXls(request, appSceneCostMaterialProcessHours, AppSceneCostMaterialProcessHours.class, "app_scene_cost_material_process_hours"); +// } + +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppSceneCostMaterialProcessHours.class); +// } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java new file mode 100644 index 0000000..a451064 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPartMissingInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_part_missing_info + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Api(tags = "cost-部件缺失信息") +@RestController +@RequestMapping("//partMissingInfo") +@Slf4j +public class AppSceneCostPartMissingInfoController extends JeecgController { + @Autowired + private IAppSceneCostPartMissingInfoService appSceneCostPartMissingInfoService; + + /** + * 分页列表查询 + * + * @param appSceneCostPartMissingInfo + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_part_missing_info-分页列表查询") + @ApiOperation(value = "app_scene_cost_part_missing_info-分页列表查询", notes = "app_scene_cost_part_missing_info-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostPartMissingInfo appSceneCostPartMissingInfo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPartMissingInfo, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostPartMissingInfoService.page(page, queryWrapper); + return Result.OK(pageList); + } +// +// /** +// * 添加 +// * +// * @param appSceneCostPartMissingInfo +// * @return +// */ +// @AutoLog(value = "app_scene_cost_part_missing_info-添加") +// @ApiOperation(value = "app_scene_cost_part_missing_info-添加", notes = "app_scene_cost_part_missing_info-添加") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) { +// appSceneCostPartMissingInfoService.save(appSceneCostPartMissingInfo); +// return Result.OK("添加成功!"); +// } +// +// /** +// * 编辑 +// * +// * @param appSceneCostPartMissingInfo +// * @return +// */ +// @AutoLog(value = "app_scene_cost_part_missing_info-编辑") +// @ApiOperation(value = "app_scene_cost_part_missing_info-编辑", notes = "app_scene_cost_part_missing_info-编辑") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:edit") +// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) +// public Result edit(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) { +// appSceneCostPartMissingInfoService.updateById(appSceneCostPartMissingInfo); +// return Result.OK("编辑成功!"); +// } +// +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @AutoLog(value = "app_scene_cost_part_missing_info-通过id删除") +// @ApiOperation(value = "app_scene_cost_part_missing_info-通过id删除", notes = "app_scene_cost_part_missing_info-通过id删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:delete") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name = "id", required = true) String id) { +// appSceneCostPartMissingInfoService.removeById(id); +// return Result.OK("删除成功!"); +// } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_part_missing_info-批量删除") +// @ApiOperation(value = "app_scene_cost_part_missing_info-批量删除", notes = "app_scene_cost_part_missing_info-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostPartMissingInfoService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } +// +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "app_scene_cost_part_missing_info-通过id查询") +// @ApiOperation(value = "app_scene_cost_part_missing_info-通过id查询", notes = "app_scene_cost_part_missing_info-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name = "id", required = true) String id) { +// AppSceneCostPartMissingInfo appSceneCostPartMissingInfo = appSceneCostPartMissingInfoService.getById(id); +// if (appSceneCostPartMissingInfo == null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(appSceneCostPartMissingInfo); +// } +// +// /** +// * 导出excel +// * +// * @param request +// * @param appSceneCostPartMissingInfo +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) { +// return super.exportXls(request, appSceneCostPartMissingInfo, AppSceneCostPartMissingInfo.class, "app_scene_cost_part_missing_info"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppSceneCostPartMissingInfo.class); +// } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java new file mode 100644 index 0000000..4a750c1 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchasePriceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_purchase_price + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Api(tags = "cost-采购价") +@RestController +@RequestMapping("//purchasePrice") +@Slf4j +public class AppSceneCostPurchasePriceController extends JeecgController { + @Autowired + private IAppSceneCostPurchasePriceService appSceneCostPurchasePriceService; + + /** + * 分页列表查询 + * + * @param appSceneCostPurchasePrice + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_purchase_price-分页列表查询") + @ApiOperation(value = "app_scene_cost_purchase_price-分页列表查询", notes = "app_scene_cost_purchase_price-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostPurchasePrice appSceneCostPurchasePrice, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchasePrice, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostPurchasePriceService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostPurchasePrice + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_price-添加") + @ApiOperation(value = "app_scene_cost_purchase_price-添加", notes = "app_scene_cost_purchase_price-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { + appSceneCostPurchasePriceService.save(appSceneCostPurchasePrice); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostPurchasePrice + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_price-编辑") + @ApiOperation(value = "app_scene_cost_purchase_price-编辑", notes = "app_scene_cost_purchase_price-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { + appSceneCostPurchasePriceService.updateById(appSceneCostPurchasePrice); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_price-通过id删除") + @ApiOperation(value = "app_scene_cost_purchase_price-通过id删除", notes = "app_scene_cost_purchase_price-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostPurchasePriceService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_price-批量删除") + @ApiOperation(value = "app_scene_cost_purchase_price-批量删除", notes = "app_scene_cost_purchase_price-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostPurchasePriceService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_purchase_price-通过id查询") + @ApiOperation(value = "app_scene_cost_purchase_price-通过id查询", notes = "app_scene_cost_purchase_price-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostPurchasePrice appSceneCostPurchasePrice = appSceneCostPurchasePriceService.getById(id); + if (appSceneCostPurchasePrice == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostPurchasePrice); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostPurchasePrice + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchasePrice appSceneCostPurchasePrice) { + return super.exportXls(request, appSceneCostPurchasePrice, AppSceneCostPurchasePrice.class, "app_scene_cost_purchase_price"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostPurchasePrice.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java new file mode 100644 index 0000000..0676b9d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java @@ -0,0 +1,157 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_standard_version + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Api(tags = "cost-标准成本-版本号") +@RestController +@RequestMapping("//costStandardVersion") +public class AppSceneCostStandardVersionController extends JeecgController { + @Autowired + private IAppSceneCostStandardVersionService appSceneCostStandardVersionService; + + /** + * 分页列表查询 + * + * @param appSceneCostStandardVersion + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询") + @ApiOperation(value = "app_scene_cost_standard_version-分页列表查询", notes = "app_scene_cost_standard_version-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostStandardVersion appSceneCostStandardVersion, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardVersion, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostStandardVersionService.page(page, queryWrapper); + return Result.OK(pageList); + } + +// /** +// * 添加 +// * +// * @param appSceneCostStandardVersion +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_version-添加") +// @ApiOperation(value = "app_scene_cost_standard_version-添加", notes = "app_scene_cost_standard_version-添加") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) { +// appSceneCostStandardVersionService.save(appSceneCostStandardVersion); +// return Result.OK("添加成功!"); +// } +// +// /** +// * 编辑 +// * +// * @param appSceneCostStandardVersion +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_version-编辑") +// @ApiOperation(value = "app_scene_cost_standard_version-编辑", notes = "app_scene_cost_standard_version-编辑") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:edit") +// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) +// public Result edit(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) { +// appSceneCostStandardVersionService.updateById(appSceneCostStandardVersion); +// return Result.OK("编辑成功!"); +// } +// +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_version-通过id删除") +// @ApiOperation(value = "app_scene_cost_standard_version-通过id删除", notes = "app_scene_cost_standard_version-通过id删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:delete") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name = "id", required = true) String id) { +// appSceneCostStandardVersionService.removeById(id); +// return Result.OK("删除成功!"); +// } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_standard_version-批量删除") +// @ApiOperation(value = "app_scene_cost_standard_version-批量删除", notes = "app_scene_cost_standard_version-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostStandardVersionService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } +// +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "app_scene_cost_standard_version-通过id查询") +// @ApiOperation(value = "app_scene_cost_standard_version-通过id查询", notes = "app_scene_cost_standard_version-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name = "id", required = true) String id) { +// AppSceneCostStandardVersion appSceneCostStandardVersion = appSceneCostStandardVersionService.getById(id); +// if (appSceneCostStandardVersion == null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(appSceneCostStandardVersion); +// } +// +// /** +// * 导出excel +// * +// * @param request +// * @param appSceneCostStandardVersion +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostStandardVersion appSceneCostStandardVersion) { +// return super.exportXls(request, appSceneCostStandardVersion, AppSceneCostStandardVersion.class, "app_scene_cost_standard_version"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppSceneCostStandardVersion.class); +// } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java deleted file mode 100644 index 00ec80c..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; -import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialBomService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - *

- * 物料bom 前端控制器 - *

- * - * @author - * @since 2024-06-21 - */ -@RequestMapping("//cost-material-bom") -@Api(tags="cost-标准成本-bom信息") -@RestController -public class CostMaterialBomController { - @Autowired - CostMaterialBomService costMaterialBomService; - /** - * 分页列表查询 - * - * @param costMaterialBom - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询") - @ApiOperation(value="物料bom分页列表查询", notes="物料bom分页列表查询") - @GetMapping(value = "/pageList") - public Result> queryPageList(CostMaterialBom costMaterialBom, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costMaterialBom, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = costMaterialBomService.page(page, queryWrapper); - return Result.OK(pageList); - } - /** - * 列表查询 - * - * @return - */ - @ApiOperation(value="物料bom列表查询", notes="物料bom列表查询") - @GetMapping(value = "/list") - public Result< List> queryList(@RequestParam(name = "materialNumber",required = false) String materialNumber) { - List list = costMaterialBomService.queryListResult(materialNumber); - return Result.OK(list); - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialProcessHoursController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialProcessHoursController.java deleted file mode 100644 index bf5d55c..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialProcessHoursController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 物料工时工序表 前端控制器 - *

- * - * @author - * @since 2024-06-19 - */ -@RestController -@RequestMapping("/cost-material-process-hours") -public class CostMaterialProcessHoursController { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java deleted file mode 100644 index b2e432c..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostPartMissingInfo; -import com.zzsmart.qomo.kn.cost.manage.service.ICostPartMissingInfoService; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: 标准成本-部件缺失信息 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -@Api(tags="cost-标准成本-部件缺失信息") -@RestController -@RequestMapping("//costPartMissingInfo") -@Slf4j -public class CostPartMissingInfoController extends JeecgController { - @Autowired - private ICostPartMissingInfoService costPartMissingInfoService; - - /** - * 分页列表查询 - * - * @param costPartMissingInfo - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "app_scene_cost_part_missing_info-分页列表查询") - @ApiOperation(value="app_scene_cost_part_missing_info-分页列表查询", notes="app_scene_cost_part_missing_info-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(CostPartMissingInfo costPartMissingInfo, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costPartMissingInfo, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = costPartMissingInfoService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param costPartMissingInfo - * @return - */ - @AutoLog(value = "app_scene_cost_part_missing_info-添加") - @ApiOperation(value="app_scene_cost_part_missing_info-添加", notes="app_scene_cost_part_missing_info-添加") -// @RequiresPermissions(":app_scene_cost_part_missing_info:add") - @PostMapping(value = "/add") - public Result add(@RequestBody CostPartMissingInfo costPartMissingInfo) { - costPartMissingInfoService.save(costPartMissingInfo); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param costPartMissingInfo - * @return - */ - @AutoLog(value = "app_scene_cost_part_missing_info-编辑") - @ApiOperation(value="app_scene_cost_part_missing_info-编辑", notes="app_scene_cost_part_missing_info-编辑") -// @RequiresPermissions(":app_scene_cost_part_missing_info:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody CostPartMissingInfo costPartMissingInfo) { - costPartMissingInfoService.updateById(costPartMissingInfo); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "app_scene_cost_part_missing_info-通过id删除") - @ApiOperation(value="app_scene_cost_part_missing_info-通过id删除", notes="app_scene_cost_part_missing_info-通过id删除") -// @RequiresPermissions(":app_scene_cost_part_missing_info:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - costPartMissingInfoService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "app_scene_cost_part_missing_info-批量删除") - @ApiOperation(value="app_scene_cost_part_missing_info-批量删除", notes="app_scene_cost_part_missing_info-批量删除") -// @RequiresPermissions(":app_scene_cost_part_missing_info:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.costPartMissingInfoService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "app_scene_cost_part_missing_info-通过id查询") - @ApiOperation(value="app_scene_cost_part_missing_info-通过id查询", notes="app_scene_cost_part_missing_info-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - CostPartMissingInfo costPartMissingInfo = costPartMissingInfoService.getById(id); - if(costPartMissingInfo==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(costPartMissingInfo); - } - - /** - * 导出excel - * - * @param request - * @param costPartMissingInfo - */ -// @RequiresPermissions(":app_scene_cost_part_missing_info:exportXls") - @RequestMapping(value = "/exportXls",method = RequestMethod.GET) - public ModelAndView exportXls(HttpServletRequest request, CostPartMissingInfo costPartMissingInfo) { - return super.exportXls(request, costPartMissingInfo, CostPartMissingInfo.class, "app_scene_cost_part_missing_info"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ -// @RequiresPermissions(":app_scene_cost_part_missing_info:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, CostPartMissingInfo.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPurchasePriceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPurchasePriceController.java deleted file mode 100644 index 7f0e7df..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPurchasePriceController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 物料采购单价 前端控制器 - *

- * - * @author - * @since 2024-06-19 - */ -@RestController -@RequestMapping("/cost-purchase-price") -public class CostPurchasePriceController { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java deleted file mode 100644 index 29537bc..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.Arrays; -import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; -import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; - -/** - * @Description: 标准成本-版本号 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -@Api(tags="cost-标准成本-版本号") -@RestController -@RequestMapping("//costStandardVersion") -@Slf4j -public class CostStandardVersionController extends JeecgController { - @Autowired - private ICostStandardVersionService costStandardVersionService; - - /** - * 分页列表查询 - * - * @param costStandardVersion - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询") - @ApiOperation(value="app_scene_cost_standard_version-分页列表查询", notes="app_scene_cost_standard_version-分页列表查询") - @GetMapping(value = "/pageList") - public Result> queryPageList(CostStandardVersion costStandardVersion, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costStandardVersion, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = costStandardVersionService.page(page, queryWrapper); - return Result.OK(pageList); - } - /** - * 列表查询 - * - * @return - */ - @ApiOperation(value="版本号列表查询", notes="版本号列表查询") - @GetMapping(value = "/list") - public Result< List> queryList(@RequestParam(name = "versionNumber",required = false) String versionNumber) { - List list = costStandardVersionService.queryListResult(versionNumber); - return Result.OK(list); - } - /** - * 添加 - * - * @param costStandardVersion - * @return - */ - @AutoLog(value = "app_scene_cost_standard_version-添加") - @ApiOperation(value="app_scene_cost_standard_version-添加", notes="app_scene_cost_standard_version-添加") -// @RequiresPermissions(":app_scene_cost_standard_version:add") - @PostMapping(value = "/add") - public Result add(@RequestBody CostStandardVersion costStandardVersion) { - boolean save = costStandardVersionService.save(costStandardVersion); - if(save){ - return Result.OK("添加成功!"); - }else { - return Result.OK("添加失败!"); - } - } - - /** - * 编辑 - * - * @param costStandardVersion - * @return - */ - @AutoLog(value = "app_scene_cost_standard_version-编辑") - @ApiOperation(value="app_scene_cost_standard_version-编辑", notes="app_scene_cost_standard_version-编辑") -// @RequiresPermissions(":app_scene_cost_standard_version:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody CostStandardVersion costStandardVersion) { - costStandardVersionService.updateById(costStandardVersion); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "app_scene_cost_standard_version-通过id删除") - @ApiOperation(value="app_scene_cost_standard_version-通过id删除", notes="app_scene_cost_standard_version-通过id删除") -// @RequiresPermissions(":app_scene_cost_standard_version:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - costStandardVersionService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "app_scene_cost_standard_version-批量删除") - @ApiOperation(value="app_scene_cost_standard_version-批量删除", notes="app_scene_cost_standard_version-批量删除") -// @RequiresPermissions(":app_scene_cost_standard_version:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.costStandardVersionService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "app_scene_cost_standard_version-通过id查询") - @ApiOperation(value="app_scene_cost_standard_version-通过id查询", notes="app_scene_cost_standard_version-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - CostStandardVersion costStandardVersion = costStandardVersionService.getById(id); - if(costStandardVersion==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(costStandardVersion); - } - - /** - * 导出excel - * - * @param request - * @param costStandardVersion - */ -// @RequiresPermissions(":app_scene_cost_standard_version:exportXls") - @RequestMapping(value = "/exportXls", method = RequestMethod.GET) - public ModelAndView exportXls(HttpServletRequest request, CostStandardVersion costStandardVersion) { - return super.exportXls(request, costStandardVersion, CostStandardVersion.class, "app_scene_cost_standard_version"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ -// @RequiresPermissions(":app_scene_cost_standard_version:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return this.costStandardVersionService.importExcel(request, response, CostStandardVersion.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java deleted file mode 100644 index bc449eb..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.HourRate; -import com.zzsmart.qomo.kn.cost.manage.service.IHourRateService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.system.query.QueryGenerator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; - - /** - * @Description: hour_rate - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -@Api(tags="cost-小时费率") -@RestController -@RequestMapping("//hourRate") -@Slf4j -public class HourRateController extends JeecgController { - @Autowired - private IHourRateService hourRateService; - - /** - * 分页列表查询 - * - * @param hourRate - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "hour_rate-分页列表查询") - @ApiOperation(value="hour_rate-分页列表查询", notes="hour_rate-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(HourRate hourRate, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(hourRate, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = hourRateService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param hourRate - * @return - */ - @AutoLog(value = "hour_rate-添加") - @ApiOperation(value="hour_rate-添加", notes="hour_rate-添加") -// @RequiresPermissions(":hour_rate:add") - @PostMapping(value = "/add") - public Result add(@RequestBody HourRate hourRate) { - hourRateService.save(hourRate); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param hourRate - * @return - */ - @AutoLog(value = "hour_rate-编辑") - @ApiOperation(value="hour_rate-编辑", notes="hour_rate-编辑") -// @RequiresPermissions(":hour_rate:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody HourRate hourRate) { - hourRateService.updateById(hourRate); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "hour_rate-通过id删除") - @ApiOperation(value="hour_rate-通过id删除", notes="hour_rate-通过id删除") -// @RequiresPermissions(":hour_rate:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - hourRateService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "hour_rate-批量删除") - @ApiOperation(value="hour_rate-批量删除", notes="hour_rate-批量删除") -// @RequiresPermissions(":hour_rate:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.hourRateService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "hour_rate-通过id查询") - @ApiOperation(value="hour_rate-通过id查询", notes="hour_rate-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - HourRate hourRate = hourRateService.getById(id); - if(hourRate==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(hourRate); - } - - /** - * 导出excel - * - * @param request - * @param hourRate - */ - @RequiresPermissions(":hour_rate:exportXls") - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, HourRate hourRate) { - return super.exportXls(request, hourRate, HourRate.class, "hour_rate"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - @RequiresPermissions(":hour_rate:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, HourRate.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostHourRate.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostHourRate.java new file mode 100644 index 0000000..dc640a7 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostHourRate.java @@ -0,0 +1,127 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description: app_scene_cost_hour_rate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_hour_rate") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_hour_rate对象", description = "app_scene_cost_hour_rate") +public class AppSceneCostHourRate implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 年度 + */ + @Excel(name = "年度", width = 15) + @ApiModelProperty(value = "年度") + private String year; + /** + * 成本中心代码 + */ + @Excel(name = "成本中心代码", width = 15) + @ApiModelProperty(value = "成本中心代码") + private String costCenterCode; + /** + * 工厂代码 + */ + @Excel(name = "工厂代码", width = 15) + @ApiModelProperty(value = "工厂代码") + private String factory; + /** + * 人工小时费率 + */ + @Excel(name = "人工小时费率", width = 15) + @ApiModelProperty(value = "人工小时费率") + private BigDecimal laborHourRate; + /** + * 设备小时费率 + */ + @Excel(name = "设备小时费率", width = 15) + @ApiModelProperty(value = "设备小时费率") + private BigDecimal equipHourRate; + /** + * 燃动小时费率 + */ + @Excel(name = "燃动小时费率", width = 15) + @ApiModelProperty(value = "燃动小时费率") + private BigDecimal fuelHourRate; + /** + * 辅料小时费率 + */ + @Excel(name = "辅料小时费率", width = 15) + @ApiModelProperty(value = "辅料小时费率") + private BigDecimal auxiliaryHourRate; + /** + * 其他小时费率 + */ + @Excel(name = "其他小时费率", width = 15) + @ApiModelProperty(value = "其他小时费率") + private BigDecimal otherHourRate; + /** + * 生效日期 + */ + @Excel(name = "生效日期", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "生效日期") + private Date effectiveDate; + /** + * 失效日期 + */ + @Excel(name = "失效日期", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "失效日期") + private Date expirationDate; + /** + * 维护人员 + */ + @Excel(name = "维护人员", width = 15) + @ApiModelProperty(value = "维护人员") + private String guardian; + /** + * 维护时间 + */ + @Excel(name = "维护时间", width = 15) + @ApiModelProperty(value = "维护时间") + private String maintenanceTime; + /** + * 预留字段1 + */ + @Excel(name = "预留字段1", width = 15) + @ApiModelProperty(value = "预留字段1") + private String reserve1; + /** + * 预留字段2 + */ + @Excel(name = "预留字段2", width = 15) + @ApiModelProperty(value = "预留字段2") + private BigDecimal reserve2; + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java new file mode 100644 index 0000000..15c9849 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java @@ -0,0 +1,261 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description: app_scene_cost_material_bom + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_material_bom") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_material_bom对象", description = "app_scene_cost_material_bom") +public class AppSceneCostMaterialBom implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private String id; + /** + * 物料编码 + */ + @Excel(name = "物料编码", width = 15) + @ApiModelProperty(value = "物料编码") + private String materialCode; + /** + * 物料名称 + */ + @Excel(name = "物料名称", width = 15) + @ApiModelProperty(value = "物料名称") + private String materialName; + /** + * 父级物料编码 + */ + @Excel(name = "父级物料编码", width = 15) + @ApiModelProperty(value = "父级物料编码") + private String parentMaterialCode; + /** + * 级别 + */ + @Excel(name = "级别", width = 15) + @ApiModelProperty(value = "级别") + private String level; + /** + * 排序 + */ + @Excel(name = "排序", width = 15) + @ApiModelProperty(value = "排序") + private Integer sort; + /** + * 计量单位 + */ + @Excel(name = "计量单位", width = 15) + @ApiModelProperty(value = "计量单位") + private String unit; + /** + * 数量 + */ + @Excel(name = "数量", width = 15) + @ApiModelProperty(value = "数量") + private Integer number; + /** + * 人工工时(分钟) + */ + @Excel(name = "人工工时(分钟)", width = 15) + @ApiModelProperty(value = "人工工时(分钟)") + private BigDecimal laborHours; + /** + * 设备工时 + */ + @Excel(name = "设备工时", width = 15) + @ApiModelProperty(value = "设备工时") + private BigDecimal deviceHours; + /** + * 借用物料编码 + */ + @Excel(name = "借用物料编码", width = 15) + @ApiModelProperty(value = "借用物料编码") + private String borrowMaterialCode; + /** + * 参考物料编码 + */ + @Excel(name = "参考物料编码", width = 15) + @ApiModelProperty(value = "参考物料编码") + private String referMaterialCode; + /** + * 采购类型 + */ + @Excel(name = "采购类型", width = 15) + @ApiModelProperty(value = "采购类型") + private String purchaseType; + /** + * 特殊采购类型 + */ + @Excel(name = "特殊采购类型", width = 15) + @ApiModelProperty(value = "特殊采购类型") + private String specialPurchaseType; + /** + * 说明 + */ + @Excel(name = "说明", width = 15) + @ApiModelProperty(value = "说明") + private String explanation; + /** + * 单位数量 + */ + @Excel(name = "单位数量", width = 15) + @ApiModelProperty(value = "单位数量") + private BigDecimal quantity; + /** + * 重量(g) + */ + @Excel(name = "重量(g)", width = 15) + @ApiModelProperty(value = "重量(g)") + private String weight; + /** + * 材料/牌号 + */ + @Excel(name = "材料/牌号", width = 15) + @ApiModelProperty(value = "材料/牌号") + private String materialAndBrand; + /** + * 表面处理,材料 + */ + @Excel(name = "表面处理,材料", width = 15) + @ApiModelProperty(value = "表面处理,材料") + private String surfaceMaterial; + /** + * 厚度(mm) + */ + @Excel(name = "厚度(mm)", width = 15) + @ApiModelProperty(value = "厚度(mm)") + private String surfaceThickness; + /** + * 表面积(mm²) + */ + @Excel(name = "表面积(mm²)", width = 15) + @ApiModelProperty(value = "表面积(mm²)") + private String surfaceArea; + /** + * 长(mm) + */ + @Excel(name = "长(mm)", width = 15) + @ApiModelProperty(value = "长(mm)") + private String length; + /** + * 宽(mm) + */ + @Excel(name = "宽(mm)", width = 15) + @ApiModelProperty(value = "宽(mm)") + private String width; + /** + * 高(mm) + */ + @Excel(name = "高(mm)", width = 15) + @ApiModelProperty(value = "高(mm)") + private String height; + /** + * 图示/图档/文档 文件ID + */ + @Excel(name = "图示/图档/文档 文件ID", width = 15) + @ApiModelProperty(value = "图示/图档/文档 文件ID") + private Integer figureFileId; + /** + * 是否新摸具(0否 1是) + */ + @Excel(name = "是否新摸具(0否 1是)", width = 15) + @ApiModelProperty(value = "是否新摸具(0否 1是)") + private Integer newTooling; + /** + * 成型方式(枚举) + */ + @Excel(name = "成型方式(枚举)", width = 15) + @ApiModelProperty(value = "成型方式(枚举)") + private String shapingMethod; + /** + * 作业内容 + */ + @Excel(name = "作业内容", width = 15) + @ApiModelProperty(value = "作业内容") + private String workContent; + /** + * 加工地点 + */ + @Excel(name = "加工地点", width = 15) + @ApiModelProperty(value = "加工地点") + private String processLocation; + /** + * 成本中心 + */ + @Excel(name = "成本中心", width = 15) + @ApiModelProperty(value = "成本中心") + private String costCenter; + /** + * 单价(未税) + */ + @Excel(name = "单价(未税)", width = 15) + @ApiModelProperty(value = "单价(未税)") + private BigDecimal unitPrice; + /** + * 总价(未税) + */ + @Excel(name = "总价(未税)", width = 15) + @ApiModelProperty(value = "总价(未税)") + private BigDecimal totalPrice; + /** + * 摸具费(未税) + */ + @Excel(name = "摸具费(未税)", width = 15) + @ApiModelProperty(value = "摸具费(未税)") + private BigDecimal mouldPrice; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private String createBy; + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + /** + * 修改人 + */ + @ApiModelProperty(value = "修改人") + private String updateBy; + /** + * 修改时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "修改时间") + private Date updateTime; + /** + * 备注(特殊技术信息) + */ + @Excel(name = "备注(特殊技术信息)", width = 15) + @ApiModelProperty(value = "备注(特殊技术信息)") + private String remark; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialProcessHours.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialProcessHours.java similarity index 51% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialProcessHours.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialProcessHours.java index f2bfabd..0c20406 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialProcessHours.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialProcessHours.java @@ -1,174 +1,129 @@ package com.zzsmart.qomo.kn.cost.manage.entity; import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; -import java.time.LocalDateTime; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.Accessors; +import java.util.Date; /** - *

- * 物料工时工序表 - *

- * - * @author - * @since 2024-06-19 + * @Description: app_scene_cost_material_process_hours + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 */ -@Getter -@Setter -@Accessors(chain = true) +@Data @TableName("app_scene_cost_material_process_hours") -public class CostMaterialProcessHours implements Serializable { - +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_material_process_hours对象", description = "app_scene_cost_material_process_hours") +public class AppSceneCostMaterialProcessHours implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "id") - @TableId(value = "id", type = IdType.AUTO) + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") private String id; - /** * 物料编码 */ + @Excel(name = "物料编码", width = 15) @ApiModelProperty(value = "物料编码") - @TableField("material_code") private String materialCode; - /** * 物料名称 */ + @Excel(name = "物料名称", width = 15) @ApiModelProperty(value = "物料名称") - @TableField("material_name") private String materialName; - /** * 层级 */ + @Excel(name = "层级", width = 15) @ApiModelProperty(value = "层级") - @TableField("level") private String level; - /** * 数量 */ + @Excel(name = "数量", width = 15) @ApiModelProperty(value = "数量") - @TableField("quantity") private BigDecimal quantity; - /** * 采购类型 */ + @Excel(name = "采购类型", width = 15) @ApiModelProperty(value = "采购类型") - @TableField("purchase_type") private String purchaseType; - /** * 工序 */ + @Excel(name = "工序", width = 15) @ApiModelProperty(value = "工序") - @TableField("work_process") private String workProcess; - /** * 描述 */ + @Excel(name = "描述", width = 15) @ApiModelProperty(value = "描述") - @TableField("described") private String described; - /** * 人工工时 */ + @Excel(name = "人工工时", width = 15) @ApiModelProperty(value = "人工工时") - @TableField("labor_hours") private BigDecimal laborHours; - /** * 设备工时 */ + @Excel(name = "设备工时", width = 15) @ApiModelProperty(value = "设备工时") - @TableField("device_hours") private BigDecimal deviceHours; - /** * 工作中心 */ + @Excel(name = "工作中心", width = 15) @ApiModelProperty(value = "工作中心") - @TableField("work_center") private String workCenter; - /** * 创建人 */ - @TableField("create_by") + @ApiModelProperty(value = "创建人") private String createBy; - /** * 创建时间 */ - @TableField("create_time") - private LocalDateTime createTime; - + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; /** * 修改人 */ - @TableField("update_by") + @ApiModelProperty(value = "修改人") private String updateBy; - /** * 修改时间 */ - @TableField("update_time") - private LocalDateTime updateTime; - + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "修改时间") + private Date updateTime; /** * 备注 */ + @Excel(name = "备注", width = 15) @ApiModelProperty(value = "备注") - @TableField("remark") private String remark; - - - public static final String ID = "id"; - - public static final String MATERIAL_CODE = "material_code"; - - public static final String MATERIAL_NAME = "material_name"; - - public static final String LEVEL = "level"; - - public static final String QUANTITY = "quantity"; - - public static final String PURCHASE_TYPE = "purchase_type"; - - public static final String WORK_PROCESS = "work_process"; - - public static final String DESCRIBED = "described"; - - public static final String LABOR_HOURS = "labor_hours"; - - public static final String DEVICE_HOURS = "device_hours"; - - public static final String WORK_CENTER = "work_center"; - - public static final String CREATE_BY = "create_by"; - - public static final String CREATE_TIME = "create_time"; - - public static final String UPDATE_BY = "update_by"; - - public static final String UPDATE_TIME = "update_time"; - - public static final String REMARK = "remark"; - } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPartMissingInfo.java similarity index 55% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPartMissingInfo.java index a167b45..02cb927 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPartMissingInfo.java @@ -1,28 +1,22 @@ package com.zzsmart.qomo.kn.cost.manage.entity; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableLogic; -import lombok.Builder; -import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; + +import java.io.Serializable; /** - * @Description: 标准成本-部件缺失信息 - * @Author: wangqiong - * @Date: 2024-06-13 + * @Description: app_scene_cost_part_missing_info + * @Author: jeecg-boot + * @Date: 2024-08-02 * @Version: V1.0 */ @Data @@ -30,28 +24,38 @@ import lombok.experimental.Accessors; @TableName("app_scene_cost_part_missing_info") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="app_scene_cost_part_missing_info对象", description="app_scene_cost_part_missing_info") -public class CostPartMissingInfo implements Serializable { +@ApiModel(value = "app_scene_cost_part_missing_info对象", description = "app_scene_cost_part_missing_info") +public class AppSceneCostPartMissingInfo implements Serializable { private static final long serialVersionUID = 1L; - /**id*/ - @TableId(type = IdType.ASSIGN_ID) + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "id") private String id; - /**标准成本表主键id*/ - @Excel(name = "标准成本表主键id", width = 15) - @ApiModelProperty(value = "标准成本表主键id") - private String costStandardId; - /**物料号*/ - @Excel(name = "物料号", width = 15) + /** + * 物料号 + */ + @Excel(name = "物料号", width = 15) @ApiModelProperty(value = "物料号") private String materialNumber; - /**版本号*/ - @Excel(name = "版本号", width = 15) + /** + * 版本号 + */ + @Excel(name = "版本号", width = 15) @ApiModelProperty(value = "版本号") private String versionNumber; - /**缺失信息*/ - @Excel(name = "缺失信息", width = 15) + /** + * 缺失信息 + */ + @Excel(name = "缺失信息", width = 15) @ApiModelProperty(value = "缺失信息") private String missingInfo; + /** + * 标准成本表主键id + */ + @Excel(name = "标准成本表主键id", width = 15) + @ApiModelProperty(value = "标准成本表主键id") + private String costStandardId; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java new file mode 100644 index 0000000..5ff64c5 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java @@ -0,0 +1,173 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description: app_scene_cost_purchase_price + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_purchase_price") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_purchase_price对象", description = "app_scene_cost_purchase_price") +public class AppSceneCostPurchasePrice implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + /** + * 物料编码 + */ + @Excel(name = "物料编码", width = 15) + @ApiModelProperty(value = "物料编码") + private String materialCode; + /** + * 物料名称 + */ + @Excel(name = "物料名称", width = 15) + @ApiModelProperty(value = "物料名称") + private String materialName; + /** + * 规格型号 + */ + @Excel(name = "规格型号", width = 15) + @ApiModelProperty(value = "规格型号") + private String specification; + /** + * 采购类型 + */ + @Excel(name = "采购类型", width = 15) + @ApiModelProperty(value = "采购类型") + private String purchaseType; + /** + * 供应商代码 + */ + @Excel(name = "供应商代码", width = 15) + @ApiModelProperty(value = "供应商代码") + private String supplierCode; + /** + * 供应商名称 + */ + @Excel(name = "供应商名称", width = 15) + @ApiModelProperty(value = "供应商名称") + private String supplierName; + /** + * 采购价时间 + */ + @Excel(name = "采购价时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "采购价时间") + private Date purchasePriceTime; + /** + * 采购价合计 + */ + @Excel(name = "采购价合计", width = 15) + @ApiModelProperty(value = "采购价合计") + private BigDecimal purchasePriceSum; + /** + * 最低采购单价 + */ + @Excel(name = "最低采购单价", width = 15) + @ApiModelProperty(value = "最低采购单价") + private BigDecimal minPurchasePrice; + /** + * 最新采购单价 + */ + @Excel(name = "最新采购单价", width = 15) + @ApiModelProperty(value = "最新采购单价") + private BigDecimal lastPurchasePrice; + /** + * 平均采购价 + */ + @Excel(name = "平均采购价", width = 15) + @ApiModelProperty(value = "平均采购价") + private BigDecimal purchasePriceAvg; + /** + * 直接材料费 + */ + @Excel(name = "直接材料费", width = 15) + @ApiModelProperty(value = "直接材料费") + private BigDecimal directMaterialCost; + /** + * 工艺加工费用 + */ + @Excel(name = "工艺加工费用", width = 15) + @ApiModelProperty(value = "工艺加工费用") + private BigDecimal processCost; + /** + * 运输费用 + */ + @Excel(name = "运输费用", width = 15) + @ApiModelProperty(value = "运输费用") + private BigDecimal transportCost; + /** + * 模具费用 + */ + @Excel(name = "模具费用", width = 15) + @ApiModelProperty(value = "模具费用") + private BigDecimal mouldCost; + /** + * 其他费用 + */ + @Excel(name = "其他费用", width = 15) + @ApiModelProperty(value = "其他费用") + private BigDecimal ortherCost; + /** + * 税率 + */ + @Excel(name = "税率", width = 15) + @ApiModelProperty(value = "税率") + private BigDecimal taxTate; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private String createBy; + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + /** + * 修改人 + */ + @ApiModelProperty(value = "修改人") + private String updateBy; + /** + * 修改时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "修改时间") + private Date updateTime; + /** + * 备注 + */ + @Excel(name = "备注", width = 15) + @ApiModelProperty(value = "备注") + private String remark; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java similarity index 78% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java index e65e5ef..62692e6 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java @@ -17,18 +17,18 @@ import java.io.Serializable; import java.util.Date; /** - * @Description: 标准成本-版本号 - * @Author: wangqiong - * @Date: 2024-06-13 + * @Description: app_scene_cost_standard_version + * @Author: jeecg-boot + * @Date: 2024-08-02 * @Version: V1.0 */ @Data -@TableName("app_scene_cost_standard_version") @Builder +@TableName("app_scene_cost_standard_version") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) @ApiModel(value = "app_scene_cost_standard_version对象", description = "app_scene_cost_standard_version") -public class CostStandardVersion implements Serializable { +public class AppSceneCostStandardVersion implements Serializable { private static final long serialVersionUID = 1L; /** @@ -37,7 +37,6 @@ public class CostStandardVersion implements Serializable { @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "id") private String id; - /** * 图号 */ @@ -47,23 +46,25 @@ public class CostStandardVersion implements Serializable { /** * 阶段,A-初始,B-首批,C-量产 */ - @Excel(name = "阶段", width = 15) - @ApiModelProperty(value = "阶段") + @Excel(name = "阶段,A-初始,B-首批,C-量产", width = 15) + @ApiModelProperty(value = "阶段,A-初始,B-首批,C-量产") private String stage; /** - * 物料号 + * 物料号,关联kn_new_sap_mara表matnr字段 */ - @Excel(name = "物料号", width = 15) - @ApiModelProperty(value = "物料号") + @Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15) + @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段") private String materialNumber; /** * 版本号 */ + @Excel(name = "版本号", width = 15) @ApiModelProperty(value = "版本号") private String versionNumber; /** * 版本状态 */ + @Excel(name = "版本状态", width = 15) @ApiModelProperty(value = "版本状态") private String versionStatus; /** @@ -93,11 +94,13 @@ public class CostStandardVersion implements Serializable { /** * 备注 */ + @Excel(name = "备注", width = 15) @ApiModelProperty(value = "备注") private String remark; /** * 年份 */ + @Excel(name = "年份", width = 15) @ApiModelProperty(value = "年份") private String versionYear; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java deleted file mode 100644 index 4f0ef69..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java +++ /dev/null @@ -1,335 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.Accessors; - -/** - *

- * 物料bom - *

- * - * @author - * @since 2024-06-21 - */ -@Getter -@Setter -@Accessors(chain = true) -@TableName("app_scene_cost_material_bom") -public class CostMaterialBom implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * id - */ - @TableId(value = "id", type = IdType.AUTO) - private String id; - - /** - * 物料编码 - */ - @TableField("material_code") - private String materialCode; - - /** - * 物料名称 - */ - @TableField("material_name") - private String materialName; - - /** - * 父级物料编码 - */ - @TableField("parent_material_code") - private String parentMaterialCode; - - /** - * 级别 - */ - @TableField("level") - private String level; - - /** - * 排序 - */ - @TableField("sort") - private Integer sort; - - /** - * 计量单位 - */ - @TableField("unit") - private String unit; - - /** - * 数量 - */ - @TableField("number") - private Integer number; - - /** - * 人工工时(分钟) - */ - @TableField("labor_hours") - private BigDecimal laborHours; - - /** - * 设备工时 - */ - @TableField("device_hours") - private BigDecimal deviceHours; - - /** - * 借用物料编码 - */ - @TableField("borrow_material_code") - private String borrowMaterialCode; - - /** - * 参考物料编码 - */ - @TableField("refer_material_code") - private String referMaterialCode; - - /** - * 采购类型 - */ - @TableField("purchase_type") - private String purchaseType; - - /** - * 特殊采购类型 - */ - @TableField("special_purchase_type") - private String specialPurchaseType; - - /** - * 说明 - */ - @TableField("explanation") - private String explanation; - - /** - * 单位数量 - */ - @TableField("quantity") - private BigDecimal quantity; - - /** - * 重量(g) - */ - @TableField("weight") - private String weight; - - /** - * 材料/牌号 - */ - @TableField("material_and_brand") - private String materialAndBrand; - - /** - * 表面处理,材料 - */ - @TableField("surface_material") - private String surfaceMaterial; - - /** - * 厚度(mm) - */ - @TableField("surface_thickness") - private String surfaceThickness; - - /** - * 表面积(mm²) - */ - @TableField("surface_area") - private String surfaceArea; - - /** - * 长(mm) - */ - @TableField("length") - private String length; - - /** - * 宽(mm) - */ - @TableField("width") - private String width; - - /** - * 高(mm) - */ - @TableField("height") - private String height; - - /** - * 图示/图档/文档 文件ID - */ - @TableField("figure_file_id") - private Long figureFileId; - - /** - * 是否新摸具(0否 1是) - */ - @TableField("new_tooling") - private Boolean newTooling; - - /** - * 成型方式(枚举) - */ - @TableField("shaping_method") - private String shapingMethod; - - /** - * 作业内容 - */ - @TableField("work_content") - private String workContent; - - /** - * 加工地点 - */ - @TableField("process_location") - private String processLocation; - - /** - * 成本中心 - */ - @TableField("cost_center") - private String costCenter; - - /** - * 单价(未税) - */ - @TableField("unit_price") - private BigDecimal unitPrice; - - /** - * 总价(未税) - */ - @TableField("total_price") - private BigDecimal totalPrice; - - /** - * 摸具费(未税) - */ - @TableField("mould_price") - private BigDecimal mouldPrice; - - /** - * 创建人 - */ - @TableField("create_by") - private String createBy; - - /** - * 创建时间 - */ - @TableField("create_time") - private LocalDateTime createTime; - - /** - * 修改人 - */ - @TableField("update_by") - private String updateBy; - - /** - * 修改时间 - */ - @TableField("update_time") - private LocalDateTime updateTime; - - /** - * 备注(特殊技术信息) - */ - @TableField("remark") - private String remark; - - - public static final String ID = "id"; - - public static final String MATERIAL_CODE = "material_code"; - - public static final String MATERIAL_NAME = "material_name"; - - public static final String PARENT_MATERIAL_CODE = "parent_material_code"; - - public static final String LEVEL = "level"; - - public static final String SORT = "sort"; - - public static final String UNIT = "unit"; - - public static final String NUMBER = "number"; - - public static final String LABOR_HOURS = "labor_hours"; - - public static final String DEVICE_HOURS = "device_hours"; - - public static final String BORROW_MATERIAL_CODE = "borrow_material_code"; - - public static final String REFER_MATERIAL_CODE = "refer_material_code"; - - public static final String PURCHASE_TYPE = "purchase_type"; - - public static final String SPECIAL_PURCHASE_TYPE = "special_purchase_type"; - - public static final String EXPLANATION = "explanation"; - - public static final String QUANTITY = "quantity"; - - public static final String WEIGHT = "weight"; - - public static final String MATERIAL_AND_BRAND = "material_and_brand"; - - public static final String SURFACE_MATERIAL = "surface_material"; - - public static final String SURFACE_THICKNESS = "surface_thickness"; - - public static final String SURFACE_AREA = "surface_area"; - - public static final String LENGTH = "length"; - - public static final String WIDTH = "width"; - - public static final String HEIGHT = "height"; - - public static final String FIGURE_FILE_ID = "figure_file_id"; - - public static final String NEW_TOOLING = "new_tooling"; - - public static final String SHAPING_METHOD = "shaping_method"; - - public static final String WORK_CONTENT = "work_content"; - - public static final String PROCESS_LOCATION = "process_location"; - - public static final String COST_CENTER = "cost_center"; - - public static final String UNIT_PRICE = "unit_price"; - - public static final String TOTAL_PRICE = "total_price"; - - public static final String MOULD_PRICE = "mould_price"; - - public static final String CREATE_BY = "create_by"; - - public static final String CREATE_TIME = "create_time"; - - public static final String UPDATE_BY = "update_by"; - - public static final String UPDATE_TIME = "update_time"; - - public static final String REMARK = "remark"; - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostModel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostModel.java deleted file mode 100644 index 51b57d9..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostModel.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.time.LocalDateTime; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.Accessors; - -/** - *

- * - *

- * - * @author - * @since 2024-07-11 - */ -@Getter -@Setter -@Accessors(chain = true) -@TableName("app_scene_cost_model") -public class CostModel implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - /** - * 模型名称 - */ - @ApiModelProperty(value = "模型名称") - @TableField("model_name") - private String modelName; - - /** - * 图号 - */ - @ApiModelProperty(value = "图号") - @TableField("drawing_no") - private Integer drawingNo; - - /** - * 物料号 - */ - @ApiModelProperty(value = "物料号") - @TableField("material_no") - private Integer materialNo; - - /** - * 物料类型 - */ - @ApiModelProperty(value = "物料类型") - @TableField("material_type") - private String materialType; - - /** - * 模型版本 - */ - @ApiModelProperty(value = "模型版本") - @TableField("model_version") - private String modelVersion; - - /** - * 状态 - */ - @ApiModelProperty(value = "状态") - @TableField("status") - private String status; - - /** - * 创建时间 - */ - @ApiModelProperty(value = "创建时间") - @TableField("create_time") - private LocalDateTime createTime; - - /** - * 创建人 - */ - @TableField("create_by") - private Integer createBy; - - /** - * 更新时间 - */ - @TableField("update_time") - private LocalDateTime updateTime; - - /** - * 更新人 - */ - @TableField("update_by") - private Integer updateBy; - - /** - * 模型配置信息 - */ - @TableField("cost_model_detail") - private String costModelDetail; - - - public static final String ID = "id"; - - public static final String MODEL_NAME = "model_name"; - - public static final String DRAWING_NO = "drawing_no"; - - public static final String MATERIAL_NO = "material_no"; - - public static final String MATERIAL_TYPE = "material_type"; - - public static final String MODEL_VERSION = "model_version"; - - public static final String STATUS = "status"; - - public static final String CREATE_TIME = "create_time"; - - public static final String CREATE_BY = "create_by"; - - public static final String UPDATE_TIME = "update_time"; - - public static final String UPDATE_BY = "update_by"; - - public static final String COST_MODEL_DETAIL = "cost_model_detail"; - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java deleted file mode 100644 index 07974d5..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.Accessors; - -/** - *

- * 物料采购单价 - *

- * - * @author - * @since 2024-06-19 - */ -@Getter -@Setter -@Accessors(chain = true) -@TableName("app_scene_cost_purchase_price") -public class CostPurchasePrice implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private String id; - - /** - * 物料编码 - */ - @TableField("material_code") - private String materialCode; - - /** - * 物料名称 - */ - @TableField("material_name") - private String materialName; - - /** - * 规格型号 - */ - @TableField("specification") - private String specification; - - /** - * 采购类型 - */ - @TableField("purchase_type") - private String purchaseType; - - /** - * 供应商代码 - */ - @TableField("supplier_code") - private String supplierCode; - - /** - * 供应商名称 - */ - @TableField("supplier_name") - private String supplierName; - - /** - * 采购价时间 - */ - @TableField("purchase_price_time") - private LocalDateTime purchasePriceTime; - - /** - * 采购价合计 - */ - @TableField("purchase_price_sum") - private BigDecimal purchasePriceSum; - - /** - * 最低采购单价 - */ - @TableField("min_purchase_price") - private BigDecimal minPurchasePrice; - - /** - * 最新采购单价 - */ - @TableField("last_purchase_price") - private BigDecimal lastPurchasePrice; - - /** - * 平均采购价 - */ - @TableField("purchase_price_avg") - private BigDecimal purchasePriceAvg; - - /** - * 直接材料费 - */ - @TableField("direct_material_cost") - private BigDecimal directMaterialCost; - - /** - * 工艺加工费用 - */ - @TableField("process_cost") - private BigDecimal processCost; - - /** - * 运输费用 - */ - @TableField("transport_cost") - private BigDecimal transportCost; - - /** - * 模具费用 - */ - @TableField("mould_cost") - private BigDecimal mouldCost; - - /** - * 其他费用 - */ - @TableField("orther_cost") - private BigDecimal ortherCost; - - /** - * 税率 - */ - @TableField("tax_tate") - private BigDecimal taxTate; - - /** - * 创建人 - */ - @TableField("create_by") - private String createBy; - - /** - * 创建时间 - */ - @TableField("create_time") - private LocalDateTime createTime; - - /** - * 修改人 - */ - @TableField("update_by") - private String updateBy; - - /** - * 修改时间 - */ - @TableField("update_time") - private LocalDateTime updateTime; - - /** - * 备注 - */ - @TableField("remark") - private String remark; - - - public static final String ID = "id"; - - public static final String MATERIAL_CODE = "material_code"; - - public static final String MATERIAL_NAME = "material_name"; - - public static final String SPECIFICATION = "specification"; - - public static final String PURCHASE_TYPE = "purchase_type"; - - public static final String SUPPLIER_CODE = "supplier_code"; - - public static final String SUPPLIER_NAME = "supplier_name"; - - public static final String PURCHASE_PRICE_TIME = "purchase_price_time"; - - public static final String PURCHASE_PRICE_SUM = "purchase_price_sum"; - - public static final String MIN_PURCHASE_PRICE = "min_purchase_price"; - - public static final String LAST_PURCHASE_PRICE = "last_purchase_price"; - - public static final String PURCHASE_PRICE_AVG = "purchase_price_avg"; - - public static final String DIRECT_MATERIAL_COST = "direct_material_cost"; - - public static final String PROCESS_COST = "process_cost"; - - public static final String TRANSPORT_COST = "transport_cost"; - - public static final String MOULD_COST = "mould_cost"; - - public static final String ORTHER_COST = "orther_cost"; - - public static final String TAX_TATE = "tax_tate"; - - public static final String CREATE_BY = "create_by"; - - public static final String CREATE_TIME = "create_time"; - - public static final String UPDATE_BY = "update_by"; - - public static final String UPDATE_TIME = "update_time"; - - public static final String REMARK = "remark"; - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java deleted file mode 100644 index 3da771c..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.entity; - -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; - -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * @Description: hour_rate - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -@Data -@TableName("app_scene_cost_hour_rate") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="hour_rate对象", description="hour_rate") -public class HourRate implements Serializable { - private static final long serialVersionUID = 1L; - - /**年度*/ - @Excel(name = "年度", width = 15) - @ApiModelProperty(value = "年度") - private java.lang.String year; - /**成本中心代码*/ - @Excel(name = "成本中心代码", width = 15) - @ApiModelProperty(value = "成本中心代码") - private java.lang.String costCenterCode; - /**工厂代码*/ - @Excel(name = "工厂代码", width = 15) - @ApiModelProperty(value = "工厂代码") - private java.lang.String factory; - /**人工小时费率*/ - @Excel(name = "人工小时费率", width = 15) - @ApiModelProperty(value = "人工小时费率") - private java.math.BigDecimal laborHourRate; - /**设备小时费率*/ - @Excel(name = "设备小时费率", width = 15) - @ApiModelProperty(value = "设备小时费率") - private java.math.BigDecimal equipHourRate; - /**燃动小时费率*/ - @Excel(name = "燃动小时费率", width = 15) - @ApiModelProperty(value = "燃动小时费率") - private java.math.BigDecimal fuelHourRate; - /**辅料小时费率*/ - @Excel(name = "辅料小时费率", width = 15) - @ApiModelProperty(value = "辅料小时费率") - private java.math.BigDecimal auxiliaryHourRate; - /**其他小时费率*/ - @Excel(name = "其他小时费率", width = 15) - @ApiModelProperty(value = "其他小时费率") - private java.math.BigDecimal otherHourRate; - /**生效日期*/ - @Excel(name = "生效日期", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") - @ApiModelProperty(value = "生效日期") - private java.util.Date effectiveDate; - /**失效日期*/ - @Excel(name = "失效日期", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") - @ApiModelProperty(value = "失效日期") - private java.util.Date expirationDate; - /**维护人员*/ - @Excel(name = "维护人员", width = 15) - @ApiModelProperty(value = "维护人员") - private java.lang.String guardian; - /**维护时间*/ - @Excel(name = "维护时间", width = 15) - @ApiModelProperty(value = "维护时间") - private java.lang.String maintenanceTime; - /**预留字段1*/ - @Excel(name = "预留字段1", width = 15) - @ApiModelProperty(value = "预留字段1") - @TableField(value = "reserve_1") - private java.lang.String reserve1; - /**预留字段2*/ - @Excel(name = "预留字段2", width = 15) - @ApiModelProperty(value = "预留字段2") - @TableField(value = "reserve_2") - private java.math.BigDecimal reserve2; - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "主键") - private java.lang.String id; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java new file mode 100644 index 0000000..97b285d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate; + +/** + * @Description: app_scene_cost_hour_rate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface AppSceneCostHourRateMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java similarity index 62% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java index c5fdff5..2de786a 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java @@ -2,24 +2,19 @@ package com.zzsmart.qomo.kn.cost.manage.mapper; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; -import org.apache.ibatis.annotations.Mapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; -import java.sql.Blob; import java.util.List; /** - *

- * 物料bom Mapper 接口 - *

- * - * @author - * @since 2024-06-21 + * @Description: app_scene_cost_material_bom + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 */ -@Mapper -public interface CostMaterialBomMapper extends BaseMapper { +public interface AppSceneCostMaterialBomMapper extends BaseMapper { /** * 根据动态SQL语句查询物料BOM表 * @@ -27,11 +22,13 @@ public interface CostMaterialBomMapper extends BaseMapper { * @return */ @Select("${selectCommand}") - List customSelect(@Param("selectCommand") String selectCommand); + List customSelect(@Param("selectCommand") String selectCommand); @Select("${selectSql}") JSONObject customSelectOne(@Param("selectSql") String selectSql); + @Select("${SelectBlobModel}") String customSelectBlobModelJson(@Param("SelectBlobModel") String SelectBlobModel); + } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java new file mode 100644 index 0000000..cc08037 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; + +/** + * @Description: app_scene_cost_material_process_hours + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface AppSceneCostMaterialProcessHoursMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPartMissingInfoMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPartMissingInfoMapper.java new file mode 100644 index 0000000..6dcc140 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPartMissingInfoMapper.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; + +/** + * @Description: app_scene_cost_part_missing_info + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface AppSceneCostPartMissingInfoMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java new file mode 100644 index 0000000..6914312 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; + +/** + * @Description: app_scene_cost_purchase_price + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface AppSceneCostPurchasePriceMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java new file mode 100644 index 0000000..e25bd53 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java @@ -0,0 +1,17 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import java.util.List; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: app_scene_cost_standard_version + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface AppSceneCostStandardVersionMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialProcessHoursMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialProcessHoursMapper.java deleted file mode 100644 index b846b7a..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialProcessHoursMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 物料工时工序表 Mapper 接口 - *

- * - * @author - * @since 2024-06-19 - */ -@Mapper -public interface CostMaterialProcessHoursMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPartMissingInfoMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPartMissingInfoMapper.java deleted file mode 100644 index 6bc98b6..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPartMissingInfoMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostPartMissingInfo; -import org.apache.ibatis.annotations.Param; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: 标准成本-部件缺失信息 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -public interface CostPartMissingInfoMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPurchasePriceMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPurchasePriceMapper.java deleted file mode 100644 index ac0abf3..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostPurchasePriceMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 物料采购单价 Mapper 接口 - *

- * - * @author - * @since 2024-06-19 - */ -@Mapper -public interface CostPurchasePriceMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardVersionMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardVersionMapper.java deleted file mode 100644 index e38ce8f..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardVersionMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; -import org.apache.ibatis.annotations.Param; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: 标准成本-版本号 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -public interface CostStandardVersionMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/HourRateMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/HourRateMapper.java deleted file mode 100644 index 737a754..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/HourRateMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zzsmart.qomo.kn.cost.manage.entity.HourRate; - -/** - * @Description: hour_rate - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -public interface HourRateMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardVersionMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostHourRateMapper.xml similarity index 64% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardVersionMapper.xml rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostHourRateMapper.xml index 0a5c2dd..4aaf433 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardVersionMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostHourRateMapper.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostPartMissingInfoMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml similarity index 63% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostPartMissingInfoMapper.xml rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml index 8a78591..23d4a07 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostPartMissingInfoMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml new file mode 100644 index 0000000..f86ee8c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPartMissingInfoMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPartMissingInfoMapper.xml new file mode 100644 index 0000000..74bcb03 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPartMissingInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/HourRateMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchasePriceMapper.xml similarity index 63% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/HourRateMapper.xml rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchasePriceMapper.xml index b69672d..6571f46 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/HourRateMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchasePriceMapper.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml index de4b57b..ff3e64f 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardDetailMapper.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardVersionMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardVersionMapper.xml new file mode 100644 index 0000000..ac3f8be --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardVersionMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialBomMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialBomMapper.xml deleted file mode 100644 index 0782414..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialBomMapper.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, material_code, material_name, parent_material_code, level, sort, unit, number, labor_hours, device_hours, borrow_material_code, refer_material_code, purchase_type, special_purchase_type, explanation, quantity, weight, material_and_brand, surface_material, surface_thickness, surface_area, length, width, height, figure_file_id, new_tooling, shaping_method, work_content, process_location, cost_center, unit_price, total_price, mould_price, create_by, create_time, update_by, update_time, remark - - - diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialProcessHoursMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialProcessHoursMapper.xml deleted file mode 100644 index c8e27fe..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostMaterialProcessHoursMapper.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, material_code, material_name, level, quantity, purchase_type, work_process, described, labor_hours, device_hours, work_center, create_by, create_time, update_by, update_time, remark - - - diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostPurchasePriceMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostPurchasePriceMapper.xml deleted file mode 100644 index 5fb2b48..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostPurchasePriceMapper.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, material_code, material_name, specification, purchase_type, supplier_code, supplier_name, purchase_price_time, purchase_price_sum, min_purchase_price, last_purchase_price, purchase_price_avg, direct_material_cost, process_cost, transport_cost, mould_cost, orther_cost, tax_tate, create_by, create_time, update_by, update_time, remark - - - diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index cbbfc8a..33673e8 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -6,7 +6,7 @@ import com.zzsmart.qomo.kn.cost.manage.entity.*; import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum; import com.zzsmart.qomo.kn.cost.manage.enums.HourOrRateTypeEnum; import com.zzsmart.qomo.kn.cost.manage.enums.TotalCostEnum; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialBomMapper; import com.zzsmart.qomo.kn.cost.manage.service.*; import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO; import com.zzsmart.qomo.kn.cost.manage.vo.TotalResultValue; @@ -32,25 +32,25 @@ public class StandardCostService { * 物料BOM信息 */ @Autowired - CostMaterialBomMapper costMaterialBomMapper; + AppSceneCostMaterialBomMapper costMaterialBomMapper; @Autowired - CostMaterialBomService costMaterialBomService; + IAppSceneCostMaterialBomService costMaterialBomService; /** * 小时费率 */ @Autowired - IHourRateService iHourRateService; + IAppSceneCostHourRateService iHourRateService; /** * 采购单价 */ @Autowired - CostPurchasePriceService costPurchasePriceService; + IAppSceneCostPurchasePriceService costPurchasePriceService; /** * 工序 */ @Autowired - CostMaterialProcessHoursService costMaterialProcessHoursService; + IAppSceneCostMaterialProcessHoursService costMaterialProcessHoursService; /** * 标准成本计算结果 */ @@ -111,11 +111,11 @@ public class StandardCostService { String sql = flowTaskInfoVO.getSqlString(); log.info("传递过来的SQL语句:" + sql); //TODO 查询最顶部的BOM物料编号下所有的物料并进行层级排序 - List list = standardCostService.costMaterialBomService.queryAllBomInfoBytopMaterialCode(topMaterialCode); + List list = standardCostService.costMaterialBomService.queryAllBomInfoBytopMaterialCode(topMaterialCode); log.info("Full EmptyTask list: {}", list); //2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code) for (int i = 0; list != null && i < list.size(); i++) { - CostMaterialBom material = list.get(i); + AppSceneCostMaterialBom material = list.get(i); AppSceneCostResultValue appSceneCostResultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(material.getMaterialCode()).parentMarterialNo(material.getParentMaterialCode()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).num(material.getNumber()).build(); standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue); } @@ -271,7 +271,7 @@ public class StandardCostService { JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql); BigDecimal hourRate = new BigDecimal("0"); if (jsonObject != null) { - HourRate rate = JSON.toJavaObject(jsonObject, HourRate.class); + AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class); hourRate = rate.getLaborHourRate(); } //1.查询出物料编号对应的下所有的BOM信息 @@ -283,17 +283,17 @@ public class StandardCostService { MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); } //查询工序工时 - Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); + Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); for (int i = 0; i < list.size(); i++) { AppSceneCostResultValue appSceneCostResultValue = list.get(i); String marterialNo = appSceneCostResultValue.getMarterialNo(); if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); + List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { - CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); laborHours = laborHours.add(processHours.getLaborHours()); //计算总人工成本 totalCost = totalCost.add(processHours.getLaborHours().multiply(hourRate)); @@ -339,7 +339,7 @@ public class StandardCostService { JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql); BigDecimal hourRate = new BigDecimal("0"); if (jsonObject != null) { - HourRate rate = JSON.toJavaObject(jsonObject, HourRate.class); + AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class); hourRate = rate.getLaborHourRate(); } //1.查询出物料编号对应的下所有的BOM信息 @@ -350,7 +350,7 @@ public class StandardCostService { if (list != null && list.size() > 0) { MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); } - Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); + Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); //2.1机器折旧费(机器工时*费率) if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { for (int i = 0; i < list.size(); i++) { @@ -359,10 +359,10 @@ public class StandardCostService { if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); + List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { - CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); laborHours = laborHours.add(processHours.getDeviceHours()); //计算机器成本 totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); @@ -381,10 +381,10 @@ public class StandardCostService { if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); + List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { - CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); //TODO 辅料工时来源 laborHours = laborHours.add(processHours.getDeviceHours()); //机物料消耗 @@ -404,10 +404,10 @@ public class StandardCostService { if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); + List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { - CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); //TODO 燃动力工时来源 laborHours = laborHours.add(processHours.getDeviceHours()); //水电费(燃动力工时*费率)成本 @@ -427,10 +427,10 @@ public class StandardCostService { if (marterialNo != null) { BigDecimal totalCost = new BigDecimal("0.0"); BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); + List costMaterialProcessHours = processHoursMap.get(marterialNo); if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { for (int j = 0; j < costMaterialProcessHours.size(); j++) { - CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); //TODO 其他工时来源 laborHours = laborHours.add(processHours.getDeviceHours()); //其他制费成本 diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java deleted file mode 100644 index 79f47c2..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - *

- * 物料bom 服务类 - *

- * - * @author - * @since 2024-06-21 - */ -public interface CostMaterialBomService extends IService { - /** - * 分页查询 - * @param - * @return - */ - List queryListResult(String materialNumber); - - /** - * 查询最顶层物料编号下所有的物料 - * @param topMaterialCode - * @return - */ - List queryAllBomInfoBytopMaterialCode(String topMaterialCode); -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialProcessHoursService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialProcessHoursService.java deleted file mode 100644 index 182a7a7..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialProcessHoursService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; -import java.util.Map; - -/** - *

- * 物料工时工序表 服务类 - *

- * - * @author - * @since 2024-06-19 - */ -public interface CostMaterialProcessHoursService extends IService { -/** - * 查询满足物料编号的工时工序 - */ - Map> getProcessHoursByMaterialNo(List materialNos); -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java new file mode 100644 index 0000000..830ba71 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate; + +/** + * @Description: app_scene_cost_hour_rate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface IAppSceneCostHourRateService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java new file mode 100644 index 0000000..9036f61 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java @@ -0,0 +1,28 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; + +import java.util.List; + +/** + * @Description: app_scene_cost_material_bom + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface IAppSceneCostMaterialBomService extends IService { + /** + * 分页查询 + * @param + * @return + */ + List queryListResult(String materialNumber); + + /** + * 查询最顶层物料编号下所有的物料 + * @param topMaterialCode + * @return + */ + List queryAllBomInfoBytopMaterialCode(String topMaterialCode); +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java new file mode 100644 index 0000000..5487ab5 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java @@ -0,0 +1,22 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialProcessHoursMapper; + +import java.util.List; +import java.util.Map; + +/** + * @Description: app_scene_cost_material_process_hours + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface IAppSceneCostMaterialProcessHoursService extends IService { + /** + * 查询满足物料编号的工时工序 + */ + Map> getProcessHoursByMaterialNo(List materialNos); + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPartMissingInfoService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPartMissingInfoService.java new file mode 100644 index 0000000..cfdcddc --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPartMissingInfoService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; + +/** + * @Description: app_scene_cost_part_missing_info + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface IAppSceneCostPartMissingInfoService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostPurchasePriceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java similarity index 54% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostPurchasePriceService.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java index 4a7d836..ee33790 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostPurchasePriceService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java @@ -1,24 +1,22 @@ package com.zzsmart.qomo.kn.cost.manage.service; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours; -import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice; import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; import java.math.BigDecimal; import java.util.List; import java.util.Map; /** - *

- * 物料采购单价 服务类 - *

- * - * @author - * @since 2024-06-19 + * @Description: app_scene_cost_purchase_price + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 */ -public interface CostPurchasePriceService extends IService { +public interface IAppSceneCostPurchasePriceService extends IService { /** * 查询满足物料编号的最低采购价 */ Map getMinCostPurchasePriceByMaterialNo(List materialNos); + } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardVersionService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardVersionService.java new file mode 100644 index 0000000..d3433b2 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardVersionService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; + +/** + * @Description: app_scene_cost_standard_version + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface IAppSceneCostStandardVersionService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostPartMissingInfoService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostPartMissingInfoService.java deleted file mode 100644 index 39c2607..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostPartMissingInfoService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.CostPartMissingInfo; - -/** - * @Description: 标准成本-部件缺失信息 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -public interface ICostPartMissingInfoService extends IService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java deleted file mode 100644 index 9086cbd..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - - -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; -import org.jeecg.common.api.vo.Result; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - - -/** - * @Description: 标准成本-版本号 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -public interface ICostStandardVersionService extends IService { - /** - * excel导入 - * @param request - * @param response - * @param costStandardVersionClass - * @return - */ - Result importExcel(HttpServletRequest request, HttpServletResponse response, Class costStandardVersionClass); - /** - * 分页查询 - * @param - * @return - */ - List queryListResult(String versionNumber); -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IHourRateService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IHourRateService.java deleted file mode 100644 index 3568013..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IHourRateService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - - -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.HourRate; - -/** - * @Description: hour_rate - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -public interface IHourRateService extends IService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java index 4da1102..2c48923 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -3,12 +3,12 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; -import com.zzsmart.qomo.kn.cost.manage.entity.CostPartMissingInfo; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostPartMissingInfoMapper; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; -import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; import com.zzsmart.qomo.service.IDataFlowInstanceService; import org.springframework.beans.factory.annotation.Autowired; @@ -27,11 +27,11 @@ import java.util.List; @Service public class AppSceneCostCountServiceImpl extends ServiceImpl implements IAppSceneCostCountService { @Autowired - private ICostStandardVersionService costStandardVersionService; + private IAppSceneCostStandardVersionService costStandardVersionService; @Autowired private IDataFlowInstanceService flowInstanceService; @Autowired - private CostPartMissingInfoMapper costPartMissingInfoMapper; + private AppSceneCostPartMissingInfoMapper costPartMissingInfoMapper; /** * 查看关键缺失部件 @@ -43,12 +43,12 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl queryMissingComponentById(String id) { List list = new ArrayList<>(); if (id != null) { - QueryWrapper queryWrapper = new QueryWrapper<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("costStandardId", id); - List costPartMissingInfos = costPartMissingInfoMapper.selectList(queryWrapper); + List costPartMissingInfos = costPartMissingInfoMapper.selectList(queryWrapper); if (costPartMissingInfos != null && costPartMissingInfos.size() > 0) { for (int i = 0; i < costPartMissingInfos.size(); i++) { - CostPartMissingInfo costPartMissingInfo = costPartMissingInfos.get(i); + AppSceneCostPartMissingInfo costPartMissingInfo = costPartMissingInfos.get(i); if (costPartMissingInfo.getMissingInfo() != null) { String[] split = costPartMissingInfo.getMissingInfo().split(";"); for (int j = 0; j < split.length; j++) { @@ -99,7 +99,7 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl implements IAppSceneCostHourRateService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialBomServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java similarity index 64% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialBomServiceImpl.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java index 4f4147b..cbd4bef 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialBomServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java @@ -2,27 +2,26 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; -import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialBomService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialBomMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialBomService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import java.util.List; /** - *

- * 物料bom 服务实现类 - *

- * - * @author - * @since 2024-06-21 + * @Description: app_scene_cost_material_bom + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 */ @Service -public class CostMaterialBomServiceImpl extends ServiceImpl implements CostMaterialBomService { +public class AppSceneCostMaterialBomServiceImpl extends ServiceImpl implements IAppSceneCostMaterialBomService { @Autowired - CostMaterialBomMapper costMaterialBomMapper; + AppSceneCostMaterialBomMapper costMaterialBomMapper; /** * 分页查询 @@ -31,7 +30,7 @@ public class CostMaterialBomServiceImpl extends ServiceImpl queryListResult(String materialNumber) { + public List queryListResult(String materialNumber) { QueryWrapper queryWrapper = new QueryWrapper(); if (StrUtil.isNotEmpty(materialNumber)) { // 物料号 @@ -48,7 +47,7 @@ public class CostMaterialBomServiceImpl extends ServiceImpl queryAllBomInfoBytopMaterialCode(String topMaterialCode) { + public List queryAllBomInfoBytopMaterialCode(String topMaterialCode) { QueryWrapper queryWrapper = new QueryWrapper(); //TODO 循环遍历查出所有的物料下的物料(包含最上层的物料) // if (StrUtil.isNotEmpty(topMaterialCode)) { diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java new file mode 100644 index 0000000..b2ff71b --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java @@ -0,0 +1,55 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialProcessHoursMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialProcessHoursService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description: app_scene_cost_material_process_hours + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Service +public class AppSceneCostMaterialProcessHoursServiceImpl extends ServiceImpl implements IAppSceneCostMaterialProcessHoursService { + @Autowired + AppSceneCostMaterialProcessHoursMapper costMaterialProcessHoursMapper; + + /** + * 查询满足物料编号的工时工序 + * + * @param materialNos + */ + @Override + public Map> getProcessHoursByMaterialNo(List materialNos) { + Map> map = new HashMap<>(); + QueryWrapper queryWrapper = new QueryWrapper(); + if (materialNos != null && materialNos.size() > 0) { + queryWrapper.in("material_code", materialNos); + List costMaterialProcessHours = costMaterialProcessHoursMapper.selectList(queryWrapper); + for (int i = 0; i < costMaterialProcessHours.size(); i++) { + AppSceneCostMaterialProcessHours costMaterialProcessHours1 = costMaterialProcessHours.get(i); + String materialCode = costMaterialProcessHours1.getMaterialCode(); + if (map.containsKey(materialCode)) { + List list = map.get(materialCode); + list.add(costMaterialProcessHours1); + map.put(materialCode, list); + } else { + List list = new ArrayList<>(); + list.add(costMaterialProcessHours1); + map.put(materialCode, list); + } + } + } + return map; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPartMissingInfoServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPartMissingInfoServiceImpl.java new file mode 100644 index 0000000..ec5ee52 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPartMissingInfoServiceImpl.java @@ -0,0 +1,18 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPartMissingInfoService; +import org.springframework.stereotype.Service; + +/** + * @Description: app_scene_cost_part_missing_info + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Service +public class AppSceneCostPartMissingInfoServiceImpl extends ServiceImpl implements IAppSceneCostPartMissingInfoService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPurchasePriceServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java similarity index 53% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPurchasePriceServiceImpl.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java index d93f624..230f850 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPurchasePriceServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java @@ -1,33 +1,29 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours; -import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostPurchasePriceMapper; -import com.zzsmart.qomo.kn.cost.manage.service.CostPurchasePriceService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.checkerframework.checker.units.qual.A; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchasePriceMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchasePriceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import java.math.BigDecimal; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** - *

- * 物料采购单价 服务实现类 - *

- * - * @author - * @since 2024-06-19 + * @Description: app_scene_cost_purchase_price + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 */ @Service -public class CostPurchasePriceServiceImpl extends ServiceImpl implements CostPurchasePriceService { +public class AppSceneCostPurchasePriceServiceImpl extends ServiceImpl implements IAppSceneCostPurchasePriceService { @Autowired - CostPurchasePriceMapper costPurchasePriceMapper; + AppSceneCostPurchasePriceMapper costPurchasePriceMapper; /** * 查询满足物料编号的最低采购价 @@ -37,12 +33,12 @@ public class CostPurchasePriceServiceImpl extends ServiceImpl getMinCostPurchasePriceByMaterialNo(List materialNos) { Map map = new HashMap<>(); - QueryWrapper queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper(); if (materialNos != null && materialNos.size() > 0) { queryWrapper.in("material_code", materialNos); - List costPurchasePrices = costPurchasePriceMapper.selectList(queryWrapper); + List costPurchasePrices = costPurchasePriceMapper.selectList(queryWrapper); for (int i = 0; i < costPurchasePrices.size(); i++) { - CostPurchasePrice costPurchasePrice = costPurchasePrices.get(i); + AppSceneCostPurchasePrice costPurchasePrice = costPurchasePrices.get(i); map.put(costPurchasePrice.getMaterialCode(), costPurchasePrice.getMinPurchasePrice()); } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardVersionServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardVersionServiceImpl.java new file mode 100644 index 0000000..d60e98d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardVersionServiceImpl.java @@ -0,0 +1,19 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardVersionMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; +import org.springframework.stereotype.Service; + + +/** + * @Description: app_scene_cost_standard_version + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Service +public class AppSceneCostStandardVersionServiceImpl extends ServiceImpl implements IAppSceneCostStandardVersionService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialProcessHoursServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialProcessHoursServiceImpl.java deleted file mode 100644 index 7c8a3b8..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialProcessHoursServiceImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialProcessHoursMapper; -import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialProcessHoursService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - *

- * 物料工时工序表 服务实现类 - *

- * - * @author - * @since 2024-06-19 - */ -@Service -public class CostMaterialProcessHoursServiceImpl extends ServiceImpl implements CostMaterialProcessHoursService { - @Autowired - CostMaterialProcessHoursMapper costMaterialProcessHoursMapper; - - /** - * 查询满足物料编号的工时工序 - * - * @param materialNos - */ - @Override - public Map> getProcessHoursByMaterialNo(List materialNos) { - Map> map = new HashMap<>(); - QueryWrapper queryWrapper = new QueryWrapper(); - if (materialNos != null && materialNos.size() > 0) { - queryWrapper.in("material_code", materialNos); - List costMaterialProcessHours = costMaterialProcessHoursMapper.selectList(queryWrapper); - for (int i = 0; i < costMaterialProcessHours.size(); i++) { - CostMaterialProcessHours costMaterialProcessHours1 = costMaterialProcessHours.get(i); - String materialCode = costMaterialProcessHours1.getMaterialCode(); - if (map.containsKey(materialCode)) { - List list = map.get(materialCode); - list.add(costMaterialProcessHours1); - map.put(materialCode, list); - } else { - List list = new ArrayList<>(); - list.add(costMaterialProcessHours1); - map.put(materialCode, list); - } - } - } - return map; - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPartMissingInfoServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPartMissingInfoServiceImpl.java deleted file mode 100644 index 8ae9775..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPartMissingInfoServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - - -import com.zzsmart.qomo.kn.cost.manage.entity.CostPartMissingInfo; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostPartMissingInfoMapper; -import com.zzsmart.qomo.kn.cost.manage.service.ICostPartMissingInfoService; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * @Description: 标准成本-部件缺失信息 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -@Service -public class CostPartMissingInfoServiceImpl extends ServiceImpl implements ICostPartMissingInfoService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java deleted file mode 100644 index fabb5b6..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java +++ /dev/null @@ -1,214 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zzsmart.qomo.kn.cost.manage.constants.Constants; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; -import com.zzsmart.qomo.kn.cost.manage.enums.StandardStageEnum; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardVersionMapper; -import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; - -import org.apache.shiro.SecurityUtils; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.vo.LoginUser; -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.time.ZoneId; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - - -/** - * @Description: 标准成本-版本号 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -@Service -public class CostStandardVersionServiceImpl extends ServiceImpl implements ICostStandardVersionService { - @Autowired - private CostStandardVersionMapper costStandardVersionMapper; - private static final Logger log = LoggerFactory.getLogger(CostStandardVersionServiceImpl.class); - - @Transactional(rollbackFor = Exception.class) - @Override - public boolean save(CostStandardVersion costStandardVersion) { - // todo 查物料表看是否存在改物料,没有抛异常 - LoginUser sysUser = null; - try { - sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - } catch (Exception ignored) { - - } - if (sysUser != null) { - costStandardVersion.setCreateBy(sysUser.getUsername()); - } - // 保存版本号表 - boolean save = super.save(costStandardVersion); - return save; - } - - - /** - * 标准成本计算 - * - * @param costStandardVersion 版本号 - * @return - */ - // private CostStandard standardCalculate(CostStandardVersion costStandardVersion) { - // 计算逻辑,生成版本号输入的物料号是根节点物料号, - // 1,根据根节点物料号查找物料表kn_new_sap_mara - - // 2,去bom表找出对应下的所有层级物料app_scene_cost_material_bom - - // 3,根据物料去工时工序表找出对应工序,工序表中包含所计算的工时,app_scene_cost_material_process_hours - // 4,查小时费率表,找到对应工时费率app_scene_cost_hour_rate - // 5,查采购单价表,找到对应采购单价app_scene_cost_purchase_price - // 5,计算每层级的物料标准成本,存到标准成本明细表app_scene_cost_standard_detail - - // 4,计算bom费用,BOM表清单物料用量*采购单价 - // 5,计算包装费 - // 6,计算辅料费 - // 7,计算人工费,人工工时*费率 - // 8,计算机器折旧费,机器工时*费率 - // 9,计算机物料消耗费,辅料工时*费率 - // 10,计算水电费,燃动力工时*费率 - // 11,计算其他制造费,其他工时*费率 - // 12,计算物流费,物流费用=(机器折旧+机物料消耗+水电费+其他制费)*10.16% - // 13,计算制造成本,前面所有费用汇总(即人工费+机器折旧费+机物料消耗费+水电费+其他制造费+物流费) - // 18,计算总成本 - -// return standard; -// } - - - - /** - * excel导入 - * - * @param request - * @param response - * @param clazz - * @return - */ - @Transactional(rollbackFor = Exception.class) - @Override - public Result importExcel(HttpServletRequest request, HttpServletResponse response, Class clazz) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - Iterator iterator = fileMap.entrySet().iterator(); - if (iterator.hasNext()) { - Map.Entry entity = (Map.Entry) iterator.next(); - MultipartFile file = (MultipartFile) entity.getValue(); - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List list = ExcelImportUtil.importExcel(file.getInputStream(), clazz, params); - if (CollectionUtil.isEmpty(list)) { - log.error("无可导入的数据!"); - return Result.error("无可导入的数据!"); - } - int successNum = 0; - int failureNum = 0; - // StringBuilder successMsg = new StringBuilder(); - StringBuilder failureMsg = new StringBuilder(); - long start = System.currentTimeMillis(); - // 校验并组装list - for (int i = 0; i < list.size(); i++) { - CostStandardVersion standardVersion = list.get(i); - // 校验物料号是否为空 - if (StrUtil.isEmpty(standardVersion.getMaterialNumber())) { - failureNum++; - failureMsg.append("
第 " + (i + 2) + " 行【物料号】字段不能为空:"); - continue; - } - if (StrUtil.isNotEmpty(standardVersion.getStage())) { - standardVersion.setStage(StandardStageEnum.getCodeByText(standardVersion.getStage())); - } - // 创建日期 - Date createDate = new Date(); - standardVersion.setCreateTime(createDate); - String dateStr = new SimpleDateFormat("yyyyMMddHHmmss").format(createDate); - // 生成版本号,版本号=图号_阶段_创建日期(格式:yyyyMMddHHmmss) - standardVersion.setVersionNumber(standardVersion.getFigureNumber()+ Constants.UNDER_LINE +standardVersion.getStage()+Constants.UNDER_LINE+dateStr); - // 设置年份 - standardVersion.setVersionYear(String.valueOf(createDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getYear())); - // 调用保存方法 - try { - save(standardVersion); - } catch (Exception e) { - failureNum++; - String msg = "
第 " + (i + 2) + " 行数据导入失败;"; - failureMsg.append(msg); - log.error(msg, e); - } - successNum++; - } - // costStandardVersionService.saveBatch(list); - log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒"); - String returnMsg = "文件导入成功!数据行数:" + successNum; - if (failureNum > 0) { - returnMsg += "
失败数据行数:" + failureNum + ",失败信息如下:
" + failureMsg.toString(); - } - return Result.ok(returnMsg); - } catch (Exception exception) { - String msg = exception.getMessage(); - log.error(msg, exception); - Result result; - String duplicateEntry = "Duplicate entry"; - if (msg != null && msg.contains(duplicateEntry)) { - result = Result.error("文件导入失败:有重复数据!"); - return result; - } else { - result = Result.error("文件导入失败:" + exception.getMessage()); - return result; - } - } finally { - try { - file.getInputStream().close(); - } catch (IOException var23) { - var23.printStackTrace(); - } - } - } else { - return Result.error("文件导入失败!"); - } - - } - - /** - * 分页查询 - * - * @param versionNumber@return - */ - @Override - public List queryListResult(String versionNumber) { - QueryWrapper queryWrapper = new QueryWrapper(); - if (StrUtil.isNotEmpty(versionNumber)) { - // 物料号 - queryWrapper.like("version_number", versionNumber); - } - List list = costStandardVersionMapper.selectList(queryWrapper); - return list; - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/HourRateServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/HourRateServiceImpl.java deleted file mode 100644 index b604ed5..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/HourRateServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.zzsmart.qomo.kn.cost.manage.entity.HourRate; -import com.zzsmart.qomo.kn.cost.manage.mapper.HourRateMapper; -import com.zzsmart.qomo.kn.cost.manage.service.IHourRateService; -import org.springframework.stereotype.Service; - -/** - * @Description: hour_rate - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -@Service -public class HourRateServiceImpl extends ServiceImpl implements IHourRateService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java index 66c2209..c9fc892 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java @@ -1,14 +1,12 @@ package com.zzsmart.qomo.kn.cost.manage.vo; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; -import lombok.Builder; import lombok.Data; @Data -@Builder public class AppSceneCostCountVO extends AppSceneCostCount { /** * 状态名称 */ - private String statusName; + public String statusName; } From 28f050efc2776732e579707b120e8e5995c11c79 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Fri, 2 Aug 2024 11:17:51 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=90=88=E5=90=8C=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ppSceneCostPurchaseEvaluateController.java | 162 ++++++++++++++++++ .../entity/AppSceneCostPurchaseEvaluate.java | 86 ++++++++++ .../AppSceneCostPurchaseEvaluateMapper.java | 14 ++ .../AppSceneCostPurchaseEvaluateMapper.xml | 5 + .../IAppSceneCostPurchaseEvaluateService.java | 14 ++ ...pSceneCostPurchaseEvaluateServiceImpl.java | 19 ++ 6 files changed, 300 insertions(+) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseEvaluate.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseEvaluateMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseEvaluateMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseEvaluateService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseEvaluateServiceImpl.java diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java new file mode 100644 index 0000000..c2e9fac --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java @@ -0,0 +1,162 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseEvaluateService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_purchase_evaluate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Api(tags = "cost-采购合同") +@RestController +@RequestMapping("//PurchaseEvaluate") +@Slf4j +public class AppSceneCostPurchaseEvaluateController extends JeecgController { + @Autowired + private IAppSceneCostPurchaseEvaluateService appSceneCostPurchaseEvaluateService; + + /** + * 分页列表查询 + * + * @param appSceneCostPurchaseEvaluate + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_purchase_evaluate-分页列表查询") + @ApiOperation(value = "app_scene_cost_purchase_evaluate-分页列表查询", notes = "app_scene_cost_purchase_evaluate-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchaseEvaluate, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostPurchaseEvaluateService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostPurchaseEvaluate + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_evaluate-添加") + @ApiOperation(value = "app_scene_cost_purchase_evaluate-添加", notes = "app_scene_cost_purchase_evaluate-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) { + appSceneCostPurchaseEvaluateService.save(appSceneCostPurchaseEvaluate); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostPurchaseEvaluate + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_evaluate-编辑") + @ApiOperation(value = "app_scene_cost_purchase_evaluate-编辑", notes = "app_scene_cost_purchase_evaluate-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) { + appSceneCostPurchaseEvaluateService.updateById(appSceneCostPurchaseEvaluate); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_evaluate-通过id删除") + @ApiOperation(value = "app_scene_cost_purchase_evaluate-通过id删除", notes = "app_scene_cost_purchase_evaluate-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostPurchaseEvaluateService.removeById(id); + return Result.OK("删除成功!"); + } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "app_scene_cost_purchase_evaluate-批量删除") +// @ApiOperation(value = "app_scene_cost_purchase_evaluate-批量删除", notes = "app_scene_cost_purchase_evaluate-批量删除") +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { +// this.appSceneCostPurchaseEvaluateService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } +// +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "app_scene_cost_purchase_evaluate-通过id查询") +// @ApiOperation(value = "app_scene_cost_purchase_evaluate-通过id查询", notes = "app_scene_cost_purchase_evaluate-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name = "id", required = true) String id) { +// AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate = appSceneCostPurchaseEvaluateService.getById(id); +// if (appSceneCostPurchaseEvaluate == null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(appSceneCostPurchaseEvaluate); +// } +// +// /** +// * 导出excel +// * +// * @param request +// * @param appSceneCostPurchaseEvaluate +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) { +// return super.exportXls(request, appSceneCostPurchaseEvaluate, AppSceneCostPurchaseEvaluate.class, "app_scene_cost_purchase_evaluate"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppSceneCostPurchaseEvaluate.class); +// } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseEvaluate.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseEvaluate.java new file mode 100644 index 0000000..a6b8656 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseEvaluate.java @@ -0,0 +1,86 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Builder; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: app_scene_cost_purchase_evaluate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Data +@Builder +@TableName("app_scene_cost_purchase_evaluate") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_purchase_evaluate对象", description = "app_scene_cost_purchase_evaluate") +public class AppSceneCostPurchaseEvaluate implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private Integer id; + /** + * 合同编号 + */ + @Excel(name = "合同编号", width = 15) + @ApiModelProperty(value = "合同编号") + private String contractNo; + /** + * 估价 + */ + @Excel(name = "估价", width = 15) + @ApiModelProperty(value = "估价") + private BigDecimal evaluate; + /** + * 合同名称 + */ + @Excel(name = "合同名称", width = 15) + @ApiModelProperty(value = "合同名称") + private String contractName; + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private Integer createBy; + /** + * 更新时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private Date updateTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private Integer updateBy; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseEvaluateMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseEvaluateMapper.java new file mode 100644 index 0000000..8771364 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseEvaluateMapper.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate; + +/** + * @Description: app_scene_cost_purchase_evaluate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface AppSceneCostPurchaseEvaluateMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseEvaluateMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseEvaluateMapper.xml new file mode 100644 index 0000000..05c4719 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseEvaluateMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseEvaluateService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseEvaluateService.java new file mode 100644 index 0000000..3044e7a --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseEvaluateService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate; + +/** + * @Description: app_scene_cost_purchase_evaluate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +public interface IAppSceneCostPurchaseEvaluateService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseEvaluateServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseEvaluateServiceImpl.java new file mode 100644 index 0000000..a1c4823 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseEvaluateServiceImpl.java @@ -0,0 +1,19 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseEvaluateMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseEvaluateService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: app_scene_cost_purchase_evaluate + * @Author: jeecg-boot + * @Date: 2024-08-02 + * @Version: V1.0 + */ +@Service +public class AppSceneCostPurchaseEvaluateServiceImpl extends ServiceImpl implements IAppSceneCostPurchaseEvaluateService { + +} From 71497f5641119d3fd6940bcd7b7ed6a7fe07867d Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Fri, 2 Aug 2024 18:05:54 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppSceneCostStandardDetailController.java | 2 +- .../manage/service/impl/AppSceneCostCountServiceImpl.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java index e081205..6845b96 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java @@ -137,7 +137,7 @@ public class AppSceneCostStandardDetailController extends JeecgController Date: Tue, 6 Aug 2024 14:54:33 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9pom=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=EF=BC=88=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=87=BA=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=8C=85=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 5 - .../src/main/resources/application-dev.yml | 7 +- qomo-kn-cost-manage/pom.xml | 34 ----- .../AppSceneCostStandardDetailController.java | 1 + .../manage/entity/AppSceneCostHourRate.java | 25 +--- .../kn/cost/manage/util/EasyExcelUtil.java | 135 ------------------ 6 files changed, 11 insertions(+), 196 deletions(-) delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java diff --git a/pom.xml b/pom.xml index 7f9a66e..c6ecd48 100644 --- a/pom.xml +++ b/pom.xml @@ -138,11 +138,6 @@ qomo-data-selfReport ${dmp.version} - - - - - diff --git a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml index 839dcd4..ac280f8 100644 --- a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml +++ b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml @@ -282,8 +282,8 @@ jeecg: #webapp文件路径 webapp: /opt/webapp shiro: - excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** -# excludeUrls: /**/**,/**/**/** +# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** + excludeUrls: /**/**,/**/**/** #阿里云oss存储和大鱼短信秘钥配置 oss: @@ -436,7 +436,8 @@ seaTunnelHome: /opt/service/apache-seatunnel-2.3.4 hiveMetastoreUri: thrift://192.168.50.102:9083 hiveSitePath: /opt/service/apache-seatunnel-2.3.4/deploy/hive-site.xml hdfsSitePath: /opt/service/apache-seatunnel-2.3.4/deploy/hdfs-site.xml - +hdfs: + enable: false minio: server: http://192.168.50.9 port: 9100 diff --git a/qomo-kn-cost-manage/pom.xml b/qomo-kn-cost-manage/pom.xml index 7e5a041..7fa2ad8 100644 --- a/qomo-kn-cost-manage/pom.xml +++ b/qomo-kn-cost-manage/pom.xml @@ -13,12 +13,6 @@ org.qomo.boot qomo-system-biz - ${revision} - - - org.projectlombok - lombok - provided com.google.auto.service @@ -29,33 +23,5 @@ com.zzsmart.qomo qomo-data-integration - - org.projectlombok - lombok - RELEASE - compile - - - org.apache.poi - poi - 5.2.3 - - - org.apache.poi - poi-ooxml - 5.2.3 - - - - - - - - - com.alibaba - easyexcel - 4.0.1 - - \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java index 6845b96..2bca7fb 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java @@ -139,6 +139,7 @@ public class AppSceneCostStandardDetailController extends JeecgController void export(HttpServletResponse response, String fileName, List head, List data, Class clazz) throws IOException { - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setCharacterEncoding(StandardCharsets.UTF_8.name()); - try { - fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()).replaceAll("\\+", "%20"); - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - // 自定义表头样式 - HorizontalCellStyleStrategy horizontalCellStyleStrategy = getHorizontalCellStyleStrategy(); - - // 使用EasyExcel导出 - try { - EasyExcel.write(response.getOutputStream(), clazz) - // 注册样式策略 - .registerWriteHandler(horizontalCellStyleStrategy).sheet("1111").doWrite(data); - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } -// FileOutputStream outputStream= new FileOutputStream(fileName); -// try { -// EasyExcel.write(outputStream) -// // 设置自定义样式,可选 -// .sheet("Sheet1") // 设置工作表名称 -// .doWrite(data); // 将数据写入Excel -// } catch (Exception e) { -// e.printStackTrace(); -// System.out.println("zheli=============="); -// } finally { -//// if (excelWriter != null) { -//// excelWriter.finish(); -//// } -// if (outputStream != null) { -// outputStream.close(); -// } - -// } - } - - /** - * 创建自定义的水平单元格样式策略,用于表头样式。 - * - * @return 水平单元格样式策略 - */ - private static HorizontalCellStyleStrategy getHorizontalCellStyleStrategy() { - // 设置表头字体样式 - WriteFont headFont = new WriteFont(); - headFont.setFontHeightInPoints((short) 12); - headFont.setFontName("Arial"); - headFont.setBold(true); - - // 设置表头单元格样式 - WriteCellStyle headCellStyle = new WriteCellStyle(); - headCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); - headCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); - headCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); - headCellStyle.setBorderLeft(BorderStyle.THIN); - headCellStyle.setBorderRight(BorderStyle.THIN); - headCellStyle.setBorderTop(BorderStyle.THIN); - headCellStyle.setBorderBottom(BorderStyle.THIN); - headCellStyle.setWriteFont(headFont); - - // 创建并返回水平单元格样式策略 - return new HorizontalCellStyleStrategy(headCellStyle, (List) null); - } - - /** - * 获取带有@Excel注解的属性集合 - * - * @param clazz 实体类的Class对象 - * @return 带有@Excel注解的Field集合 - */ - public static Field[] getExcelPropertyAnnotatedFields(Class clazz) { - Field[] fields = clazz.getDeclaredFields(); - List annotatedFields = new ArrayList<>(); - - for (Field field : fields) { - if (field.isAnnotationPresent(ExcelProperty.class)) { - annotatedFields.add(field); - } - } - return annotatedFields.toArray(new Field[0]); - } - - /** - * 查询类需要导出的列名 - * - * @param clazz - * @return - */ - public static Set getIncludeFields(Class clazz) { - Field[] excelPropertyAnnotatedFields = getExcelPropertyAnnotatedFields(AppSceneCostStandardDetail.class); - Set includeColumnFiledNames = new HashSet(); - for (int i = 0; i < excelPropertyAnnotatedFields.length; i++) { - includeColumnFiledNames.add(excelPropertyAnnotatedFields[i].getName()); - } - return includeColumnFiledNames; - } -} From 48507ebd3ae411fe16c7565a8bc418a2c3a80d36 Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Fri, 23 Aug 2024 11:43:30 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=A0=91=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=B3=A8=E9=87=8A=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 13 +++++++++---- .../controller/AppSceneCostCountController.java | 10 +++++----- .../controller/AppSceneCostHourRateController.java | 12 ++++++------ .../AppSceneCostMaterialBomController.java | 12 ++++++------ ...AppSceneCostMaterialProcessHoursController.java | 12 ++++++------ .../AppSceneCostPartMissingInfoController.java | 12 ++++++------ .../AppSceneCostPurchaseEvaluateController.java | 12 ++++++------ .../AppSceneCostPurchasePriceController.java | 12 ++++++------ .../AppSceneCostResultValueController.java | 4 ++-- .../AppSceneCostStandardDetailController.java | 12 ++++++------ .../AppSceneCostStandardVersionController.java | 12 ++++++------ .../service/impl/AppSceneCostCountServiceImpl.java | 2 ++ .../manage/service/impl/BomTreeServiceImpl.java | 14 +++++++------- .../qomo/kn/cost/manage/util/BomTreeBuilder.java | 12 +++++++++++- 14 files changed, 84 insertions(+), 67 deletions(-) diff --git a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml index ac280f8..18a44f0 100644 --- a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml +++ b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml @@ -15,7 +15,7 @@ v2: defaultFormat: .png server: - port: 8082 + port: 8098 tomcat: max-swallow-size: -1 error: @@ -205,10 +205,15 @@ spring: # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: +# master: +# url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false +# username: zzzz +# password: knphm2021 +# driver-class-name: com.mysql.cj.jdbc.Driver master: - url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false - username: zzzz - password: knphm2021 + url: jdbc:mysql://158.158.4.51:13306/kn_otd_app?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false + username: knotd + password: otd@2024 driver-class-name: com.mysql.cj.jdbc.Driver # 多数据源配置 #multi-datasource1: diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java index 9616664..6c021b0 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java @@ -79,7 +79,7 @@ public class AppSceneCostCountController extends JeecgController addCostCountTask(@RequestBody AppSceneCostCount appSceneCostCount) { appSceneCostCountService.addCostCountTask(appSceneCostCount); @@ -95,7 +95,7 @@ public class AppSceneCostCountController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostCountService.removeById(id); @@ -110,7 +110,7 @@ public class AppSceneCostCountController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostCountService.removeByIds(Arrays.asList(ids.split(","))); @@ -157,7 +157,7 @@ public class AppSceneCostCountController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, AppSceneCostCount.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java index 8cd1407..0d343b1 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java @@ -65,7 +65,7 @@ public class AppSceneCostHourRateController extends JeecgController add(@RequestBody AppSceneCostHourRate appSceneCostHourRate) { appSceneCostHourRateService.save(appSceneCostHourRate); @@ -80,7 +80,7 @@ public class AppSceneCostHourRateController extends JeecgController edit(@RequestBody AppSceneCostHourRate appSceneCostHourRate) { appSceneCostHourRateService.updateById(appSceneCostHourRate); @@ -95,7 +95,7 @@ public class AppSceneCostHourRateController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostHourRateService.removeById(id); @@ -110,7 +110,7 @@ public class AppSceneCostHourRateController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostHourRateService.removeByIds(Arrays.asList(ids.split(","))); @@ -140,7 +140,7 @@ public class AppSceneCostHourRateController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostHourRate.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java index a2018ac..6cc8480 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java @@ -93,7 +93,7 @@ public class AppSceneCostMaterialBomController extends JeecgController add(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { // appSceneCostMaterialBomService.save(appSceneCostMaterialBom); @@ -108,7 +108,7 @@ public class AppSceneCostMaterialBomController extends JeecgController edit(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { // appSceneCostMaterialBomService.updateById(appSceneCostMaterialBom); @@ -123,7 +123,7 @@ public class AppSceneCostMaterialBomController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostMaterialBomService.removeById(id); @@ -138,7 +138,7 @@ public class AppSceneCostMaterialBomController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostMaterialBomService.removeByIds(Arrays.asList(ids.split(","))); @@ -168,7 +168,7 @@ public class AppSceneCostMaterialBomController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostMaterialBom.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java index da07942..ea838e4 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java @@ -62,7 +62,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< */ @AutoLog(value = "app_scene_cost_material_process_hours-添加") @ApiOperation(value = "app_scene_cost_material_process_hours-添加", notes = "app_scene_cost_material_process_hours-添加") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:add") + //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:add") @PostMapping(value = "/add") public Result add(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { appSceneCostMaterialProcessHoursService.save(appSceneCostMaterialProcessHours); @@ -77,7 +77,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< */ @AutoLog(value = "app_scene_cost_material_process_hours-编辑") @ApiOperation(value = "app_scene_cost_material_process_hours-编辑", notes = "app_scene_cost_material_process_hours-编辑") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:edit") + //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) public Result edit(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { appSceneCostMaterialProcessHoursService.updateById(appSceneCostMaterialProcessHours); @@ -92,7 +92,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< */ @AutoLog(value = "app_scene_cost_material_process_hours-通过id删除") @ApiOperation(value = "app_scene_cost_material_process_hours-通过id删除", notes = "app_scene_cost_material_process_hours-通过id删除") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:delete") + //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name = "id", required = true) String id) { appSceneCostMaterialProcessHoursService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< // */ // @AutoLog(value = "app_scene_cost_material_process_hours-批量删除") // @ApiOperation(value = "app_scene_cost_material_process_hours-批量删除", notes = "app_scene_cost_material_process_hours-批量删除") -// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:deleteBatch") +// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:deleteBatch") // @DeleteMapping(value = "/deleteBatch") // public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostMaterialProcessHoursService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< // * @param request // * @param appSceneCostMaterialProcessHours // */ -// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:exportXls") +// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:exportXls") // @RequestMapping(value = "/exportXls") // public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { // return super.exportXls(request, appSceneCostMaterialProcessHours, AppSceneCostMaterialProcessHours.class, "app_scene_cost_material_process_hours"); @@ -150,7 +150,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< // * @param response // * @return // */ -// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:importExcel") +// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:importExcel") // @RequestMapping(value = "/importExcel", method = RequestMethod.POST) // public Result importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostMaterialProcessHours.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java index a451064..0af4a63 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java @@ -62,7 +62,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController add(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) { // appSceneCostPartMissingInfoService.save(appSceneCostPartMissingInfo); @@ -77,7 +77,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController edit(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) { // appSceneCostPartMissingInfoService.updateById(appSceneCostPartMissingInfo); @@ -92,7 +92,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostPartMissingInfoService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostPartMissingInfoService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostPartMissingInfo.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java index c2e9fac..f379bc0 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java @@ -65,7 +65,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController add(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) { appSceneCostPurchaseEvaluateService.save(appSceneCostPurchaseEvaluate); @@ -80,7 +80,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController edit(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) { appSceneCostPurchaseEvaluateService.updateById(appSceneCostPurchaseEvaluate); @@ -95,7 +95,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostPurchaseEvaluateService.removeById(id); @@ -110,7 +110,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostPurchaseEvaluateService.removeByIds(Arrays.asList(ids.split(","))); @@ -140,7 +140,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostPurchaseEvaluate.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java index 4a750c1..1bfe828 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java @@ -62,7 +62,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController add(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { appSceneCostPurchasePriceService.save(appSceneCostPurchasePrice); @@ -77,7 +77,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController edit(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { appSceneCostPurchasePriceService.updateById(appSceneCostPurchasePrice); @@ -92,7 +92,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostPurchasePriceService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { this.appSceneCostPurchasePriceService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, AppSceneCostPurchasePrice.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java index fecbd6a..30f2ee7 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java @@ -157,7 +157,7 @@ public class AppSceneCostResultValueController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, AppSceneCostResultValue.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java index 2bca7fb..b8baada 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java @@ -62,7 +62,7 @@ public class AppSceneCostStandardDetailController extends JeecgController add(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) { // appSceneCostStandardDetailService.save(appSceneCostStandardDetail); @@ -77,7 +77,7 @@ public class AppSceneCostStandardDetailController extends JeecgController edit(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) { // appSceneCostStandardDetailService.updateById(appSceneCostStandardDetail); @@ -92,7 +92,7 @@ public class AppSceneCostStandardDetailController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostStandardDetailService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostStandardDetailController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostStandardDetailService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostStandardDetailController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostStandardDetail.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java index 0676b9d..d2554d7 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java @@ -60,7 +60,7 @@ public class AppSceneCostStandardVersionController extends JeecgController add(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) { // appSceneCostStandardVersionService.save(appSceneCostStandardVersion); @@ -75,7 +75,7 @@ public class AppSceneCostStandardVersionController extends JeecgController edit(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) { // appSceneCostStandardVersionService.updateById(appSceneCostStandardVersion); @@ -90,7 +90,7 @@ public class AppSceneCostStandardVersionController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostStandardVersionService.removeById(id); @@ -105,7 +105,7 @@ public class AppSceneCostStandardVersionController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostStandardVersionService.removeByIds(Arrays.asList(ids.split(","))); @@ -135,7 +135,7 @@ public class AppSceneCostStandardVersionController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostStandardVersion.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java index 2301d8f..bbe9ab3 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -2,6 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.dao.entity.FlowDefinition; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; @@ -11,6 +12,7 @@ import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; +import com.zzsmart.qomo.service.IDataFlowDefinitionService; import com.zzsmart.qomo.service.IDataFlowInstanceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java index fba0566..e59f926 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java @@ -12,10 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; +import java.util.*; import java.util.stream.Collectors; @Service @@ -53,9 +50,12 @@ public class BomTreeServiceImpl implements BomTreeService { parentDataMap = parentNodeList.stream().collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); } else { //父类结果有多个(找出最上级节点) - Map> levelGroupMap = parentNodeList.stream().collect(Collectors.groupingBy(AppSceneCostStandardDetail::getLevel)); - TreeMap> levelTreeMap = new TreeMap<>(levelGroupMap); - parentDataMap = levelTreeMap.firstEntry().getValue().stream().collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); + Map> levelGroupMap = new HashMap<>(); + if (parentNodeList != null && parentNodeList.size() > 0) { + levelGroupMap = parentNodeList.stream().filter(s->s.getLevel()!=null).collect(Collectors.groupingBy(AppSceneCostStandardDetail::getLevel)); + TreeMap> levelTreeMap = new TreeMap<>(levelGroupMap); + parentDataMap = levelTreeMap.firstEntry().getValue().stream().filter(s->s.getMaterialNumber()!=null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); + } } //查询所有父节点下的子节点(即第二层叶子节点) List costStandardDetails = new ArrayList<>(); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java index 864b679..f43c06c 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java @@ -16,7 +16,17 @@ public class BomTreeBuilder { return result; } //1.把BOM信息分成按照物料号分组 - Map materialMap = sourceData.stream().filter(s -> s.getMaterialNumber() != null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); + Map materialMap = sourceData.stream().filter(s->s.getMaterialNumber()!=null) + .collect(Collectors.toMap( + // Key extractor + AppSceneCostStandardDetail::getMaterialNumber, + // Value mapper + detail -> detail, + // Merger function to handle duplicates + (existing, replacement) -> existing + )); + +// Map materialMap = sourceData.stream().filter(s -> s.getMaterialNumber() != null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); //查找最顶端的父类节点 if (parentDataMap == null || (parentDataMap != null && parentDataMap.size() < 1)) { parentDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() == null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); From fd86a96a6d4b14fed3d1c88e99bfb286c72d5c4d Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Sun, 8 Sep 2024 16:21:58 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90bom?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E5=BA=8F=E3=80=81=E9=87=87=E8=B4=AD=E4=BB=B7?= =?UTF-8?q?=E3=80=81=E7=89=88=E6=9C=AC=E5=8F=B7mapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 23 ++- qomo-kn-cost-manage/pom.xml | 16 ++ .../AppSceneCostBomRelevancyController.java | 159 ++++++++++++++++++ ...stProductProcessMaintenanceController.java | 159 ++++++++++++++++++ .../AppSceneCostPurchaseRecordController.java | 159 ++++++++++++++++++ ...AppSceneCostStandardVersionController.java | 10 +- .../entity/AppSceneCostBomRelevancy.java | 87 ++++++++++ ...AppSceneCostProductProcessMaintenance.java | 111 ++++++++++++ .../entity/AppSceneCostPurchaseRecord.java | 94 +++++++++++ .../entity/AppSceneCostStandardVersion.java | 112 ++++++++---- .../AppSceneCostBomRelevancyMapper.java | 17 ++ ...neCostProductProcessMaintenanceMapper.java | 17 ++ .../AppSceneCostPurchaseRecordMapper.java | 15 ++ .../AppSceneCostStandardVersionMapper.java | 6 +- .../xml/AppSceneCostBomRelevancyMapper.xml | 5 + ...eneCostProductProcessMaintenanceMapper.xml | 5 + .../xml/AppSceneCostPurchaseRecordMapper.xml | 5 + .../IAppSceneCostBomRelevancyService.java | 14 ++ ...eCostProductProcessMaintenanceService.java | 14 ++ .../IAppSceneCostPurchaseRecordService.java | 14 ++ .../AppSceneCostBomRelevancyServiceImpl.java | 19 +++ .../impl/AppSceneCostCountServiceImpl.java | 4 +- ...tProductProcessMaintenanceServiceImpl.java | 19 +++ ...AppSceneCostPurchaseRecordServiceImpl.java | 18 ++ 24 files changed, 1047 insertions(+), 55 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java diff --git a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml index 18a44f0..121138b 100644 --- a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml +++ b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml @@ -15,7 +15,7 @@ v2: defaultFormat: .png server: - port: 8098 + port: 8099 tomcat: max-swallow-size: -1 error: @@ -211,9 +211,9 @@ spring: # password: knphm2021 # driver-class-name: com.mysql.cj.jdbc.Driver master: - url: jdbc:mysql://158.158.4.51:13306/kn_otd_app?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false - username: knotd - password: otd@2024 + url: jdbc:mysql://158.158.4.51:3386/kn_energy_cost?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false + username: root + password: knEnergyCost0826# driver-class-name: com.mysql.cj.jdbc.Driver # 多数据源配置 #multi-datasource1: @@ -222,16 +222,23 @@ spring: #password: root #driver-class-name: com.mysql.cj.jdbc.Driver #redis 配置 - redis: +# redis: # database: 5 # host: 121.40.189.20 # port: 6389 + redis: database: 9 host: 192.168.50.9 port: 7379 password: 'zzboard' main: allow-circular-references: true +# redis: +# database: 10 +# host: localhost +# port: 6379 +# main: +# allow-circular-references: true #rabbitmq 配置 rabbitmq: @@ -265,6 +272,8 @@ mybatis-plus: # log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # 返回类型为Map,显示null对应的字段 call-setters-on-nulls: true + security: + enabled: false #jeecg专用配置 minidao: base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.* @@ -287,8 +296,8 @@ jeecg: #webapp文件路径 webapp: /opt/webapp shiro: -# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** - excludeUrls: /**/**,/**/**/** + excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** + # excludeUrls: /**/**,/**/**/** #阿里云oss存储和大鱼短信秘钥配置 oss: diff --git a/qomo-kn-cost-manage/pom.xml b/qomo-kn-cost-manage/pom.xml index 7fa2ad8..827b04f 100644 --- a/qomo-kn-cost-manage/pom.xml +++ b/qomo-kn-cost-manage/pom.xml @@ -13,6 +13,7 @@ org.qomo.boot qomo-system-biz + 2.0.1-SNAPSHOT com.google.auto.service @@ -22,6 +23,21 @@ com.zzsmart.qomo qomo-data-integration + + + com.zzsmart.hdp.hive + hive-jdbc + + + + + com.zzsmart.hdp.hive + hive-jdbc + 2.6.5.0-292 + + + com.zzsmart.qomo + qomo-data-selfReport \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java new file mode 100644 index 0000000..0e806cb --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Api(tags = "app_scene_cost_bom_relevancy") +@RestController +@RequestMapping("//appSceneCostBomRelevancy") +@Slf4j +public class AppSceneCostBomRelevancyController extends JeecgController { + @Autowired + private IAppSceneCostBomRelevancyService appSceneCostBomRelevancyService; + + /** + * 分页列表查询 + * + * @param appSceneCostBomRelevancy + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_bom_relevancy-分页列表查询") + @ApiOperation(value = "app_scene_cost_bom_relevancy-分页列表查询", notes = "app_scene_cost_bom_relevancy-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostBomRelevancy appSceneCostBomRelevancy, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostBomRelevancy, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostBomRelevancyService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostBomRelevancy + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-添加") + @ApiOperation(value = "app_scene_cost_bom_relevancy-添加", notes = "app_scene_cost_bom_relevancy-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostBomRelevancy appSceneCostBomRelevancy) { + appSceneCostBomRelevancyService.save(appSceneCostBomRelevancy); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostBomRelevancy + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-编辑") + @ApiOperation(value = "app_scene_cost_bom_relevancy-编辑", notes = "app_scene_cost_bom_relevancy-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostBomRelevancy appSceneCostBomRelevancy) { + appSceneCostBomRelevancyService.updateById(appSceneCostBomRelevancy); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-通过id删除") + @ApiOperation(value = "app_scene_cost_bom_relevancy-通过id删除", notes = "app_scene_cost_bom_relevancy-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostBomRelevancyService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-批量删除") + @ApiOperation(value = "app_scene_cost_bom_relevancy-批量删除", notes = "app_scene_cost_bom_relevancy-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostBomRelevancyService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_bom_relevancy-通过id查询") + @ApiOperation(value = "app_scene_cost_bom_relevancy-通过id查询", notes = "app_scene_cost_bom_relevancy-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostBomRelevancy appSceneCostBomRelevancy = appSceneCostBomRelevancyService.getById(id); + if (appSceneCostBomRelevancy == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostBomRelevancy); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostBomRelevancy + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostBomRelevancy appSceneCostBomRelevancy) { + return super.exportXls(request, appSceneCostBomRelevancy, AppSceneCostBomRelevancy.class, "app_scene_cost_bom_relevancy"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostBomRelevancy.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java new file mode 100644 index 0000000..8d64974 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostProductProcessMaintenanceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +//@Api(tags = "app_scene_cost_product_process_maintenance") +@RestController +@RequestMapping("//appSceneCostProductProcessMaintenance") +@Slf4j +public class AppSceneCostProductProcessMaintenanceController extends JeecgController { + @Autowired + private IAppSceneCostProductProcessMaintenanceService appSceneCostProductProcessMaintenanceService; + + /** + * 分页列表查询 + * + * @param appSceneCostProductProcessMaintenance + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_product_process_maintenance-分页列表查询") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-分页列表查询", notes = "app_scene_cost_product_process_maintenance-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostProductProcessMaintenance, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostProductProcessMaintenanceService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostProductProcessMaintenance + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-添加") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-添加", notes = "app_scene_cost_product_process_maintenance-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance) { + appSceneCostProductProcessMaintenanceService.save(appSceneCostProductProcessMaintenance); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostProductProcessMaintenance + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-编辑") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-编辑", notes = "app_scene_cost_product_process_maintenance-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance) { + appSceneCostProductProcessMaintenanceService.updateById(appSceneCostProductProcessMaintenance); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-通过id删除") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-通过id删除", notes = "app_scene_cost_product_process_maintenance-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostProductProcessMaintenanceService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-批量删除") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-批量删除", notes = "app_scene_cost_product_process_maintenance-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostProductProcessMaintenanceService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_product_process_maintenance-通过id查询") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-通过id查询", notes = "app_scene_cost_product_process_maintenance-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance = appSceneCostProductProcessMaintenanceService.getById(id); + if (appSceneCostProductProcessMaintenance == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostProductProcessMaintenance); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostProductProcessMaintenance + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance) { + return super.exportXls(request, appSceneCostProductProcessMaintenance, AppSceneCostProductProcessMaintenance.class, "app_scene_cost_product_process_maintenance"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostProductProcessMaintenance.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java new file mode 100644 index 0000000..03d8c1c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +//@Api(tags = "app_scene_cost_purchase_record") +@RestController +@RequestMapping("//appSceneCostPurchaseRecord") +@Slf4j +public class AppSceneCostPurchaseRecordController extends JeecgController { + @Autowired + private IAppSceneCostPurchaseRecordService appSceneCostPurchaseRecordService; + + /** + * 分页列表查询 + * + * @param appSceneCostPurchaseRecord + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_purchase_record-分页列表查询") + @ApiOperation(value = "app_scene_cost_purchase_record-分页列表查询", notes = "app_scene_cost_purchase_record-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostPurchaseRecord appSceneCostPurchaseRecord, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchaseRecord, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostPurchaseRecordService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostPurchaseRecord + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-添加") + @ApiOperation(value = "app_scene_cost_purchase_record-添加", notes = "app_scene_cost_purchase_record-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostPurchaseRecord appSceneCostPurchaseRecord) { + appSceneCostPurchaseRecordService.save(appSceneCostPurchaseRecord); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostPurchaseRecord + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-编辑") + @ApiOperation(value = "app_scene_cost_purchase_record-编辑", notes = "app_scene_cost_purchase_record-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostPurchaseRecord appSceneCostPurchaseRecord) { + appSceneCostPurchaseRecordService.updateById(appSceneCostPurchaseRecord); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-通过id删除") + @ApiOperation(value = "app_scene_cost_purchase_record-通过id删除", notes = "app_scene_cost_purchase_record-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostPurchaseRecordService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-批量删除") + @ApiOperation(value = "app_scene_cost_purchase_record-批量删除", notes = "app_scene_cost_purchase_record-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostPurchaseRecordService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_purchase_record-通过id查询") + @ApiOperation(value = "app_scene_cost_purchase_record-通过id查询", notes = "app_scene_cost_purchase_record-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostPurchaseRecord appSceneCostPurchaseRecord = appSceneCostPurchaseRecordService.getById(id); + if (appSceneCostPurchaseRecord == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostPurchaseRecord); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostPurchaseRecord + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchaseRecord appSceneCostPurchaseRecord) { + return super.exportXls(request, appSceneCostPurchaseRecord, AppSceneCostPurchaseRecord.class, "app_scene_cost_purchase_record"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostPurchaseRecord.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java index d2554d7..6bfa100 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java @@ -7,18 +7,16 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; /** * @Description: app_scene_cost_standard_version diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java new file mode 100644 index 0000000..a26363e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java @@ -0,0 +1,87 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_bom_relevancy") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="app_scene_cost_bom_relevancy对象", description="app_scene_cost_bom_relevancy") +public class AppSceneCostBomRelevancy implements Serializable { + private static final long serialVersionUID = 1L; + + /**父物料号*/ + @Excel(name = "父物料号", width = 15) + @ApiModelProperty(value = "父物料号") + private String matnr; + /**版本号*/ + @Excel(name = "版本号", width = 15) + @ApiModelProperty(value = "版本号") + private String versionNumber; + /**posnr*/ + @Excel(name = "posnr", width = 15) + @ApiModelProperty(value = "posnr") + private String posnr; + /**工厂*/ + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String werks; + /**bmeng*/ + @Excel(name = "bmeng", width = 15) + @ApiModelProperty(value = "bmeng") + private BigDecimal bmeng; + /**stlan*/ + @Excel(name = "stlan", width = 15) + @ApiModelProperty(value = "stlan") + private String stlan; + /**antxt*/ + @Excel(name = "antxt", width = 15) + @ApiModelProperty(value = "antxt") + private String antxt; + /**子物料号*/ + @Excel(name = "子物料号", width = 15) + @ApiModelProperty(value = "子物料号") + private String idnrk; + /**领用量*/ + @Excel(name = "领用量", width = 15) + @ApiModelProperty(value = "领用量") + private String meins; + /**menge*/ + @Excel(name = "menge", width = 15) + @ApiModelProperty(value = "menge") + private BigDecimal menge; + /**ausch*/ + @Excel(name = "ausch", width = 15) + @ApiModelProperty(value = "ausch") + private BigDecimal ausch; + /**datuv*/ + @Excel(name = "datuv", width = 15) + @ApiModelProperty(value = "datuv") + private String datuv; + /**potx1*/ + @Excel(name = "potx1", width = 15) + @ApiModelProperty(value = "potx1") + private String potx1; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java new file mode 100644 index 0000000..2e02a03 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java @@ -0,0 +1,111 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_product_process_maintenance") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="app_scene_cost_product_process_maintenance对象", description="app_scene_cost_product_process_maintenance") +public class AppSceneCostProductProcessMaintenance implements Serializable { + private static final long serialVersionUID = 1L; + + /**工厂*/ + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String factory; + /**物料号*/ + @Excel(name = "物料号", width = 15) + @ApiModelProperty(value = "物料号") + private String mainPartNumber; + /**工序编号*/ + @Excel(name = "工序编号", width = 15) + @ApiModelProperty(value = "工序编号") + private String processRouteNumber; + /**序号*/ + @Excel(name = "序号", width = 15) + @ApiModelProperty(value = "序号") + private String serialNumber; + /**工序名称*/ + @Excel(name = "工序名称", width = 15) + @ApiModelProperty(value = "工序名称") + private String processName; + /**成本中心*/ + @Excel(name = "成本中心", width = 15) + @ApiModelProperty(value = "成本中心") + private String costCenterCode; + /**准备工时*/ + @Excel(name = "准备工时", width = 15) + @ApiModelProperty(value = "准备工时") + private BigDecimal prepareHour; + /**人工工时*/ + @Excel(name = "人工工时", width = 15) + @ApiModelProperty(value = "人工工时") + private BigDecimal laborHour; + /**设备工时*/ + @Excel(name = "设备工时", width = 15) + @ApiModelProperty(value = "设备工时") + private BigDecimal machineHour; + /**燃动工时*/ + @Excel(name = "燃动工时", width = 15) + @ApiModelProperty(value = "燃动工时") + private BigDecimal burningHour; + /**辅料工时*/ + @Excel(name = "辅料工时", width = 15) + @ApiModelProperty(value = "辅料工时") + private BigDecimal auxiliaryHour; + /**其他工时*/ + @Excel(name = "其他工时", width = 15) + @ApiModelProperty(value = "其他工时") + private BigDecimal otherHour; + /**hourType*/ + @Excel(name = "hourType", width = 15) + @ApiModelProperty(value = "hourType") + private String hourType; + /**版本号*/ + @Excel(name = "版本号", width = 15) + @ApiModelProperty(value = "版本号") + private String versionNumber; + /**guardian*/ + @Excel(name = "guardian", width = 15) + @ApiModelProperty(value = "guardian") + private String guardian; + /**maintenanceTime*/ + @Excel(name = "maintenanceTime", width = 15) + @ApiModelProperty(value = "maintenanceTime") + private String maintenanceTime; + /**reserve1*/ + @Excel(name = "reserve1", width = 15) + @ApiModelProperty(value = "reserve1") + private String reserve1; + /**reserve2*/ + @Excel(name = "reserve2", width = 15) + @ApiModelProperty(value = "reserve2") + private BigDecimal reserve2; + /**jobCode*/ + @Excel(name = "jobCode", width = 15) + @ApiModelProperty(value = "jobCode") + private String jobCode; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java new file mode 100644 index 0000000..3c963ae --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java @@ -0,0 +1,94 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_purchase_record") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_purchase_record对象", description = "app_scene_cost_purchase_record") +public class AppSceneCostPurchaseRecord implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 工厂 + */ + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String werks; + /** + * 组织 + */ + @Excel(name = "组织", width = 15) + @ApiModelProperty(value = "组织") + private String ekorg; + /** + * 物料号 + */ + @Excel(name = "物料号", width = 15) + @ApiModelProperty(value = "物料号") + private String infnr; + /** + * 供应商代码 + */ + @Excel(name = "供应商代码", width = 15) + @ApiModelProperty(value = "供应商代码") + private String lifnr; + /** + * esokz + */ + @Excel(name = "esokz", width = 15) + @ApiModelProperty(value = "esokz") + private String esokz; + /** + * 单价 + */ + @Excel(name = "单价", width = 15) + @ApiModelProperty(value = "单价") + private BigDecimal netpr; + /** + * 币种 + */ + @Excel(name = "币种", width = 15) + @ApiModelProperty(value = "币种") + private String waers; + /** + * 有效截止时间 + */ + @Excel(name = "有效截止时间", width = 15) + @ApiModelProperty(value = "有效截止时间") + private String prdat; + /** + * 有效开始时间 + */ + @Excel(name = "有效开始时间", width = 15) + @ApiModelProperty(value = "有效开始时间") + private String erdat; + /** + * ukurs + */ + @Excel(name = "ukurs", width = 15) + @ApiModelProperty(value = "ukurs") + private BigDecimal ukurs; + /** + * 人名币单价 + */ + @Excel(name = "人名币单价", width = 15) + @ApiModelProperty(value = "人名币单价") + private BigDecimal cnyPrice; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java index 62692e6..d686996 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java @@ -19,7 +19,7 @@ import java.util.Date; /** * @Description: app_scene_cost_standard_version * @Author: jeecg-boot - * @Date: 2024-08-02 + * @Date: 2024-09-08 * @Version: V1.0 */ @Data @@ -32,71 +32,111 @@ public class AppSceneCostStandardVersion implements Serializable { private static final long serialVersionUID = 1L; /** - * id + * 主键id */ @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "id") - private String id; + @ApiModelProperty(value = "主键id") + private Integer id; /** - * 图号 + * 项目名称 */ - @Excel(name = "图号", width = 15) - @ApiModelProperty(value = "图号") - private String figureNumber; + @Excel(name = "项目名称", width = 15) + @ApiModelProperty(value = "项目名称") + private String projectname; /** - * 阶段,A-初始,B-首批,C-量产 + * 阶段 */ - @Excel(name = "阶段,A-初始,B-首批,C-量产", width = 15) - @ApiModelProperty(value = "阶段,A-初始,B-首批,C-量产") + @Excel(name = "阶段", width = 15) + @ApiModelProperty(value = "阶段") private String stage; /** - * 物料号,关联kn_new_sap_mara表matnr字段 + * 日期 */ - @Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15) - @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段") - private String materialNumber; + @Excel(name = "日期", width = 15) + @ApiModelProperty(value = "日期") + private String date; /** * 版本号 */ @Excel(name = "版本号", width = 15) @ApiModelProperty(value = "版本号") - private String versionNumber; + private String version; /** - * 版本状态 + * 工厂 */ - @Excel(name = "版本状态", width = 15) - @ApiModelProperty(value = "版本状态") - private String versionStatus; + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String werks; /** - * 创建人 + * 物料号 */ - @ApiModelProperty(value = "创建人") - private String createBy; + @Excel(name = "物料号", width = 15) + @ApiModelProperty(value = "物料号") + private String matnr; + /** + * 状态 + */ + @Excel(name = "状态", width = 15) + @ApiModelProperty(value = "状态") + private String status; /** * 创建时间 */ + @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") - private Date createTime; + private Date createdtime; /** - * 修改人 - */ - @ApiModelProperty(value = "修改人") - private String updateBy; - /** - * 修改时间 + * 完成时间 */ + @Excel(name = "完成时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "修改时间") - private Date updateTime; + @ApiModelProperty(value = "完成时间") + private Date finishtime; /** - * 备注 + * batchname */ - @Excel(name = "备注", width = 15) - @ApiModelProperty(value = "备注") - private String remark; + @Excel(name = "batchname", width = 15) + @ApiModelProperty(value = "batchname") + private String batchname; + /** + * userid + */ + @Excel(name = "userid", width = 15) + @ApiModelProperty(value = "userid") + private Integer userid; + /** + * 图号 + */ + @Excel(name = "图号", width = 15) + @ApiModelProperty(value = "图号") + private String graphicnumber; + /** + * projectpspid + */ + @Excel(name = "projectpspid", width = 15) + @ApiModelProperty(value = "projectpspid") + private String projectpspid; + /** + * projectcate + */ + @Excel(name = "projectcate", width = 15) + @ApiModelProperty(value = "projectcate") + private String projectcate; + /** + * keylost + */ + @Excel(name = "keylost", width = 15) + @ApiModelProperty(value = "keylost") + private Integer keylost; + /** + * mknum + */ + @Excel(name = "mknum", width = 15) + @ApiModelProperty(value = "mknum") + private Integer mknum; /** * 年份 */ diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java new file mode 100644 index 0000000..b4a85d8 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java @@ -0,0 +1,17 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import java.util.List; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface AppSceneCostBomRelevancyMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java new file mode 100644 index 0000000..7c75270 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java @@ -0,0 +1,17 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import java.util.List; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface AppSceneCostProductProcessMaintenanceMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java new file mode 100644 index 0000000..d78e4ea --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java @@ -0,0 +1,15 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; + + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface AppSceneCostPurchaseRecordMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java index e25bd53..6489601 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java @@ -1,15 +1,13 @@ package com.zzsmart.qomo.kn.cost.manage.mapper; -import java.util.List; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; -import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; /** * @Description: app_scene_cost_standard_version * @Author: jeecg-boot - * @Date: 2024-08-02 + * @Date: 2024-09-08 * @Version: V1.0 */ public interface AppSceneCostStandardVersionMapper extends BaseMapper { diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml new file mode 100644 index 0000000..4d8a366 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml new file mode 100644 index 0000000..997c398 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml new file mode 100644 index 0000000..52fce70 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java new file mode 100644 index 0000000..bad9322 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface IAppSceneCostBomRelevancyService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java new file mode 100644 index 0000000..76ce058 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface IAppSceneCostProductProcessMaintenanceService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java new file mode 100644 index 0000000..ce23c84 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface IAppSceneCostPurchaseRecordService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java new file mode 100644 index 0000000..a9b0247 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java @@ -0,0 +1,19 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Service +public class AppSceneCostBomRelevancyServiceImpl extends ServiceImpl implements IAppSceneCostBomRelevancyService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java index bbe9ab3..52198a1 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -102,11 +102,11 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl implements IAppSceneCostProductProcessMaintenanceService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java new file mode 100644 index 0000000..1a4d138 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java @@ -0,0 +1,18 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseRecordMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService; +import org.springframework.stereotype.Service; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Service +public class AppSceneCostPurchaseRecordServiceImpl extends ServiceImpl implements IAppSceneCostPurchaseRecordService { + +} From 734414f3ba3557f05fb153600c3c530c663cbc7f Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Fri, 13 Sep 2024 19:57:57 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E3=80=82=E4=BC=98=E5=8C=96=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppSceneCostModelController.java | 62 +++++++++-- .../cost/manage/entity/AppSceneCostModel.java | 103 ++++++++++-------- .../manage/enums/CostModelStatusEnum.java | 65 +++++++++++ .../manage/plugin/StandardCostService.java | 2 +- .../cost/manage/vo/CostModelDefinitionVO.java | 45 ++++++++ 5 files changed, 223 insertions(+), 54 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java index fc5d5e4..1018688 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java @@ -5,12 +5,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzsmart.qomo.dao.entity.FlowDefinition; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel; +import com.zzsmart.qomo.kn.cost.manage.enums.CostModelStatusEnum; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostModelMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService; +import com.zzsmart.qomo.kn.cost.manage.vo.CostModelDefinitionVO; import com.zzsmart.qomo.service.IDataFlowDefinitionService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.query.QueryGenerator; @@ -20,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.List; +import java.util.Random; /** * @Description: app_scene_cost_model @@ -36,7 +42,10 @@ public class AppSceneCostModelController { private IAppSceneCostModelService appSceneCostModelService; @Autowired private IDataFlowDefinitionService flowDefinitionService; - + @Autowired + private AppSceneCostCountMapper appSceneCostCountMapper; + @Autowired + private AppSceneCostModelMapper costModelMapper; /** * 标准成本模型分页列表查询 * @@ -71,17 +80,41 @@ public class AppSceneCostModelController { /** * 添加标准成本模型 * - * @param flowDefinition + * @param modelDefinitionVO * @return */ @AutoLog(value = "app_scene_cost_model-添加") @ApiOperation(value = "app_scene_cost_model-添加", notes = "app_scene_cost_model-添加") @PostMapping(value = "/add") - public Result add(@RequestBody FlowDefinition flowDefinition) { - flowDefinition.setCreateTime(new Date()); - flowDefinition.setUpdateTime(new Date()); - FlowDefinition definition = flowDefinitionService.add(flowDefinition); - return Result.OK(definition); + public Result add(@RequestBody CostModelDefinitionVO modelDefinitionVO) { + try { + FlowDefinition flowDefinition = new FlowDefinition(); + //TODO 新增平台层模型定义记录 + String flowCode = "FLOW_" + System.currentTimeMillis() + new Random(10000).nextInt(); + flowDefinition.setUpdateTime(new Date()); + flowDefinition.setCreateTime(new Date()); + flowDefinition.setCode(flowCode); + flowDefinition.setProjectId(modelDefinitionVO.getProjectId()); + flowDefinition.setUserId("1744546658109349889"); + flowDefinition.setUserName("系统管理员"); + flowDefinition.setTenantId(-1); + flowDefinition.setEnvironmentId(1); + flowDefinition.setName(modelDefinitionVO.getModelName()); + FlowDefinition definition = flowDefinitionService.add(flowDefinition); + AppSceneCostModel forecastModel = new AppSceneCostModel(); + forecastModel.setModelType(modelDefinitionVO.getModelType()); + forecastModel.setModelName(modelDefinitionVO.getModelName()); + forecastModel.setStatus(CostModelStatusEnum.Draft.getCode()); + //2.新模型记录 + forecastModel.setFlowDefinitionId(definition.getId()); + forecastModel.setUpdateTime(new Date()); + forecastModel.setCreateTime(new Date()); + costModelMapper.insert(forecastModel); + + } catch (Exception e) { + return Result.error("新增失败"); + } + return Result.OK("新增成功"); } /** @@ -108,6 +141,19 @@ public class AppSceneCostModelController { @ApiOperation(value = "app_scene_cost_model-通过id删除", notes = "app_scene_cost_model-通过id删除") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name = "id", required = true) Integer id) { + //检查模型是否被引用或挂载 + if (id != null) { + FlowDefinition flowDefinition = flowDefinitionService.getById(id); + if (flowDefinition != null) { + Integer id1 = flowDefinition.getId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("flow_definition_id", id1); + Long aLong = appSceneCostCountMapper.selectCount(queryWrapper); + if (aLong > 0) { + return Result.error("该模型正在被引用,无法删除!"); + } + } + } flowDefinitionService.delete(id); return Result.OK("删除成功!"); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java index a80a2fd..50700f6 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java @@ -1,75 +1,88 @@ package com.zzsmart.qomo.kn.cost.manage.entity; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableLogic; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; +import lombok.*; import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; /** * @Description: app_scene_cost_model * @Author: jeecg-boot - * @Date: 2024-07-29 + * @Date: 2024-09-09 * @Version: V1.0 */ @Data +@Builder +@AllArgsConstructor +@NoArgsConstructor @TableName("app_scene_cost_model") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="app_scene_cost_model对象", description="app_scene_cost_model") +@ApiModel(value = "app_scene_cost_model对象", description = "app_scene_cost_model") public class AppSceneCostModel implements Serializable { private static final long serialVersionUID = 1L; - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键") private Integer id; - /**物料编号*/ - @Excel(name = "物料编号", width = 15) - @ApiModelProperty(value = "物料编号") - private String materialNo; - /**图号*/ - @Excel(name = "图号", width = 15) - @ApiModelProperty(value = "图号") - private String drawingNo; - /**标准成本计算流程id*/ - @Excel(name = "标准成本计算流程id", width = 15) - @ApiModelProperty(value = "标准成本计算流程id") + /** + * 模型名称 + */ + @Excel(name = "模型名称", width = 15) + @ApiModelProperty(value = "模型名称") + private String modelName; + /** + * 模型类型(标准成本、成本挖掘) + */ + @Excel(name = "模型类型(标准成本、成本挖掘)", width = 15) + @ApiModelProperty(value = "模型类型(标准成本、成本挖掘)") + private String modelType; + /** + * 模型定义id + */ + @Excel(name = "模型定义id", width = 15) + @ApiModelProperty(value = "模型定义id") private Integer flowDefinitionId; - /**状态*/ - @Excel(name = "状态", width = 15) - @ApiModelProperty(value = "状态") - private Integer status; - /**模型版本*/ - @Excel(name = "模型版本", width = 15) - @ApiModelProperty(value = "模型版本") - private String modelVersion; - /**创建人*/ - @ApiModelProperty(value = "创建人") - private Integer createBy; - /**创建时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 状态(草稿、已发布、已作废) + */ + @Excel(name = "状态(草稿、已发布、已作废)", width = 15) + @ApiModelProperty(value = "状态(草稿、已发布、已作废)") + private String status; + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") private Date createTime; - /**更新人*/ - @ApiModelProperty(value = "更新人") - private Integer updateBy; - /**更新时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private String createBy; + /** + * 更新时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新时间") private Date updateTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private String updateBy; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java new file mode 100644 index 0000000..08609fa --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java @@ -0,0 +1,65 @@ +package com.zzsmart.qomo.kn.cost.manage.enums; + +/** + * 预测模型状态枚举 + */ +public enum CostModelStatusEnum { + /** + * 草稿 + */ + Draft("Draft", "草稿"), + /** + * 已删除 + */ + Delete("Deleted", "已删除"), + /** + * 已发布 + */ + Published("Published", "已发布"); + + private final String code; + private final String name; + + CostModelStatusEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + /** + * 根据code获取text + * + * @param codeNo + * @return + */ + public static String getTextByCode(String codeNo) { + for (CostModelStatusEnum value : CostModelStatusEnum.values()) { + if (value.getCode().equals(codeNo)) { + return value.name(); + } + } + return codeNo.toString(); + } + + /** + * 根据text获取code + * + * @param name + * @return + */ + public static String getCodeByName(String name) { + for (CostModelStatusEnum value : CostModelStatusEnum.values()) { + if (value.name().equals(name)) { + return value.name(); + } + } + return name; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 33673e8..1f5fd9a 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -478,7 +478,7 @@ public class StandardCostService { //获取最上层的物料号 String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); //获取任务类型 - String taskType = parameters.getTaskType(); + String taskType = parameters.getTaksType(); //获取任务代码 String taskCode = flowTaskInfoVO.getTaskCode(); //获取流程id diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java new file mode 100644 index 0000000..35bf7b9 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java @@ -0,0 +1,45 @@ +package com.zzsmart.qomo.kn.cost.manage.vo; + +import com.zzsmart.qomo.common.enums.ReleaseState; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 模型信息封装 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class CostModelDefinitionVO extends AppSceneCostModel { + @ApiModelProperty("encoding") + private String code; + @ApiModelProperty("flow definition name") + private String name; + @ApiModelProperty("flow definition version") + private Integer version; + @ApiModelProperty("flow definition release state: 0:offline,1:online") + private ReleaseState releaseState; + @ApiModelProperty("定时调度表达式") + private String scheduleCron; + @ApiModelProperty("任务调度模式(1任务队列领取模式(推荐) 2所有集群服务器均可同时运行 3只有主服务器可运行(主服务器失败时其他服务器接管) 4由调度服务器统一调度)") + private Integer scheduleMode; + @ApiModelProperty("依赖周期(分钟)") + private Integer dependencyCycle; + @ApiModelProperty("在任务队列模式下可以根据任务重要性来领取任务(10为最高)") + private Integer taskImportance; + @ApiModelProperty("运行方式(0 禁用 1手动触发 2定时自动调度 3依赖上级流程)") + private Integer runMode; + @ApiModelProperty("project id") + private Integer projectId; + @ApiModelProperty("project code") + private String projectCode; + @ApiModelProperty("环境配置ID") + private Integer environmentId; + @ApiModelProperty("租户ID") + private Integer tenantId; +} From 1eb6e5915ec39e47bd63088d9129dd2a53c401be Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Sat, 14 Sep 2024 18:35:25 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=E8=BF=9B=E8=A1=8C=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/plugin/StandardCostService.java | 12 +--- .../impl/AppSceneCostCountServiceImpl.java | 69 +++++++++++++++---- 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 1f5fd9a..6e5e59d 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -110,15 +110,7 @@ public class StandardCostService { //1.查询出所有满足物料编号的物料(BOM物料) String sql = flowTaskInfoVO.getSqlString(); log.info("传递过来的SQL语句:" + sql); - //TODO 查询最顶部的BOM物料编号下所有的物料并进行层级排序 - List list = standardCostService.costMaterialBomService.queryAllBomInfoBytopMaterialCode(topMaterialCode); - log.info("Full EmptyTask list: {}", list); - //2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code) - for (int i = 0; list != null && i < list.size(); i++) { - AppSceneCostMaterialBom material = list.get(i); - AppSceneCostResultValue appSceneCostResultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(material.getMaterialCode()).parentMarterialNo(material.getParentMaterialCode()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).num(material.getNumber()).build(); - standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue); - } + } catch (Exception e) { throw new RuntimeException(e); } @@ -478,7 +470,7 @@ public class StandardCostService { //获取最上层的物料号 String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); //获取任务类型 - String taskType = parameters.getTaksType(); + String taskType = parameters.getTaskType(); //获取任务代码 String taskCode = flowTaskInfoVO.getTaskCode(); //获取流程id diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java index 52198a1..b90efaf 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -1,19 +1,23 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.zzsmart.qomo.dao.entity.FlowDefinition; +import com.zzsmart.qomo.dao.entity.FlowInstance; +import com.zzsmart.qomo.dao.entity.FlowInstanceParameter; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper; +import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; -import com.zzsmart.qomo.service.IDataFlowDefinitionService; import com.zzsmart.qomo.service.IDataFlowInstanceService; +import com.zzsmart.qomo.service.IFlowInstanceParameterService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,7 +38,11 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl