parent
42c70e1d0d
commit
bdb0c2128c
22 changed files with 1552 additions and 17 deletions
@ -0,0 +1,101 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.pojo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.mp.base.BaseEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 成本计算产值配置表 实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Data |
||||
@TableName("MES_COST_CALCULATION_EMPLOYEE") |
||||
@Schema(description = "MesCostCalculationEmployee对象") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class CostCalculationEmployeeEntity extends BaseEntity { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
|
||||
/** |
||||
* 作业中心id |
||||
*/ |
||||
@Schema(description = "作业中心id") |
||||
private Long workCenterId; |
||||
|
||||
/** |
||||
* 作业中心名称 |
||||
*/ |
||||
@Schema(description = "作业中心编码") |
||||
private String workCenterCode; |
||||
|
||||
/** |
||||
* 作业中心名称 |
||||
*/ |
||||
@Schema(description = "作业中心名称") |
||||
private String workCenterName; |
||||
|
||||
/** |
||||
* 员工工号 |
||||
*/ |
||||
@Schema(description = "员工工号") |
||||
private String employeeCode; |
||||
|
||||
/** |
||||
* 员工姓名 |
||||
*/ |
||||
@Schema(description = "员工姓名") |
||||
private String employeeName; |
||||
|
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@Schema(description = "备注") |
||||
private String remarks; |
||||
|
||||
/** |
||||
* 创建人姓名 |
||||
*/ |
||||
@Schema(description = "创建人姓名") |
||||
private String createUserName; |
||||
|
||||
/** |
||||
* 更新人姓名 |
||||
*/ |
||||
@Schema(description = "更新人姓名") |
||||
private String updateUserName; |
||||
|
||||
} |
||||
@ -0,0 +1,99 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.pojo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.mp.base.BaseEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 成本计算产值配置表 实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Data |
||||
@TableName("MES_COST_CALCULATION_OUTPUT") |
||||
@Schema(description = "MesCostCalculationOutput对象") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class CostCalculationOutputEntity extends BaseEntity { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 月份 |
||||
*/ |
||||
@Schema(description = "月份") |
||||
private String month; |
||||
|
||||
/** |
||||
* 作业中心id |
||||
*/ |
||||
@Schema(description = "作业中心id") |
||||
private Long workCenterId; |
||||
|
||||
/** |
||||
* 作业中心名称 |
||||
*/ |
||||
@Schema(description = "作业中心编码") |
||||
private String workCenterCode; |
||||
|
||||
/** |
||||
* 作业中心名称 |
||||
*/ |
||||
@Schema(description = "作业中心名称") |
||||
private String workCenterName; |
||||
|
||||
/** |
||||
* 产值 |
||||
*/ |
||||
@Schema(description = "产值") |
||||
private Double output; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@Schema(description = "备注") |
||||
private String remarks; |
||||
|
||||
/** |
||||
* 创建人姓名 |
||||
*/ |
||||
@Schema(description = "创建人姓名") |
||||
private String createUserName; |
||||
|
||||
/** |
||||
* 更新人姓名 |
||||
*/ |
||||
@Schema(description = "更新人姓名") |
||||
private String updateUserName; |
||||
|
||||
} |
||||
@ -0,0 +1,46 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.pojo.vo; |
||||
|
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationEmployeeEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 视图实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class CostCalculationEmployeeVO extends CostCalculationEmployeeEntity { |
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
||||
@ -0,0 +1,46 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.pojo.vo; |
||||
|
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationOutputEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 视图实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class CostCalculationOutputVO extends CostCalculationOutputEntity { |
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
||||
@ -0,0 +1,227 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import jakarta.validation.Valid; |
||||
import lombok.AllArgsConstructor; |
||||
import org.apache.commons.collections4.CollectionUtils; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.excel.util.ExcelUtil; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.secure.BladeUser; |
||||
import org.springblade.core.secure.annotation.IsAdmin; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.desk.cost.excel.CostCalculationEmployeeExcel; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationEmployeeEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationEmployeeVO; |
||||
import org.springblade.desk.cost.service.ICostCalculationEmployeeService; |
||||
import org.springblade.desk.cost.wrapper.CostCalculationEmployeeWrapper; |
||||
import org.springblade.desk.dashboard.pojo.entity.BsWorkCenterEntity; |
||||
import org.springblade.desk.dashboard.service.IBsWorkCenterService; |
||||
import org.springblade.system.cache.UserCache; |
||||
import org.springblade.system.pojo.entity.UserInfo; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 控制器 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/costCalculationEmployee") |
||||
@Tag(name = "成本计算物料配置表", description = "成本计算物料配置表接口") |
||||
public class CostCalculationEmployeeController extends BladeController { |
||||
|
||||
private final ICostCalculationEmployeeService costCalculationEmployeeService; |
||||
private final IBsWorkCenterService workCenterService; |
||||
|
||||
|
||||
/** |
||||
* 成本计算物料配置表 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@Operation(summary = "详情", description = "传入CostCalculationEmployee") |
||||
public R<CostCalculationEmployeeVO> detail(CostCalculationEmployeeEntity costCalculationEmployee) { |
||||
CostCalculationEmployeeEntity detail = costCalculationEmployeeService.getOne(Condition.getQueryWrapper(costCalculationEmployee)); |
||||
return R.data(CostCalculationEmployeeWrapper.build().entityVO(detail)); |
||||
} |
||||
/** |
||||
* 成本计算物料配置表 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@Operation(summary = "分页", description = "传入CostCalculationEmployee") |
||||
public R<IPage<CostCalculationEmployeeVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> costCalculationEmployee, Query query) { |
||||
IPage<CostCalculationEmployeeEntity> pages = costCalculationEmployeeService.page(Condition.getPage(query), Condition.getQueryWrapper(costCalculationEmployee, CostCalculationEmployeeEntity.class)); |
||||
return R.data(CostCalculationEmployeeWrapper.build().pageVO(pages)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 自定义分页 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@Operation(summary = "分页", description = "传入CostCalculationEmployee") |
||||
public R<IPage<CostCalculationEmployeeVO>> page(CostCalculationEmployeeVO costCalculationEmployee, Query query) { |
||||
IPage<CostCalculationEmployeeVO> pages = costCalculationEmployeeService.selectCostCalculationEmployeePage(Condition.getPage(query), costCalculationEmployee); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@Operation(summary = "新增", description = "传入CostCalculationEmployee") |
||||
public R save(@Valid @RequestBody CostCalculationEmployeeEntity costCalculationEmployee) { |
||||
return R.status(costCalculationEmployeeService.save(costCalculationEmployee)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@Operation(summary = "修改", description = "传入CostCalculationEmployee") |
||||
public R update(@Valid @RequestBody CostCalculationEmployeeEntity costCalculationEmployee) { |
||||
return R.status(costCalculationEmployeeService.updateById(costCalculationEmployee)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@Operation(summary = "新增或修改", description = "传入CostCalculationEmployee") |
||||
public R submit(@Valid @RequestBody CostCalculationEmployeeEntity costCalculationEmployee) { |
||||
return R.status(costCalculationEmployeeService.saveOrUpdate(costCalculationEmployee)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@Operation(summary = "逻辑删除", description = "传入ids") |
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(costCalculationEmployeeService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
*/ |
||||
@IsAdmin |
||||
@GetMapping("/export-costCalculationEmployee") |
||||
@ApiOperationSupport(order = 9) |
||||
@Operation(summary = "导出数据", description = "传入CostCalculationEmployee") |
||||
public void exportCostCalculationEmployee(@Parameter(hidden = true) @RequestParam Map<String, Object> costCalculationEmployee, BladeUser bladeUser, HttpServletResponse response) { |
||||
QueryWrapper<CostCalculationEmployeeEntity> queryWrapper = Condition.getQueryWrapper(costCalculationEmployee, CostCalculationEmployeeEntity.class); |
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(CostCalculationEmployee::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(CostCalculationEmployeeEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<CostCalculationEmployeeExcel> list = costCalculationEmployeeService.export(queryWrapper); |
||||
ExcelUtil.export(response, "成本计算员工配置表数据" + DateUtil.time(), "成本计算员工配置表数据表", list, CostCalculationEmployeeExcel.class); |
||||
} |
||||
|
||||
/** |
||||
* 导入模版 |
||||
*/ |
||||
@GetMapping("/importTemplate") |
||||
@ApiOperationSupport(order = 9) |
||||
@Operation(summary = "导入模版", description = "导入模版") |
||||
public void importTemplate(HttpServletResponse response) { |
||||
List<CostCalculationEmployeeExcel> list = new ArrayList<>(); |
||||
ExcelUtil.export(response, "成本计算员工配置表数据" + DateUtil.time(), "成本计算员工配置表数据", list, CostCalculationEmployeeExcel.class); |
||||
} |
||||
|
||||
/** |
||||
* [基础分类] 导入Excel |
||||
*/ |
||||
@PostMapping("/import") |
||||
@ApiOperationSupport(order = 72) |
||||
@Operation(summary = "导入Excel", description = "MultipartFile") |
||||
public R importExcel(@RequestParam("file") MultipartFile file) { |
||||
List<CostCalculationEmployeeExcel> importList = ExcelUtil.read( |
||||
file, 0, 1, CostCalculationEmployeeExcel.class |
||||
); |
||||
if(CollectionUtils.isEmpty(importList)){ |
||||
return R.fail("无法导入空数据!"); |
||||
} |
||||
List<CostCalculationEmployeeEntity> list = new ArrayList<>(); |
||||
for(CostCalculationEmployeeExcel employExcel : importList){ |
||||
//根据员工编号查询,有则删除
|
||||
CostCalculationEmployeeEntity old = costCalculationEmployeeService.getOne(Wrappers.<CostCalculationEmployeeEntity>lambdaQuery().eq(CostCalculationEmployeeEntity::getEmployeeCode,employExcel.getEmployeeCode())); |
||||
if(old != null){ |
||||
costCalculationEmployeeService.deleteLogic(Func.toLongList(old.getId().toString())); |
||||
} |
||||
BsWorkCenterEntity workCenter = workCenterService.getOne(Wrappers.<BsWorkCenterEntity>lambdaQuery().eq(BsWorkCenterEntity::getWcName,employExcel.getWorkCenterName())); |
||||
if(workCenter == null){ |
||||
return R.fail("作业中心[" + employExcel.getWorkCenterName() + "]不存在!"); |
||||
} |
||||
UserInfo userInfo = UserCache.getUserByCode(employExcel.getEmployeeCode()); |
||||
if(userInfo == null){ |
||||
return R.fail("员工工号[" + employExcel.getEmployeeCode() + "]不存在!"); |
||||
} |
||||
CostCalculationEmployeeEntity entity = new CostCalculationEmployeeEntity(); |
||||
BeanUtils.copyProperties(employExcel,entity); |
||||
entity.setWorkCenterName(workCenter.getWcName()); |
||||
entity.setWorkCenterCode(workCenter.getWcCode()); |
||||
entity.setWorkCenterId(workCenter.getId()); |
||||
entity.setEmployeeName(userInfo.getUser().getRealName()); |
||||
entity.setCreateUserName(UserCache.getUser(Long.valueOf(AuthUtil.getUserId())).getRealName()); |
||||
entity.setUpdateUserName(UserCache.getUser(Long.valueOf(AuthUtil.getUserId())).getRealName()); |
||||
list.add(entity); |
||||
} |
||||
if(CollectionUtils.isNotEmpty(list)){ |
||||
costCalculationEmployeeService.saveBatch(list); |
||||
} |
||||
|
||||
return R.data("导入成功"); |
||||
} |
||||
} |
||||
@ -0,0 +1,224 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import jakarta.validation.Valid; |
||||
import lombok.AllArgsConstructor; |
||||
import org.apache.commons.collections4.CollectionUtils; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.excel.util.ExcelUtil; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.secure.BladeUser; |
||||
import org.springblade.core.secure.annotation.IsAdmin; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.desk.cost.excel.CostCalculationOutputExcel; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationOutputEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationOutputVO; |
||||
import org.springblade.desk.cost.service.ICostCalculationOutputService; |
||||
import org.springblade.desk.cost.wrapper.CostCalculationOutputWrapper; |
||||
import org.springblade.desk.dashboard.pojo.entity.BsWorkCenterEntity; |
||||
import org.springblade.desk.dashboard.service.IBsWorkCenterService; |
||||
import org.springblade.system.cache.UserCache; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 控制器 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/costCalculationOutput") |
||||
@Tag(name = "成本计算物料配置表", description = "成本计算物料配置表接口") |
||||
public class CostCalculationOutputController extends BladeController { |
||||
|
||||
private final ICostCalculationOutputService costCalculationOutputService; |
||||
private final IBsWorkCenterService workCenterService; |
||||
|
||||
|
||||
/** |
||||
* 成本计算物料配置表 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@Operation(summary = "详情", description = "传入CostCalculationOutput") |
||||
public R<CostCalculationOutputVO> detail(CostCalculationOutputEntity costCalculationOutput) { |
||||
CostCalculationOutputEntity detail = costCalculationOutputService.getOne(Condition.getQueryWrapper(costCalculationOutput)); |
||||
return R.data(CostCalculationOutputWrapper.build().entityVO(detail)); |
||||
} |
||||
/** |
||||
* 成本计算物料配置表 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@Operation(summary = "分页", description = "传入CostCalculationOutput") |
||||
public R<IPage<CostCalculationOutputVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> costCalculationOutput, Query query) { |
||||
IPage<CostCalculationOutputEntity> pages = costCalculationOutputService.page(Condition.getPage(query), Condition.getQueryWrapper(costCalculationOutput, CostCalculationOutputEntity.class)); |
||||
return R.data(CostCalculationOutputWrapper.build().pageVO(pages)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 自定义分页 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@Operation(summary = "分页", description = "传入CostCalculationOutput") |
||||
public R<IPage<CostCalculationOutputVO>> page(CostCalculationOutputVO costCalculationOutput, Query query) { |
||||
IPage<CostCalculationOutputVO> pages = costCalculationOutputService.selectCostCalculationOutputPage(Condition.getPage(query), costCalculationOutput); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@Operation(summary = "新增", description = "传入CostCalculationOutput") |
||||
public R save(@Valid @RequestBody CostCalculationOutputEntity costCalculationOutput) { |
||||
return R.status(costCalculationOutputService.save(costCalculationOutput)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@Operation(summary = "修改", description = "传入CostCalculationOutput") |
||||
public R update(@Valid @RequestBody CostCalculationOutputEntity costCalculationOutput) { |
||||
return R.status(costCalculationOutputService.updateById(costCalculationOutput)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@Operation(summary = "新增或修改", description = "传入CostCalculationOutput") |
||||
public R submit(@Valid @RequestBody CostCalculationOutputEntity costCalculationOutput) { |
||||
return R.status(costCalculationOutputService.saveOrUpdate(costCalculationOutput)); |
||||
} |
||||
|
||||
/** |
||||
* 成本计算物料配置表 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@Operation(summary = "逻辑删除", description = "传入ids") |
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(costCalculationOutputService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
*/ |
||||
@IsAdmin |
||||
@GetMapping("/export-costCalculationOutput") |
||||
@ApiOperationSupport(order = 9) |
||||
@Operation(summary = "导出数据", description = "传入CostCalculationOutput") |
||||
public void exportCostCalculationOutput(@Parameter(hidden = true) @RequestParam Map<String, Object> costCalculationOutput, BladeUser bladeUser, HttpServletResponse response) { |
||||
QueryWrapper<CostCalculationOutputEntity> queryWrapper = Condition.getQueryWrapper(costCalculationOutput, CostCalculationOutputEntity.class); |
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(CostCalculationOutput::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(CostCalculationOutputEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<CostCalculationOutputExcel> list = costCalculationOutputService.export(queryWrapper); |
||||
ExcelUtil.export(response, "成本计算产值配置表数据" + DateUtil.time(), "成本计算物料产值表数据表", list, CostCalculationOutputExcel.class); |
||||
} |
||||
|
||||
/** |
||||
* 导入模版 |
||||
*/ |
||||
@GetMapping("/importTemplate") |
||||
@ApiOperationSupport(order = 9) |
||||
@Operation(summary = "导入模版", description = "导入模版") |
||||
public void importTemplate(HttpServletResponse response) { |
||||
List<CostCalculationOutputExcel> list = new ArrayList<>(); |
||||
ExcelUtil.export(response, "成本计算产值配置表数据" + DateUtil.time(), "成本计算产值配置表数据", list, CostCalculationOutputExcel.class); |
||||
} |
||||
|
||||
/** |
||||
* [基础分类] 导入Excel |
||||
*/ |
||||
@PostMapping("/import") |
||||
@ApiOperationSupport(order = 72) |
||||
@Operation(summary = "导入Excel", description = "MultipartFile") |
||||
public R importExcel(@RequestParam("file") MultipartFile file) { |
||||
List<CostCalculationOutputExcel> importList = ExcelUtil.read( |
||||
file, 0, 1, CostCalculationOutputExcel.class |
||||
); |
||||
if(CollectionUtils.isEmpty(importList)){ |
||||
return R.fail("无法导入空数据!"); |
||||
} |
||||
List<CostCalculationOutputEntity> list = new ArrayList<>(); |
||||
for(CostCalculationOutputExcel outputExcel : importList){ |
||||
//根据月份和作业中心查询,有则删除
|
||||
CostCalculationOutputEntity old = costCalculationOutputService.getOne(Wrappers.<CostCalculationOutputEntity>lambdaQuery() |
||||
.eq(CostCalculationOutputEntity::getMonth,outputExcel.getMonth()) |
||||
.eq(CostCalculationOutputEntity::getWorkCenterName,outputExcel.getWorkCenterName())); |
||||
if(old != null){ |
||||
costCalculationOutputService.deleteLogic(Func.toLongList(old.getId().toString())); |
||||
} |
||||
BsWorkCenterEntity workCenter = workCenterService.getOne(Wrappers.<BsWorkCenterEntity>lambdaQuery().eq(BsWorkCenterEntity::getWcName,outputExcel.getWorkCenterName())); |
||||
if(workCenter == null){ |
||||
return R.fail("作业中心[" + outputExcel.getWorkCenterName() + "]不存在!"); |
||||
} |
||||
|
||||
CostCalculationOutputEntity entity = new CostCalculationOutputEntity(); |
||||
BeanUtils.copyProperties(outputExcel,entity); |
||||
entity.setWorkCenterName(workCenter.getWcName()); |
||||
entity.setWorkCenterCode(workCenter.getWcCode()); |
||||
entity.setWorkCenterId(workCenter.getId()); |
||||
entity.setCreateUserName(UserCache.getUser(Long.valueOf(AuthUtil.getUserId())).getRealName()); |
||||
entity.setUpdateUserName(UserCache.getUser(Long.valueOf(AuthUtil.getUserId())).getRealName()); |
||||
list.add(entity); |
||||
} |
||||
if(CollectionUtils.isNotEmpty(list)){ |
||||
costCalculationOutputService.saveBatch(list); |
||||
} |
||||
|
||||
return R.data("导入成功"); |
||||
} |
||||
} |
||||
@ -0,0 +1,70 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.excel; |
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serial; |
||||
import java.io.Serializable; |
||||
|
||||
|
||||
/** |
||||
* 成本计算物料配置表 Excel实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class CostCalculationEmployeeExcel implements Serializable { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
|
||||
/** |
||||
* 物料编码 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("作业中心名称") |
||||
private String workCenterName; |
||||
|
||||
/** |
||||
* 物料编码 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("人员工号") |
||||
private String employeeCode; |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,76 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.excel; |
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serial; |
||||
import java.io.Serializable; |
||||
|
||||
|
||||
/** |
||||
* 成本计算物料配置表 Excel实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class CostCalculationOutputExcel implements Serializable { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 物料编码 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("月份") |
||||
private String month; |
||||
|
||||
/** |
||||
* 物料编码 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("作业中心名称") |
||||
private String workCenterName; |
||||
|
||||
/** |
||||
* 物料编码 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("产值") |
||||
private Double output; |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,64 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.springblade.desk.cost.excel.CostCalculationEmployeeExcel; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationEmployeeEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationEmployeeVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 Mapper 接口 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
public interface CostCalculationEmployeeMapper extends BaseMapper<CostCalculationEmployeeEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param CostCalculationEmployee 查询参数 |
||||
* @return List<CostCalculationEmployeeVO> |
||||
*/ |
||||
List<CostCalculationEmployeeVO> selectCostCalculationEmployeePage(IPage page, CostCalculationEmployeeVO CostCalculationEmployee); |
||||
|
||||
|
||||
/** |
||||
* 获取导出数据 |
||||
* |
||||
* @param queryWrapper 查询条件 |
||||
* @return List<CostCalculationEmployeeExcel> |
||||
*/ |
||||
List<CostCalculationEmployeeExcel> export(@Param("ew") Wrapper<CostCalculationEmployeeEntity> queryWrapper); |
||||
|
||||
} |
||||
@ -0,0 +1,36 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.springblade.desk.cost.mapper.CostCalculationEmployeeMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="costCalculationEmployeeResultMap" type="org.springblade.desk.cost.pojo.entity.CostCalculationEmployeeEntity"> |
||||
<result column="ID" property="id"/> |
||||
<result column="WORK_CENTER_ID" property="workCenterId"/> |
||||
<result column="WORK_CENTER_CODE" property="workCenterCode"/> |
||||
<result column="WORK_CENTER_NAME" property="workCenterName"/> |
||||
<result column="EMPLOYEE_CODE" property="employeeCode"/> |
||||
<result column="EMPLOYEE_NAME" property="employeeName"/> |
||||
<result column="CREATE_TIME" property="createTime"/> |
||||
<result column="CREATE_USER" property="createUser"/> |
||||
<result column="CREATE_DEPT" property="createDept"/> |
||||
<result column="UPDATE_TIME" property="updateTime"/> |
||||
<result column="UPDATE_USER" property="updateUser"/> |
||||
<result column="REMARKS" property="remarks"/> |
||||
<result column="STATUS" property="status"/> |
||||
<result column="IS_DELETED" property="isDeleted"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectCostCalculationEmployeePage" resultMap="costCalculationEmployeeResultMap"> |
||||
select * from MES_COST_CALCULATION_EMPLOYEE |
||||
<where> |
||||
is_deleted = 0 |
||||
</where> |
||||
</select> |
||||
|
||||
|
||||
<select id="export" resultType="org.springblade.desk.cost.excel.CostCalculationEmployeeExcel"> |
||||
SELECT * FROM MES_COST_CALCULATION_EMPLOYEE ${ew.customSqlSegment} |
||||
</select> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,64 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.springblade.desk.cost.excel.CostCalculationOutputExcel; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationOutputEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationOutputVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 Mapper 接口 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
public interface CostCalculationOutputMapper extends BaseMapper<CostCalculationOutputEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param CostCalculationOutput 查询参数 |
||||
* @return List<CostCalculationOutputVO> |
||||
*/ |
||||
List<CostCalculationOutputVO> selectCostCalculationOutputPage(IPage page, CostCalculationOutputVO CostCalculationOutput); |
||||
|
||||
|
||||
/** |
||||
* 获取导出数据 |
||||
* |
||||
* @param queryWrapper 查询条件 |
||||
* @return List<CostCalculationOutputExcel> |
||||
*/ |
||||
List<CostCalculationOutputExcel> export(@Param("ew") Wrapper<CostCalculationOutputEntity> queryWrapper); |
||||
|
||||
} |
||||
@ -0,0 +1,42 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.springblade.desk.cost.mapper.CostCalculationOutputMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="costCalculationOutputResultMap" type="org.springblade.desk.cost.pojo.entity.CostCalculationOutputEntity"> |
||||
<result column="ID" property="id"/> |
||||
<result column="MONTH" property="month"/> |
||||
<result column="WORK_CENTER_ID" property="workCenterId"/> |
||||
<result column="WORK_CENTER_CODE" property="workCenterCode"/> |
||||
<result column="WORK_CENTER_NAME" property="workCenterName"/> |
||||
<result column="OUTPUT" property="output"/> |
||||
<result column="CREATE_TIME" property="createTime"/> |
||||
<result column="CREATE_USER" property="createUser"/> |
||||
<result column="CREATE_DEPT" property="createDept"/> |
||||
<result column="UPDATE_TIME" property="updateTime"/> |
||||
<result column="UPDATE_USER" property="updateUser"/> |
||||
<result column="REMARKS" property="remarks"/> |
||||
<result column="STATUS" property="status"/> |
||||
<result column="IS_DELETED" property="isDeleted"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectCostCalculationOutputPage" resultMap="costCalculationOutputResultMap"> |
||||
select * from MES_COST_CALCULATION_OUTPUT |
||||
<where> |
||||
is_deleted = 0 |
||||
<if test="param2.month != null and param2.month != ''"> |
||||
and month = #{param2.month} |
||||
</if> |
||||
<if test="param2.workCenterId != null and param2.workCenterId != ''"> |
||||
and WORK_CENTER_ID = #{param2.workCenterId} |
||||
</if> |
||||
</where> |
||||
</select> |
||||
|
||||
|
||||
<select id="export" resultType="org.springblade.desk.cost.excel.CostCalculationOutputExcel"> |
||||
SELECT * FROM MES_COST_CALCULATION_OUTPUT ${ew.customSqlSegment} |
||||
</select> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,62 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.desk.cost.excel.CostCalculationEmployeeExcel; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationEmployeeEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationEmployeeVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 服务类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
public interface ICostCalculationEmployeeService extends BaseService<CostCalculationEmployeeEntity> { |
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param costCalculationEmployee 查询参数 |
||||
* @return IPage<CostCalculationEmployeeVO> |
||||
*/ |
||||
IPage<CostCalculationEmployeeVO> selectCostCalculationEmployeePage(IPage<CostCalculationEmployeeVO> page, CostCalculationEmployeeVO costCalculationEmployee); |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
* |
||||
* @param queryWrapper 查询条件 |
||||
* @return List<CostCalculationEmployeeExcel> |
||||
*/ |
||||
List<CostCalculationEmployeeExcel> export(Wrapper<CostCalculationEmployeeEntity> queryWrapper); |
||||
|
||||
} |
||||
@ -0,0 +1,62 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.desk.cost.excel.CostCalculationOutputExcel; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationOutputEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationOutputVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 服务类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
public interface ICostCalculationOutputService extends BaseService<CostCalculationOutputEntity> { |
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param costCalculationOutput 查询参数 |
||||
* @return IPage<CostCalculationOutputVO> |
||||
*/ |
||||
IPage<CostCalculationOutputVO> selectCostCalculationOutputPage(IPage<CostCalculationOutputVO> page, CostCalculationOutputVO costCalculationOutput); |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
* |
||||
* @param queryWrapper 查询条件 |
||||
* @return List<CostCalculationOutputExcel> |
||||
*/ |
||||
List<CostCalculationOutputExcel> export(Wrapper<CostCalculationOutputEntity> queryWrapper); |
||||
|
||||
} |
||||
@ -0,0 +1,64 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.desk.cost.excel.CostCalculationEmployeeExcel; |
||||
import org.springblade.desk.cost.mapper.CostCalculationEmployeeMapper; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationEmployeeEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationEmployeeVO; |
||||
import org.springblade.desk.cost.service.ICostCalculationEmployeeService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 服务实现类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Service |
||||
public class CostCalculationEmployeeServiceImpl extends BaseServiceImpl<CostCalculationEmployeeMapper, CostCalculationEmployeeEntity> implements ICostCalculationEmployeeService { |
||||
|
||||
@Override |
||||
public IPage<CostCalculationEmployeeVO> selectCostCalculationEmployeePage(IPage<CostCalculationEmployeeVO> page, CostCalculationEmployeeVO costCalculationEmployee) { |
||||
return page.setRecords(baseMapper.selectCostCalculationEmployeePage(page, costCalculationEmployee)); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public List<CostCalculationEmployeeExcel> export(Wrapper<CostCalculationEmployeeEntity> queryWrapper) { |
||||
List<CostCalculationEmployeeExcel> costCalculationEmployeeList = baseMapper.export(queryWrapper); |
||||
//CostCalculationEmployeeList.forEach(CostCalculationEmployee -> {
|
||||
// CostCalculationEmployee.setTypeName(DictCache.getValue(DictEnum.YES_NO, CostCalculationEmployee.getType()));
|
||||
//});
|
||||
return costCalculationEmployeeList; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,64 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.desk.cost.excel.CostCalculationOutputExcel; |
||||
import org.springblade.desk.cost.mapper.CostCalculationOutputMapper; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationOutputEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationOutputVO; |
||||
import org.springblade.desk.cost.service.ICostCalculationOutputService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 服务实现类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
@Service |
||||
public class CostCalculationOutputServiceImpl extends BaseServiceImpl<CostCalculationOutputMapper, CostCalculationOutputEntity> implements ICostCalculationOutputService { |
||||
|
||||
@Override |
||||
public IPage<CostCalculationOutputVO> selectCostCalculationOutputPage(IPage<CostCalculationOutputVO> page, CostCalculationOutputVO costCalculationOutput) { |
||||
return page.setRecords(baseMapper.selectCostCalculationOutputPage(page, costCalculationOutput)); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public List<CostCalculationOutputExcel> export(Wrapper<CostCalculationOutputEntity> queryWrapper) { |
||||
List<CostCalculationOutputExcel> costCalculationOutputList = baseMapper.export(queryWrapper); |
||||
//CostCalculationOutputList.forEach(CostCalculationOutput -> {
|
||||
// CostCalculationOutput.setTypeName(DictCache.getValue(DictEnum.YES_NO, CostCalculationOutput.getType()));
|
||||
//});
|
||||
return costCalculationOutputList; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,60 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.wrapper; |
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationEmployeeEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationEmployeeVO; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 包装类,返回视图层所需的字段 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
public class CostCalculationEmployeeWrapper extends BaseEntityWrapper<CostCalculationEmployeeEntity, CostCalculationEmployeeVO> { |
||||
|
||||
public static CostCalculationEmployeeWrapper build() { |
||||
return new CostCalculationEmployeeWrapper(); |
||||
} |
||||
|
||||
@Override |
||||
public CostCalculationEmployeeVO entityVO(CostCalculationEmployeeEntity costCalculationEmployee) { |
||||
CostCalculationEmployeeVO costCalculationEmployeeVO = Objects.requireNonNull(BeanUtil.copyProperties(costCalculationEmployee, CostCalculationEmployeeVO.class)); |
||||
|
||||
//User createUser = UserCache.getUser(CostCalculationEmployee.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(CostCalculationEmployee.getUpdateUser());
|
||||
//CostCalculationEmployeeVO.setCreateUserName(createUser.getName());
|
||||
//CostCalculationEmployeeVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return costCalculationEmployeeVO; |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,60 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.cost.wrapper; |
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.desk.cost.pojo.entity.CostCalculationOutputEntity; |
||||
import org.springblade.desk.cost.pojo.vo.CostCalculationOutputVO; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 成本计算物料配置表 包装类,返回视图层所需的字段 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-04-21 |
||||
*/ |
||||
public class CostCalculationOutputWrapper extends BaseEntityWrapper<CostCalculationOutputEntity, CostCalculationOutputVO> { |
||||
|
||||
public static CostCalculationOutputWrapper build() { |
||||
return new CostCalculationOutputWrapper(); |
||||
} |
||||
|
||||
@Override |
||||
public CostCalculationOutputVO entityVO(CostCalculationOutputEntity costCalculationOutput) { |
||||
CostCalculationOutputVO costCalculationOutputVO = Objects.requireNonNull(BeanUtil.copyProperties(costCalculationOutput, CostCalculationOutputVO.class)); |
||||
|
||||
//User createUser = UserCache.getUser(CostCalculationOutput.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(CostCalculationOutput.getUpdateUser());
|
||||
//CostCalculationOutputVO.setCreateUserName(createUser.getName());
|
||||
//CostCalculationOutputVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return costCalculationOutputVO; |
||||
} |
||||
|
||||
|
||||
} |
||||
Loading…
Reference in new issue