From 7f8f31100ae6564ac8bbf59656e333ed6d6e6943 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Tue, 23 Jul 2024 17:33:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=87=E5=87=86=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E8=AE=A1=E7=AE=97=E6=B5=81=E7=A8=8B=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/QomoCostManageApplication.java | 10 +- qomo-kn-cost-manage/pom.xml | 1 + .../AppSceneCostResultValueController.java | 179 ++++++++++++++++++ .../entity/AppSceneCostResultValue.java | 75 ++++++++ .../mapper/AppSceneCostResultValueMapper.java | 15 ++ .../manage/mapper/CostMaterialBomMapper.java | 17 +- .../xml/AppSceneCostResultValueMapper.xml | 5 + .../plugin/laborcost/LaborCostParameters.java | 51 +++++ .../plugin/laborcost/LaborCostTask.java | 71 +++++++ .../laborcost/LaborCostTaskChannel.java | 52 +++++ .../LaborCostTaskChannelFactory.java | 44 +++++ .../ManufacturingCostParameters.java | 51 +++++ .../ManufacturingCostTask.java | 76 ++++++++ .../ManufacturingCostTaskChannel.java | 52 +++++ .../ManufacturingCostTaskChannelFactory.java | 44 +++++ .../materialcost/MaterialCostParameters.java | 51 +++++ .../plugin/materialcost/MaterialCostTask.java | 76 ++++++++ .../materialcost/MaterialCostTaskChannel.java | 52 +++++ .../MaterialCostTaskChannelFactory.java | 44 +++++ .../MaterialInputParameters.java | 51 +++++ .../materialinput/MaterialInputTask.java | 74 ++++++++ .../MaterialInputTaskChannel.java | 52 +++++ .../MaterialInputTaskChannelFactory.java | 44 +++++ .../materialinput/StandardCostService.java | 91 +++++++++ .../standardcost/StandardCostParameters.java | 51 +++++ .../plugin/standardcost/StandardCostTask.java | 72 +++++++ .../standardcost/StandardCostTaskChannel.java | 52 +++++ .../StandardCostTaskChannelFactory.java | 44 +++++ .../IAppSceneCostResultValueService.java | 14 ++ .../AppSceneCostResultValueServiceImpl.java | 20 ++ .../qomo/kn/cost/manage/ApplicationTests.java | 127 ++++++------- 31 files changed, 1582 insertions(+), 76 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/StandardCostService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java diff --git a/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java b/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java index c20c2fb..d68a8dc 100644 --- a/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java +++ b/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java @@ -2,6 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.util.oConvertUtils; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; @@ -14,11 +15,12 @@ import java.net.InetAddress; import java.net.UnknownHostException; /** -* 单体启动类 -* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class} -*/ + * 单体启动类 + * 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class} + */ @Slf4j -@SpringBootApplication (scanBasePackages ={"org.jeecg", "com.zzsmart.qomo"}) +@SpringBootApplication(scanBasePackages = {"org.jeecg", "com.zzsmart.qomo"}) +//@MapperScan({"com.zzsmart.qomo.kn.cost.manage.mapper"}) //@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class}) @EnableAsync public class QomoCostManageApplication extends SpringBootServletInitializer { diff --git a/qomo-kn-cost-manage/pom.xml b/qomo-kn-cost-manage/pom.xml index 1e4276b..7e5a041 100644 --- a/qomo-kn-cost-manage/pom.xml +++ b/qomo-kn-cost-manage/pom.xml @@ -56,5 +56,6 @@ 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/AppSceneCostResultValueController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java new file mode 100644 index 0000000..fecbd6a --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java @@ -0,0 +1,179 @@ +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.AppSceneCostResultValue; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService; +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: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-23 + * @Version: V1.0 + */ +@Api(tags="app_scene_cost_result_value") +@RestController +@RequestMapping("/com.zzsmart.qomo.kn.cost.manage/appSceneCostResultValue") +@Slf4j +public class AppSceneCostResultValueController extends JeecgController { + @Autowired + private IAppSceneCostResultValueService appSceneCostResultValueService; + + /** + * 分页列表查询 + * + * @param appSceneCostResultValue + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_result_value-分页列表查询") + @ApiOperation(value="app_scene_cost_result_value-分页列表查询", notes="app_scene_cost_result_value-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostResultValue appSceneCostResultValue, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostResultValue, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostResultValueService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostResultValue + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-添加") + @ApiOperation(value="app_scene_cost_result_value-添加", notes="app_scene_cost_result_value-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostResultValue appSceneCostResultValue) { + appSceneCostResultValueService.save(appSceneCostResultValue); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostResultValue + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-编辑") + @ApiOperation(value="app_scene_cost_result_value-编辑", notes="app_scene_cost_result_value-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostResultValue appSceneCostResultValue) { + appSceneCostResultValueService.updateById(appSceneCostResultValue); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-通过id删除") + @ApiOperation(value="app_scene_cost_result_value-通过id删除", notes="app_scene_cost_result_value-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + appSceneCostResultValueService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-批量删除") + @ApiOperation(value="app_scene_cost_result_value-批量删除", notes="app_scene_cost_result_value-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.appSceneCostResultValueService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_result_value-通过id查询") + @ApiOperation(value="app_scene_cost_result_value-通过id查询", notes="app_scene_cost_result_value-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValueService.getById(id); + if(appSceneCostResultValue==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostResultValue); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostResultValue + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostResultValue appSceneCostResultValue) { + return super.exportXls(request, appSceneCostResultValue, AppSceneCostResultValue.class, "app_scene_cost_result_value"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result 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/entity/AppSceneCostResultValue.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java new file mode 100644 index 0000000..87f4bbc --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java @@ -0,0 +1,75 @@ +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_result_value + * @Author: jeecg-boot + * @Date: 2024-07-23 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_result_value") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="app_scene_cost_result_value对象", description="app_scene_cost_result_value") +public class AppSceneCostResultValue 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 belongTopMaterialNo; + /**物料编号*/ + @Excel(name = "物料编号", width = 15) + @ApiModelProperty(value = "物料编号") + private String marterialNo; + /**父类物料编号*/ + @Excel(name = "父类物料编号", width = 15) + @ApiModelProperty(value = "父类物料编号") + private String parentMarterialNo; + /**任务类型*/ + @Excel(name = "任务类型", width = 15) + @ApiModelProperty(value = "任务类型") + private String taskType; + /**任务代码*/ + @Excel(name = "任务代码", width = 15) + @ApiModelProperty(value = "任务代码") + private String taskCode; + /**流程id*/ + @Excel(name = "流程id", width = 15) + @ApiModelProperty(value = "流程id") + private String flowInstanceId; + /**计算结果值(多个值通过字段拼接)*/ + @Excel(name = "计算结果值(多个值通过字段拼接)", width = 15) + @ApiModelProperty(value = "计算结果值(多个值通过字段拼接)") + private String countValue; + /**创建时间*/ + @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; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.java new file mode 100644 index 0000000..2553ce9 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.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.AppSceneCostResultValue; + +/** + * @Description: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-23 + * @Version: V1.0 + */ +public interface AppSceneCostResultValueMapper 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/CostMaterialBomMapper.java index 712b28d..c8a7bb5 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/CostMaterialBomMapper.java @@ -1,18 +1,29 @@ package com.zzsmart.qomo.kn.cost.manage.mapper; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; /** *

* 物料bom Mapper 接口 *

* - * @author + * @author * @since 2024-06-21 */ @Mapper public interface CostMaterialBomMapper extends BaseMapper { - + /** + * 根据动态SQL语句查询物料BOM表 + * + * @param selectCommand + * @return + */ + @Select("${selectCommand}") + List customSelect(@Param("selectCommand") String selectCommand); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.xml new file mode 100644 index 0000000..c15291c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.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/laborcost/LaborCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java new file mode 100644 index 0000000..e0fbb06 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class LaborCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "人工成本任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java new file mode 100644 index 0000000..7b2767a --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + +import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskCallBack; +import com.zzsmart.qomo.plugin.task.api.TaskException; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 人工成本计算任务 + */ +public class LaborCostTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private LaborCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public LaborCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new LaborCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", emptyParameters); + + //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java new file mode 100644 index 0000000..79018f2 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class LaborCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new LaborCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), LaborCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, LaborCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java new file mode 100644 index 0000000..78e148d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class LaborCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "LaborCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new LaborCostTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java new file mode 100644 index 0000000..fd6b280 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class ManufacturingCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "制造费用成本任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java new file mode 100644 index 0000000..dc8e76c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue; +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.IAppSceneCostResultValueService; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskCallBack; +import com.zzsmart.qomo.plugin.task.api.TaskException; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.List; + +/** + * 制造费用成本任务 + */ +public class ManufacturingCostTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private ManufacturingCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public ManufacturingCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new ManufacturingCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", emptyParameters); + + //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java new file mode 100644 index 0000000..8defc02 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class ManufacturingCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new ManufacturingCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), ManufacturingCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, ManufacturingCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java new file mode 100644 index 0000000..83d7e6f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class ManufacturingCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "ManufacturingCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new ManufacturingCostTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java new file mode 100644 index 0000000..2f84721 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class MaterialCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "物料成本任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java new file mode 100644 index 0000000..86ce8da --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue; +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.IAppSceneCostResultValueService; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskCallBack; +import com.zzsmart.qomo.plugin.task.api.TaskException; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.List; + +/** + * 物料成本计算任务 + */ +public class MaterialCostTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private MaterialCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public MaterialCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new MaterialCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", emptyParameters); + + //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java new file mode 100644 index 0000000..8883b9d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class MaterialCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new MaterialCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), MaterialCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, MaterialCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java new file mode 100644 index 0000000..b46e669 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class MaterialCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "MaterialCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new MaterialCostTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java new file mode 100644 index 0000000..fc32246 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class MaterialInputParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "物料编号输入任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java new file mode 100644 index 0000000..23f75b4 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue; +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.IAppSceneCostResultValueService; +import com.zzsmart.qomo.plugin.task.api.*; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 物料编号输入任务 + */ +public class MaterialInputTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private MaterialInputParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public MaterialInputTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new MaterialInputParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", emptyParameters); + + //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java new file mode 100644 index 0000000..a6e0293 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class MaterialInputTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new MaterialInputTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), MaterialInputParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, MaterialInputParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java new file mode 100644 index 0000000..a4ecd74 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class MaterialInputTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "MaterialInput"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new MaterialInputTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/StandardCostService.java new file mode 100644 index 0000000..f01a4e6 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/StandardCostService.java @@ -0,0 +1,91 @@ +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue; +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.IAppSceneCostResultValueService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.util.Date; +import java.util.List; + +@Service +@Slf4j +public class StandardCostService { + @Autowired + CostMaterialBomMapper costMaterialBomMapper; + @Autowired + IAppSceneCostResultValueService iAppSceneCostResultValueService; + public static StandardCostService standardCostService; + + @PostConstruct + public void init() { + standardCostService = this; + standardCostService.costMaterialBomMapper = this.costMaterialBomMapper; + standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService; + } + + + /** + * 物料编号输入任务 + */ + public static void materialInputTask(String materialCode) { + //1.查询出所有满足物料编号的物料(BOM物料) + String sql = "select * from app_scene_cost_material_bom "; + List list = standardCostService.costMaterialBomMapper.customSelect(sql); + log.info("Full EmptyTask list: {}", list); + //2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code) + AppSceneCostResultValue appSceneCostResultValue = new AppSceneCostResultValue(); + + appSceneCostResultValue.setInstanceCode("11"); + appSceneCostResultValue.setCountValue("11"); + appSceneCostResultValue.setCreateTime(new Date()); + standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue); + + } + + /** + * 物料成本任务 + */ + public static void materialCostTask(String materialCode) { + //1.查询出物料编号对应的下所有的BOM信息 + //2.计算出所有的单个物料的物料成本 + //2.1查询出物料的单价和采购数量 + //2.2计算出物料成本并存储到成本结果数据表中 + } + + /** + * 人工成本任务 + */ + public static void laborCostTask(String materialCode) { + //1.查询出物料编号对应的下所有的BOM信息 + //2.计算出所有的单个物料的人工成本 + //2.1查询出物料的人员工时和人工费率 + //2.2计算出人工成本并存储到成本结果数据表中 + } + + /** + * 制造费用成本任务 + */ + public static void manufacturingCostTask(String materialCode) { + //1.查询出物料编号对应的下所有的BOM信息 + //2.根据费用类型进行不同的费用计算 + //2.1机器折旧费(机器工时*费率) + //2.2机物料消耗费(辅料工时*费率) + //2.3水电费(燃动力工时*费率) + //2.4其他制费(其他工时*费率) + //2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%) + } + + /** + * 标准成本计算任务 + */ + public static void standardCostTask(String materialCode) { + //1.查询出物料编号对应的下所有的BOM信息 + //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) + //3.计算出所有的单个物料的累计标准成本 + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java new file mode 100644 index 0000000..ebf9b1e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class StandardCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "标准成本计算任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java new file mode 100644 index 0000000..c705ee9 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + +import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskCallBack; +import com.zzsmart.qomo.plugin.task.api.TaskException; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 标准成本计算任务 + */ +public class StandardCostTask extends AbstractTask { + + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private StandardCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public StandardCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new StandardCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", emptyParameters); + + //setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java new file mode 100644 index 0000000..1c6ae08 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class StandardCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new StandardCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), StandardCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, StandardCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java new file mode 100644 index 0000000..fc9ad4f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class StandardCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "StandardCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new StandardCostTaskChannel(); + } +} 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 new file mode 100644 index 0000000..cfdca85 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.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.AppSceneCostResultValue; + +/** + * @Description: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-22 + * @Version: V1.0 + */ +public interface IAppSceneCostResultValueService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java new file mode 100644 index 0000000..77db0b4 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java @@ -0,0 +1,20 @@ +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.AppSceneCostResultValue; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostResultValueMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService; +import org.springframework.stereotype.Service; + + +/** + * @Description: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-22 + * @Version: V1.0 + */ +@Service +public class AppSceneCostResultValueServiceImpl extends ServiceImpl implements IAppSceneCostResultValueService { + +} diff --git a/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java b/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java index 9166eee..b02a8a0 100644 --- a/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java +++ b/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java @@ -1,78 +1,67 @@ package com.zzsmart.qomo.kn.cost.manage; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.generator.FastAutoGenerator; -import com.baomidou.mybatisplus.generator.config.OutputFile; -import com.baomidou.mybatisplus.generator.config.TemplateType; -import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; -import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; -import org.junit.Test; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.Collections; - -@SpringBootTest +//@SpringBootTest public class ApplicationTests { /** * 根据表名生成相应结构代码 -// * @param databaseName 数据库名 -// * @param tableName 表名 + // * @param databaseName 数据库名 + // * @param tableName 表名 */ - @Test - public void Generation(){ - FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"knne"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#") - .globalConfig(builder -> { - builder.author(" ") - .fileOverride()//是否覆盖 - //启用swagger - //.enableSwagger() - //指定输出目录 - .outputDir(System.getProperty("user.dir")+"/src/main/java"); - }) - .packageConfig(builder -> { - builder.entity("entity")//实体类包名 - .parent("com.zzsmart.qomo.kn.cost.manage")//父包名。如果为空,将下面子包名必须写全部, 否则就只需写子包名 - .controller("controller")//控制层包名 - .mapper("mapper")//mapper层包名 - //.other("dto")//生成dto目录 可不用 - .service("service")//service层包名 - .serviceImpl("service.impl")//service实现类包名 - //自定义mapper.xml文件输出目录 - .pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml")); - }) - .strategyConfig(builder -> { - builder.addInclude("app_scene_cost_model")// todo 设置需要生成的表名 - //.addTablePrefix("sys_")//设置表前缀过滤 - .entityBuilder() - .enableLombok() - .enableChainModel() - .naming(NamingStrategy.underline_to_camel)//数据表映射实体命名策略:默认下划线转驼峰underline_to_camel - .columnNaming(NamingStrategy.underline_to_camel)//表字段映射实体属性命名规则:默认null,不指定按照naming执行 - .idType(IdType.AUTO)//添加全局主键类型 - .formatFileName("%s")//格式化实体名称,%s取消首字母I, - .enableTableFieldAnnotation() - .enableColumnConstant() - .mapperBuilder() - .enableMapperAnnotation()//开启mapper注解 - .enableBaseResultMap()//启用xml文件中的BaseResultMap 生成 - .enableBaseColumnList()//启用xml文件中的BaseColumnList - .formatMapperFileName("%sMapper")//格式化Dao类名称 - .formatXmlFileName("%sMapper")//格式化xml文件名称 - .serviceBuilder() - .formatServiceFileName("%sService")//格式化 service 接口文件名称 - .formatServiceImplFileName("%sServiceImpl")//格式化 service 接口文件名称 - .controllerBuilder() - .enableRestStyle(); - }) - // 使用Freemarker引擎模板,默认的是Velocity引擎模板 -// .templateConfig(builder -> { -// builder.disable(TemplateType.CONTROLLER) -// .disable(TemplateType.SERVICE) -// .disable(TemplateType.SERVICEIMPL); +// @Test +// public void Generation(){ +// FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"knne"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#") +// .globalConfig(builder -> { +// builder.author(" ") +// .fileOverride()//是否覆盖 +// //启用swagger +// //.enableSwagger() +// //指定输出目录 +// .outputDir(System.getProperty("user.dir")+"/src/main/java"); // }) - .templateEngine(new FreemarkerTemplateEngine()) - .execute(); - - } +// .packageConfig(builder -> { +// builder.entity("entity")//实体类包名 +// .parent("com.zzsmart.qomo.kn.cost.manage")//父包名。如果为空,将下面子包名必须写全部, 否则就只需写子包名 +// .controller("controller")//控制层包名 +// .mapper("mapper")//mapper层包名 +// //.other("dto")//生成dto目录 可不用 +// .service("service")//service层包名 +// .serviceImpl("service.impl")//service实现类包名 +// //自定义mapper.xml文件输出目录 +// .pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml")); +// }) +// .strategyConfig(builder -> { +// builder.addInclude("app_scene_cost_model")// todo 设置需要生成的表名 +// //.addTablePrefix("sys_")//设置表前缀过滤 +// .entityBuilder() +// .enableLombok() +// .enableChainModel() +// .naming(NamingStrategy.underline_to_camel)//数据表映射实体命名策略:默认下划线转驼峰underline_to_camel +// .columnNaming(NamingStrategy.underline_to_camel)//表字段映射实体属性命名规则:默认null,不指定按照naming执行 +// .idType(IdType.AUTO)//添加全局主键类型 +// .formatFileName("%s")//格式化实体名称,%s取消首字母I, +// .enableTableFieldAnnotation() +// .enableColumnConstant() +// .mapperBuilder() +// .enableMapperAnnotation()//开启mapper注解 +// .enableBaseResultMap()//启用xml文件中的BaseResultMap 生成 +// .enableBaseColumnList()//启用xml文件中的BaseColumnList +// .formatMapperFileName("%sMapper")//格式化Dao类名称 +// .formatXmlFileName("%sMapper")//格式化xml文件名称 +// .serviceBuilder() +// .formatServiceFileName("%sService")//格式化 service 接口文件名称 +// .formatServiceImplFileName("%sServiceImpl")//格式化 service 接口文件名称 +// .controllerBuilder() +// .enableRestStyle(); +// }) +// // 使用Freemarker引擎模板,默认的是Velocity引擎模板 +//// .templateConfig(builder -> { +//// builder.disable(TemplateType.CONTROLLER) +//// .disable(TemplateType.SERVICE) +//// .disable(TemplateType.SERVICEIMPL); +//// }) +// .templateEngine(new FreemarkerTemplateEngine()) +// .execute(); +// +// } }