liweidong
liweidong-hj 2 days ago
commit 5d885015b5
  1. 101
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/cost/pojo/entity/CostCalculationEmployeeEntity.java
  2. 99
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/cost/pojo/entity/CostCalculationOutputEntity.java
  3. 12
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/cost/pojo/entity/CostStatisticsEntity.java
  4. 46
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/cost/pojo/vo/CostCalculationEmployeeVO.java
  5. 46
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/cost/pojo/vo/CostCalculationOutputVO.java
  6. 6
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/oem/pojo/entity/OemStandardProcessEntity.java
  7. 3
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/oem/pojo/vo/OemStandardProcessVO.java
  8. 230
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/controller/CostCalculationEmployeeController.java
  9. 224
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/controller/CostCalculationOutputController.java
  10. 70
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/excel/CostCalculationEmployeeExcel.java
  11. 76
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/excel/CostCalculationOutputExcel.java
  12. 64
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/mapper/CostCalculationEmployeeMapper.java
  13. 43
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/mapper/CostCalculationEmployeeMapper.xml
  14. 64
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/mapper/CostCalculationOutputMapper.java
  15. 42
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/mapper/CostCalculationOutputMapper.xml
  16. 4
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/mapper/CostStatisticsMapper.java
  17. 32
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/mapper/CostStatisticsMapper.xml
  18. 62
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/service/ICostCalculationEmployeeService.java
  19. 62
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/service/ICostCalculationOutputService.java
  20. 64
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/service/impl/CostCalculationEmployeeServiceImpl.java
  21. 64
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/service/impl/CostCalculationOutputServiceImpl.java
  22. 61
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/service/impl/CostStatisticsServiceImpl.java
  23. 60
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/wrapper/CostCalculationEmployeeWrapper.java
  24. 60
      blade-service/blade-desk/src/main/java/org/springblade/desk/cost/wrapper/CostCalculationOutputWrapper.java
  25. 21
      blade-service/blade-desk/src/main/java/org/springblade/desk/efficiency/excel/BsSalaryCalculationExcel.java
  26. 35
      blade-service/blade-desk/src/main/java/org/springblade/desk/efficiency/pojo/vo/BsSalaryCalculationVO.java
  27. 58
      blade-service/blade-desk/src/main/java/org/springblade/desk/oem/controller/OemStandardProcessController.java
  28. 6
      blade-service/blade-desk/src/main/java/org/springblade/desk/oem/mapper/OemStandardProcessMapper.xml
  29. 28
      blade-service/blade-desk/src/main/java/org/springblade/desk/oem/service/impl/OemStatementServiceImpl.java
  30. 27
      blade-service/blade-desk/src/main/java/org/springblade/desk/order/service/impl/YieldOrderCraftServiceImpl.java
  31. 26
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/mapper/WorkPlanMapper.xml
  32. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/service/impl/WorkOrderServiceImpl.java
  33. 4
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StOtherReceiptRecordMapper.java
  34. 12
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StOtherReceiptRecordMapper.xml
  35. 18
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/impl/StGlassCakeOutServiceImpl.java
  36. 17
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/impl/StGraphiteMoldOutServiceImpl.java
  37. 7
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/impl/StOtherReceiptRecordServiceImpl.java

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

@ -133,4 +133,16 @@ public class CostStatisticsEntity extends BaseEntity {
@Schema(description = "交付中心")
private Long jcId;
/**
* 产值
*/
@Schema(description = "产值")
private BigDecimal output;
/**
* 成本费用率
*/
@Schema(description = "成本费用率")
private BigDecimal costRate;
}

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

@ -24,10 +24,10 @@ public class OemStandardProcessEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 工序ID
* 工序名称
*/
@Schema(description = "工序ID")
private Long processId;
@Schema(description = "工序名称")
private String processName;
/**
* 镀种
*/

@ -20,9 +20,6 @@ public class OemStandardProcessVO extends OemStandardProcessEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "工序名称")
private String processName;
@Schema(description = "维护人")
private String updateUserName;

@ -0,0 +1,230 @@
/**
* 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.base.BaseEntity;
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;
import java.util.stream.Collectors;
/**
* 成本计算物料配置表 控制器
*
* @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){
//根据作业中心查询,有则删除
List<CostCalculationEmployeeEntity> oldList = costCalculationEmployeeService.list(Wrappers.<CostCalculationEmployeeEntity>lambdaQuery().eq(CostCalculationEmployeeEntity::getWorkCenterName,employExcel.getWorkCenterName()));
if(CollectionUtils.isNotEmpty(oldList)){
List<Long> idList = oldList.stream().map(BaseEntity::getId).collect(Collectors.toList());
costCalculationEmployeeService.deleteLogic(idList);
}
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,43 @@
<?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
WORK_CENTER_NAME,
LISTAGG ( TO_CHAR( EMPLOYEE_NAME ), ',' ) WITHIN GROUP ( ORDER BY EMPLOYEE_NAME ) AS EMPLOYEE_NAME,
CREATE_USER_NAME,
CREATE_TIME
from MES_COST_CALCULATION_EMPLOYEE
<where>
is_deleted = 0
</where>
GROUP BY
WORK_CENTER_NAME,CREATE_USER_NAME,CREATE_TIME
</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>

@ -74,4 +74,8 @@ public interface CostStatisticsMapper extends BaseMapper<CostStatisticsEntity> {
List<StStockInoutRecordExcel> exportWorkCenterMaterialCost(@Param("workCenterId")Long workCenterId, @Param("month")String month);
List<StStockInoutRecordExcel> exportAssistantMaterialCost(@Param("month")String month);
BigDecimal getWorkCenterMaterialCostByUser(@Param("userCodeList")List<String> userCodeList, @Param("month")String month);
BigDecimal getAssistantMaterialCostByUser(@Param("userCodeList")List<String> userCodeList,@Param("month")String month);
}

@ -71,6 +71,23 @@
AND a.GOODS_ID NOT IN ( SELECT id FROM ST_GOODS WHERE GOODS_CODE IN ( SELECT GOODS_CODE FROM MES_COST_CALCULATION_GOODS ) )
</select>
<select id="getWorkCenterMaterialCostByUser" resultType="java.math.BigDecimal">
SELECT
nvl(sum(a.SIR_MONEY),0)
FROM
ST_STOCK_INOUT_RECORD a
left join blade_user b on a.user_id = b.id
WHERE
a.IS_DELETED = 0
AND a.IN_OUT_TYPE = 1
AND b.code in
<foreach collection="userCodeList" item="userCode" open="(" close=")" separator=",">
#{userCode}
</foreach>
AND to_char( IN_OUT_DATE, 'yyyy-MM' ) = #{month}
AND a.GOODS_ID NOT IN ( SELECT id FROM ST_GOODS WHERE GOODS_CODE IN ( SELECT GOODS_CODE FROM MES_COST_CALCULATION_GOODS ) )
</select>
<select id="getAssistantMaterialCost" resultType="java.math.BigDecimal">
SELECT
nvl(sum( a.SIR_MONEY ),0)
@ -83,6 +100,21 @@
AND to_char( IN_OUT_DATE, 'yyyy-MM' ) = #{month}
AND a.GOODS_ID NOT IN ( SELECT id FROM ST_GOODS WHERE GOODS_CODE IN ( SELECT GOODS_CODE FROM MES_COST_CALCULATION_GOODS ) )
</select>
<select id="getAssistantMaterialCostByUser" resultType="java.math.BigDecimal">
SELECT
nvl(sum( a.SIR_MONEY ),0)
FROM
ST_STOCK_INOUT_RECORD a left join blade_user b on a.user_id = b.id
WHERE
a.is_deleted = 0
AND b.code not in
<foreach collection="userCodeList" item="userCode" open="(" close=")" separator=",">
#{userCode}
</foreach>
AND a.IN_OUT_TYPE = 1
AND to_char( IN_OUT_DATE, 'yyyy-MM' ) = #{month}
AND a.GOODS_ID NOT IN ( SELECT id FROM ST_GOODS WHERE GOODS_CODE IN ( SELECT GOODS_CODE FROM MES_COST_CALCULATION_GOODS ) )
</select>
<select id="getWorkCenterAssistantRate" resultType="java.math.BigDecimal">
SELECT nvl(

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

@ -39,20 +39,15 @@ import org.springblade.desk.basic.service.IWorkCenterService;
import org.springblade.desk.cost.excel.CostStatisticsExcel;
import org.springblade.desk.cost.excel.StStockInoutRecordExcel;
import org.springblade.desk.cost.mapper.CostStatisticsMapper;
import org.springblade.desk.cost.pojo.entity.CostCalculationProcessEntity;
import org.springblade.desk.cost.pojo.entity.CostStatisticsEntity;
import org.springblade.desk.cost.pojo.entity.SubjectFeeDetailEntity;
import org.springblade.desk.cost.pojo.entity.SubjectFeeEntity;
import org.springblade.desk.cost.pojo.entity.*;
import org.springblade.desk.cost.pojo.vo.CostStatisticsVO;
import org.springblade.desk.cost.service.ICostCalculationProcessService;
import org.springblade.desk.cost.service.ICostStatisticsService;
import org.springblade.desk.cost.service.ISubjectFeeDetailService;
import org.springblade.desk.cost.service.ISubjectFeeService;
import org.springblade.desk.cost.service.*;
import org.springblade.desk.produce.service.IWorkPlanService;
import org.springblade.system.cache.UserCache;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -72,6 +67,8 @@ public class CostStatisticsServiceImpl extends BaseServiceImpl<CostStatisticsMap
private final ISubjectFeeDetailService subjectFeeDetailService;
private final IWorkPlanService workPlanService;
private final ICostCalculationProcessService costCalculationProcessService;
private final ICostCalculationOutputService costCalculationOutputService;
private final ICostCalculationEmployeeService costCalculationEmployeeService;
@Override
public IPage<CostStatisticsVO> selectCostStatisticsPage(IPage<CostStatisticsVO> page, CostStatisticsVO CostStatistics) {
return page.setRecords(baseMapper.selectCostStatisticsPage(page, CostStatistics));
@ -114,18 +111,46 @@ public class CostStatisticsServiceImpl extends BaseServiceImpl<CostStatisticsMap
for(WorkCenter workCenter : workCenterList){
//制造费用
BigDecimal productCost = getProductCost(subjectFeeList,workCenter,month);
//作业中心材料费用(剔除成本计算维护的物料)
BigDecimal workCenterMaterialCost = baseMapper.getWorkCenterMaterialCost(workCenter.getId(),month);
//费用科目中维护的作业中心材料费用
BigDecimal erpWorkCenterMaterialCost = getMaterialCost(subjectFeeList,workCenter,month);
//作业中心辅助人员材料费用比例
BigDecimal rate = baseMapper.getWorkCenterAssistantRate(workCenter.getId(),month);
//辅助人员材料费用
BigDecimal assistantMaterialCost = assistantMaterialCostSum.multiply(rate).divide(BigDecimal.valueOf(100),2, BigDecimal.ROUND_HALF_UP);
//材料费用
BigDecimal materialCost = workCenterMaterialCost.add(assistantMaterialCost).add(erpWorkCenterMaterialCost);
BigDecimal materialCost = BigDecimal.ZERO;
BigDecimal workCenterMaterialCost = BigDecimal.ZERO;
BigDecimal erpWorkCenterMaterialCost = BigDecimal.ZERO;
BigDecimal assistantMaterialCost = BigDecimal.ZERO;
//查询成分配置人员
List<CostCalculationEmployeeEntity> costCalculationEmployeeList = costCalculationEmployeeService.list(Wrappers.<CostCalculationEmployeeEntity>lambdaQuery().eq(CostCalculationEmployeeEntity::getWorkCenterId,workCenter.getId()));
if(CollectionUtils.isEmpty(costCalculationEmployeeList)){
//作业中心材料费用(剔除成本计算维护的物料)
workCenterMaterialCost = baseMapper.getWorkCenterMaterialCost(workCenter.getId(),month);
//费用科目中维护的作业中心材料费用
erpWorkCenterMaterialCost = getMaterialCost(subjectFeeList,workCenter,month);
//作业中心辅助人员材料费用比例
BigDecimal rate = baseMapper.getWorkCenterAssistantRate(workCenter.getId(),month);
//辅助人员材料费用
assistantMaterialCost = assistantMaterialCostSum.multiply(rate).divide(BigDecimal.valueOf(100),2, BigDecimal.ROUND_HALF_UP);
//材料费用
materialCost = workCenterMaterialCost.add(assistantMaterialCost).add(erpWorkCenterMaterialCost);
}else{
List<String> userCodeList = costCalculationEmployeeList.stream().map(CostCalculationEmployeeEntity::getEmployeeCode).collect(Collectors.toList());
//作业中心材料费用(剔除成本计算维护的物料)
workCenterMaterialCost = baseMapper.getWorkCenterMaterialCostByUser(userCodeList,month);
//费用科目中维护的作业中心材料费用
erpWorkCenterMaterialCost = getMaterialCost(subjectFeeList,workCenter,month);
assistantMaterialCost = baseMapper.getAssistantMaterialCostByUser(userCodeList,month);
//材料费用
materialCost = workCenterMaterialCost.add(assistantMaterialCost).add(erpWorkCenterMaterialCost);
}
//月度产出
List<CostCalculationProcessEntity> processList = costCalculationProcessService.list(Wrappers.<CostCalculationProcessEntity>lambdaQuery().eq(CostCalculationProcessEntity::getWorkCenterId,workCenter.getId()));
//产值
BigDecimal output = BigDecimal.ZERO;
//成本费用率
BigDecimal costRate = BigDecimal.ZERO;
CostCalculationOutputEntity costCalculationOutput = costCalculationOutputService.getOne(Wrappers.<CostCalculationOutputEntity>lambdaQuery().eq(CostCalculationOutputEntity::getMonth,month).eq(CostCalculationOutputEntity::getWorkCenterId,workCenter.getId()));
if(costCalculationOutput != null){
output = BigDecimal.valueOf(costCalculationOutput.getOutput());
costRate = productCost.add(materialCost).divide(output,2, RoundingMode.HALF_UP);
}
BigDecimal monthOutputArea = BigDecimal.ZERO;
BigDecimal monthOutputVolume = BigDecimal.ZERO;
BigDecimal unitCost = BigDecimal.ZERO;
@ -157,6 +182,8 @@ public class CostStatisticsServiceImpl extends BaseServiceImpl<CostStatisticsMap
entity.setUnitCost(unitCost);
entity.setMonthOutputArea(monthOutputArea);
entity.setMonthOutputVolume(monthOutputVolume);
entity.setOutput(output);
entity.setCostRate(costRate);
entity.setCreateUserName(UserCache.getUser(Long.valueOf(AuthUtil.getUserId())).getRealName());
entity.setUpdateUserName(UserCache.getUser(Long.valueOf(AuthUtil.getUserId())).getRealName());
list.add(entity);

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

@ -7,6 +7,8 @@ import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ -83,25 +85,25 @@ public class BsSalaryCalculationExcel implements Serializable {
private String ppsName;
/**
* 额工时
* 工时
*/
@ColumnWidth(20)
@ExcelProperty("额工时")
private String hourQuota;
@ExcelProperty("额工时")
private BigDecimal standardTime;
/**
* 准备工时
*/
@ColumnWidth(20)
@ExcelProperty("准备工时")
private String hourPrepar;
private BigDecimal prepareTime;
/**
* 工时额定单位
*/
@ColumnWidth(20)
@ExcelProperty("工时额定单位")
private String hqUnit;
private String hourTypeValue;
/**
* 报工数
@ -115,7 +117,14 @@ public class BsSalaryCalculationExcel implements Serializable {
*/
@ColumnWidth(20)
@ExcelProperty("总工时")
private String hourTotal;
private BigDecimal totalHour;
/**
* 实际总工时
*/
@ColumnWidth(20)
@ExcelProperty("实际总工时")
private BigDecimal hourQuota;
/**
* 责任人

@ -3,6 +3,7 @@ package org.springblade.desk.efficiency.pojo.vo;
import lombok.Data;
import java.io.Serial;
import java.math.BigDecimal;
@Data
public class BsSalaryCalculationVO {
@ -56,9 +57,9 @@ public class BsSalaryCalculationVO {
private String ppsName;
/**
* 定额工时
* 工时定额
*/
private String hourQuota;
private BigDecimal hourQuota;
/**
* 准备工时
@ -75,11 +76,6 @@ public class BsSalaryCalculationVO {
*/
private String workQty;
/**
* 总工时
*/
private String hourTotal;
/**
* 责任人
*/
@ -169,4 +165,29 @@ public class BsSalaryCalculationVO {
*/
private boolean isAsc;
/**
* 额定工时
*/
private BigDecimal standardTime;
/**
* 准备工时
*/
private BigDecimal prepareTime;
/**
* 工时类型 0-按件 1-按订单
*/
private String hourType;
/**
* 工时类型
*/
private String hourTypeValue;
/**
* 总工时
*/
private BigDecimal totalHour;
}

@ -1,5 +1,6 @@
package org.springblade.desk.oem.controller;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
@ -23,7 +24,6 @@ import org.springblade.desk.oem.service.IOemStandardProcessService;
import org.springframework.beans.BeanUtils;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -68,12 +68,28 @@ public class OemStandardProcessController {
@Operation(summary = "新增或修改", description = "传入bsEfficiencyTempList")
public R submit(@Valid @RequestBody List<OemStandardProcessEntity> oemStandardProcessList) {
for (OemStandardProcessEntity oemStandardProcessEntity : oemStandardProcessList) {
LambdaQueryWrapper<OemStandardProcessEntity> wrapper = new LambdaQueryWrapper<OemStandardProcessEntity>().eq(OemStandardProcessEntity::getProcessId, oemStandardProcessEntity.getProcessId()).eq(OemStandardProcessEntity::getPlate, oemStandardProcessEntity.getPlate()).eq(OemStandardProcessEntity::getPlateThickness, oemStandardProcessEntity.getPlateThickness()).eq(OemStandardProcessEntity::getPartName, oemStandardProcessEntity.getPartName());
LambdaQueryWrapper<OemStandardProcessEntity> qw = new LambdaQueryWrapper<>();
qw.eq(OemStandardProcessEntity::getProcessName, oemStandardProcessEntity.getProcessName());
if (StringUtils.isEmpty(oemStandardProcessEntity.getPlate())) {
qw.isNull(OemStandardProcessEntity::getPlate);
} else {
qw.eq(OemStandardProcessEntity::getPlate, oemStandardProcessEntity.getPlate());
}
if (StringUtils.isEmpty(oemStandardProcessEntity.getPlateThickness())) {
qw.isNull(OemStandardProcessEntity::getPlateThickness);
} else {
qw.eq(OemStandardProcessEntity::getPlateThickness, oemStandardProcessEntity.getPlateThickness());
}
if (StringUtils.isEmpty(oemStandardProcessEntity.getPartName())) {
qw.isNull(OemStandardProcessEntity::getPartName);
} else {
qw.eq(OemStandardProcessEntity::getPartName, oemStandardProcessEntity.getPartName());
}
if (oemStandardProcessEntity.getId() != null) {
wrapper.ne(OemStandardProcessEntity::getId, oemStandardProcessEntity.getId());
qw.ne(OemStandardProcessEntity::getId, oemStandardProcessEntity.getId());
}
List<OemStandardProcessEntity> list = oemStandardProcessService.list(wrapper);
if (!CollectionUtils.isEmpty(list)) {
List<OemStandardProcessEntity> list = oemStandardProcessService.list(qw);
if (CollectionUtils.isNotEmpty(list)) {
return R.fail("数据已存在");
}
}
@ -91,6 +107,7 @@ public class OemStandardProcessController {
/**
* 外协标准工序代码 下载模板
*
* @return
*/
@GetMapping("/download-excel-template")
@ -101,6 +118,7 @@ public class OemStandardProcessController {
/**
* 外协标准工序代码 导入Excel
*
* @param file
* @return
*/
@ -120,24 +138,40 @@ public class OemStandardProcessController {
if (StringUtils.isEmpty(row.getProcessName())) {
return R.fail(rowNum + "行工序未填写");
}
if(StringUtils.isEmpty(row.getStandardProcessCode())){
if (StringUtils.isEmpty(row.getStandardProcessCode())) {
return R.fail(rowNum + "行标准工序代码未填写");
}
String uniqueStr = StringUtils.joinWith("|", row.getProcessName(), row.getPlate(), row.getPlateThickness(), row.getPartName());
String uniqueStr = StringUtils.joinWith("|", String.valueOf(row.getProcessName()), String.valueOf(row.getPlate()), String.valueOf(row.getPlateThickness()), String.valueOf(row.getPartName()));
if (!uniqueSet.add(uniqueStr)) {
return R.fail(rowNum + "行在Excel中重复");
}
BsProcessSetEntity processSet = bsProcessSetService.getOne(new LambdaQueryWrapper<BsProcessSetEntity>().eq(BsProcessSetEntity::getName, row.getProcessName()));
if (processSet == null) {
List<BsProcessSetEntity> processSet = bsProcessSetService.list(new LambdaQueryWrapper<BsProcessSetEntity>().eq(BsProcessSetEntity::getName, row.getProcessName()));
if (CollectionUtils.isEmpty(processSet)) {
return R.fail(rowNum + "行错误,系统无此工序");
}
OemStandardProcessEntity exist = oemStandardProcessService.getOne(new LambdaQueryWrapper<OemStandardProcessEntity>().eq(OemStandardProcessEntity::getProcessId, processSet.getId()).eq(OemStandardProcessEntity::getPlate, row.getPlate()).eq(OemStandardProcessEntity::getPlateThickness, row.getPlateThickness()).eq(OemStandardProcessEntity::getPartName, row.getPartName()));
if (exist != null) {
LambdaQueryWrapper<OemStandardProcessEntity> qw = new LambdaQueryWrapper<>();
qw.eq(OemStandardProcessEntity::getProcessName, row.getProcessName());
if (StringUtils.isEmpty(row.getPlate())) {
qw.isNull(OemStandardProcessEntity::getPlate);
} else {
qw.eq(OemStandardProcessEntity::getPlate, row.getPlate());
}
if (StringUtils.isEmpty(row.getPlateThickness())) {
qw.isNull(OemStandardProcessEntity::getPlateThickness);
} else {
qw.eq(OemStandardProcessEntity::getPlateThickness, row.getPlateThickness());
}
if (StringUtils.isEmpty(row.getPartName())) {
qw.isNull(OemStandardProcessEntity::getPartName);
} else {
qw.eq(OemStandardProcessEntity::getPartName, row.getPartName());
}
List<OemStandardProcessEntity> exist = oemStandardProcessService.list(qw);
if (CollectionUtils.isNotEmpty(exist)) {
return R.fail(rowNum + "行错误,数据已存在");
}
OemStandardProcessEntity entity = new OemStandardProcessEntity();
BeanUtils.copyProperties(row, entity);
entity.setProcessId(processSet.getId());
entityList.add(entity);
}
return R.status(oemStandardProcessService.saveBatch(entityList));

@ -5,7 +5,7 @@
<!-- 通用查询映射结果 -->
<resultMap id="mesOemStandardProcessVOResultMap" type="org.springblade.desk.oem.pojo.vo.OemStandardProcessVO">
<result column="ID" property="id"/>
<result column="PROCESS_ID" property="processId"/>
<result column="PROCESS_NAME" property="processName"/>
<result column="PLATE" property="plate"/>
<result column="PLATE_THICKNESS" property="plateThickness"/>
<result column="PART_NAME" property="partName"/>
@ -24,15 +24,13 @@
<select id="selectOemStandardProcessPage" resultMap="mesOemStandardProcessVOResultMap">
SELECT * FROM (
SELECT t.*,
p.NAME as PROCESS_NAME,
bu.REAL_NAME as UPDATE_USER_NAME
FROM MES_OEM_STANDARD_PROCESS t
INNER JOIN BS_PROCESS_SET p ON t.PROCESS_ID = p.ID AND p.IS_DELETED = 0
LEFT JOIN BLADE_USER bu ON t.update_user = bu.id
<where>
t.IS_DELETED = 0
<if test="oemStandardProcess.processName != null">
AND p.NAME like concat(concat('%', #{oemStandardProcess.processName}),'%')
AND t.PROCESS_NAME like concat(concat('%', #{oemStandardProcess.processName}),'%')
</if>
<if test="oemStandardProcess.plate != null">
AND t.PLATE like concat(concat('%', #{oemStandardProcess.plate}),'%')

@ -1387,19 +1387,19 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper,
*/
private void matchStandardProcess(List<StatementVO> settlementVOs) {
// 根据工序Id分组
Map<Long, List<StatementVO>> groupByPsId = settlementVOs.stream().collect(Collectors.groupingBy(StatementVO::getPpsId));
Set<Long> psIds = groupByPsId.keySet();
Map<String, List<StatementVO>> groupByPsName = settlementVOs.stream().collect(Collectors.groupingBy(StatementVO::getPsName));
Set<String> psNames = groupByPsName.keySet();
final int batchSize = 500;
List<OemStandardProcessEntity> allStandardList = new ArrayList<>();
List<List<Long>> splitPsIds = Lists.partition(new ArrayList<>(psIds), batchSize);
for (List<Long> subPsIds : splitPsIds) {
List<OemStandardProcessEntity> batchList = oemStandardProcessService.list(new LambdaQueryWrapper<OemStandardProcessEntity>().in(OemStandardProcessEntity::getProcessId, subPsIds));
List<List<String>> splitPsNames = Lists.partition(new ArrayList<>(psNames), batchSize);
for (List<String> subPsNames : splitPsNames) {
List<OemStandardProcessEntity> batchList = oemStandardProcessService.list(new LambdaQueryWrapper<OemStandardProcessEntity>().in(OemStandardProcessEntity::getProcessName, subPsNames));
allStandardList.addAll(batchList);
}
Map<Long, List<OemStandardProcessEntity>> standardMap = allStandardList.stream().collect(Collectors.groupingBy(OemStandardProcessEntity::getProcessId));
for (Map.Entry<Long, List<StatementVO>> entry : groupByPsId.entrySet()) {
Long psId = entry.getKey();
List<OemStandardProcessEntity> standardProcessList = standardMap.getOrDefault(psId, Collections.emptyList());
Map<String, List<OemStandardProcessEntity>> standardMap = allStandardList.stream().collect(Collectors.groupingBy(OemStandardProcessEntity::getProcessName));
for (Map.Entry<String, List<StatementVO>> entry : groupByPsName.entrySet()) {
String psName = entry.getKey();
List<OemStandardProcessEntity> standardProcessList = standardMap.getOrDefault(psName, Collections.emptyList());
for (StatementVO statementVO : entry.getValue()) {
OemStandardProcessEntity oemStandardProcessEntity = getStandardProcessCode(standardProcessList, statementVO);
if (oemStandardProcessEntity != null) {
@ -1422,31 +1422,31 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper,
}
// ====================== 规则1:仅【工序】,其他全为null ======================
for (OemStandardProcessEntity s : allStandardList) {
boolean rule1 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName());
boolean rule1 = Objects.equals(s.getProcessName(), statementVO.getPsName()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName());
if (rule1) return s;
}
// ====================== 规则2:仅【工序+镀种】,其他null ======================
for (OemStandardProcessEntity s : allStandardList) {
boolean rule2 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.equals(s.getPlate(), statementVO.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName());
boolean rule2 = Objects.equals(s.getProcessName(), statementVO.getPsName()) && StringUtils.equals(s.getPlate(), statementVO.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName());
if (rule2) return s;
}
// ====================== 规则3:仅【工序+镀层厚度】,其他null ======================
for (OemStandardProcessEntity s : allStandardList) {
boolean rule3 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getRosThickness()) && StringUtils.isEmpty(s.getPartName());
boolean rule3 = Objects.equals(s.getProcessName(), statementVO.getPsName()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getRosThickness()) && StringUtils.isEmpty(s.getPartName());
if (rule3) return s;
}
// ====================== 规则4:仅【工序+零件名】,其他null ======================
for (OemStandardProcessEntity s : allStandardList) {
boolean rule4 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName());
boolean rule4 = Objects.equals(s.getProcessName(), statementVO.getPsName()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName());
if (rule4) return s;
}
// ====================== 规则5:【工序+镀层厚度+零件名】,镀种null ======================
for (OemStandardProcessEntity s : allStandardList) {
boolean rule5 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getRosThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName());
boolean rule5 = Objects.equals(s.getProcessName(), statementVO.getPsName()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getRosThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName());
if (rule5) return s;
}
return null;

@ -413,7 +413,7 @@ public class YieldOrderCraftServiceImpl extends BaseServiceImpl<YieldOrderCraftM
for (YieldOrderCraft orderCraft : orderCrafts) {
Long centerId = orderCraft.getWorkCenterId();
// 判定是否是特殊工序
BsProcessSetEntity processSet = processSetService.selectBsProcessSetByProcessCode(orderCraft.getProcessCode());
BsProcessSetEntity processSet = processSetService.getById(orderCraft.getPpsId());
if (Func.isNotEmpty(processSet) && Func.isNotBlank(processSet.getTeam())) {
BsTeamSetEntity teamSetEntity = teamSetService.selectByTeamName(processSet.getTeam());
if (Func.isNotEmpty(teamSetEntity)) {
@ -431,7 +431,7 @@ public class YieldOrderCraftServiceImpl extends BaseServiceImpl<YieldOrderCraftM
orderCraft.setWorkCenterId(centerId);
}else{
if(workCenter == null){
throw new BusinessException("工艺" + orderCraft.getCaId() + "未查询到对应作业中心");
throw new ServiceException("工艺" + orderCraft.getCaId() + "未查询到对应作业中心");
}
orderCraft.setWorkCenterId(workCenter.getId());
}
@ -596,16 +596,27 @@ public class YieldOrderCraftServiceImpl extends BaseServiceImpl<YieldOrderCraftM
//开始循环生产订单中组合的工艺能力key集合,主工艺能力之前的全部分配到此外协商
for (Long key : keys) {
//验证工艺能力
oemAbility = oemCraftAbilityService.findBsOemAbility(oemCustomer.getId(), key);
if (oemAbility == null) {
break;
}
// oemAbility = oemCraftAbilityService.findBsOemAbility(oemCustomer.getId(), key);
// if (oemAbility == null) {
// break;
// }
rtnList.addAll(craftAbilityMap.get(key));
}
// 开始分派到外协商
WorkCenter workCenter;
for (YieldOrderCraft orderCraft : rtnList) {
orderCraft.setOcId(oemCustomer.getId());
orderCraft.setIsOutsource(Boolean.TRUE);
BsProcessSetEntity processSet = processSetService.getById(orderCraft.getPpsId());
if (processSet != null && "1".equals(processSet.getIsDispatch())) {
workCenter = workCenterService.getOne(Wrappers.<WorkCenter>lambdaQuery().apply("INSTR(',' || CRAFT_ABILITY_ID || ',', ',' || {0} || ',') > 0", orderCraft.getCaId()));
if (workCenter == null) {
throw new ServiceException("工艺" + orderCraft.getCaId() + "未查询到对应作业中心");
}
orderCraft.setWorkCenterId(workCenter.getId());
orderCraft.setIsOutsource(Boolean.FALSE);
} else {
orderCraft.setOcId(oemCustomer.getId());
orderCraft.setIsOutsource(Boolean.TRUE);
}
}
// 更新主工序工艺能力日产能信息

@ -490,7 +490,18 @@
CASE WHEN a.BASE_AMOUNT IS NULL AND a.SUBSIDY_AMOUNT IS NULL
THEN NULL
ELSE NVL(a.BASE_AMOUNT, 0) + NVL(a.SUBSIDY_AMOUNT, 0)
END AS totalAmount
END AS totalAmount,
a.STANDARD_TIME as standardTime,
a.PREPARE_TIME as prepareTime,
a.HOUR_TYPE as hourType,
CASE
WHEN a.HOUR_TYPE = '0' THEN a.WORK_QTY * a.STANDARD_TIME + PREPARE_TIME
WHEN a.HOUR_TYPE = '1' THEN a.STANDARD_TIME + PREPARE_TIME
ELSE NULL END as totalHour,
CASE
WHEN a.HOUR_TYPE = '0' THEN '按件'
WHEN a.HOUR_TYPE = '1' THEN '按订单'
ELSE '' END as hourTypeValue
FROM MES_WORK_PLAN a
INNER JOIN BS_PROCESS_SET b ON a.PPS_ID = b.ID AND b.IS_DELETED = 0
INNER JOIN MES_MAKE_REC c ON a.ID = c.WP_ID AND c.IS_DELETED = 0
@ -640,7 +651,18 @@
CASE WHEN a.BASE_AMOUNT IS NULL AND a.SUBSIDY_AMOUNT IS NULL
THEN NULL
ELSE NVL(a.BASE_AMOUNT, 0) + NVL(a.SUBSIDY_AMOUNT, 0)
END AS totalAmount
END AS totalAmount,
a.STANDARD_TIME as standardTime,
a.PREPARE_TIME as prepareTime,
a.HOUR_TYPE as hourType,
CASE
WHEN a.HOUR_TYPE = '0' THEN a.WORK_QTY * a.STANDARD_TIME + PREPARE_TIME
WHEN a.HOUR_TYPE = '1' THEN a.STANDARD_TIME + PREPARE_TIME
ELSE NULL END as totalHour,
CASE
WHEN a.HOUR_TYPE = '0' THEN '按件'
WHEN a.HOUR_TYPE = '1' THEN '按订单'
ELSE '' END as hourTypeValue
FROM MES_WORK_PLAN a
INNER JOIN BS_PROCESS_SET b ON a.PPS_ID = b.ID AND b.IS_DELETED = 0
INNER JOIN MES_MAKE_REC c ON a.ID = c.WP_ID AND c.IS_DELETED = 0

@ -2037,7 +2037,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
public void oemHandle(Long nextWpId, int type) {
// 接收工序
WorkPlan workPlan = workPlanService.getById(nextWpId);
if (workPlan != null && !"1".equals(workPlan.getOem())) {
if (workPlan == null || !"1".equals(workPlan.getOem())) {
return;
}
// 完成工序

@ -46,5 +46,9 @@ public interface StOtherReceiptRecordMapper extends BaseMapper<StOtherReceiptRec
WorkOrder getByWoCode(String woCode);
YieldOrder getByYoId(Long yoId);
void updateByWoId(Long id, String batchNo);
void updateByYoId(Long id, String batchNo);
}

@ -123,4 +123,16 @@
FROM MES_YIELD_ORDER
WHERE ID = #{yoId}
</select>
<update id="updateByWoId">
UPDATE MES_WORK_ORDER
SET batch_no = #{batchNo}
WHERE ID = #{id}
</update>
<update id="updateByYoId">
UPDATE MES_YIELD_ORDER
SET batch_no = #{batchNo}
WHERE ID = #{id}
</update>
</mapper>

@ -1,6 +1,8 @@
package org.springblade.wms.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -16,6 +18,7 @@ import org.springblade.wms.excel.StGlassCakeOutExcel;
import org.springblade.wms.mapper.StGlassCakeOutMapper;
import org.springblade.wms.mapper.StOtherReceiptRecordMapper;
import org.springblade.wms.mapper.StRealtimeStockMapper;
import org.springblade.wms.mapper.StStockInoutRecordMapper;
import org.springblade.wms.pojo.dto.StGlassCakeOutDTO;
import org.springblade.wms.pojo.entity.*;
import org.springblade.wms.pojo.vo.StGlassCakeOutVO;
@ -43,6 +46,8 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap
@Resource
IStStockInoutRecordService stStockInoutRecordService;
@Resource
StStockInoutRecordMapper stStockInoutRecordMapper;
@Resource
IStRealtimeStockService stRealtimeStockService;
@Resource
IStGoodsService stGoodsService;
@ -155,6 +160,15 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap
// 3. 初始化预出库列表(收集所有库存充足的预出库实体)
List<StGlassCakeOut> preOutStockList = new ArrayList<>();
String datePrefix = DateUtil.format(new Date(), "yyyyMMdd");
// 2. 当天最大序号
String maxCode = stStockInoutRecordMapper.getMaxCheckCode(datePrefix);
int lastNum = 0;
if (StrUtil.isNotBlank(maxCode)) {
String number = maxCode.substring(datePrefix.length());
lastNum = Integer.parseInt(number);
}
// 4. 遍历每个玻璃饼,单独匹配库存+判断是否生成预出库
if (!CollectionUtils.isEmpty(glassCakePartList)) {
for (DsPartEntity glassCake : glassCakePartList) {
@ -269,7 +283,9 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap
preOutStock.setPartCode(faYieldOrder.getPartCode());
preOutStock.setPartName(faYieldOrder.getPartName());
preOutStock.setOutCode(stStockInoutRecordService.generateCode());
String sirCode = datePrefix + StrUtil.padPre(String.valueOf(lastNum), 4, '0');
preOutStock.setOutCode(sirCode);
// preOutStock.setOutCode(stStockInoutRecordService.generateCode());
preOutStock.setRequireQty(requireQty);
preOutStock.setGoodsId(maxStock.getGoodsId());
StGoods stGoods = stGoodsService.getById(maxStock.getGoodsId());

@ -1,6 +1,8 @@
package org.springblade.wms.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -13,6 +15,7 @@ import org.springblade.desk.order.pojo.entity.YieldOrder;
import org.springblade.wms.excel.StGraphiteMoldOutExcel;
import org.springblade.wms.mapper.StGraphiteMoldOutMapper;
import org.springblade.wms.mapper.StRealtimeStockMapper;
import org.springblade.wms.mapper.StStockInoutRecordMapper;
import org.springblade.wms.pojo.dto.StGraphiteMoldOutDTO;
import org.springblade.wms.pojo.entity.*;
import org.springblade.wms.pojo.vo.StGraphiteMoldOutVO;
@ -40,6 +43,8 @@ public class StGraphiteMoldOutServiceImpl extends BaseServiceImpl<StGraphiteMold
@Resource
IStStockInoutRecordService stStockInoutRecordService;
@Resource
StStockInoutRecordMapper stStockInoutRecordMapper;
@Resource
IStRealtimeStockService stRealtimeStockService;
@Resource
IStGoodsService stGoodsService;
@ -104,6 +109,14 @@ public class StGraphiteMoldOutServiceImpl extends BaseServiceImpl<StGraphiteMold
}
double remainingQty = requireQty;
String datePrefix = DateUtil.format(new Date(), "yyyyMMdd");
// 2. 当天最大序号
String maxCode = stStockInoutRecordMapper.getMaxCheckCode(datePrefix);
int lastNum = 0;
if (StrUtil.isNotBlank(maxCode)) {
String number = maxCode.substring(datePrefix.length());
lastNum = Integer.parseInt(number);
}
for (StRealtimeStock maxStock : candidateStockList) {
if (remainingQty <= 0.001) {
break;
@ -117,7 +130,9 @@ public class StGraphiteMoldOutServiceImpl extends BaseServiceImpl<StGraphiteMold
preOutStock.setYoCode(faYieldOrder.getYoCode());
preOutStock.setCardNo(dto.getCardNo());
preOutStock.setOutCode(stStockInoutRecordService.generateCode());
String sirCode = datePrefix + StrUtil.padPre(String.valueOf(lastNum), 4, '0');
preOutStock.setOutCode(sirCode);
// preOutStock.setOutCode(stStockInoutRecordService.generateCode());
preOutStock.setNeedQuantity(requireQty);
preOutStock.setGoodsId(maxStock.getGoodsId());
StGoods stGoods = stGoodsService.getById(maxStock.getGoodsId());

@ -381,6 +381,13 @@ public class StOtherReceiptRecordServiceImpl extends BaseServiceImpl<StOtherRece
otherReceiptRecord.setInoutList(inoutList);
this.otherWarehousing(otherReceiptRecord, user);
WorkOrder workOrder = baseMapper.getByWoCode(woCode);
workOrder.setBatchNo(batchNo);
baseMapper.updateByWoId(workOrder.getId(), batchNo);
YieldOrder yieldOrder = baseMapper.getByYoId(workOrder.getYoId());
baseMapper.updateByYoId(yieldOrder.getId(), batchNo);
}
@Override

Loading…
Cancel
Save