feat(system): 添加工厂叉车、打包线固定资产和木托绑带资产的 Excel 临时表相关功能
- 新增 ForkliftTemporaryTable、LineFixedAssetsTemporaryTable 和 PackagingToolsTable 的相关实体类、Mapper 和 Controller - 实现了这些资产类型的分页查询、导入等功能 - 添加了获取部门列表的相关接口 - 优化了代码结构,引入了 MyBatis-Plus 的 IService 接口 - 新增了中文转换工具类 ChineseConversionUtils
This commit is contained in:
parent
34d4078199
commit
c48204ce92
@ -137,6 +137,12 @@
|
|||||||
<groupId>org.jsoup</groupId>
|
<groupId>org.jsoup</groupId>
|
||||||
<artifactId>jsoup</artifactId>
|
<artifactId>jsoup</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 中文转换大写 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.belerweb</groupId>
|
||||||
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Test 测试相关 -->
|
<!-- Test 测试相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -22,6 +22,14 @@ public class AssetsTypeCodeEnum {
|
|||||||
* 叉车 电
|
* 叉车 电
|
||||||
*/
|
*/
|
||||||
public static final String FORKLIFT_ELECTRICITY = "FORKLIFT_ELECTRICITY";
|
public static final String FORKLIFT_ELECTRICITY = "FORKLIFT_ELECTRICITY";
|
||||||
|
/**
|
||||||
|
* 叉车 油转电
|
||||||
|
*/
|
||||||
|
public static final String FORKLIFT_OIL_TO_ELECTRICITY = "FORKLIFT_OIL_TO_ELECTRICITY";
|
||||||
|
/**
|
||||||
|
* 拖拉机
|
||||||
|
*/
|
||||||
|
public static final String FORKLIFT_TRACTOR = "FORKLIFT_TRACTOR";
|
||||||
/**
|
/**
|
||||||
* 托盘
|
* 托盘
|
||||||
*/
|
*/
|
||||||
@ -30,4 +38,9 @@ public class AssetsTypeCodeEnum {
|
|||||||
* 绑带
|
* 绑带
|
||||||
*/
|
*/
|
||||||
public static final String STRAPS = "STRAPS";
|
public static final String STRAPS = "STRAPS";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产机械
|
||||||
|
*/
|
||||||
|
public static final String PRODUCTION_MACHINERY = "PRODUCTION_MACHINERY";
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.framework.common.util.spring;
|
||||||
|
|
||||||
|
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spring 中文转换
|
||||||
|
*/
|
||||||
|
public class ChineseConversionUtils {
|
||||||
|
|
||||||
|
public static String getChineseInitials(String chinese) {
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
for (char c : chinese.toCharArray()) {
|
||||||
|
// 获取汉字对应的拼音数组(可能有多音字)
|
||||||
|
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c);
|
||||||
|
if (pinyinArray != null && pinyinArray.length > 0) {
|
||||||
|
// 取第一个拼音的首字母并转大写
|
||||||
|
result.append(pinyinArray[0].charAt(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toString().toUpperCase();
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ import java.util.*;
|
|||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*;
|
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*;
|
||||||
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
|
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
## 特殊:主子表专属逻辑
|
## 特殊:主子表专属逻辑
|
||||||
#foreach ($subTable in $subTables)
|
#foreach ($subTable in $subTables)
|
||||||
import ${basePackage}.module.${subTable.moduleName}.dal.dataobject.${subTable.businessName}.${subTable.className}DO;
|
import ${basePackage}.module.${subTable.moduleName}.dal.dataobject.${subTable.businessName}.${subTable.className}DO;
|
||||||
@ -16,7 +17,7 @@ import ${PageParamClassName};
|
|||||||
*
|
*
|
||||||
* @author ${table.author}
|
* @author ${table.author}
|
||||||
*/
|
*/
|
||||||
public interface ${table.className}Service {
|
public interface ${table.className}Service extends IService<${table.className}DO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建${table.classComment}
|
* 创建${table.classComment}
|
||||||
|
@ -15,6 +15,7 @@ import ${basePackage}.module.${subTable.moduleName}.dal.dataobject.${subTable.bu
|
|||||||
import ${PageResultClassName};
|
import ${PageResultClassName};
|
||||||
import ${PageParamClassName};
|
import ${PageParamClassName};
|
||||||
import ${BeanUtils};
|
import ${BeanUtils};
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import ${basePackage}.module.${table.moduleName}.dal.mysql.${table.businessName}.${table.className}Mapper;
|
import ${basePackage}.module.${table.moduleName}.dal.mysql.${table.businessName}.${table.className}Mapper;
|
||||||
## 特殊:主子表专属逻辑
|
## 特殊:主子表专属逻辑
|
||||||
@ -33,7 +34,8 @@ import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class ${table.className}ServiceImpl implements ${table.className}Service {
|
#set($mainMapper = "${table.className}Mapper")
|
||||||
|
public class ${table.className}ServiceImpl extends ServiceImpl<${mainMapper}, ${table.className}DO> implements ${table.className}Service {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ${table.className}Mapper ${classNameVar}Mapper;
|
private ${table.className}Mapper ${classNameVar}Mapper;
|
||||||
|
@ -30,9 +30,4 @@ public interface AssetsTypeApi {
|
|||||||
@Parameter(name = "id", description = "资产类型编号", example = "1", required = true)
|
@Parameter(name = "id", description = "资产类型编号", example = "1", required = true)
|
||||||
CommonResult<AssetsTypeDTO> get(@RequestParam("id") Long id);
|
CommonResult<AssetsTypeDTO> get(@RequestParam("id") Long id);
|
||||||
|
|
||||||
@GetMapping(PREFIX + "/get-list")
|
|
||||||
@Operation(summary = "获得资产类型信息")
|
|
||||||
@Parameter(name = "ids", description = "资产类型编号", example = "1", required = true)
|
|
||||||
CommonResult<List<AssetsTypeDTO>> getList(@RequestParam("ids") Collection<Long> ids);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,9 +36,4 @@ public class AssetsTypeApiImpl implements AssetsTypeApi {
|
|||||||
return success(BeanUtils.toBean(assetsTypeDO, AssetsTypeDTO.class));
|
return success(BeanUtils.toBean(assetsTypeDO, AssetsTypeDTO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public CommonResult<List<AssetsTypeDTO>> getList(Collection<Long> ids) {
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,10 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.*;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
@ -54,6 +57,14 @@ public class DeptController {
|
|||||||
return success(deptId);
|
return success(deptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("getDeptListByLeaderUserId")
|
||||||
|
@Operation(summary = "获取当前用户所负责的部门列表")
|
||||||
|
public CommonResult<List<DeptDO>> getDeptListByLeaderUserId() {
|
||||||
|
Long id = getLoginUserId();
|
||||||
|
List<DeptDO> list = deptService.getDeptByLeaderId(id);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
@PutMapping("update")
|
@PutMapping("update")
|
||||||
@Operation(summary = "更新部门")
|
@Operation(summary = "更新部门")
|
||||||
@PreAuthorize("@ss.hasPermission('system:dept:update')")
|
@PreAuthorize("@ss.hasPermission('system:dept:update')")
|
||||||
@ -135,7 +146,7 @@ public class DeptController {
|
|||||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = { "/virtually-list"})
|
@GetMapping(value = {"/virtually-list"})
|
||||||
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||||
public CommonResult<List<DeptSimpleRespVO>> getVirtuallyDeptList() {
|
public CommonResult<List<DeptSimpleRespVO>> getVirtuallyDeptList() {
|
||||||
List<DeptDO> list = deptService.getDeptList(
|
List<DeptDO> list = deptService.getDeptList(
|
||||||
@ -178,7 +189,8 @@ public class DeptController {
|
|||||||
|
|
||||||
// 获取外部人员 部门信息
|
// 获取外部人员 部门信息
|
||||||
String deptString = configApi.getConfigKey("system.outsiders").getCheckedData();
|
String deptString = configApi.getConfigKey("system.outsiders").getCheckedData();
|
||||||
Map<String, String> deptMap = JsonUtils.parseObject(deptString, new TypeReference<Map<String, String>>(){});
|
Map<String, String> deptMap = JsonUtils.parseObject(deptString, new TypeReference<Map<String, String>>() {
|
||||||
|
});
|
||||||
// 判断当前登录用户是否 属于外部人员
|
// 判断当前登录用户是否 属于外部人员
|
||||||
for (String key : deptMap.keySet()) {
|
for (String key : deptMap.keySet()) {
|
||||||
String value = deptMap.get(key);
|
String value = deptMap.get(key);
|
||||||
@ -212,7 +224,7 @@ public class DeptController {
|
|||||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = { "/get-factory-dept"})
|
@GetMapping(value = {"/get-factory-dept"})
|
||||||
@Operation(summary = "获取工厂部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
@Operation(summary = "获取工厂部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||||
@DataPermission(enable = false)
|
@DataPermission(enable = false)
|
||||||
public CommonResult<List<DeptSimpleRespVO>> getFactoryDept() {
|
public CommonResult<List<DeptSimpleRespVO>> getFactoryDept() {
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.forklifttemporarytable;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.system.service.forklifttemporarytable.ForkliftTemporaryTableService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 工厂叉车资产(excel 临时表)")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/forklift-temporary-table")
|
||||||
|
@Validated
|
||||||
|
public class ForkliftTemporaryTableController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ForkliftTemporaryTableService forkliftTemporaryTableService;
|
||||||
|
|
||||||
|
@GetMapping("/test")
|
||||||
|
@Operation(summary = "测试")
|
||||||
|
@PermitAll
|
||||||
|
public CommonResult<Boolean> test() {
|
||||||
|
forkliftTemporaryTableService.test();
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.forklifttemporarytable.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂叉车资产(excel 临时表)分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ForkliftTemporaryTablePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "叉车编号")
|
||||||
|
private String carNo;
|
||||||
|
|
||||||
|
@Schema(description = "品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@Schema(description = "资产类型", example = "2")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "设别编号")
|
||||||
|
private String equipmentNo;
|
||||||
|
|
||||||
|
@Schema(description = "出厂编号")
|
||||||
|
private String factoryNo;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
private String nameplateTime;
|
||||||
|
|
||||||
|
@Schema(description = "车牌")
|
||||||
|
private String licensePlate;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "投入使用月份")
|
||||||
|
private String monthOfUse;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.forklifttemporarytable.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂叉车资产(excel 临时表) Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ForkliftTemporaryTableRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "叉车编号")
|
||||||
|
@ExcelProperty("叉车编号")
|
||||||
|
private String carNo;
|
||||||
|
|
||||||
|
@Schema(description = "品牌")
|
||||||
|
@ExcelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@Schema(description = "资产类型", example = "2")
|
||||||
|
@ExcelProperty("资产类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
@ExcelProperty("规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "设别编号")
|
||||||
|
@ExcelProperty("设别编号")
|
||||||
|
private String equipmentNo;
|
||||||
|
|
||||||
|
@Schema(description = "出厂编号")
|
||||||
|
@ExcelProperty("出厂编号")
|
||||||
|
private String factoryNo;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
@ExcelProperty("铭牌日期")
|
||||||
|
private String nameplateTime;
|
||||||
|
|
||||||
|
@Schema(description = "车牌")
|
||||||
|
@ExcelProperty("车牌")
|
||||||
|
private String licensePlate;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
@ExcelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "投入使用月份")
|
||||||
|
@ExcelProperty("投入使用月份")
|
||||||
|
private String monthOfUse;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
|
@ExcelProperty("工厂名称")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.forklifttemporarytable.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂叉车资产(excel 临时表)新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ForkliftTemporaryTableSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "叉车编号")
|
||||||
|
private String carNo;
|
||||||
|
|
||||||
|
@Schema(description = "品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@Schema(description = "资产类型", example = "2")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "设别编号")
|
||||||
|
private String equipmentNo;
|
||||||
|
|
||||||
|
@Schema(description = "出厂编号")
|
||||||
|
private String factoryNo;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
private String nameplateTime;
|
||||||
|
|
||||||
|
@Schema(description = "车牌")
|
||||||
|
private String licensePlate;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "投入使用月份")
|
||||||
|
private String monthOfUse;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.linefixedassetstemporarytable;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.system.service.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 打包线固定资产(excel 临时表)")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/line-fixed-assets-temporary-table")
|
||||||
|
@Validated
|
||||||
|
public class LineFixedAssetsTemporaryTableController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LineFixedAssetsTemporaryTableService lineFixedAssetsTemporaryTableService;
|
||||||
|
|
||||||
|
@GetMapping("/test")
|
||||||
|
@Operation(summary = "打包线固定资产(excel 临时表) 导入")
|
||||||
|
@PermitAll
|
||||||
|
public CommonResult<Boolean> test() {
|
||||||
|
lineFixedAssetsTemporaryTableService.test();
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.linefixedassetstemporarytable.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线固定资产(excel 临时表)分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class LineFixedAssetsTemporaryTablePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "打包线编号")
|
||||||
|
private String lineNo;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private String num;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private String[] nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "使用日期")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private String[] useDate;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "李四")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.linefixedassetstemporarytable.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线固定资产(excel 临时表) Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class LineFixedAssetsTemporaryTableRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25128")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "打包线编号")
|
||||||
|
@ExcelProperty("打包线编号")
|
||||||
|
private String lineNo;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
@ExcelProperty("规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "王五")
|
||||||
|
@ExcelProperty("名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
@ExcelProperty("型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
@ExcelProperty("厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
@ExcelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
@ExcelProperty("数量")
|
||||||
|
private String num;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
@ExcelProperty("铭牌日期")
|
||||||
|
private String nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "使用日期")
|
||||||
|
@ExcelProperty("使用日期")
|
||||||
|
private String useDate;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
@ExcelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "李四")
|
||||||
|
@ExcelProperty("工厂名称")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.linefixedassetstemporarytable.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线固定资产(excel 临时表)新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class LineFixedAssetsTemporaryTableSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25128")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "打包线编号")
|
||||||
|
private String lineNo;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private String num;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
private String nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "使用日期")
|
||||||
|
private String useDate;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "李四")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.packagingtoolstable;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.system.service.packagingtoolstable.PackagingToolsTableService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 木托绑带资产 (excel 临时表)")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/packaging-tools-table")
|
||||||
|
@Validated
|
||||||
|
public class PackagingToolsTableController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PackagingToolsTableService packagingToolsTableService;
|
||||||
|
|
||||||
|
@GetMapping("/test")
|
||||||
|
@Operation(summary = "导入木托绑带资产 (excel 临时表)")
|
||||||
|
@PermitAll
|
||||||
|
public CommonResult<Boolean> test() {
|
||||||
|
packagingToolsTableService.test();
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.packagingtoolstable.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 木托绑带资产 (excel 临时表)分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class PackagingToolsTablePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "总数")
|
||||||
|
private Integer totalNum;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.packagingtoolstable.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 木托绑带资产 (excel 临时表) Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class PackagingToolsTableRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28645")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "王五")
|
||||||
|
@ExcelProperty("名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
@ExcelProperty("规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
@ExcelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "总数")
|
||||||
|
@ExcelProperty("总数")
|
||||||
|
private Integer totalNum;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
|
@ExcelProperty("工厂名称")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.packagingtoolstable.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 木托绑带资产 (excel 临时表)新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class PackagingToolsTableSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28645")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "总数")
|
||||||
|
private Integer totalNum;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.forklifttemporarytable;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂叉车资产(excel 临时表) DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("zc_forklift_temporary_table")
|
||||||
|
@KeySequence("zc_forklift_temporary_table_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ForkliftTemporaryTableDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 叉车编号
|
||||||
|
*/
|
||||||
|
private String carNo;
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*/
|
||||||
|
private String brand;
|
||||||
|
/**
|
||||||
|
* 资产类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 规格
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
/**
|
||||||
|
* 设别编号
|
||||||
|
*/
|
||||||
|
private String equipmentNo;
|
||||||
|
/**
|
||||||
|
* 出厂编号
|
||||||
|
*/
|
||||||
|
private String factoryNo;
|
||||||
|
/**
|
||||||
|
* 铭牌日期
|
||||||
|
*/
|
||||||
|
private String nameplateTime;
|
||||||
|
/**
|
||||||
|
* 车牌
|
||||||
|
*/
|
||||||
|
private String licensePlate;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 投入使用月份
|
||||||
|
*/
|
||||||
|
private String monthOfUse;
|
||||||
|
/**
|
||||||
|
* 工厂名称
|
||||||
|
*/
|
||||||
|
private String factoryName;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.linefixedassetstemporarytable;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产(excel 临时表) DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("zc_line_fixed_assets_temporary_table")
|
||||||
|
@KeySequence("zc_line_fixed_assets_temporary_table_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LineFixedAssetsTemporaryTableDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 打包线编号
|
||||||
|
*/
|
||||||
|
private String lineNo;
|
||||||
|
/**
|
||||||
|
* 规格
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 型号
|
||||||
|
*/
|
||||||
|
private String modelNo;
|
||||||
|
/**
|
||||||
|
* 厂商
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private String num;
|
||||||
|
/**
|
||||||
|
* 铭牌日期
|
||||||
|
*/
|
||||||
|
private String nameplateDate;
|
||||||
|
/**
|
||||||
|
* 使用日期
|
||||||
|
*/
|
||||||
|
private String useDate;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 工厂名称
|
||||||
|
*/
|
||||||
|
private String factoryName;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.packagingtoolstable;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 木托绑带资产 (excel 临时表) DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("zc_packaging_tools_table")
|
||||||
|
@KeySequence("zc_packaging_tools_table_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PackagingToolsTableDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 规格
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 总数
|
||||||
|
*/
|
||||||
|
private Integer totalNum;
|
||||||
|
/**
|
||||||
|
* 工厂名称
|
||||||
|
*/
|
||||||
|
private String factoryName;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.forklifttemporarytable;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.forklifttemporarytable.ForkliftTemporaryTableDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂叉车资产(excel 临时表) Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ForkliftTemporaryTableMapper extends BaseMapperX<ForkliftTemporaryTableDO> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.linefixedassetstemporarytable;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.linefixedassetstemporarytable.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产(excel 临时表) Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface LineFixedAssetsTemporaryTableMapper extends BaseMapperX<LineFixedAssetsTemporaryTableDO> {
|
||||||
|
|
||||||
|
default PageResult<LineFixedAssetsTemporaryTableDO> selectPage(LineFixedAssetsTemporaryTablePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<LineFixedAssetsTemporaryTableDO>()
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getLineNo, reqVO.getLineNo())
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getSku, reqVO.getSku())
|
||||||
|
.likeIfPresent(LineFixedAssetsTemporaryTableDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getModelNo, reqVO.getModelNo())
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getManufacturer, reqVO.getManufacturer())
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getUnit, reqVO.getUnit())
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getNum, reqVO.getNum())
|
||||||
|
.betweenIfPresent(LineFixedAssetsTemporaryTableDO::getNameplateDate, reqVO.getNameplateDate())
|
||||||
|
.betweenIfPresent(LineFixedAssetsTemporaryTableDO::getUseDate, reqVO.getUseDate())
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getStatus, reqVO.getStatus())
|
||||||
|
.likeIfPresent(LineFixedAssetsTemporaryTableDO::getFactoryName, reqVO.getFactoryName())
|
||||||
|
.eqIfPresent(LineFixedAssetsTemporaryTableDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(LineFixedAssetsTemporaryTableDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(LineFixedAssetsTemporaryTableDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.packagingtoolstable;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.packagingtoolstable.PackagingToolsTableDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.packagingtoolstable.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 木托绑带资产 (excel 临时表) Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PackagingToolsTableMapper extends BaseMapperX<PackagingToolsTableDO> {
|
||||||
|
|
||||||
|
default PageResult<PackagingToolsTableDO> selectPage(PackagingToolsTablePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<PackagingToolsTableDO>()
|
||||||
|
.likeIfPresent(PackagingToolsTableDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(PackagingToolsTableDO::getSku, reqVO.getSku())
|
||||||
|
.eqIfPresent(PackagingToolsTableDO::getUnit, reqVO.getUnit())
|
||||||
|
.eqIfPresent(PackagingToolsTableDO::getTotalNum, reqVO.getTotalNum())
|
||||||
|
.likeIfPresent(PackagingToolsTableDO::getFactoryName, reqVO.getFactoryName())
|
||||||
|
.eqIfPresent(PackagingToolsTableDO::getRemake, reqVO.getRemake())
|
||||||
|
.betweenIfPresent(PackagingToolsTableDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(PackagingToolsTableDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -6,12 +6,14 @@ import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
|
|||||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||||
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
||||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryforklift.FactoryForkliftApi;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.linefixedassets.LineFixedAssetsApi;
|
||||||
import cn.iocoder.yudao.module.smartfactory.api.staff.StaffApi;
|
import cn.iocoder.yudao.module.smartfactory.api.staff.StaffApi;
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, FactoryInfoApi.class, BpmModelApi.class, BpmOAGoOutApi.class, BpmOAEntryApi.class, ConfigApi.class,
|
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, FactoryInfoApi.class, BpmModelApi.class, BpmOAGoOutApi.class, BpmOAEntryApi.class, ConfigApi.class,
|
||||||
BpmOAEvectionApi.class, BpmOAReplacementCardApi.class, BpmOARefundApi.class, BpmOALeaveApi.class, StaffApi.class})
|
BpmOAEvectionApi.class, BpmOAReplacementCardApi.class, BpmOARefundApi.class, BpmOALeaveApi.class, StaffApi.class, FactoryForkliftApi.class, LineFixedAssetsApi.class})
|
||||||
public class RpcConfiguration {
|
public class RpcConfiguration {
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.system.api.assets.dto.SupplierAssetAllocationDTO;
|
|||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsPageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsPageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -14,7 +15,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author 艾楷
|
* @author 艾楷
|
||||||
*/
|
*/
|
||||||
public interface AssetsService {
|
public interface AssetsService extends IService<AssetsDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建资产
|
* 创建资产
|
||||||
|
@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.assets.AssetsMapper;
|
|||||||
import cn.iocoder.yudao.module.system.dal.mysql.assets.AssetsTypeMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.assets.AssetsTypeMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -28,7 +29,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class AssetsServiceImpl implements AssetsService {
|
public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, AssetsDO> implements AssetsService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AssetsMapper assetsMapper;
|
private AssetsMapper assetsMapper;
|
||||||
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypePageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypePageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypeSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypeSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -14,7 +15,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author 艾楷
|
* @author 艾楷
|
||||||
*/
|
*/
|
||||||
public interface AssetsTypeService {
|
public interface AssetsTypeService extends IService<AssetsTypeDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建资产类型
|
* 创建资产类型
|
||||||
@ -71,7 +72,7 @@ public interface AssetsTypeService {
|
|||||||
List<AssetsTypeDO> getByPid(Long pid);
|
List<AssetsTypeDO> getByPid(Long pid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取全部
|
* 获取全部 业务类型 1行政类型 2生产类型
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -79,6 +80,7 @@ public interface AssetsTypeService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据资产名称 获得指定资产类型信息
|
* 根据资产名称 获得指定资产类型信息
|
||||||
|
*
|
||||||
* @param name 资产名称
|
* @param name 资产名称
|
||||||
* @return 资产类型
|
* @return 资产类型
|
||||||
*/
|
*/
|
||||||
@ -86,6 +88,7 @@ public interface AssetsTypeService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过资产类型code获取资产类型ids
|
* 通过资产类型code获取资产类型ids
|
||||||
|
*
|
||||||
* @param code
|
* @param code
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypeSaveR
|
|||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.mysql.assets.AssetsTypeMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.assets.AssetsTypeMapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class AssetsTypeServiceImpl implements AssetsTypeService {
|
public class AssetsTypeServiceImpl extends ServiceImpl<AssetsTypeMapper, AssetsTypeDO> implements AssetsTypeService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AssetsTypeMapper assetsTypeMapper;
|
private AssetsTypeMapper assetsTypeMapper;
|
||||||
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.system.controller.admin.assets.dto.AssetAllocatio
|
|||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.*;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.*;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsInOutStockDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsInOutStockDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -14,7 +15,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author 艾楷
|
* @author 艾楷
|
||||||
*/
|
*/
|
||||||
public interface DeptAssetsInOutStockService {
|
public interface DeptAssetsInOutStockService extends IService<DeptAssetsInOutStockDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建部门资产出入库
|
* 创建部门资产出入库
|
||||||
|
@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.assets.DeptAssetsMapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -37,7 +38,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.STOCK_EXCE
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class DeptAssetsInOutStockServiceImpl implements DeptAssetsInOutStockService {
|
public class DeptAssetsInOutStockServiceImpl extends ServiceImpl<DeptAssetsInOutStockMapper, DeptAssetsInOutStockDO> implements DeptAssetsInOutStockService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DeptAssetsInOutStockMapper deptAssetsInOutStockMapper;
|
private DeptAssetsInOutStockMapper deptAssetsInOutStockMapper;
|
||||||
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.assets.vo.DeptAssetsPageR
|
|||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.DeptAssetsRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.DeptAssetsRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.DeptAssetsSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.DeptAssetsSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ import javax.validation.Valid;
|
|||||||
*
|
*
|
||||||
* @author 艾楷
|
* @author 艾楷
|
||||||
*/
|
*/
|
||||||
public interface DeptAssetsService {
|
public interface DeptAssetsService extends IService<DeptAssetsDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建部门资产
|
* 创建部门资产
|
||||||
|
@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.system.controller.admin.assets.vo.DeptAssetsSaveR
|
|||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.mysql.assets.DeptAssetsMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.assets.DeptAssetsMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ import javax.annotation.Resource;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class DeptAssetsServiceImpl implements DeptAssetsService {
|
public class DeptAssetsServiceImpl extends ServiceImpl<DeptAssetsMapper, DeptAssetsDO> implements DeptAssetsService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DeptAssetsMapper deptAssetsMapper;
|
private DeptAssetsMapper deptAssetsMapper;
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.forklifttemporarytable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂叉车资产(excel 临时表) Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface ForkliftTemporaryTableService {
|
||||||
|
|
||||||
|
|
||||||
|
void test();
|
||||||
|
}
|
@ -0,0 +1,162 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.forklifttemporarytable;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.AssetsTypeCodeEnum;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryforklift.FactoryForkliftApi;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryforklift.dto.FactoryForkliftDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsInOutStockDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.forklifttemporarytable.ForkliftTemporaryTableDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.mysql.forklifttemporarytable.ForkliftTemporaryTableMapper;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.AssetsService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.AssetsTypeService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.DeptAssetsInOutStockService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.DeptAssetsService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂叉车资产(excel 临时表) Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ForkliftTemporaryTableServiceImpl implements ForkliftTemporaryTableService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ForkliftTemporaryTableMapper forkliftTemporaryTableMapper;
|
||||||
|
@Resource
|
||||||
|
private AssetsTypeService assetsTypeService;
|
||||||
|
@Resource
|
||||||
|
private AssetsService assetsService;
|
||||||
|
@Resource
|
||||||
|
private FactoryInfoApi factoryInfoApi;
|
||||||
|
@Resource
|
||||||
|
private DeptService deptService;
|
||||||
|
@Resource
|
||||||
|
private DeptAssetsService deptAssetsService;
|
||||||
|
@Resource
|
||||||
|
private DeptAssetsInOutStockService deptAssetsInOutStockService;
|
||||||
|
@Resource
|
||||||
|
private FactoryForkliftApi factoryForkliftApi;
|
||||||
|
@Override
|
||||||
|
public void test() {
|
||||||
|
List<ForkliftTemporaryTableDO> forkliftTemporaryTableDOS = forkliftTemporaryTableMapper.selectList();
|
||||||
|
// 获取所有叉车类型
|
||||||
|
List<AssetsTypeDO> list = assetsTypeService.list(new LambdaQueryWrapper<AssetsTypeDO>()
|
||||||
|
.like(AssetsTypeDO::getCode, AssetsTypeCodeEnum.FORKLIFT));
|
||||||
|
//根据名字分组
|
||||||
|
Map<String, Long> map = list.stream().collect(Collectors.toMap(AssetsTypeDO::getName, AssetsTypeDO::getId));
|
||||||
|
// 需要做新增操作的列表 ------ 开始
|
||||||
|
List<AssetsDO> assetsDOS = new ArrayList<>();
|
||||||
|
List<DeptAssetsInOutStockDO> deptAssetsInOutStockDOS = new ArrayList<>();
|
||||||
|
List<DeptAssetsDO> deptAssetsDOS = new ArrayList<>();
|
||||||
|
List<FactoryForkliftDTO> factoryForkliftDTOS = new ArrayList<>();
|
||||||
|
// 需要做新增操作的列表 ------ 结束
|
||||||
|
|
||||||
|
|
||||||
|
// 获取工厂列表
|
||||||
|
List<FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getAllList().getCheckedData();
|
||||||
|
Map<String, Long> factoryMap = factoryInfoDTOS.stream().collect(Collectors.toMap(FactoryInfoDTO::getShortName, FactoryInfoDTO::getId));
|
||||||
|
// 获取工厂对应的部门
|
||||||
|
// 获取部门列表
|
||||||
|
List<DeptDO> deptDOList = deptService.getDeptListByFactoryIds(factoryInfoDTOS.stream().map(FactoryInfoDTO::getId).collect(Collectors.toList()));
|
||||||
|
Map<Long, Long> factoryDeptMap = deptDOList.stream().collect(Collectors.toMap(DeptDO::getFactoryId, DeptDO::getId));
|
||||||
|
|
||||||
|
for (ForkliftTemporaryTableDO forkliftTemporaryTableDO : forkliftTemporaryTableDOS) {
|
||||||
|
// ----------- 资产表 -----------
|
||||||
|
AssetsDO assetsDO = new AssetsDO();
|
||||||
|
assetsDO.setId(IdWorker.getId());
|
||||||
|
assetsDO.setName(forkliftTemporaryTableDO.getType());
|
||||||
|
// 公司名称 + 用途 + 类别 + 名称 + 日期 + 流水号
|
||||||
|
|
||||||
|
// String assetsNo = ChineseConversionUtils.getChineseInitials(forkliftTemporaryTableDO.getFactoryName()) + "_" +
|
||||||
|
// ChineseConversionUtils.getChineseInitials(forkliftTemporaryTableDO.getType()) + "_" +
|
||||||
|
// ChineseConversionUtils.getChineseInitials();
|
||||||
|
assetsDO.setAssetsNo("//");
|
||||||
|
assetsDO.setStatus(0);
|
||||||
|
assetsDO.setStock(0);
|
||||||
|
Long typeId = map.get(forkliftTemporaryTableDO.getType());
|
||||||
|
assetsDO.setTypeId(typeId);
|
||||||
|
// ----------- 资产表 -----------
|
||||||
|
|
||||||
|
// -- 我这里只有工厂名称 - 我要通过工厂名称 找到工厂id 再通过工厂id 拿到对应的部门id
|
||||||
|
Long factoryId = factoryMap.get(forkliftTemporaryTableDO.getFactoryName().trim());
|
||||||
|
Long deptId = null;
|
||||||
|
if (factoryId != null) {
|
||||||
|
deptId = factoryDeptMap.get(factoryId);
|
||||||
|
}
|
||||||
|
if (deptId == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// ----------- 资产出入库记录表 -----------
|
||||||
|
DeptAssetsInOutStockDO deptAssetsInOutStockDO = new DeptAssetsInOutStockDO();
|
||||||
|
deptAssetsInOutStockDO.setInDeptId(deptId);
|
||||||
|
deptAssetsInOutStockDO.setOutDeptId(-1L);
|
||||||
|
deptAssetsInOutStockDO.setAssetsId(assetsDO.getId());
|
||||||
|
deptAssetsInOutStockDO.setNum(1);
|
||||||
|
deptAssetsInOutStockDO.setInOutNo(IdWorker.get32UUID());
|
||||||
|
// ----------- 资产出入库记录表 -----------
|
||||||
|
|
||||||
|
// ----------- 部门资产表 -----------
|
||||||
|
DeptAssetsDO deptAssetsDO = new DeptAssetsDO();
|
||||||
|
deptAssetsDO.setId(IdWorker.getId());
|
||||||
|
deptAssetsDO.setDeptId(deptId);
|
||||||
|
deptAssetsDO.setAssetsId(assetsDO.getId());
|
||||||
|
deptAssetsDO.setStatus("在用".equals(forkliftTemporaryTableDO.getStatus()) ? 1
|
||||||
|
: "维修".equals(forkliftTemporaryTableDO.getStatus()) ? 2
|
||||||
|
: "备用".equals(forkliftTemporaryTableDO.getStatus()) ? 0
|
||||||
|
: "停用".equals(forkliftTemporaryTableDO.getStatus()) ? 4
|
||||||
|
: "报废".equals(forkliftTemporaryTableDO.getStatus()) ? 3
|
||||||
|
: -1);
|
||||||
|
deptAssetsDO.setStock(1);
|
||||||
|
// ----------- 部门资产表 -----------
|
||||||
|
// ----------- 叉车表 -----------
|
||||||
|
FactoryForkliftDTO factoryForkliftDTO = new FactoryForkliftDTO();
|
||||||
|
factoryForkliftDTO.setAssetsNo(assetsDO.getAssetsNo());
|
||||||
|
factoryForkliftDTO.setFactoryId(factoryId);
|
||||||
|
factoryForkliftDTO.setDeptId(deptId);
|
||||||
|
factoryForkliftDTO.setName(forkliftTemporaryTableDO.getType());
|
||||||
|
factoryForkliftDTO.setManufacturer(forkliftTemporaryTableDO.getBrand());
|
||||||
|
factoryForkliftDTO.setEquipmentCode(forkliftTemporaryTableDO.getEquipmentNo());
|
||||||
|
factoryForkliftDTO.setSerialNo(forkliftTemporaryTableDO.getFactoryNo());
|
||||||
|
factoryForkliftDTO.setModelNo(forkliftTemporaryTableDO.getSku());
|
||||||
|
factoryForkliftDTO.setLicensePlate(forkliftTemporaryTableDO.getLicensePlate());
|
||||||
|
factoryForkliftDTO.setNameplateDate(forkliftTemporaryTableDO.getNameplateTime());
|
||||||
|
factoryForkliftDTO.setRemark(forkliftTemporaryTableDO.getRemark());
|
||||||
|
|
||||||
|
// ----------- 叉车表 -----------
|
||||||
|
factoryForkliftDTOS.add(factoryForkliftDTO);
|
||||||
|
deptAssetsDOS.add(deptAssetsDO);
|
||||||
|
deptAssetsInOutStockDOS.add(deptAssetsInOutStockDO);
|
||||||
|
assetsDOS.add(assetsDO);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(factoryForkliftDTOS)) {
|
||||||
|
factoryForkliftApi.batchSave(factoryForkliftDTOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(assetsDOS)) {
|
||||||
|
assetsService.saveBatch(assetsDOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deptAssetsDOS)) {
|
||||||
|
deptAssetsService.saveBatch(deptAssetsDOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deptAssetsInOutStockDOS)) {
|
||||||
|
deptAssetsInOutStockService.saveBatch(deptAssetsInOutStockDOS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.linefixedassetstemporarytable;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产(excel 临时表) Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface LineFixedAssetsTemporaryTableService extends IService<LineFixedAssetsTemporaryTableDO> {
|
||||||
|
|
||||||
|
void test();
|
||||||
|
}
|
@ -0,0 +1,169 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.linefixedassetstemporarytable;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.linefixedassets.LineFixedAssetsApi;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.linefixedassets.dto.LineFixedAssetsDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsInOutStockDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.mysql.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableMapper;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.AssetsService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.DeptAssetsInOutStockService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.DeptAssetsService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产(excel 临时表) Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class LineFixedAssetsTemporaryTableServiceImpl extends ServiceImpl<LineFixedAssetsTemporaryTableMapper, LineFixedAssetsTemporaryTableDO> implements LineFixedAssetsTemporaryTableService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LineFixedAssetsTemporaryTableMapper lineFixedAssetsTemporaryTableMapper;
|
||||||
|
@Resource
|
||||||
|
private FactoryInfoApi factoryInfoApi;
|
||||||
|
@Resource
|
||||||
|
private DeptService deptService;
|
||||||
|
@Resource
|
||||||
|
private LineFixedAssetsApi lineFixedAssetsApi;
|
||||||
|
@Resource
|
||||||
|
private AssetsService assetsService;
|
||||||
|
@Resource
|
||||||
|
private DeptAssetsService deptAssetsService;
|
||||||
|
@Resource
|
||||||
|
private DeptAssetsInOutStockService deptAssetsInOutStockService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void test() {
|
||||||
|
List<LineFixedAssetsTemporaryTableDO> lineFixedAssetsTemporaryTableDOS = lineFixedAssetsTemporaryTableMapper.selectList();
|
||||||
|
//首先进入资产表
|
||||||
|
// 需要做新增操作的列表 ------ 开始
|
||||||
|
List<AssetsDO> assetsDOS = new ArrayList<>();
|
||||||
|
List<DeptAssetsInOutStockDO> deptAssetsInOutStockDOS = new ArrayList<>();
|
||||||
|
List<DeptAssetsDO> deptAssetsDOS = new ArrayList<>();
|
||||||
|
List<LineFixedAssetsDTO> lineFixedAssetsDTOS = new ArrayList<>();
|
||||||
|
// 需要做新增操作的列表 ------ 结束
|
||||||
|
|
||||||
|
// 获取工厂列表
|
||||||
|
List<FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getAllList().getCheckedData();
|
||||||
|
Map<String, Long> factoryMap = factoryInfoDTOS.stream().collect(Collectors.toMap(FactoryInfoDTO::getShortName, FactoryInfoDTO::getId));
|
||||||
|
// 获取工厂对应的部门
|
||||||
|
// 获取部门列表
|
||||||
|
List<DeptDO> deptDOList = deptService.getDeptListByFactoryIds(factoryInfoDTOS.stream().map(FactoryInfoDTO::getId).collect(Collectors.toList()));
|
||||||
|
Map<Long, Long> factoryDeptMap = deptDOList.stream().collect(Collectors.toMap(DeptDO::getFactoryId, DeptDO::getId));
|
||||||
|
|
||||||
|
|
||||||
|
// -- 如果数量 大于 1 则再复制一条数据到列表中
|
||||||
|
List<LineFixedAssetsTemporaryTableDO> resultList = lineFixedAssetsTemporaryTableDOS.stream()
|
||||||
|
.flatMap(item -> {
|
||||||
|
if ("米".equals(item.getUnit())) { // 判断单位为"米"
|
||||||
|
return Stream.of(item); // 直接返回单个元素流
|
||||||
|
} else {
|
||||||
|
int copies = Math.max(Integer.parseInt(item.getNum()), 1);
|
||||||
|
return IntStream.range(0, copies).mapToObj(i -> item); // 正常复制
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
for (LineFixedAssetsTemporaryTableDO lineFixedAssetsTemporaryTableDO : resultList) {
|
||||||
|
// -- 我这里只有工厂名称 - 我要通过工厂名称 找到工厂id 再通过工厂id 拿到对应的部门id
|
||||||
|
Long factoryId = factoryMap.get(lineFixedAssetsTemporaryTableDO.getFactoryName().trim());
|
||||||
|
Long deptId = null;
|
||||||
|
if (factoryId != null) {
|
||||||
|
deptId = factoryDeptMap.get(factoryId);
|
||||||
|
}
|
||||||
|
if (deptId == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------- 资产表 -----------
|
||||||
|
AssetsDO assetsDO = new AssetsDO();
|
||||||
|
assetsDO.setId(IdWorker.getId());
|
||||||
|
assetsDO.setName(lineFixedAssetsTemporaryTableDO.getName());
|
||||||
|
// 公司名称 + 用途 + 类别 + 名称 + 日期 + 流水号
|
||||||
|
// String assetsNo = ChineseConversionUtils.getChineseInitials(forkliftTemporaryTableDO.getFactoryName()) + "_" +
|
||||||
|
// ChineseConversionUtils.getChineseInitials(forkliftTemporaryTableDO.getType()) + "_" +
|
||||||
|
// ChineseConversionUtils.getChineseInitials();
|
||||||
|
assetsDO.setAssetsNo(IdWorker.get32UUID());
|
||||||
|
assetsDO.setStatus(0);
|
||||||
|
assetsDO.setStock(0);
|
||||||
|
// todo 这里的类型 到生产上可能会变 要注意
|
||||||
|
assetsDO.setTypeId(37L);
|
||||||
|
// ----------- 资产表 -----------
|
||||||
|
|
||||||
|
// ----------- 资产出入库记录表 -----------
|
||||||
|
DeptAssetsInOutStockDO deptAssetsInOutStockDO = new DeptAssetsInOutStockDO();
|
||||||
|
deptAssetsInOutStockDO.setInDeptId(deptId);
|
||||||
|
deptAssetsInOutStockDO.setOutDeptId(-1L);
|
||||||
|
deptAssetsInOutStockDO.setAssetsId(assetsDO.getId());
|
||||||
|
deptAssetsInOutStockDO.setNum(1);
|
||||||
|
deptAssetsInOutStockDO.setInOutNo(IdWorker.get32UUID());
|
||||||
|
// ----------- 资产出入库记录表 -----------
|
||||||
|
|
||||||
|
|
||||||
|
// ----------- 部门资产表 -----------
|
||||||
|
DeptAssetsDO deptAssetsDO = new DeptAssetsDO();
|
||||||
|
deptAssetsDO.setId(IdWorker.getId());
|
||||||
|
deptAssetsDO.setDeptId(deptId);
|
||||||
|
deptAssetsDO.setAssetsId(assetsDO.getId());
|
||||||
|
deptAssetsDO.setStatus("在用".equals(lineFixedAssetsTemporaryTableDO.getStatus()) ? 1
|
||||||
|
: "维修".equals(lineFixedAssetsTemporaryTableDO.getStatus()) ? 2
|
||||||
|
: "备用".equals(lineFixedAssetsTemporaryTableDO.getStatus()) ? 0
|
||||||
|
: "停用".equals(lineFixedAssetsTemporaryTableDO.getStatus()) ? 4
|
||||||
|
: "报废".equals(lineFixedAssetsTemporaryTableDO.getStatus()) ? 3
|
||||||
|
: -1);
|
||||||
|
deptAssetsDO.setStock(1);
|
||||||
|
// ----------- 部门资产表 -----------
|
||||||
|
|
||||||
|
// ----------- 工厂固定资产表 -----------
|
||||||
|
LineFixedAssetsDTO lineFixedAssetsDTO = new LineFixedAssetsDTO();
|
||||||
|
lineFixedAssetsDTO.setAssetsNo(assetsDO.getAssetsNo());
|
||||||
|
lineFixedAssetsDTO.setFactoryId(factoryId);
|
||||||
|
lineFixedAssetsDTO.setDeptId(deptId);
|
||||||
|
lineFixedAssetsDTO.setName(lineFixedAssetsTemporaryTableDO.getName());
|
||||||
|
lineFixedAssetsDTO.setSku(lineFixedAssetsTemporaryTableDO.getSku());
|
||||||
|
lineFixedAssetsDTO.setLineNo(lineFixedAssetsTemporaryTableDO.getLineNo());
|
||||||
|
lineFixedAssetsDTO.setModelNo(lineFixedAssetsTemporaryTableDO.getModelNo());
|
||||||
|
lineFixedAssetsDTO.setManufacturer(lineFixedAssetsTemporaryTableDO.getManufacturer());
|
||||||
|
lineFixedAssetsDTO.setUnit(lineFixedAssetsTemporaryTableDO.getUnit());
|
||||||
|
lineFixedAssetsDTO.setNameplateDate(lineFixedAssetsTemporaryTableDO.getNameplateDate());
|
||||||
|
lineFixedAssetsDTO.setUseDate(lineFixedAssetsTemporaryTableDO.getUseDate());
|
||||||
|
lineFixedAssetsDTO.setRemark(lineFixedAssetsTemporaryTableDO.getRemark());
|
||||||
|
// ----------- 工厂固定资产表 -----------
|
||||||
|
assetsDOS.add(assetsDO);
|
||||||
|
deptAssetsInOutStockDOS.add(deptAssetsInOutStockDO);
|
||||||
|
deptAssetsDOS.add(deptAssetsDO);
|
||||||
|
lineFixedAssetsDTOS.add(lineFixedAssetsDTO);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(assetsDOS)) {
|
||||||
|
assetsService.saveBatch(assetsDOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deptAssetsDOS)) {
|
||||||
|
deptAssetsService.saveBatch(deptAssetsDOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deptAssetsInOutStockDOS)) {
|
||||||
|
deptAssetsInOutStockService.saveBatch(deptAssetsInOutStockDOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(lineFixedAssetsDTOS)) {
|
||||||
|
lineFixedAssetsApi.batchSave(lineFixedAssetsDTOS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.packagingtoolstable;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.packagingtoolstable.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.packagingtoolstable.PackagingToolsTableDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 木托绑带资产 (excel 临时表) Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface PackagingToolsTableService extends IService<PackagingToolsTableDO> {
|
||||||
|
|
||||||
|
void test();
|
||||||
|
}
|
@ -0,0 +1,143 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.packagingtoolstable;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.DeptAssetsInOutStockDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.packagingtoolstable.PackagingToolsTableDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.mysql.packagingtoolstable.PackagingToolsTableMapper;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.AssetsService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.AssetsTypeService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.DeptAssetsInOutStockService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.assets.DeptAssetsService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 木托绑带资产 (excel 临时表) Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class PackagingToolsTableServiceImpl extends ServiceImpl<PackagingToolsTableMapper, PackagingToolsTableDO> implements PackagingToolsTableService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PackagingToolsTableMapper packagingToolsTableMapper;
|
||||||
|
@Resource
|
||||||
|
private FactoryInfoApi factoryInfoApi;
|
||||||
|
@Resource
|
||||||
|
private DeptService deptService;
|
||||||
|
@Resource
|
||||||
|
private AssetsTypeService assetsTypeService;
|
||||||
|
@Resource
|
||||||
|
private AssetsService assetsService;
|
||||||
|
@Resource
|
||||||
|
private DeptAssetsService deptAssetsService;
|
||||||
|
@Resource
|
||||||
|
private DeptAssetsInOutStockService deptAssetsInOutStockService;
|
||||||
|
@Override
|
||||||
|
public void test() {
|
||||||
|
List<PackagingToolsTableDO> packagingToolsTableDOS = packagingToolsTableMapper.selectList();
|
||||||
|
//首先进入资产表
|
||||||
|
// 需要做新增操作的列表 ------ 开始
|
||||||
|
List<AssetsDO> assetsDOS = new ArrayList<>();
|
||||||
|
List<DeptAssetsInOutStockDO> deptAssetsInOutStockDOS = new ArrayList<>();
|
||||||
|
List<DeptAssetsDO> deptAssetsDOS = new ArrayList<>();
|
||||||
|
// 需要做新增操作的列表 ------ 结束
|
||||||
|
|
||||||
|
// 获取工厂列表
|
||||||
|
List<FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getAllList().getCheckedData();
|
||||||
|
Map<String, Long> factoryMap = factoryInfoDTOS.stream().collect(Collectors.toMap(FactoryInfoDTO::getShortName, FactoryInfoDTO::getId));
|
||||||
|
// 获取工厂对应的部门
|
||||||
|
// 获取部门列表
|
||||||
|
List<DeptDO> deptDOList = deptService.getDeptListByFactoryIds(factoryInfoDTOS.stream().map(FactoryInfoDTO::getId).collect(Collectors.toList()));
|
||||||
|
Map<Long, Long> factoryDeptMap = deptDOList.stream().collect(Collectors.toMap(DeptDO::getFactoryId, DeptDO::getId));
|
||||||
|
|
||||||
|
List<AssetsTypeDO> assetsTypeDOS = assetsTypeService.getAllList(2);
|
||||||
|
for (PackagingToolsTableDO packagingToolsTableDO : packagingToolsTableDOS) {
|
||||||
|
// -- 我这里只有工厂名称 - 我要通过工厂名称 找到工厂id 再通过工厂id 拿到对应的部门id
|
||||||
|
Long factoryId = factoryMap.get(packagingToolsTableDO.getFactoryName().trim());
|
||||||
|
Long deptId = null;
|
||||||
|
if (factoryId != null) {
|
||||||
|
deptId = factoryDeptMap.get(factoryId);
|
||||||
|
}
|
||||||
|
if (deptId == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------- 资产表 -----------
|
||||||
|
AssetsDO assetsDO = new AssetsDO();
|
||||||
|
assetsDO.setId(IdWorker.getId());
|
||||||
|
assetsDO.setName(packagingToolsTableDO.getName());
|
||||||
|
// 公司名称 + 用途 + 类别 + 名称 + 日期 + 流水号
|
||||||
|
// String assetsNo = ChineseConversionUtils.getChineseInitials(forkliftTemporaryTableDO.getFactoryName()) + "_" +
|
||||||
|
// ChineseConversionUtils.getChineseInitials(forkliftTemporaryTableDO.getType()) + "_" +
|
||||||
|
// ChineseConversionUtils.getChineseInitials();
|
||||||
|
assetsDO.setAssetsNo(IdWorker.get32UUID());
|
||||||
|
assetsDO.setStatus(-1);
|
||||||
|
// -- 根据名称 + sku 计算得出类型id
|
||||||
|
assetsDO.setStock(0);
|
||||||
|
// -- 先根据名称过滤一道 - 再根据sku 过滤一道
|
||||||
|
List<AssetsTypeDO> assetsTypeDOList = assetsTypeDOS.stream()
|
||||||
|
.filter(a -> a.getName().contains(packagingToolsTableDO.getName())).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(assetsTypeDOList) && StrUtil.isNotEmpty(packagingToolsTableDO.getSku())) {
|
||||||
|
assetsTypeDOList = assetsTypeDOList.stream().filter(a -> a.getName().contains(packagingToolsTableDO.getSku())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if (CollUtil.isEmpty(assetsTypeDOList)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
assetsDO.setTypeId(assetsTypeDOList.get(0).getId());
|
||||||
|
// ----------- 资产表 -----------
|
||||||
|
|
||||||
|
// ----------- 资产出入库记录表 -----------
|
||||||
|
DeptAssetsInOutStockDO deptAssetsInOutStockDO = new DeptAssetsInOutStockDO();
|
||||||
|
deptAssetsInOutStockDO.setInDeptId(deptId);
|
||||||
|
deptAssetsInOutStockDO.setOutDeptId(-1L);
|
||||||
|
deptAssetsInOutStockDO.setAssetsId(assetsDO.getId());
|
||||||
|
deptAssetsInOutStockDO.setNum(packagingToolsTableDO.getTotalNum());
|
||||||
|
deptAssetsInOutStockDO.setInOutNo(IdWorker.get32UUID());
|
||||||
|
// ----------- 资产出入库记录表 -----------
|
||||||
|
|
||||||
|
|
||||||
|
// ----------- 部门资产表 -----------
|
||||||
|
DeptAssetsDO deptAssetsDO = new DeptAssetsDO();
|
||||||
|
deptAssetsDO.setId(IdWorker.getId());
|
||||||
|
deptAssetsDO.setDeptId(deptId);
|
||||||
|
deptAssetsDO.setAssetsId(assetsDO.getId());
|
||||||
|
deptAssetsDO.setStatus(1);
|
||||||
|
deptAssetsDO.setStock(packagingToolsTableDO.getTotalNum());
|
||||||
|
// ----------- 部门资产表 -----------
|
||||||
|
|
||||||
|
// ----------- 工厂固定资产表 -----------
|
||||||
|
assetsDOS.add(assetsDO);
|
||||||
|
deptAssetsInOutStockDOS.add(deptAssetsInOutStockDO);
|
||||||
|
deptAssetsDOS.add(deptAssetsDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(assetsDOS)) {
|
||||||
|
assetsService.saveBatch(assetsDOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deptAssetsDOS)) {
|
||||||
|
deptAssetsService.saveBatch(deptAssetsDOS);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deptAssetsInOutStockDOS)) {
|
||||||
|
deptAssetsInOutStockService.saveBatch(deptAssetsInOutStockDOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -41,13 +41,13 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://47.97.8.94:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
url: jdbc:mysql://47.97.8.94:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: yhtkj@2024!
|
password: yhtkj@2024!
|
||||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://47.97.8.94:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
url: jdbc:mysql://47.97.8.94:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: yhtkj@2024!
|
password: yhtkj@2024!
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.system.dal.mysql.forklifttemporarytable.ForkliftTemporaryTableMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.system.dal.mysql.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.system.dal.mysql.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.system.dal.mysql.packagingtoolstable.PackagingToolsTableMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -17,7 +17,7 @@ import java.util.Map;
|
|||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||||
|
|
||||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
@Tag(name = "RPC 服务 - 考勤设备")
|
@Tag(name = "RPC 服务 - 工厂服务")
|
||||||
public interface FactoryInfoApi {
|
public interface FactoryInfoApi {
|
||||||
|
|
||||||
String PREFIX = ApiConstants.PREFIX + "/factory-info";
|
String PREFIX = ApiConstants.PREFIX + "/factory-info";
|
||||||
@ -30,6 +30,10 @@ public interface FactoryInfoApi {
|
|||||||
@Operation(summary = "获得工厂信息列表")
|
@Operation(summary = "获得工厂信息列表")
|
||||||
CommonResult<List<FactoryInfoDTO>> getFactoryInfoList(@RequestParam("factoryId") Collection<Long> factoryId);
|
CommonResult<List<FactoryInfoDTO>> getFactoryInfoList(@RequestParam("factoryId") Collection<Long> factoryId);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/get-all-list")
|
||||||
|
@Operation(summary = "获得工厂信息列表")
|
||||||
|
CommonResult<List<FactoryInfoDTO>> getAllList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得工厂信息 Map
|
* 获得工厂信息 Map
|
||||||
* @param factoryId 工厂编号集合
|
* @param factoryId 工厂编号集合
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.api.factoryforklift;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryforklift.dto.FactoryForkliftDTO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.enums.ApiConstants;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
@Tag(name = "RPC 服务 - 叉车服务")
|
||||||
|
public interface FactoryForkliftApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/factory-forklift";
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/batchSave")
|
||||||
|
@Operation(summary = "批量插入工厂叉车")
|
||||||
|
CommonResult<Boolean> batchSave(@RequestBody List<FactoryForkliftDTO> dtoList);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.api.factoryforklift.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FactoryForkliftDTO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25769")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "资产编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String assetsNo;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1056")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "23631")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "叉车名称", example = "芋艿")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "设备代码")
|
||||||
|
private String equipmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "出厂编号")
|
||||||
|
private String serialNo;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "车牌")
|
||||||
|
private String licensePlate;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
private String nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "用途类型 根据字典值来匹配", example = "1")
|
||||||
|
private Integer useType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "1")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.api.linefixedassets;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.linefixedassets.dto.LineFixedAssetsDTO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.enums.ApiConstants;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
@Tag(name = "RPC 服务 - 打包线固定资产服务")
|
||||||
|
public interface LineFixedAssetsApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/line-fixed-assets";
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/batchSave")
|
||||||
|
@Operation(summary = "批量插入打包线固定资产")
|
||||||
|
CommonResult<Boolean> batchSave(@RequestBody List<LineFixedAssetsDTO> dtoList);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.api.linefixedassets.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LineFixedAssetsDTO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12837")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "资产编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String assetsNo;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29331")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "28310")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "打包线编号")
|
||||||
|
private String lineNo;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
private String nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "使用日期")
|
||||||
|
private String useDate;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -35,4 +35,10 @@ public class FactoryInfoApiImpl implements FactoryInfoApi {
|
|||||||
List<FactoryInfoDO> factoryInfoDOS = factoryInfoService.getFactoryList(factoryId);
|
List<FactoryInfoDO> factoryInfoDOS = factoryInfoService.getFactoryList(factoryId);
|
||||||
return success(BeanUtils.toBean(factoryInfoDOS, FactoryInfoDTO.class));
|
return success(BeanUtils.toBean(factoryInfoDOS, FactoryInfoDTO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<List<FactoryInfoDTO>> getAllList() {
|
||||||
|
List<FactoryInfoDO> factoryInfoDOS = factoryInfoService.getFactoryList();
|
||||||
|
return success(BeanUtils.toBean(factoryInfoDOS, FactoryInfoDTO.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.api.factoryforklift;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.factoryforklift.dto.FactoryForkliftDTO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryforklift.FactoryForkliftDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.factoryforklift.FactoryForkliftService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||||
|
@Validated
|
||||||
|
public class FactoryForkliftApiImpl implements FactoryForkliftApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FactoryForkliftService factoryForkliftService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<Boolean> batchSave(List<FactoryForkliftDTO> dtoList) {
|
||||||
|
List<FactoryForkliftDO> factoryForkliftDOS = BeanUtil.copyToList(dtoList, FactoryForkliftDO.class);
|
||||||
|
factoryForkliftService.saveBatch(factoryForkliftDOS);
|
||||||
|
return CommonResult.success(true);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.api.linefixedassets;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.api.linefixedassets.dto.LineFixedAssetsDTO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.linefixedassets.LineFixedAssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.linefixedassets.LineFixedAssetsService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||||
|
@Validated
|
||||||
|
public class LineFixedAssetsApiImpl implements LineFixedAssetsApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LineFixedAssetsService lineFixedAssetsService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<Boolean> batchSave(List<LineFixedAssetsDTO> dtoList) {
|
||||||
|
List<LineFixedAssetsDO> list = BeanUtil.copyToList(dtoList, LineFixedAssetsDO.class);
|
||||||
|
lineFixedAssetsService.saveBatch(list);
|
||||||
|
return CommonResult.success(true);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.linefixedassets.LineFixedAssetsDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.linefixedassets.LineFixedAssetsService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 打包线固定资产")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/smartfactory/line-fixed-assets")
|
||||||
|
@Validated
|
||||||
|
public class LineFixedAssetsController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LineFixedAssetsService lineFixedAssetsService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建打包线固定资产")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:line-fixed-assets:create')")
|
||||||
|
public CommonResult<Long> createLineFixedAssets(@Valid @RequestBody LineFixedAssetsSaveReqVO createReqVO) {
|
||||||
|
return success(lineFixedAssetsService.createLineFixedAssets(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新打包线固定资产")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:line-fixed-assets:update')")
|
||||||
|
public CommonResult<Boolean> updateLineFixedAssets(@Valid @RequestBody LineFixedAssetsSaveReqVO updateReqVO) {
|
||||||
|
lineFixedAssetsService.updateLineFixedAssets(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除打包线固定资产")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:line-fixed-assets:delete')")
|
||||||
|
public CommonResult<Boolean> deleteLineFixedAssets(@RequestParam("id") Long id) {
|
||||||
|
lineFixedAssetsService.deleteLineFixedAssets(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得打包线固定资产")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:line-fixed-assets:query')")
|
||||||
|
public CommonResult<LineFixedAssetsRespVO> getLineFixedAssets(@RequestParam("id") Long id) {
|
||||||
|
LineFixedAssetsDO lineFixedAssets = lineFixedAssetsService.getLineFixedAssets(id);
|
||||||
|
return success(BeanUtils.toBean(lineFixedAssets, LineFixedAssetsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得打包线固定资产分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:line-fixed-assets:query')")
|
||||||
|
public CommonResult<PageResult<LineFixedAssetsRespVO>> getLineFixedAssetsPage(@Valid LineFixedAssetsPageReqVO pageReqVO) {
|
||||||
|
PageResult<LineFixedAssetsDO> pageResult = lineFixedAssetsService.getLineFixedAssetsPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, LineFixedAssetsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出打包线固定资产 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:line-fixed-assets:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportLineFixedAssetsExcel(@Valid LineFixedAssetsPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<LineFixedAssetsDO> list = lineFixedAssetsService.getLineFixedAssetsPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "打包线固定资产.xls", "数据", LineFixedAssetsRespVO.class,
|
||||||
|
BeanUtils.toBean(list, LineFixedAssetsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线固定资产分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class LineFixedAssetsPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "资产编号")
|
||||||
|
private String assetsNo;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", example = "29331")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "28310")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "打包线编号")
|
||||||
|
private String lineNo;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
private String nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "使用日期")
|
||||||
|
private String useDate;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "资产类型ids")
|
||||||
|
private List<Long> typeIds;
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线固定资产 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class LineFixedAssetsRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12837")
|
||||||
|
@ExcelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "资产编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("资产编号")
|
||||||
|
private String assetsNo;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29331")
|
||||||
|
@ExcelProperty("工厂id")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "29331")
|
||||||
|
@ExcelProperty("工厂名称")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "28310")
|
||||||
|
@ExcelProperty("部门id")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "部门名称", example = "28310")
|
||||||
|
@ExcelProperty("部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "赵六")
|
||||||
|
@ExcelProperty("名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
@ExcelProperty("规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "打包线编号")
|
||||||
|
@ExcelProperty("打包线编号")
|
||||||
|
private String lineNo;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
@ExcelProperty("型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
@ExcelProperty("厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
@ExcelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
@ExcelProperty("铭牌日期")
|
||||||
|
private String nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "使用日期")
|
||||||
|
@ExcelProperty("使用日期")
|
||||||
|
private String useDate;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线固定资产新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class LineFixedAssetsSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12837")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "资产编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "资产编号不能为空")
|
||||||
|
private String assetsNo;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29331")
|
||||||
|
@NotNull(message = "工厂id不能为空")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "28310")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
@Schema(description = "打包线编号")
|
||||||
|
private String lineNo;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
private String modelNo;
|
||||||
|
|
||||||
|
@Schema(description = "厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "铭牌日期")
|
||||||
|
private String nameplateDate;
|
||||||
|
|
||||||
|
@Schema(description = "使用日期")
|
||||||
|
private String useDate;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.linefixedassets;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("sf_line_fixed_assets")
|
||||||
|
@KeySequence("sf_line_fixed_assets_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LineFixedAssetsDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 资产编号
|
||||||
|
*/
|
||||||
|
private String assetsNo;
|
||||||
|
/**
|
||||||
|
* 工厂id
|
||||||
|
*/
|
||||||
|
private Long factoryId;
|
||||||
|
/**
|
||||||
|
* 部门id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 规格
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
/**
|
||||||
|
* 打包线编号
|
||||||
|
*/
|
||||||
|
private String lineNo;
|
||||||
|
/**
|
||||||
|
* 型号
|
||||||
|
*/
|
||||||
|
private String modelNo;
|
||||||
|
/**
|
||||||
|
* 厂商
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 铭牌日期
|
||||||
|
*/
|
||||||
|
private String nameplateDate;
|
||||||
|
/**
|
||||||
|
* 使用日期
|
||||||
|
*/
|
||||||
|
private String useDate;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂名称
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String factoryName;
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.mysql.linefixedassets;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.linefixedassets.LineFixedAssetsDO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets.vo.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface LineFixedAssetsMapper extends BaseMapperX<LineFixedAssetsDO> {
|
||||||
|
|
||||||
|
default PageResult<LineFixedAssetsDO> selectPage(LineFixedAssetsPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<LineFixedAssetsDO>()
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getAssetsNo, reqVO.getAssetsNo())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getFactoryId, reqVO.getFactoryId())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getDeptId, reqVO.getDeptId())
|
||||||
|
.likeIfPresent(LineFixedAssetsDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getSku, reqVO.getSku())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getLineNo, reqVO.getLineNo())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getModelNo, reqVO.getModelNo())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getManufacturer, reqVO.getManufacturer())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getUnit, reqVO.getUnit())
|
||||||
|
.eqIfPresent(LineFixedAssetsDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(LineFixedAssetsDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(LineFixedAssetsDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param page
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<LineFixedAssetsDO> getLineFixedAssetsPage(@Param("page") Page page, @Param("vo") LineFixedAssetsPageReqVO vo);
|
||||||
|
}
|
@ -1,18 +1,20 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.service.factoryforklift;
|
package cn.iocoder.yudao.module.smartfactory.service.factoryforklift;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import javax.validation.*;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryforklift.FactoryForkliftDO;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.vo.FactoryForkliftPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.vo.FactoryForkliftRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.vo.FactoryForkliftSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryforklift.FactoryForkliftDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 叉车管理 Service 接口
|
* 叉车管理 Service 接口
|
||||||
*
|
*
|
||||||
* @author 姚君
|
* @author 姚君
|
||||||
*/
|
*/
|
||||||
public interface FactoryForkliftService {
|
public interface FactoryForkliftService extends IService<FactoryForkliftDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建叉车管理
|
* 创建叉车管理
|
||||||
|
@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryforklift.Facto
|
|||||||
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryforklift.FactoryForkliftMapper;
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryforklift.FactoryForkliftMapper;
|
||||||
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
|
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class FactoryForkliftServiceImpl implements FactoryForkliftService {
|
public class FactoryForkliftServiceImpl extends ServiceImpl<FactoryForkliftMapper, FactoryForkliftDO> implements FactoryForkliftService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private FactoryForkliftMapper factoryForkliftMapper;
|
private FactoryForkliftMapper factoryForkliftMapper;
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.linefixedassets;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.linefixedassets.LineFixedAssetsDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface LineFixedAssetsService extends IService<LineFixedAssetsDO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建打包线固定资产
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createLineFixedAssets(@Valid LineFixedAssetsSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新打包线固定资产
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateLineFixedAssets(@Valid LineFixedAssetsSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除打包线固定资产
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteLineFixedAssets(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得打包线固定资产
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 打包线固定资产
|
||||||
|
*/
|
||||||
|
LineFixedAssetsDO getLineFixedAssets(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得打包线固定资产分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 打包线固定资产分页
|
||||||
|
*/
|
||||||
|
PageResult<LineFixedAssetsDO> getLineFixedAssetsPage(LineFixedAssetsPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.linefixedassets;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.AssetsTypeCodeEnum;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||||
|
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.linefixedassets.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.linefixedassets.LineFixedAssetsDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.linefixedassets.LineFixedAssetsMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.smartfactory.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线固定资产 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class LineFixedAssetsServiceImpl extends ServiceImpl<LineFixedAssetsMapper, LineFixedAssetsDO> implements LineFixedAssetsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LineFixedAssetsMapper lineFixedAssetsMapper;
|
||||||
|
@Resource
|
||||||
|
private AssetsTypeApi assetsTypeApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createLineFixedAssets(LineFixedAssetsSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
LineFixedAssetsDO lineFixedAssets = BeanUtils.toBean(createReqVO, LineFixedAssetsDO.class);
|
||||||
|
lineFixedAssetsMapper.insert(lineFixedAssets);
|
||||||
|
// 返回
|
||||||
|
return lineFixedAssets.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLineFixedAssets(LineFixedAssetsSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
LineFixedAssetsDO updateObj = BeanUtils.toBean(updateReqVO, LineFixedAssetsDO.class);
|
||||||
|
lineFixedAssetsMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteLineFixedAssets(Long id) {
|
||||||
|
// 删除
|
||||||
|
lineFixedAssetsMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LineFixedAssetsDO getLineFixedAssets(Long id) {
|
||||||
|
return lineFixedAssetsMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<LineFixedAssetsDO> getLineFixedAssetsPage(LineFixedAssetsPageReqVO pageReqVO) {
|
||||||
|
CommonResult<List<Long>> forklift = assetsTypeApi.getAssetsTypeIdsByCode(AssetsTypeCodeEnum.PRODUCTION_MACHINERY);
|
||||||
|
pageReqVO.setTypeIds(forklift.getData());
|
||||||
|
IPage<LineFixedAssetsDO> page = lineFixedAssetsMapper.getLineFixedAssetsPage(MyBatisUtils.buildPage(pageReqVO),pageReqVO);
|
||||||
|
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.smartfactory.dal.mysql.linefixedassets.LineFixedAssetsMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<select id="getLineFixedAssetsPage"
|
||||||
|
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.linefixedassets.LineFixedAssetsDO">
|
||||||
|
select a.id,
|
||||||
|
a.assets_no as assetsNo,
|
||||||
|
d.id AS factoryId,
|
||||||
|
d.name as factoryName,
|
||||||
|
c.id as forkliftId,
|
||||||
|
b.dept_id as deptId,
|
||||||
|
dept.name as deptName,
|
||||||
|
d.name as factoryName,
|
||||||
|
c.*
|
||||||
|
from zc_assets as a
|
||||||
|
LEFT JOIN zc_dept_assets AS b ON a.id = b.assets_id
|
||||||
|
LEFT JOIN system_dept AS dept ON dept.id = b.dept_id
|
||||||
|
LEFT JOIN sf_line_fixed_assets AS c ON a.assets_no = c.assets_no
|
||||||
|
LEFT JOIN sf_factory_info AS d ON dept.factory_id = d.id
|
||||||
|
<where>
|
||||||
|
b.deleted = 0 AND b.stock > 0
|
||||||
|
<if test="vo.assetsNo != null and vo.assetsNo != ''">
|
||||||
|
and a.assets_no = #{vo.assetsNo}
|
||||||
|
</if>
|
||||||
|
<if test="vo.factoryId != null">
|
||||||
|
and c.factory_id = #{vo.factoryId}
|
||||||
|
</if>
|
||||||
|
<if test="vo.deptId != null">
|
||||||
|
and c.dept_id = #{vo.deptId}
|
||||||
|
</if>
|
||||||
|
<if test="vo.name != null and vo.name != ''">
|
||||||
|
and c.name like concat('%', #{vo.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="vo.sku != null and vo.sku != ''">
|
||||||
|
and c.sku like concat('%', #{vo.sku}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="vo.modelNo != null and vo.modelNo != ''">
|
||||||
|
and c.model_no like concat('%', #{vo.modelNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="vo.manufacturer != null and vo.manufacturer != ''">
|
||||||
|
and c.manufacturer like concat('%', #{vo.manufacturer}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="vo.unit != null and vo.unit != ''">
|
||||||
|
and c.unit like concat('%', #{vo.unit}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="vo.typeIds != null and vo.typeIds.size() > 0">
|
||||||
|
and a.type_id in
|
||||||
|
<foreach collection="vo.typeIds" open="(" item="typeId" separator="," close=")">
|
||||||
|
#{typeId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user