1.新增接口根据流程状态(处理中,通过,不通过,取消),统计各个状态的数据量 根据日期分组
This commit is contained in:
parent
61eda4aeca
commit
667bfd3711
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 全局用户类型枚举
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class AssetsTypeCodeEnum {
|
||||
|
||||
/**
|
||||
* 叉车
|
||||
*/
|
||||
public static final String FORKLIFT = "FORKLIFT";
|
||||
|
||||
}
|
@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
@ -129,6 +130,19 @@ public class BpmProcessInstanceController {
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程实例的状态统计查询
|
||||
* 根据流程状态(处理中,通过,不通过,取消),统计各个状态的数据量
|
||||
*/
|
||||
@GetMapping("/process_instance_result_status_statistics_group_time")
|
||||
@Operation(summary = "流程实例的状态统计查询", description = "根据流程状态(处理中,通过,不通过,取消),统计各个状态的数据量")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<Map<String, List<BpmProcessInstanceResultStatusStatisticsGroupTimeVO>>> getProcessInstanceResultStatusStatisticsGroupTime(@Valid BpmProcessInstanceStatisticsReqVO reqVO) {
|
||||
Map<String, List<BpmProcessInstanceResultStatusStatisticsGroupTimeVO>> list = processInstanceService.getProcessInstanceResultStatusStatisticsGroupTime(reqVO);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/getAll")
|
||||
@Operation(summary = "获得所有实例分页列表", description = "在【统计查询】菜单中,进行调用")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
|
||||
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 流程实例统计查询 Item Response VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class BpmProcessInstanceResultStatusStatisticsGroupTimeVO {
|
||||
|
||||
@Schema(description = "流程名称", example = "请假流程")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "流程实例统计数量", example = "1")
|
||||
private int totalCount;
|
||||
|
||||
@Schema(description = "流程实例的状态", example = "1")
|
||||
private int result ;
|
||||
|
||||
@Schema(description = "时间", example = "1")
|
||||
private String time ;
|
||||
|
||||
}
|
@ -24,6 +24,9 @@ public class BpmProcessInstanceStatisticsReqVO extends PageParam {
|
||||
@Schema(description = "流程名称", example = "请假流程")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "近几天 (默认7天)", example = "近几天")
|
||||
private Integer recentDays;
|
||||
|
||||
@Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1")
|
||||
private String category;
|
||||
|
||||
|
@ -3,10 +3,7 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.task;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessFinishStatisticsRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceMyPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceStatisticsReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceStatisticsRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -77,4 +74,10 @@ public interface BpmProcessInstanceExtMapper extends BaseMapperX<BpmProcessInsta
|
||||
|
||||
List<BpmProcessFinishStatisticsRespVO> selectUnfinishProcessCount(BpmProcessInstanceStatisticsReqVO reqVO);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pageReqVO
|
||||
* @return
|
||||
*/
|
||||
List<BpmProcessInstanceResultStatusStatisticsGroupTimeVO> getProcessInstanceResultStatusStatisticsGroupTime(BpmProcessInstanceStatisticsReqVO pageReqVO);
|
||||
}
|
||||
|
@ -197,4 +197,13 @@ public interface BpmProcessInstanceService {
|
||||
* @return
|
||||
*/
|
||||
BpmProcessInstancePrintDataRespVO getOAReportPrintData(BpmProcessInstancePrintDataReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 流程实例的状态统计查询
|
||||
* 根据流程状态(处理中,通过,不通过,取消),统计各个状态的数据量 日期分组
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
Map<String, List<BpmProcessInstanceResultStatusStatisticsGroupTimeVO>> getProcessInstanceResultStatusStatisticsGroupTime(BpmProcessInstanceStatisticsReqVO reqVO);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -78,6 +78,33 @@
|
||||
AND process_definition_id like 'oa_%'
|
||||
GROUP BY assignee_user_id
|
||||
</select>
|
||||
<select id="getProcessInstanceResultStatusStatisticsGroupTime"
|
||||
resultType="cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceResultStatusStatisticsGroupTimeVO">
|
||||
SELECT
|
||||
name,
|
||||
result,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) as time,
|
||||
COUNT(*) AS totalCount
|
||||
FROM bpm_process_instance_ext
|
||||
WHERE deleted = FALSE
|
||||
<if test="recentDays != null">
|
||||
AND create_time >= DATE_SUB( NOW(), INTERVAL #{recentDays} DAY )
|
||||
</if>
|
||||
<if test="createTime != null and createTime.length > 0">
|
||||
AND create_time
|
||||
<foreach collection="createTime" item="time" index="index" open="BETWEEN" close="" separator="AND">
|
||||
#{time}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userIds != null and userIds.length > 0">
|
||||
AND start_user_id in
|
||||
<foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
AND process_definition_id like 'oa_%'
|
||||
GROUP BY name,DATE_FORMAT( create_time, '%Y-%m-%d' );
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
|
||||
package cn.iocoder.yudao.module.system.api.assets;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 资产类型")
|
||||
public interface AssetsTypeApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/assets_type";
|
||||
|
||||
@GetMapping(PREFIX + "/getAssetsTypeIdsByCode")
|
||||
@Operation(summary = "通过资产类型code获取资产类型ids")
|
||||
@Parameter(name = "code", description = "资产类型code", example = "1", required = true)
|
||||
CommonResult<List<Long>> getAssetsTypeIdsByCode(@RequestParam("code") String code);
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.system.api.assets;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserSaveRespDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.assets.AssetsTypeService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
@DataPermission(enable = false)
|
||||
public class AssetsTypeApiImpl implements AssetsTypeApi {
|
||||
|
||||
@Resource
|
||||
private AssetsTypeService assetsTypeService;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<Long>> getAssetsTypeIdsByCode(String code) {
|
||||
List<Long> ids = assetsTypeService.getAssetsTypeIdsByCode(code);
|
||||
return success(ids);
|
||||
}
|
||||
}
|
@ -24,6 +24,9 @@ public class AssetsTypePageReqVO extends PageParam {
|
||||
@Schema(description = "上级资产类型id", example = "27306")
|
||||
private Long pid;
|
||||
|
||||
@Schema(description = "类型编码(最后一级才有)", example = "27306")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
@ -21,6 +21,10 @@ public class AssetsTypeRespVO {
|
||||
@ExcelProperty("资产类型名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型编码(最后一级才有)", example = "李四")
|
||||
@ExcelProperty("类型编码(最后一级才有)")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型 0按量 1按单件", example = "1")
|
||||
@ExcelProperty("类型 0按量 1按单件")
|
||||
private Integer type;
|
||||
|
@ -22,4 +22,10 @@ public class AssetsTypeSaveReqVO {
|
||||
@Schema(description = "上级资产类型id", example = "27306")
|
||||
private Long pid;
|
||||
|
||||
/**
|
||||
* 类型编码(最后一级才有)
|
||||
*/
|
||||
@Schema(description = "类型编码(最后一级才有)", example = "27306")
|
||||
private String code;
|
||||
|
||||
}
|
@ -101,6 +101,14 @@ public class UserController {
|
||||
userService.updateFieldwork(reqVO.getId(), reqVO.getFieldworkFlag());
|
||||
return success(true);
|
||||
}
|
||||
@GetMapping("/gpsPosition")
|
||||
@Operation(summary = "GPS定位")
|
||||
public CommonResult<Boolean> gpsPosition() {
|
||||
userService.gpsPosition();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户分页列表")
|
||||
|
@ -38,6 +38,10 @@ public class AssetsTypeDO extends BaseDO {
|
||||
* 类型 0按量 1按单件
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 类型编码(最后一级才有)
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 上级资产类型id
|
||||
*/
|
||||
|
@ -74,4 +74,11 @@ public interface AssetsTypeService {
|
||||
* @return 资产类型
|
||||
*/
|
||||
AssetsTypeDO getByName(String name);
|
||||
|
||||
/**
|
||||
* 通过资产类型code获取资产类型ids
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
List<Long> getAssetsTypeIdsByCode(String code);
|
||||
}
|
@ -11,7 +11,9 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 资产类型 Service 实现类
|
||||
@ -72,4 +74,14 @@ public class AssetsTypeServiceImpl implements AssetsTypeService {
|
||||
|
||||
return assetsTypeMapper.selectOne(AssetsTypeDO::getName, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getAssetsTypeIdsByCode(String code) {
|
||||
List<AssetsTypeDO> assetsTypeDOS = assetsTypeMapper.selectList(new LambdaQueryWrapper<AssetsTypeDO>()
|
||||
.eq(AssetsTypeDO::getCode, code));
|
||||
if (assetsTypeDOS.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return assetsTypeDOS.stream().map(AssetsTypeDO::getId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
@ -141,6 +141,8 @@ public interface AdminUserService {
|
||||
*/
|
||||
PageResult<AdminUserDO> getUserPage(UserPageReqVO reqVO);
|
||||
|
||||
void gpsPosition();
|
||||
|
||||
/**
|
||||
* 获得工厂用户分页列表
|
||||
*
|
||||
|
@ -4,6 +4,10 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
@ -31,7 +35,6 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.xingyuv.http.util.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -178,7 +181,7 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
IdCardDO idCardDO = StrUtils.IdCardAnalysis(reqVO.getIdcard());
|
||||
|
||||
//设置 性别、年龄、出生日期
|
||||
AdminUserDO adminUserDO = BeanUtils.toBean(reqVO, AdminUserDO.class).setId(id) ;
|
||||
AdminUserDO adminUserDO = BeanUtils.toBean(reqVO, AdminUserDO.class).setId(id);
|
||||
adminUserDO.setSex(idCardDO.getSex());
|
||||
adminUserDO.setAge(idCardDO.getAge());
|
||||
adminUserDO.setBirthdayDay(idCardDO.getDate());
|
||||
@ -286,6 +289,36 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
return userMapper.selectPage(reqVO, getDeptCondition(reqVO.getDeptId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gpsPosition() {
|
||||
// TODO: 2024/9/2
|
||||
Set<Long> deptCondition = getDeptCondition(130L);
|
||||
List<AdminUserDO> adminUserDOS = userMapper.selectList(new LambdaQueryWrapper<AdminUserDO>()
|
||||
.in(AdminUserDO::getDeptId, deptCondition));
|
||||
for (AdminUserDO adminUserDO : adminUserDOS) {
|
||||
JSONObject object = new JSONObject().set("name", adminUserDO.getNickname()).set("uniqueId", adminUserDO.getMobile());
|
||||
|
||||
// 请求的 URL
|
||||
String url = "http://127.0.0.1:8082/api/devices";
|
||||
// 发送 POST 请求
|
||||
HttpResponse response = HttpRequest.post(url)
|
||||
.header("Accept", "*/*")
|
||||
.header("Accept-Language", "zh-CN,zh;q=0.9")
|
||||
.header("Connection", "keep-alive")
|
||||
.header("Content-Type", "application/json")
|
||||
.header("Cookie", "JSESSIONID=node07ayjwewvdr8q3ov9smy6m94c3668.node0")
|
||||
.header("Origin", "http://47.97.8.94:8082")
|
||||
.header("Referer", "http://47.97.8.94:8082/settings/device")
|
||||
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36")
|
||||
.body(JSONUtil.toJsonStr(object))
|
||||
.timeout(20000) // 设置超时时间
|
||||
.execute(); // 执行请求并获取响应
|
||||
|
||||
// 打印响应结果
|
||||
System.out.println(response.body());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<AdminUserDO> getFactoryUserPage(FactoryUserPageReqVO reqVO) {
|
||||
|
||||
|
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
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 cn.iocoder.yudao.module.smartfactory.service.factoryforklift.FactoryForkliftService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 叉车管理")
|
||||
@RestController
|
||||
@RequestMapping("/smartfactory/factory-forklift")
|
||||
@Validated
|
||||
public class FactoryForkliftController {
|
||||
|
||||
@Resource
|
||||
private FactoryForkliftService factoryForkliftService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建叉车管理")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-forklift:create')")
|
||||
public CommonResult<Long> createFactoryForklift(@Valid @RequestBody FactoryForkliftSaveReqVO createReqVO) {
|
||||
return success(factoryForkliftService.createFactoryForklift(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新叉车管理")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-forklift:update')")
|
||||
public CommonResult<Boolean> updateFactoryForklift(@Valid @RequestBody FactoryForkliftSaveReqVO updateReqVO) {
|
||||
factoryForkliftService.updateFactoryForklift(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除叉车管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-forklift:delete')")
|
||||
public CommonResult<Boolean> deleteFactoryForklift(@RequestParam("id") Long id) {
|
||||
factoryForkliftService.deleteFactoryForklift(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得叉车管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-forklift:query')")
|
||||
public CommonResult<FactoryForkliftRespVO> getFactoryForklift(@RequestParam("id") Long id) {
|
||||
FactoryForkliftDO factoryForklift = factoryForkliftService.getFactoryForklift(id);
|
||||
return success(BeanUtils.toBean(factoryForklift, FactoryForkliftRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得叉车管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-forklift:query')")
|
||||
public CommonResult<PageResult<FactoryForkliftRespVO>> getFactoryForkliftPage(@Valid FactoryForkliftPageReqVO pageReqVO) {
|
||||
PageResult<FactoryForkliftRespVO> pageResult = factoryForkliftService.getFactoryForkliftPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出叉车管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-forklift:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFactoryForkliftExcel(@Valid FactoryForkliftPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FactoryForkliftRespVO> list = factoryForkliftService.getFactoryForkliftPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "叉车管理.xls", "数据", FactoryForkliftRespVO.class,
|
||||
list);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 叉车管理分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FactoryForkliftPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "资产编号")
|
||||
private String assetsNo;
|
||||
|
||||
@Schema(description = "工厂id", 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 modelNo;
|
||||
|
||||
@Schema(description = "车牌")
|
||||
private String licensePlate;
|
||||
|
||||
@Schema(description = "铭牌日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] nameplateDate;
|
||||
|
||||
@Schema(description = "用途类型 根据字典值来匹配", example = "1")
|
||||
private Integer useType;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
||||
@Schema(description = "资产类型ids", example = "1")
|
||||
private List<Long> typeIds;
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.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 FactoryForkliftRespVO {
|
||||
|
||||
@Schema(description = "资产id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25769")
|
||||
@ExcelProperty("资产id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "资产编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("资产编号")
|
||||
private String assetsNo;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1056")
|
||||
@ExcelProperty("工厂id")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1056")
|
||||
@ExcelProperty("工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
|
||||
@Schema(description = "叉车id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25769")
|
||||
@ExcelProperty("叉车id")
|
||||
private Long forkliftId;
|
||||
//
|
||||
// @Schema(description = "部门id", example = "23631")
|
||||
// @ExcelProperty("部门id")
|
||||
// private Long deptId;
|
||||
//
|
||||
// @Schema(description = "部门名称", example = "23631")
|
||||
// @ExcelProperty("部门名称")
|
||||
// private String deptName;
|
||||
|
||||
@Schema(description = "叉车名称", example = "芋艿")
|
||||
@ExcelProperty("叉车名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "厂商")
|
||||
@ExcelProperty("厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@Schema(description = "型号")
|
||||
@ExcelProperty("型号")
|
||||
private String modelNo;
|
||||
|
||||
@Schema(description = "车牌")
|
||||
@ExcelProperty("车牌")
|
||||
private String licensePlate;
|
||||
|
||||
@Schema(description = "铭牌日期")
|
||||
@ExcelProperty("铭牌日期")
|
||||
private String nameplateDate;
|
||||
|
||||
@Schema(description = "用途类型 根据字典值来匹配", example = "1")
|
||||
@ExcelProperty("用途类型 根据字典值来匹配")
|
||||
private Integer useType;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.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 FactoryForkliftSaveReqVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25769")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "资产编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "资产编号不能为空")
|
||||
private String assetsNo;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1056")
|
||||
@NotNull(message = "工厂id不能为空")
|
||||
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 modelNo;
|
||||
|
||||
@Schema(description = "车牌")
|
||||
private String licensePlate;
|
||||
|
||||
@Schema(description = "铭牌日期")
|
||||
private String nameplateDate;
|
||||
|
||||
@Schema(description = "用途类型 根据字典值来匹配", example = "1")
|
||||
private Integer useType;
|
||||
|
||||
}
|
@ -25,6 +25,9 @@ public class FactoryInfoPageReqVO extends PageParam {
|
||||
@Schema(description = "工厂类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "工厂业务类型 根据字典business_type来", example = "1")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
|
@ -32,6 +32,10 @@ public class FactoryInfoRespVO {
|
||||
@ExcelProperty("工厂类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "工厂业务类型 根据字典business_type来", example = "1")
|
||||
@ExcelProperty("工厂业务类型")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "工厂简介", example = "这是一个工厂简介")
|
||||
@ExcelProperty("工厂简介")
|
||||
private String description;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -26,6 +27,9 @@ public class FactoryInfoSaveReqVO {
|
||||
@NotEmpty(message = "工厂类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "工厂业务类型 根据字典business_type来", example = "1")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "工厂简介", example = "这是一个工厂简介")
|
||||
private String description;
|
||||
|
||||
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln;
|
||||
|
||||
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.factorykiln.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorykiln.FactoryKilnDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.factorykiln.FactoryKilnService;
|
||||
|
||||
@Tag(name = "管理后台 - 工厂窑炉")
|
||||
@RestController
|
||||
@RequestMapping("/smartfactory/factory-kiln")
|
||||
@Validated
|
||||
public class FactoryKilnController {
|
||||
|
||||
@Resource
|
||||
private FactoryKilnService factoryKilnService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建工厂窑炉")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-kiln:create')")
|
||||
public CommonResult<Long> createFactoryKiln(@Valid @RequestBody FactoryKilnSaveReqVO createReqVO) {
|
||||
return success(factoryKilnService.createFactoryKiln(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新工厂窑炉")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-kiln:update')")
|
||||
public CommonResult<Boolean> updateFactoryKiln(@Valid @RequestBody FactoryKilnSaveReqVO updateReqVO) {
|
||||
factoryKilnService.updateFactoryKiln(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除工厂窑炉")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-kiln:delete')")
|
||||
public CommonResult<Boolean> deleteFactoryKiln(@RequestParam("id") Long id) {
|
||||
factoryKilnService.deleteFactoryKiln(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得工厂窑炉")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-kiln:query')")
|
||||
public CommonResult<FactoryKilnRespVO> getFactoryKiln(@RequestParam("id") Long id) {
|
||||
FactoryKilnDO factoryKiln = factoryKilnService.getFactoryKiln(id);
|
||||
return success(BeanUtils.toBean(factoryKiln, FactoryKilnRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得工厂窑炉分页")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-kiln:query')")
|
||||
public CommonResult<PageResult<FactoryKilnRespVO>> getFactoryKilnPage(@Valid FactoryKilnPageReqVO pageReqVO) {
|
||||
PageResult<FactoryKilnDO> pageResult = factoryKilnService.getFactoryKilnPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FactoryKilnRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出工厂窑炉 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-kiln:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFactoryKilnExcel(@Valid FactoryKilnPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FactoryKilnDO> list = factoryKilnService.getFactoryKilnPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "工厂窑炉.xls", "数据", FactoryKilnRespVO.class,
|
||||
BeanUtils.toBean(list, FactoryKilnRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln.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 = "管理后台 - 工厂窑炉分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FactoryKilnPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂id", example = "25583")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "产能")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln.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 FactoryKilnRespVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1055")
|
||||
@ExcelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25583")
|
||||
@ExcelProperty("工厂id")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "产能")
|
||||
@ExcelProperty("产能")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln.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 FactoryKilnSaveReqVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1055")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25583")
|
||||
@NotNull(message = "工厂id不能为空")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "产能")
|
||||
private Integer capacity;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline;
|
||||
|
||||
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.factorypackingline.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorypackingline.FactoryPackingLineDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.factorypackingline.FactoryPackingLineService;
|
||||
|
||||
@Tag(name = "管理后台 - 打包线配置")
|
||||
@RestController
|
||||
@RequestMapping("/smartfactory/factory-packing-line")
|
||||
@Validated
|
||||
public class FactoryPackingLineController {
|
||||
|
||||
@Resource
|
||||
private FactoryPackingLineService factoryPackingLineService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建打包线配置")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-packing-line:create')")
|
||||
public CommonResult<Long> createFactoryPackingLine(@Valid @RequestBody FactoryPackingLineSaveReqVO createReqVO) {
|
||||
return success(factoryPackingLineService.createFactoryPackingLine(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新打包线配置")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-packing-line:update')")
|
||||
public CommonResult<Boolean> updateFactoryPackingLine(@Valid @RequestBody FactoryPackingLineSaveReqVO updateReqVO) {
|
||||
factoryPackingLineService.updateFactoryPackingLine(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除打包线配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-packing-line:delete')")
|
||||
public CommonResult<Boolean> deleteFactoryPackingLine(@RequestParam("id") Long id) {
|
||||
factoryPackingLineService.deleteFactoryPackingLine(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得打包线配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-packing-line:query')")
|
||||
public CommonResult<FactoryPackingLineRespVO> getFactoryPackingLine(@RequestParam("id") Long id) {
|
||||
FactoryPackingLineDO factoryPackingLine = factoryPackingLineService.getFactoryPackingLine(id);
|
||||
return success(BeanUtils.toBean(factoryPackingLine, FactoryPackingLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得打包线配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-packing-line:query')")
|
||||
public CommonResult<PageResult<FactoryPackingLineRespVO>> getFactoryPackingLinePage(@Valid FactoryPackingLinePageReqVO pageReqVO) {
|
||||
PageResult<FactoryPackingLineDO> pageResult = factoryPackingLineService.getFactoryPackingLinePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FactoryPackingLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出打包线配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-packing-line:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFactoryPackingLineExcel(@Valid FactoryPackingLinePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FactoryPackingLineDO> list = factoryPackingLineService.getFactoryPackingLinePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "打包线配置.xls", "数据", FactoryPackingLineRespVO.class,
|
||||
BeanUtils.toBean(list, FactoryPackingLineRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline.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 = "管理后台 - 打包线配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FactoryPackingLinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂id", example = "24676")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "打包线名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "是否公司承接 0否 1是", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "窑炉id", example = "15240")
|
||||
private Long kilnId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline.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 FactoryPackingLineRespVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21099")
|
||||
@ExcelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24676")
|
||||
@ExcelProperty("工厂id")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "打包线名称", example = "王五")
|
||||
@ExcelProperty("打包线名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "是否公司承接 0否 1是", example = "2")
|
||||
@ExcelProperty("是否公司承接 0否 1是")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "窑炉id", example = "15240")
|
||||
@ExcelProperty("窑炉id")
|
||||
private Long kilnId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline.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 FactoryPackingLineSaveReqVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21099")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24676")
|
||||
@NotNull(message = "工厂id不能为空")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "打包线名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "是否公司承接 0否 1是", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "窑炉id", example = "15240")
|
||||
private Long kilnId;
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryforklift;
|
||||
|
||||
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_factory_forklift")
|
||||
@KeySequence("sf_factory_forklift_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FactoryForkliftDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 资产编号
|
||||
*/
|
||||
private String assetsNo;
|
||||
/**
|
||||
* 工厂id
|
||||
*/
|
||||
private Long factoryId;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 叉车名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 厂商
|
||||
*/
|
||||
private String manufacturer;
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
private String modelNo;
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String licensePlate;
|
||||
/**
|
||||
* 铭牌日期
|
||||
*/
|
||||
private String nameplateDate;
|
||||
/**
|
||||
* 用途类型 根据字典值来匹配
|
||||
*/
|
||||
private Integer useType;
|
||||
|
||||
}
|
@ -50,6 +50,11 @@ public class FactoryInfoDO extends BaseDO {
|
||||
* 字典值 参考 sf_factory_type
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 工厂业务类型 根据字典business_type来
|
||||
*/
|
||||
private String businessType;
|
||||
/**
|
||||
* 工厂简介
|
||||
*/
|
||||
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorykiln;
|
||||
|
||||
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_factory_kiln")
|
||||
@KeySequence("sf_factory_kiln_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FactoryKilnDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂id
|
||||
*/
|
||||
private Long factoryId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 产能
|
||||
*/
|
||||
private Integer capacity;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorypackingline;
|
||||
|
||||
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_factory_packing_line")
|
||||
@KeySequence("sf_factory_packing_line_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FactoryPackingLineDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂id
|
||||
*/
|
||||
private Long factoryId;
|
||||
/**
|
||||
* 打包线名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 是否公司承接 0否 1是
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 窑炉id
|
||||
*/
|
||||
private Long kilnId;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryforklift;
|
||||
|
||||
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.factoryforklift.FactoryForkliftDO;
|
||||
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.factoryforklift.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 叉车管理 Mapper
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
@Mapper
|
||||
public interface FactoryForkliftMapper extends BaseMapperX<FactoryForkliftDO> {
|
||||
|
||||
default PageResult<FactoryForkliftDO> selectPage(FactoryForkliftPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryForkliftDO>()
|
||||
.eqIfPresent(FactoryForkliftDO::getAssetsNo, reqVO.getAssetsNo())
|
||||
.eqIfPresent(FactoryForkliftDO::getFactoryId, reqVO.getFactoryId())
|
||||
.eqIfPresent(FactoryForkliftDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(FactoryForkliftDO::getName, reqVO.getName())
|
||||
.eqIfPresent(FactoryForkliftDO::getManufacturer, reqVO.getManufacturer())
|
||||
.eqIfPresent(FactoryForkliftDO::getModelNo, reqVO.getModelNo())
|
||||
.eqIfPresent(FactoryForkliftDO::getLicensePlate, reqVO.getLicensePlate())
|
||||
.betweenIfPresent(FactoryForkliftDO::getNameplateDate, reqVO.getNameplateDate())
|
||||
.eqIfPresent(FactoryForkliftDO::getUseType, reqVO.getUseType())
|
||||
.betweenIfPresent(FactoryForkliftDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(FactoryForkliftDO::getId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 叉车列表
|
||||
*
|
||||
* @param pageReqVO
|
||||
* @param objectPage
|
||||
* @return
|
||||
*/
|
||||
IPage<FactoryForkliftRespVO> getFactoryForkliftPage(@Param("vo") FactoryForkliftPageReqVO pageReqVO, @Param("page") Page<Object> objectPage);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.mysql.factorykiln;
|
||||
|
||||
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.factorykiln.FactoryKilnDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln.vo.*;
|
||||
|
||||
/**
|
||||
* 工厂窑炉 Mapper
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
@Mapper
|
||||
public interface FactoryKilnMapper extends BaseMapperX<FactoryKilnDO> {
|
||||
|
||||
default PageResult<FactoryKilnDO> selectPage(FactoryKilnPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryKilnDO>()
|
||||
.eqIfPresent(FactoryKilnDO::getFactoryId, reqVO.getFactoryId())
|
||||
.likeIfPresent(FactoryKilnDO::getName, reqVO.getName())
|
||||
.eqIfPresent(FactoryKilnDO::getCapacity, reqVO.getCapacity())
|
||||
.betweenIfPresent(FactoryKilnDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(FactoryKilnDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.mysql.factorypackingline;
|
||||
|
||||
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.factorypackingline.FactoryPackingLineDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline.vo.*;
|
||||
|
||||
/**
|
||||
* 打包线配置 Mapper
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
@Mapper
|
||||
public interface FactoryPackingLineMapper extends BaseMapperX<FactoryPackingLineDO> {
|
||||
|
||||
default PageResult<FactoryPackingLineDO> selectPage(FactoryPackingLinePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryPackingLineDO>()
|
||||
.eqIfPresent(FactoryPackingLineDO::getFactoryId, reqVO.getFactoryId())
|
||||
.likeIfPresent(FactoryPackingLineDO::getName, reqVO.getName())
|
||||
.eqIfPresent(FactoryPackingLineDO::getType, reqVO.getType())
|
||||
.eqIfPresent(FactoryPackingLineDO::getKilnId, reqVO.getKilnId())
|
||||
.betweenIfPresent(FactoryPackingLineDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(FactoryPackingLineDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.smartfactory.framework.rpc.config;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.PostApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
@ -15,8 +16,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {FileApi.class,RoleApi.class, DeptApi.class, PostApi.class, AdminUserApi.class, SmsSendApi.class, DictDataApi.class, NotifyMessageSendApi.class,
|
||||
SubscribeMessageSendApi.class, ConfigApi.class, PermissionApi.class
|
||||
@EnableFeignClients(clients = {FileApi.class, RoleApi.class, DeptApi.class, PostApi.class, AdminUserApi.class, SmsSendApi.class, DictDataApi.class, NotifyMessageSendApi.class,
|
||||
SubscribeMessageSendApi.class, ConfigApi.class, PermissionApi.class, AssetsTypeApi.class
|
||||
})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
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.PageParam;
|
||||
|
||||
/**
|
||||
* 叉车管理 Service 接口
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
public interface FactoryForkliftService {
|
||||
|
||||
/**
|
||||
* 创建叉车管理
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFactoryForklift(@Valid FactoryForkliftSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新叉车管理
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFactoryForklift(@Valid FactoryForkliftSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除叉车管理
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFactoryForklift(Long id);
|
||||
|
||||
/**
|
||||
* 获得叉车管理
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 叉车管理
|
||||
*/
|
||||
FactoryForkliftDO getFactoryForklift(Long id);
|
||||
|
||||
/**
|
||||
* 获得叉车管理分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 叉车管理分页
|
||||
*/
|
||||
PageResult<FactoryForkliftRespVO> getFactoryForkliftPage(FactoryForkliftPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.service.factoryforklift;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.AssetsTypeCodeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||
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 cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryforklift.FactoryForkliftMapper;
|
||||
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 叉车管理 Service 实现类
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FactoryForkliftServiceImpl implements FactoryForkliftService {
|
||||
|
||||
@Resource
|
||||
private FactoryForkliftMapper factoryForkliftMapper;
|
||||
@Resource
|
||||
private AssetsTypeApi assetsTypeApi;
|
||||
|
||||
@Override
|
||||
public Long createFactoryForklift(FactoryForkliftSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FactoryForkliftDO factoryForklift = BeanUtils.toBean(createReqVO, FactoryForkliftDO.class);
|
||||
factoryForkliftMapper.insert(factoryForklift);
|
||||
// 返回
|
||||
return factoryForklift.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFactoryForklift(FactoryForkliftSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
FactoryForkliftDO updateObj = BeanUtils.toBean(updateReqVO, FactoryForkliftDO.class);
|
||||
factoryForkliftMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFactoryForklift(Long id) {
|
||||
// 删除
|
||||
factoryForkliftMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FactoryForkliftDO getFactoryForklift(Long id) {
|
||||
return factoryForkliftMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FactoryForkliftRespVO> getFactoryForkliftPage(FactoryForkliftPageReqVO pageReqVO) {
|
||||
// -- 通过资产类型中的code - 获取到资产类型的ids - 完了后当作参数传过去
|
||||
CommonResult<List<Long>> forklift = assetsTypeApi.getAssetsTypeIdsByCode(AssetsTypeCodeEnum.FORKLIFT);
|
||||
pageReqVO.setTypeIds(forklift.getData());
|
||||
IPage<FactoryForkliftRespVO> vos = factoryForkliftMapper.getFactoryForkliftPage(pageReqVO, MyBatisUtils.buildPage(pageReqVO));
|
||||
return new PageResult<>(vos.getRecords(), vos.getTotal());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.service.factorykiln;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorykiln.FactoryKilnDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 工厂窑炉 Service 接口
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
public interface FactoryKilnService {
|
||||
|
||||
/**
|
||||
* 创建工厂窑炉
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFactoryKiln(@Valid FactoryKilnSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新工厂窑炉
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFactoryKiln(@Valid FactoryKilnSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除工厂窑炉
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFactoryKiln(Long id);
|
||||
|
||||
/**
|
||||
* 获得工厂窑炉
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工厂窑炉
|
||||
*/
|
||||
FactoryKilnDO getFactoryKiln(Long id);
|
||||
|
||||
/**
|
||||
* 获得工厂窑炉分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工厂窑炉分页
|
||||
*/
|
||||
PageResult<FactoryKilnDO> getFactoryKilnPage(FactoryKilnPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.service.factorykiln;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln.vo.FactoryKilnPageReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorykiln.vo.FactoryKilnSaveReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorykiln.FactoryKilnDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factorykiln.FactoryKilnMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 工厂窑炉 Service 实现类
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FactoryKilnServiceImpl implements FactoryKilnService {
|
||||
|
||||
@Resource
|
||||
private FactoryKilnMapper factoryKilnMapper;
|
||||
|
||||
@Override
|
||||
public Long createFactoryKiln(FactoryKilnSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FactoryKilnDO factoryKiln = BeanUtils.toBean(createReqVO, FactoryKilnDO.class);
|
||||
factoryKilnMapper.insert(factoryKiln);
|
||||
// 返回
|
||||
return factoryKiln.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFactoryKiln(FactoryKilnSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
FactoryKilnDO updateObj = BeanUtils.toBean(updateReqVO, FactoryKilnDO.class);
|
||||
factoryKilnMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFactoryKiln(Long id) {
|
||||
// 删除
|
||||
factoryKilnMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FactoryKilnDO getFactoryKiln(Long id) {
|
||||
return factoryKilnMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FactoryKilnDO> getFactoryKilnPage(FactoryKilnPageReqVO pageReqVO) {
|
||||
return factoryKilnMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.service.factorypackingline;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorypackingline.FactoryPackingLineDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 打包线配置 Service 接口
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
public interface FactoryPackingLineService {
|
||||
|
||||
/**
|
||||
* 创建打包线配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFactoryPackingLine(@Valid FactoryPackingLineSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新打包线配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFactoryPackingLine(@Valid FactoryPackingLineSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除打包线配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFactoryPackingLine(Long id);
|
||||
|
||||
/**
|
||||
* 获得打包线配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 打包线配置
|
||||
*/
|
||||
FactoryPackingLineDO getFactoryPackingLine(Long id);
|
||||
|
||||
/**
|
||||
* 获得打包线配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 打包线配置分页
|
||||
*/
|
||||
PageResult<FactoryPackingLineDO> getFactoryPackingLinePage(FactoryPackingLinePageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.service.factorypackingline;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline.vo.FactoryPackingLinePageReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factorypackingline.vo.FactoryPackingLineSaveReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factorypackingline.FactoryPackingLineDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factorypackingline.FactoryPackingLineMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 打包线配置 Service 实现类
|
||||
*
|
||||
* @author 姚君
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FactoryPackingLineServiceImpl implements FactoryPackingLineService {
|
||||
|
||||
@Resource
|
||||
private FactoryPackingLineMapper factoryPackingLineMapper;
|
||||
|
||||
@Override
|
||||
public Long createFactoryPackingLine(FactoryPackingLineSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FactoryPackingLineDO factoryPackingLine = BeanUtils.toBean(createReqVO, FactoryPackingLineDO.class);
|
||||
factoryPackingLineMapper.insert(factoryPackingLine);
|
||||
// 返回
|
||||
return factoryPackingLine.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFactoryPackingLine(FactoryPackingLineSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
FactoryPackingLineDO updateObj = BeanUtils.toBean(updateReqVO, FactoryPackingLineDO.class);
|
||||
factoryPackingLineMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFactoryPackingLine(Long id) {
|
||||
// 删除
|
||||
factoryPackingLineMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FactoryPackingLineDO getFactoryPackingLine(Long id) {
|
||||
return factoryPackingLineMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FactoryPackingLineDO> getFactoryPackingLinePage(FactoryPackingLinePageReqVO pageReqVO) {
|
||||
return factoryPackingLineMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?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.factoryforklift.FactoryForkliftMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="getFactoryForkliftPage"
|
||||
resultType="cn.iocoder.yudao.module.smartfactory.controller.admin.factoryforklift.vo.FactoryForkliftRespVO">
|
||||
select a.id,
|
||||
a.assets_no as assetsNo,
|
||||
d.name as name,
|
||||
c.id as forkliftId,
|
||||
c.*
|
||||
from zc_assets as a
|
||||
left join zc_dept_assets as b on a.id = b.assets_id
|
||||
left join sf_factory_forklift as c on a.assets_no = c.assets_no
|
||||
left join sf_factory_info as d on c.factory_id = d.id
|
||||
<where>
|
||||
<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>
|
@ -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.smartfactory.dal.mysql.factorykiln.FactoryKilnMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.smartfactory.dal.mysql.factorypackingline.FactoryPackingLineMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user