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 4326d66..ffffd3c 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 @@ -283,8 +283,8 @@ jeecg: 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 new file mode 100644 index 0000000..7078a5c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java @@ -0,0 +1,165 @@ +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.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; +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_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Api(tags = "cost-标准成本计算") +@RestController +@RequestMapping("//costCount") +@Slf4j +public class AppSceneCostCountController extends JeecgController { + @Autowired + private IAppSceneCostCountService appSceneCostCountService; + + /** + * 分页列表查询 + * + * @param appSceneCostCount + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_count-分页列表查询") + @ApiOperation(value = "标准成本计算-分页列表查询", notes = "标准成本计算-分页列表查询") + @GetMapping(value = "/list") + 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); + } + + /** + * 添加标准成本计算任务 + * + * @param appSceneCostCount + * @return + */ + @AutoLog(value = "app_scene_cost_count-添加") + @ApiOperation(value = "添加标准成本计算任务", notes = "添加标准成本计算任务") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:addCostCountTask") + @PostMapping(value = "/addCostCountTask") + public Result addCostCountTask(@RequestBody AppSceneCostCount appSceneCostCount) { + appSceneCostCountService.addCostCountTask(appSceneCostCount); + return Result.OK("添加成功!"); + } + + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_count-通过id删除") + @ApiOperation(value = "标准成本计算-通过id删除", notes = "标准成本计算-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostCountService.removeById(id); + 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("批量删除成功!"); + } + + /** + * 重新计算 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_count-通过id查询") + @ApiOperation(value = "标准成本计算-重新计算", notes = "标准成本计算-重新计算") + @GetMapping(value = "/recountById") + public Result recountById(@RequestParam(name = "id", required = true) Integer id) { + AppSceneCostCount appSceneCostCount = appSceneCostCountService.recountById(id); + if (appSceneCostCount == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostCount); + } + + /** + * 查看关键缺失部件 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_count-通过id查询") + @ApiOperation(value = "标准成本计算-查看关键缺失部件", notes = "标准成本计算-查看关键缺失部件") + @GetMapping(value = "/queryMissingComponentById") + public Result queryMissingComponentById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostCount appSceneCostCount = appSceneCostCountService.queryMissingComponentById(id); + if (appSceneCostCount == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostCount); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostCount + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostCount appSceneCostCount) { + return super.exportXls(request, appSceneCostCount, AppSceneCostCount.class, "app_scene_cost_count"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result 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/AppSceneCostModelController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java new file mode 100644 index 0000000..8652f67 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java @@ -0,0 +1,115 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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; +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 javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @Description: app_scene_cost_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Api(tags = "cost-标准成本-模型管理") +@RestController +@RequestMapping("//cost-model") +@Slf4j +public class AppSceneCostModelController { + @Autowired + private IAppSceneCostModelService appSceneCostModelService; + @Autowired + private IDataFlowDefinitionService flowDefinitionService; + + /** + * 标准成本模型分页列表查询 + * + * @param flowDefinition + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_model-分页列表查询") + @ApiOperation(value = "标准成本模型分页列表查询", notes = "标准成本模型分页列表查询") + @GetMapping(value = "/pageList") + public Result> queryPageList(FlowDefinition flowDefinition, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap()); + Page page = new Page((long) pageNo, (long) pageSize); + LambdaQueryWrapper wrapper = queryWrapper.lambda(); + wrapper.orderByDesc(FlowDefinition::getCreateTime); + IPage pageList = flowDefinitionService.queryPageList(page, wrapper); + return Result.OK(pageList); + } + + @ApiOperation(value = "标准成本模型列表", notes = "标准成本模型列表") + @GetMapping(value = "/list") + public Result> queryList(FlowDefinition flowDefinition, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap()); + LambdaQueryWrapper wrapper = queryWrapper.lambda(); + wrapper.orderByDesc(FlowDefinition::getCreateTime); + List list = appSceneCostModelService.queryListResult(wrapper); + return Result.OK(list); + } + + /** + * 添加标准成本模型 + * + * @param flowDefinition + * @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 definition = flowDefinitionService.add(flowDefinition); + return Result.OK(definition); + } + + /** + * 编辑 + * + * @param flowDefinition + * @return + */ + @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) { + return Result.OK(flowDefinitionService.edit(flowDefinition)); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @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); + return Result.OK("删除成功!"); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostModelController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostModelController.java deleted file mode 100644 index df41620..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostModelController.java +++ /dev/null @@ -1,115 +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.CostModel; -import com.zzsmart.qomo.kn.cost.manage.service.CostModelService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostModelVO; -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.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - *

- * 前端控制器 - *

- * - * @author - * @since 2024-07-11 - */ -@RestController -@RequestMapping("/cost-model") -@Api(tags="cost-标准成本-模型管理") -public class CostModelController { - @Autowired - CostModelService costModelService; - - /** - * 分页列表查询 - * - * @param costModel - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询") - @ApiOperation(value = "标准成本模型表格信息查询", notes = "标准成本模型表格信息查询") - @GetMapping(value = "/pageList") - public Result> queryPageList(CostModel costModel, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costModel, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = costModelService.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 = costModelService.queryListResult(materialNumber); - return Result.OK(list); - } - /** - * 标准成本模型编辑 - */ - @ApiOperation(value = "标准成本模型保存", notes = "标准成本模型保存") - @PostMapping(value = "/save") - public Result save(@RequestBody CostModelVO costModelVO) { - Boolean aBoolean = costModelService.saveCostModelInfo(costModelVO); - if (aBoolean) { - return Result.OK("保存成功!"); - } - return Result.error("保存失败!"); - } - /** - * 标准成本模型编辑 - */ - @ApiOperation(value = "标准成本模型编辑", notes = "标准成本模型编辑") - @PostMapping(value = "/edit") - public Result edit(@RequestBody CostModelVO costModelVO) { - Boolean aBoolean = costModelService.updateCostModelInfo(costModelVO); - if (aBoolean) { - return Result.OK("编辑成功!"); - } - return Result.error("编辑失败!"); - } - - /** - * 标准成本模型删除 - */ - @ApiOperation(value = "标准成本模型删除", notes = "标准成本模型删除") - @PostMapping(value = "/delete") - public Result delete(@RequestBody CostModelVO costModelVO) { - Boolean aBoolean = costModelService.deleteCostModel(costModelVO); - if (aBoolean) { - return Result.OK("删除成功!"); - } - return Result.error("删除失败!"); - } - - /** - * 标准成本模型发布 - */ - @ApiOperation(value = "标准成本模型发布", notes = "标准成本模型发布") - @PostMapping(value = "/publish") - public Result publish(@RequestBody CostModelVO costModelVO) { - Boolean aBoolean = costModelService.publishCostModel(costModelVO); - if (aBoolean) { - return Result.OK("发布成功!"); - } - return Result.error("发布失败!"); - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/FlowDefinitionController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/FlowDefinitionController.java deleted file mode 100644 index a0cd518..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/FlowDefinitionController.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import com.zzsmart.qomo.controller.DataFlowDefinitionController; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping -public class FlowDefinitionController { - - private static final Logger log = LoggerFactory.getLogger(DataFlowDefinitionController.class); -// @Autowired -// FlowDefinitionService definitionService; - -// @GetMapping({"/list"}) -// public Result> queryPageList(FlowDefinition flowDefinition, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { -// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap()); -// Page page = new Page((long) pageNo, (long) pageSize); -// LambdaQueryWrapper wrapper = queryWrapper.lambda(); -// wrapper.orderByDesc(FlowDefinition::getCreateTime); -// IPage pageList = definitionService.queryPageList(page, wrapper); -// return Result.OK(pageList); -// } -} 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 new file mode 100644 index 0000000..60707fb --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java @@ -0,0 +1,85 @@ +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_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_count") +@Builder +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@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) + @ApiModelProperty(value = "主键") + private Integer id; + /**物料编号*/ + @Excel(name = "物料编号", width = 15) + @ApiModelProperty(value = "物料编号") + private String materialNo; + /**图号*/ + @Excel(name = "图号", width = 15) + @ApiModelProperty(value = "图号") + private String drawingNo; + /**stage*/ + @Excel(name = "stage", width = 15) + @ApiModelProperty(value = "stage") + private String stage; + /**标准成本计算流程id*/ + @Excel(name = "标准成本计算流程id", width = 15) + @ApiModelProperty(value = "标准成本计算流程id") + private Integer flowDefinitionId; + /**year*/ + @Excel(name = "year", width = 15) + @ApiModelProperty(value = "year") + private String year; + /**状态*/ + @Excel(name = "状态", width = 15) + @ApiModelProperty(value = "状态") + private Integer status; + /**模型版本*/ + @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") + @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 Date updateTime; +} 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 new file mode 100644 index 0000000..a80a2fd --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.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_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_model") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@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) + @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") + 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") + @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 Date updateTime; +} 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/CostStandardVersion.java index 113cd14..e65e5ef 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/CostStandardVersion.java @@ -1,80 +1,103 @@ 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.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.util.Date; /** * @Description: 标准成本-版本号 * @Author: wangqiong - * @Date: 2024-06-13 + * @Date: 2024-06-13 * @Version: V1.0 */ @Data @TableName("app_scene_cost_standard_version") +@Builder @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="app_scene_cost_standard_version对象", description="app_scene_cost_standard_version") +@ApiModel(value = "app_scene_cost_standard_version对象", description = "app_scene_cost_standard_version") public class CostStandardVersion 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; - /**图号*/ + /** + * 图号 + */ @Excel(name = "图号", width = 15) @ApiModelProperty(value = "图号") private String figureNumber; - /**阶段,A-初始,B-首批,C-量产*/ - @Excel(name = "阶段", width = 15) + /** + * 阶段,A-初始,B-首批,C-量产 + */ + @Excel(name = "阶段", width = 15) @ApiModelProperty(value = "阶段") private String stage; - /**物料号*/ - @Excel(name = "物料号", width = 15) + /** + * 物料号 + */ + @Excel(name = "物料号", width = 15) @ApiModelProperty(value = "物料号") private String materialNumber; - /**版本号*/ + /** + * 版本号 + */ @ApiModelProperty(value = "版本号") private String versionNumber; - /**版本状态*/ + /** + * 版本状态 + */ @ApiModelProperty(value = "版本状态") private String versionStatus; - /**创建人*/ + /** + * 创建人 + */ @ApiModelProperty(value = "创建人") private String 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 String 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; - /**备注*/ + /** + * 备注 + */ @ApiModelProperty(value = "备注") private String remark; - /**年份*/ + /** + * 年份 + */ @ApiModelProperty(value = "年份") private String versionYear; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.java new file mode 100644 index 0000000..ec22d28 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.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.AppSceneCostCount; + +/** + * @Description: app_scene_cost_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface AppSceneCostCountMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.java new file mode 100644 index 0000000..b782f12 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.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.AppSceneCostModel; + +/** + * @Description: app_scene_cost_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface AppSceneCostModelMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostModelMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostModelMapper.java deleted file mode 100644 index 767ffa6..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostModelMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostModel; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * Mapper 接口 - *

- * - * @author - * @since 2024-07-11 - */ -@Mapper -public interface CostModelMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.xml new file mode 100644 index 0000000..a286884 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.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/AppSceneCostModelMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostModelMapper.xml new file mode 100644 index 0000000..2948e3f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostModelMapper.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/CostModelMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostModelMapper.xml deleted file mode 100644 index f04e71d..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostModelMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, model_name, drawing_no, material_no, material_type, model_version, status, create_time, create_by, update_time, update_by, cost_model_detail - - - 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 3e2bf5c..d09caca 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 @@ -2,10 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage.plugin; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -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.entity.CostMaterialProcessHours; -import com.zzsmart.qomo.kn.cost.manage.entity.HourRate; +import com.zzsmart.qomo.kn.cost.manage.entity.*; import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum; import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; import com.zzsmart.qomo.kn.cost.manage.service.*; @@ -54,11 +51,15 @@ public class StandardCostService { @Autowired IAppSceneCostResultValueService iAppSceneCostResultValueService; public static StandardCostService standardCostService; + @Autowired + IAppSceneCostCountService appSceneCostCountService; + @PostConstruct public void init() { standardCostService = this; standardCostService.costMaterialBomMapper = this.costMaterialBomMapper; + standardCostService.appSceneCostCountService = this.appSceneCostCountService; standardCostService.costMaterialBomService = this.costMaterialBomService; standardCostService.costPurchasePriceService = this.costPurchasePriceService; standardCostService.iHourRateService = this.iHourRateService; @@ -66,6 +67,13 @@ public class StandardCostService { standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService; } + /** + * 更新成本计算模型任务状态 + */ + public static void updateCostCountTaskStatus(Boolean isSuccess, Integer costCountTaskId) { + log.info("更新成本计算模型任务状态"); + standardCostService.appSceneCostCountService.updateById(AppSceneCostCount.builder().id(costCountTaskId).status(isSuccess != null && isSuccess ? 1 : 0).build()); + } /** * 1.物料编号输入任务 @@ -472,7 +480,7 @@ public class StandardCostService { } //3.计算出所有的单个物料的累计标准成本 List standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId); - //TODO 优化累计成本的计算 + //TODO 优化累计成本的计算 totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId); } 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 index 366f4b7..81d2702 100644 --- 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 @@ -59,10 +59,14 @@ public class StandardCostTask extends AbstractTask { try { StandardCostService.standardCostTask(taskRequest); } catch (Exception e) { + //TODO 更新成本计算模型任务状态 + StandardCostService.updateCostCountTaskStatus(false, 1); //运行失败退出 setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE); } //运行成功退出 + //TODO 更新成本计算模型任务状态 + StandardCostService.updateCostCountTaskStatus(true, 1); setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostModelService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostModelService.java deleted file mode 100644 index 4335e86..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostModelService.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostModel; -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostModelVO; - -import java.util.List; - -/** - *

- * 服务类 - *

- * - * @author - * @since 2024-07-11 - */ -public interface CostModelService extends IService { - /** - * 查询标准成本模型列表 - * @param materialNumber - * @return - */ - List queryListResult(String materialNumber); - - /** - * 标准成本模型编辑 - * @param costModelVO - */ - Boolean updateCostModelInfo(CostModelVO costModelVO); - - /** - * 标准成本模型删除 - * @param costModelVO - */ - Boolean deleteCostModel(CostModelVO costModelVO); - - /** - * 标准成本模型发布 - * @param costModelVO - */ - Boolean publishCostModel(CostModelVO costModelVO); - - /** - * 标准成本模型保存 - * @param costModelVO - * @return - */ - Boolean saveCostModelInfo(CostModelVO costModelVO); -} 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 new file mode 100644 index 0000000..865605e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java @@ -0,0 +1,32 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; + +/** + * @Description: app_scene_cost_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface IAppSceneCostCountService extends IService { + /** + * 查看关键缺失部件 + * @param id + * @return + */ + AppSceneCostCount queryMissingComponentById(String id); + + /** + * 重新计算 + * @param id + * @return + */ + AppSceneCostCount recountById(Integer id); + + /** + * 添加标准成本计算任务 + * @param appSceneCostCount + */ + void addCostCountTask(AppSceneCostCount appSceneCostCount); +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java new file mode 100644 index 0000000..3f60d28 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java @@ -0,0 +1,24 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.dao.entity.FlowDefinition; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel; + +import java.util.List; + +/** + * @Description: app_scene_cost_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface IAppSceneCostModelService { + /** + * 查询标准成本模型列表 + * + * @param queryWrapper + * @return + */ + List queryListResult(Wrapper queryWrapper); +} 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 new file mode 100644 index 0000000..b05627b --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -0,0 +1,88 @@ +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.AppSceneCostCount; +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.service.IAppSceneCostCountService; +import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; +import com.zzsmart.qomo.service.IDataFlowInstanceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @Description: app_scene_cost_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Service +public class AppSceneCostCountServiceImpl extends ServiceImpl implements IAppSceneCostCountService { + @Autowired + private ICostStandardVersionService costStandardVersionService; + @Autowired + private IDataFlowInstanceService flowInstanceService; + + /** + * 查看关键缺失部件 + * + * @param id + * @return + */ + @Override + public AppSceneCostCount queryMissingComponentById(String id) { + return null; + } + + /** + * 重新计算 + * + * @param id + * @return + */ + @Override + public AppSceneCostCount recountById(Integer id) { + if (id != null) { + AppSceneCostCount appSceneCostCount = getById(id); + if (appSceneCostCount != null) { + //执行标准成本计算 + executeStandardCost(id, appSceneCostCount.getFlowDefinitionId()); + } + } + return null; + } + + /** + * 执行标准成本计算 + * + * @param id + * @param flowDefinitionId + */ + private void executeStandardCost(Integer id, Integer flowDefinitionId) { + //TODO 执行标准成本计算(参数传递) + flowInstanceService.execute(flowDefinitionId, null, null); + } + + /** + * 添加标准成本计算任务 + * + * @param appSceneCostCount + */ + @Override + public void addCostCountTask(AppSceneCostCount appSceneCostCount) { + //1.新增版本号记录成功后 + CostStandardVersion costStandardVersion = CostStandardVersion.builder().figureNumber(appSceneCostCount.getDrawingNo()).materialNumber(appSceneCostCount.getMaterialNo()).stage(appSceneCostCount.getStage()).versionNumber(appSceneCostCount.getCostVersion()).versionYear(appSceneCostCount.getYear()).build(); + boolean save = costStandardVersionService.save(costStandardVersion); + //2.新增标准成本计算任务,并立即执行标准成本计算 + if (save) { + AppSceneCostCount appSceneCostCount1 = AppSceneCostCount.builder().materialNo(appSceneCostCount.getMaterialNo()).drawingNo(appSceneCostCount.getDrawingNo()).stage(appSceneCostCount.getStage()).flowDefinitionId(appSceneCostCount.getFlowDefinitionId()).year(appSceneCostCount.getYear()).costVersion(appSceneCostCount.getCostVersion()).status(0).createTime(new Date()).build(); + boolean flag = save(appSceneCostCount1); + if (flag) { + //执行标准成本计算 + executeStandardCost(appSceneCostCount1.getId(), appSceneCostCount1.getFlowDefinitionId()); + } + } + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java new file mode 100644 index 0000000..646f50f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java @@ -0,0 +1,34 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.zzsmart.qomo.dao.entity.FlowDefinition; +import com.zzsmart.qomo.dao.mapper.FlowDefinitionMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description: app_scene_cost_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Service +public class AppSceneCostModelServiceImpl implements IAppSceneCostModelService { + @Autowired + FlowDefinitionMapper flowDefinitionMapper; + + /** + * 查询标准成本模型列表 + * + * @param queryWrapper + * @return + */ + @Override + public List queryListResult(Wrapper queryWrapper) { + List list = flowDefinitionMapper.selectList(queryWrapper); + return list; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostModelServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostModelServiceImpl.java deleted file mode 100644 index 3f8f719..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostModelServiceImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.zzsmart.qomo.kn.cost.manage.entity.CostModel; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostModelMapper; -import com.zzsmart.qomo.kn.cost.manage.service.CostModelService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostModelVO; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 服务实现类 - *

- * - * @author - * @since 2024-07-11 - */ -@Service -public class CostModelServiceImpl extends ServiceImpl implements CostModelService { - @Autowired - CostModelMapper costModelMapper; - - /** - * 查询标准成本模型列表 - * - * @param materialNumber - * @return - */ - @Override - public List queryListResult(String materialNumber) { - QueryWrapper queryWrapper = new QueryWrapper(); - if (StrUtil.isNotEmpty(materialNumber)) { - // 物料号 - queryWrapper.like("material_no", materialNumber); - } - List list = costModelMapper.selectList(queryWrapper); - return list; - } - - /** - * 标准成本模型编辑 - * - * @param costModelVO - */ - @Override - public Boolean updateCostModelInfo(CostModelVO costModelVO) { - if (costModelVO != null && costModelVO.getId() != null) { - CostModel costModel = new CostModel(); - BeanUtils.copyProperties(costModelVO, costModel); - costModel.setId(costModelVO.getId()); - costModel.setCostModelDetail(costModelVO.getCostModelDetail()); - int i = costModelMapper.updateById(costModel); - if (i > 0) { - return true; - } - } - return false; - } - - /** - * 标准成本模型删除 - * - * @param costModelVO - */ - @Override - public Boolean deleteCostModel(CostModelVO costModelVO) { - if (costModelVO != null && costModelVO.getId() != null) { - int i = costModelMapper.deleteById(costModelVO.getId()); - if (i > 0) { - return true; - } - } - return false; - } - - /** - * 标准成本模型发布 - * - * @param costModelVO - */ - @Override - public Boolean publishCostModel(CostModelVO costModelVO) { - if (costModelVO != null && costModelVO.getId() != null) { - CostModel costModel = new CostModel(); - costModel.setStatus(costModelVO.getStatus()); - costModel.setId(costModelVO.getId()); - int i = costModelMapper.updateById(costModel); - if (i > 0) { - return true; - } - } - return false; - } - - /** - * 标准成本模型保存 - * - * @param costModelVO - * @return - */ - @Override - public Boolean saveCostModelInfo(CostModelVO costModelVO) { - if (costModelVO != null) { - CostModel costModel = new CostModel(); - BeanUtils.copyProperties(costModelVO, costModel); - costModel.setCostModelDetail(costModelVO.getCostModelDetail()); - int i = costModelMapper.insert(costModel); - if (i > 0) { - return true; - } - } - return false; - } -} 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 index 7301709..fabb5b6 100644 --- 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 @@ -63,15 +63,6 @@ public class CostStandardVersionServiceImpl extends ServiceImpl