物料信息
This commit is contained in:
@@ -12,28 +12,28 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
public interface ErrorCodeConstants {
|
||||
/**
|
||||
* 业务异常的错误码区间,解决:解决各模块错误码定义,避免重复,在此只声明不做实际使用
|
||||
*
|
||||
* <p>
|
||||
* 一共 10 位,分成四段
|
||||
*
|
||||
* <p>
|
||||
* 第一段,1 位,类型
|
||||
* 1 - 业务级别异常
|
||||
* x - 预留
|
||||
* 1 - 业务级别异常
|
||||
* x - 预留
|
||||
* 第二段,3 位,系统类型
|
||||
* 001 - 用户系统
|
||||
* 002 - 商品系统
|
||||
* 003 - 订单系统
|
||||
* 004 - 支付系统
|
||||
* 005 - 优惠劵系统
|
||||
* ... - ...
|
||||
* 001 - 用户系统
|
||||
* 002 - 商品系统
|
||||
* 003 - 订单系统
|
||||
* 004 - 支付系统
|
||||
* 005 - 优惠劵系统
|
||||
* ... - ...
|
||||
* 第三段,3 位,模块
|
||||
* 不限制规则。
|
||||
* 一般建议,每个系统里面,可能有多个模块,可以再去做分段。以用户系统为例子:
|
||||
* 001 - OAuth2 模块
|
||||
* 002 - User 模块
|
||||
* 003 - MobileCode 模块
|
||||
* 不限制规则。
|
||||
* 一般建议,每个系统里面,可能有多个模块,可以再去做分段。以用户系统为例子:
|
||||
* 001 - OAuth2 模块
|
||||
* 002 - User 模块
|
||||
* 003 - MobileCode 模块
|
||||
* 第四段,3 位,错误码
|
||||
* 不限制规则。
|
||||
* 一般建议,每个模块自增。
|
||||
* 不限制规则。
|
||||
* 一般建议,每个模块自增。
|
||||
*
|
||||
* @author Rayson
|
||||
*/
|
||||
@@ -63,5 +63,18 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode PLACE_ARCHIVE_MATERIAL_NOT_EXISTS = new ErrorCode(1_100_001_008, "地点档案物料信息不存在");
|
||||
|
||||
ErrorCode CORR_FACT_NOT_EXISTS = new ErrorCode(1_100_001_009, "关联工厂信息不存在");
|
||||
// 模块 bseMngt.plceAchi [1_100_002_000 ~ 1_100_002_999]
|
||||
ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_100_002_001, "客商协同账号不存在");
|
||||
|
||||
}
|
||||
ErrorCode CARRIER_ACCOUNT_NOT_EXISTS = new ErrorCode(1_100_002_002, "物流服务商协同账号不存在");
|
||||
ErrorCode DRIVING_ACCOUNT_NOT_EXISTS = new ErrorCode(1_100_002_003, "司机协同账号不存在");
|
||||
|
||||
|
||||
// 模块 bseMngt.mtrl [1_100_003_000 ~ 1_100_003_999]
|
||||
ErrorCode MTRL_XPD_NOT_EXISTS = new ErrorCode(1_100_003_001, "物资信息扩展不存在");
|
||||
ErrorCode RLWY_MTRL_MAIN_NOT_EXISTS = new ErrorCode(1_100_003_002, "铁路物资对照主不存在");
|
||||
ErrorCode RLWY_MTRL_SUB_NOT_EXISTS = new ErrorCode(1_100_003_003, "铁路物资对照子不存在");
|
||||
ErrorCode RLWY_MTRL_SUB_MATERIAL_EXISTS = new ErrorCode(1_100_003_004, "物资对照已经存在");
|
||||
ErrorCode RLWY_MTRL_MAIN_STATUS_EXISTS = new ErrorCode(1_100_003_004, "铁路品名对照草稿状态才能操作");
|
||||
|
||||
}
|
||||
@@ -36,10 +36,10 @@ public class MtrlClsController implements BusinessControllerMarker {
|
||||
@Resource
|
||||
private MtrlClsService mtrlClsService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "获得物料分类列表")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:mtrl-cls:query')")
|
||||
public CommonResult<List<MtrlClsRespVO>> getMtrlClsList(@Valid MtrlClsListReqVO listReqVO) {
|
||||
public CommonResult<List<MtrlClsRespVO>> getMtrlClsList(@Valid @RequestBody MtrlClsListReqVO listReqVO) {
|
||||
List<MtrlClsDO> list = mtrlClsService.getMtrlClsList(listReqVO);
|
||||
return success(BeanUtils.toBean(list, MtrlClsRespVO.class));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl;
|
||||
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.mtrl.MtrlXpdDO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.service.bseMngt.mtrl.MtrlClsService;
|
||||
import cn.iocoder.yudao.module.backendlogistics.service.bseMngt.mtrl.MtrlXpdService;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
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.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 物资信息扩展")
|
||||
@RestController
|
||||
@RequestMapping("/lgst/mtrl-xpd")
|
||||
@Validated
|
||||
public class MtrlXpdController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private MtrlXpdService mtrlXpdService;
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "更新物资信息扩展")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:mtrl-xpd:update')")
|
||||
// @PermitAll
|
||||
public CommonResult<Boolean> updateMtrlXpd(@Valid @RequestBody List<MtrlXpdSaveReqVO> updateReqVOs) {
|
||||
mtrlXpdService.updateMtrlXpd(updateReqVOs);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "获得物资信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:mtrl-xpd:query')")
|
||||
public CommonResult<PageResult<MtrlXpdRespVO>> getMtrlXpdPage(@Valid @RequestBody MtrlXpdPageReqVO pageReqVO) {
|
||||
PageResult<MtrlXpdRespVO> pageResult = mtrlXpdService.getMtrlXpdPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
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
|
||||
public class MtrlXpdPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "物资ID", example = "10845")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "物资编码")
|
||||
@ExcelProperty("物资编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "物资名称")
|
||||
@ExcelProperty("物资名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "SAP编码")
|
||||
private String sapCode;
|
||||
|
||||
@Schema(description = "MDM编码")
|
||||
private String mdmCode;
|
||||
|
||||
@Schema(description = "长描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "分类id")
|
||||
private Long classesId;
|
||||
|
||||
@Schema(description = "质检标志")
|
||||
private String inspectionFlag;
|
||||
|
||||
@Schema(description = "计量标志")
|
||||
private String meteringFlag;
|
||||
|
||||
@Schema(description = "取样节点")
|
||||
private String samplingNode;
|
||||
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.beans.Transient;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
import net.sf.jsqlparser.statement.select.WithItem;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 物资信息扩展 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MtrlXpdRespVO{
|
||||
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13011")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "物资ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10845")
|
||||
@ExcelProperty("物资ID")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "物资编码")
|
||||
@ExcelProperty("物资编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "物资名称")
|
||||
@ExcelProperty("物资名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "SAP编码")
|
||||
@ExcelProperty("SAP编码")
|
||||
private String sapCode;
|
||||
|
||||
@Schema(description = "MDM编码")
|
||||
@ExcelProperty("MDM编码")
|
||||
private String mdmCode;
|
||||
|
||||
@Schema(description = "长描述")
|
||||
@ExcelProperty("长描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "大类代码")
|
||||
@ExcelProperty("大类代码")
|
||||
private String bigTypeCode;
|
||||
|
||||
@Schema(description = "大类名称", example = "王五")
|
||||
@ExcelProperty("大类名称")
|
||||
private String bigTypeName;
|
||||
|
||||
@Schema(description = "中类代码")
|
||||
@ExcelProperty("中类代码")
|
||||
private String midTypeCode;
|
||||
|
||||
@Schema(description = "中类名称", example = "芋艿")
|
||||
@ExcelProperty("中类名称")
|
||||
private String midTypeName;
|
||||
|
||||
@Schema(description = "小类代码")
|
||||
@ExcelProperty("小类代码")
|
||||
private String smalTypeCode;
|
||||
|
||||
@Schema(description = "小类名称", example = "王五")
|
||||
@ExcelProperty("小类名称")
|
||||
private String smalTypeName;
|
||||
|
||||
@Schema(description = "质检标志")
|
||||
@ExcelProperty("质检标志")
|
||||
private String inspectionFlag;
|
||||
|
||||
@Schema(description = "计量标志")
|
||||
@ExcelProperty("计量标志")
|
||||
private String meteringFlag;
|
||||
|
||||
@Schema(description = "取样节点")
|
||||
@ExcelProperty("取样节点")
|
||||
private String samplingNode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 物资信息扩展新增/修改 Request VO")
|
||||
@Data
|
||||
public class MtrlXpdSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13011")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "物资ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10845")
|
||||
@NotNull(message = "物资ID不能为空")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "质检标志")
|
||||
private String inspectionFlag;
|
||||
|
||||
@Schema(description = "计量标志")
|
||||
private String meteringFlag;
|
||||
|
||||
@Schema(description = "取样节点")
|
||||
private String samplingNode;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlMainDO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.service.bseMngt.rlwyMtrl.RlwyMtrlMainService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
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.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 铁路物资对照主")
|
||||
@RestController
|
||||
@RequestMapping("/lgst/rlwy-mtrl-main")
|
||||
@Validated
|
||||
public class RlwyMtrlMainController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private RlwyMtrlMainService rlwyMtrlMainService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建铁路物资对照主")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-main:create')")
|
||||
public CommonResult<RlwyMtrlMainRespVO> createRlwyMtrlMain(@Valid @RequestBody RlwyMtrlMainSaveReqVO createReqVO) {
|
||||
return success(rlwyMtrlMainService.createRlwyMtrlMain(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "更新铁路物资对照主")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-main:update')")
|
||||
public CommonResult<Boolean> updateRlwyMtrlMain(@Valid @RequestBody RlwyMtrlMainSaveReqVO updateReqVO) {
|
||||
rlwyMtrlMainService.updateRlwyMtrlMain(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除铁路物资对照主")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-main:delete')")
|
||||
public CommonResult<Boolean> deleteRlwyMtrlMain(@RequestParam("id") Long id) {
|
||||
rlwyMtrlMainService.deleteRlwyMtrlMain(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除铁路物资对照主")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-main:delete')")
|
||||
public CommonResult<Boolean> deleteRlwyMtrlMainList(@RequestBody BatchDeleteReqVO req) {
|
||||
rlwyMtrlMainService.deleteRlwyMtrlMainListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得铁路物资对照主")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-main:query')")
|
||||
public CommonResult<RlwyMtrlMainRespVO> getRlwyMtrlMain(@RequestParam("id") Long id) {
|
||||
RlwyMtrlMainDO rlwyMtrlMain = rlwyMtrlMainService.getRlwyMtrlMain(id);
|
||||
return success(BeanUtils.toBean(rlwyMtrlMain, RlwyMtrlMainRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "获得铁路物资对照主分页")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-main:query')")
|
||||
public CommonResult<PageResult<RlwyMtrlMainRespVO>> getRlwyMtrlMainPage(@Valid @RequestBody RlwyMtrlMainPageReqVO pageReqVO) {
|
||||
PageResult<RlwyMtrlMainDO> pageResult = rlwyMtrlMainService.getRlwyMtrlMainPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RlwyMtrlMainRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/export-excel")
|
||||
@Operation(summary = "导出铁路物资对照主 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-main:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRlwyMtrlMainExcel(@Valid @RequestBody RlwyMtrlMainPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RlwyMtrlMainDO> list = rlwyMtrlMainService.getRlwyMtrlMainPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "铁路物资对照主.xls", "数据", RlwyMtrlMainRespVO.class,
|
||||
BeanUtils.toBean(list, RlwyMtrlMainRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl;
|
||||
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlSubDO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.service.bseMngt.rlwyMtrl.RlwyMtrlSubService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
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.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 铁路物资对照子")
|
||||
@RestController
|
||||
@RequestMapping("/lgst/rlwy-mtrl-sub")
|
||||
@Validated
|
||||
public class RlwyMtrlSubController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private RlwyMtrlSubService rlwyMtrlSubService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建铁路物资对照子")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-sub:create')")
|
||||
public CommonResult<List<RlwyMtrlSubRespVO>> createRlwyMtrlSub(@Valid @RequestBody List<RlwyMtrlSubSaveReqVO> createReqVOs) {
|
||||
return success(rlwyMtrlSubService.createRlwyMtrlSub(createReqVOs));
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "更新铁路物资对照子")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-sub:update')")
|
||||
public CommonResult<Boolean> updateRlwyMtrlSub(@Valid @RequestBody RlwyMtrlSubSaveReqVO updateReqVO) {
|
||||
rlwyMtrlSubService.updateRlwyMtrlSub(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除铁路物资对照子")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-sub:delete')")
|
||||
public CommonResult<Boolean> deleteRlwyMtrlSub(@RequestParam("id") Long id) {
|
||||
rlwyMtrlSubService.deleteRlwyMtrlSub(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除铁路物资对照子")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-sub:delete')")
|
||||
public CommonResult<Boolean> deleteRlwyMtrlSubList(@RequestBody BatchDeleteReqVO req) {
|
||||
rlwyMtrlSubService.deleteRlwyMtrlSubListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得铁路物资对照子")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-sub:query')")
|
||||
public CommonResult<RlwyMtrlSubRespVO> getRlwyMtrlSub(@RequestParam("id") Long id) {
|
||||
RlwyMtrlSubDO rlwyMtrlSub = rlwyMtrlSubService.getRlwyMtrlSub(id);
|
||||
return success(BeanUtils.toBean(rlwyMtrlSub, RlwyMtrlSubRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "获得铁路物资对照子分页")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-sub:query')")
|
||||
public CommonResult<PageResult<RlwyMtrlSubRespVO>> getRlwyMtrlSubPage(@Valid @RequestBody RlwyMtrlSubPageReqVO pageReqVO) {
|
||||
PageResult<RlwyMtrlSubDO> pageResult = rlwyMtrlSubService.getRlwyMtrlSubPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RlwyMtrlSubRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/export-excel")
|
||||
@Operation(summary = "导出铁路物资对照子 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('lgst:rlwy-mtrl-sub:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRlwyMtrlSubExcel(@Valid @RequestBody RlwyMtrlSubPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RlwyMtrlSubDO> list = rlwyMtrlSubService.getRlwyMtrlSubPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "铁路物资对照子.xls", "数据", RlwyMtrlSubRespVO.class,
|
||||
BeanUtils.toBean(list, RlwyMtrlSubRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
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
|
||||
public class RlwyMtrlMainPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String sts;
|
||||
|
||||
@Schema(description = "铁路运输品名", example = "张三")
|
||||
private String rlwyTrpName;
|
||||
|
||||
@Schema(description = "品名代码")
|
||||
private String nameCd;
|
||||
|
||||
@Schema(description = "拼音码")
|
||||
private String pyCd;
|
||||
|
||||
@Schema(description = "报价费率")
|
||||
private BigDecimal chrgRte;
|
||||
|
||||
@Schema(description = "整车价号")
|
||||
private String exPrcCd;
|
||||
|
||||
@Schema(description = "零担价号")
|
||||
private String prtlPrcCd;
|
||||
|
||||
@Schema(description = "大类代码")
|
||||
private String bigTpCd;
|
||||
|
||||
@Schema(description = "大类名称", example = "李四")
|
||||
private String bigTpName;
|
||||
|
||||
@Schema(description = "中类代码")
|
||||
private String midTpCd;
|
||||
|
||||
@Schema(description = "中类名称", example = "芋艿")
|
||||
private String midTpName;
|
||||
|
||||
@Schema(description = "小类代码")
|
||||
private String smalTpCd;
|
||||
|
||||
@Schema(description = "小类名称", example = "王五")
|
||||
private String smalTpName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 铁路物资对照主 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RlwyMtrlMainRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3659")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "状态")
|
||||
@ExcelProperty("状态")
|
||||
private String sts;
|
||||
|
||||
@Schema(description = "铁路运输品名", example = "张三")
|
||||
@ExcelProperty("铁路运输品名")
|
||||
private String rlwyTrpName;
|
||||
|
||||
@Schema(description = "品名代码")
|
||||
@ExcelProperty("品名代码")
|
||||
private String nameCd;
|
||||
|
||||
@Schema(description = "拼音码")
|
||||
@ExcelProperty("拼音码")
|
||||
private String pyCd;
|
||||
|
||||
@Schema(description = "报价费率")
|
||||
@ExcelProperty("报价费率")
|
||||
private BigDecimal chrgRte;
|
||||
|
||||
@Schema(description = "整车价号")
|
||||
@ExcelProperty("整车价号")
|
||||
private String exPrcCd;
|
||||
|
||||
@Schema(description = "零担价号")
|
||||
@ExcelProperty("零担价号")
|
||||
private String prtlPrcCd;
|
||||
|
||||
@Schema(description = "大类代码")
|
||||
@ExcelProperty("大类代码")
|
||||
private String bigTpCd;
|
||||
|
||||
@Schema(description = "大类名称", example = "李四")
|
||||
@ExcelProperty("大类名称")
|
||||
private String bigTpName;
|
||||
|
||||
@Schema(description = "中类代码")
|
||||
@ExcelProperty("中类代码")
|
||||
private String midTpCd;
|
||||
|
||||
@Schema(description = "中类名称", example = "芋艿")
|
||||
@ExcelProperty("中类名称")
|
||||
private String midTpName;
|
||||
|
||||
@Schema(description = "小类代码")
|
||||
@ExcelProperty("小类代码")
|
||||
private String smalTpCd;
|
||||
|
||||
@Schema(description = "小类名称", example = "王五")
|
||||
@ExcelProperty("小类名称")
|
||||
private String smalTpName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 铁路物资对照主新增/修改 Request VO")
|
||||
@Data
|
||||
public class RlwyMtrlMainSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3659")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String sts;
|
||||
|
||||
@Schema(description = "铁路运输品名", example = "张三")
|
||||
private String rlwyTrpName;
|
||||
|
||||
@Schema(description = "品名代码")
|
||||
private String nameCd;
|
||||
|
||||
@Schema(description = "拼音码")
|
||||
private String pyCd;
|
||||
|
||||
@Schema(description = "报价费率")
|
||||
private BigDecimal chrgRte;
|
||||
|
||||
@Schema(description = "整车价号")
|
||||
private String exPrcCd;
|
||||
|
||||
@Schema(description = "零担价号")
|
||||
private String prtlPrcCd;
|
||||
|
||||
@Schema(description = "大类代码")
|
||||
private String bigTpCd;
|
||||
|
||||
@Schema(description = "大类名称", example = "李四")
|
||||
private String bigTpName;
|
||||
|
||||
@Schema(description = "中类代码")
|
||||
private String midTpCd;
|
||||
|
||||
@Schema(description = "中类名称", example = "芋艿")
|
||||
private String midTpName;
|
||||
|
||||
@Schema(description = "小类代码")
|
||||
private String smalTpCd;
|
||||
|
||||
@Schema(description = "小类名称", example = "王五")
|
||||
private String smalTpName;
|
||||
|
||||
@Schema(description = "子项")
|
||||
private List<RlwyMtrlSubSaveReqVO> items;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
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
|
||||
public class RlwyMtrlSubPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "主项ID", example = "12339")
|
||||
private Long mainId;
|
||||
|
||||
@Schema(description = "物资ID", example = "18676")
|
||||
private Long mtrlId;
|
||||
|
||||
@Schema(description = "SAP编码")
|
||||
private String sapCd;
|
||||
|
||||
@Schema(description = "MDM编码")
|
||||
private String mdmCd;
|
||||
|
||||
@Schema(description = "物料名称", example = "王五")
|
||||
private String mtrlName;
|
||||
|
||||
@Schema(description = "长描述")
|
||||
private String dsp;
|
||||
|
||||
@Schema(description = "大类代码")
|
||||
private String bigTpCd;
|
||||
|
||||
@Schema(description = "大类名称", example = "芋艿")
|
||||
private String bigTpName;
|
||||
|
||||
@Schema(description = "中类代码")
|
||||
private String midTpCd;
|
||||
|
||||
@Schema(description = "中类名称", example = "赵六")
|
||||
private String midTpName;
|
||||
|
||||
@Schema(description = "小类代码")
|
||||
private String smalTpCode;
|
||||
|
||||
@Schema(description = "小类名称", example = "李四")
|
||||
private String smalTpName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 铁路物资对照子 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RlwyMtrlSubRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17186")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "主项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12339")
|
||||
@ExcelProperty("主项ID")
|
||||
private Long mainId;
|
||||
|
||||
@Schema(description = "物资ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18676")
|
||||
@ExcelProperty("物资ID")
|
||||
private Long mtrlId;
|
||||
|
||||
@Schema(description = "SAP编码")
|
||||
@ExcelProperty("SAP编码")
|
||||
private String sapCd;
|
||||
|
||||
@Schema(description = "MDM编码")
|
||||
@ExcelProperty("MDM编码")
|
||||
private String mdmCd;
|
||||
|
||||
@Schema(description = "物料名称", example = "王五")
|
||||
@ExcelProperty("物料名称")
|
||||
private String mtrlName;
|
||||
|
||||
@Schema(description = "长描述")
|
||||
@ExcelProperty("长描述")
|
||||
private String dsp;
|
||||
|
||||
@Schema(description = "大类代码")
|
||||
@ExcelProperty("大类代码")
|
||||
private String bigTpCd;
|
||||
|
||||
@Schema(description = "大类名称", example = "芋艿")
|
||||
@ExcelProperty("大类名称")
|
||||
private String bigTpName;
|
||||
|
||||
@Schema(description = "中类代码")
|
||||
@ExcelProperty("中类代码")
|
||||
private String midTpCd;
|
||||
|
||||
@Schema(description = "中类名称", example = "赵六")
|
||||
@ExcelProperty("中类名称")
|
||||
private String midTpName;
|
||||
|
||||
@Schema(description = "小类代码")
|
||||
@ExcelProperty("小类代码")
|
||||
private String smalTpCode;
|
||||
|
||||
@Schema(description = "小类名称", example = "李四")
|
||||
@ExcelProperty("小类名称")
|
||||
private String smalTpName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 铁路物资对照子新增/修改 Request VO")
|
||||
@Data
|
||||
public class RlwyMtrlSubSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17186")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12339")
|
||||
@NotNull(message = "主项ID不能为空")
|
||||
private Long mainId;
|
||||
|
||||
@Schema(description = "物资ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18676")
|
||||
@NotNull(message = "物资ID不能为空")
|
||||
private Long mtrlId;
|
||||
|
||||
@Schema(description = "SAP编码")
|
||||
private String sapCd;
|
||||
|
||||
@Schema(description = "MDM编码")
|
||||
private String mdmCd;
|
||||
|
||||
@Schema(description = "物料名称", example = "王五")
|
||||
private String mtrlName;
|
||||
|
||||
@Schema(description = "长描述")
|
||||
private String dsp;
|
||||
|
||||
@Schema(description = "大类代码")
|
||||
private String bigTpCd;
|
||||
|
||||
@Schema(description = "大类名称", example = "芋艿")
|
||||
private String bigTpName;
|
||||
|
||||
@Schema(description = "中类代码")
|
||||
private String midTpCd;
|
||||
|
||||
@Schema(description = "中类名称", example = "赵六")
|
||||
private String midTpName;
|
||||
|
||||
@Schema(description = "小类代码")
|
||||
private String smalTpCode;
|
||||
|
||||
@Schema(description = "小类名称", example = "李四")
|
||||
private String smalTpName;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.mtrl;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -22,7 +23,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MtrlClsDO extends BusinessBaseDO {
|
||||
public class MtrlClsDO extends BaseDO {
|
||||
|
||||
public static final Long PARENT_ID_ROOT = 0L;
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.mtrl;
|
||||
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.BusinessBaseDO;
|
||||
/**
|
||||
* 物资信息扩展 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("lgst_mtrl_xpd")
|
||||
@KeySequence("lgst_mtrl_xpd_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MtrlXpdDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 物资ID
|
||||
*/
|
||||
@TableField("MTRL_ID")
|
||||
private Long materialId;
|
||||
/**
|
||||
* 质检标志
|
||||
*/
|
||||
@TableField("INSP_FLG")
|
||||
private String inspectionFlag;
|
||||
/**
|
||||
* 计量标志
|
||||
*/
|
||||
@TableField("MTNG_FLG")
|
||||
private String meteringFlag;
|
||||
/**
|
||||
* 取样节点
|
||||
*/
|
||||
@TableField("SPLG_NDE")
|
||||
private String samplingNode;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl;
|
||||
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 铁路物资对照主 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("lgst_rlwy_mtrl_main")
|
||||
@KeySequence("lgst_rlwy_mtrl_main_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class RlwyMtrlMainDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("STS")
|
||||
private String sts;
|
||||
/**
|
||||
* 铁路运输品名
|
||||
*/
|
||||
@TableField("RLWY_TRP_NAME")
|
||||
private String rlwyTrpName;
|
||||
/**
|
||||
* 品名代码
|
||||
*/
|
||||
@TableField("NAME_CD")
|
||||
private String nameCd;
|
||||
/**
|
||||
* 拼音码
|
||||
*/
|
||||
@TableField("PY_CD")
|
||||
private String pyCd;
|
||||
/**
|
||||
* 报价费率
|
||||
*/
|
||||
@TableField("CHRG_RTE")
|
||||
private BigDecimal chrgRte;
|
||||
/**
|
||||
* 整车价号
|
||||
*/
|
||||
@TableField("EX_PRC_CD")
|
||||
private String exPrcCd;
|
||||
/**
|
||||
* 零担价号
|
||||
*/
|
||||
@TableField("PRTL_PRC_CD")
|
||||
private String prtlPrcCd;
|
||||
/**
|
||||
* 大类代码
|
||||
*/
|
||||
@TableField("BIG_TP_CD")
|
||||
private String bigTpCd;
|
||||
/**
|
||||
* 大类名称
|
||||
*/
|
||||
@TableField("BIG_TP_NAME")
|
||||
private String bigTpName;
|
||||
/**
|
||||
* 中类代码
|
||||
*/
|
||||
@TableField("MID_TP_CD")
|
||||
private String midTpCd;
|
||||
/**
|
||||
* 中类名称
|
||||
*/
|
||||
@TableField("MID_TP_NAME")
|
||||
private String midTpName;
|
||||
/**
|
||||
* 小类代码
|
||||
*/
|
||||
@TableField("SMAL_TP_CD")
|
||||
private String smalTpCd;
|
||||
/**
|
||||
* 小类名称
|
||||
*/
|
||||
@TableField("SMAL_TP_NAME")
|
||||
private String smalTpName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 铁路物资对照子 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("lgst_rlwy_mtrl_sub")
|
||||
@KeySequence("lgst_rlwy_mtrl_sub_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class RlwyMtrlSubDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 主项ID
|
||||
*/
|
||||
@TableField("MAIN_ID")
|
||||
private Long mainId;
|
||||
/**
|
||||
* 物资ID
|
||||
*/
|
||||
@TableField("MTRL_ID")
|
||||
private Long mtrlId;
|
||||
/**
|
||||
* SAP编码
|
||||
*/
|
||||
@TableField("SAP_CD")
|
||||
private String sapCd;
|
||||
/**
|
||||
* MDM编码
|
||||
*/
|
||||
@TableField("MDM_CD")
|
||||
private String mdmCd;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@TableField("MTRL_NAME")
|
||||
private String mtrlName;
|
||||
/**
|
||||
* 长描述
|
||||
*/
|
||||
@TableField("DSP")
|
||||
private String dsp;
|
||||
/**
|
||||
* 大类代码
|
||||
*/
|
||||
@TableField("BIG_TP_CD")
|
||||
private String bigTpCd;
|
||||
/**
|
||||
* 大类名称
|
||||
*/
|
||||
@TableField("BIG_TP_NAME")
|
||||
private String bigTpName;
|
||||
/**
|
||||
* 中类代码
|
||||
*/
|
||||
@TableField("MID_TP_CD")
|
||||
private String midTpCd;
|
||||
/**
|
||||
* 中类名称
|
||||
*/
|
||||
@TableField("MID_TP_NAME")
|
||||
private String midTpName;
|
||||
/**
|
||||
* 小类代码
|
||||
*/
|
||||
@TableField("SMAL_TP_CODE")
|
||||
private String smalTpCode;
|
||||
/**
|
||||
* 小类名称
|
||||
*/
|
||||
@TableField("SMAL_TP_NAME")
|
||||
private String smalTpName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.dal.mysql.bseMngt.mtrl;
|
||||
|
||||
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.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.mtrl.MtrlXpdDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 物资信息扩展 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface MtrlXpdMapper extends BaseMapperX<MtrlXpdDO> {
|
||||
|
||||
|
||||
IPage<MtrlXpdRespVO> selectPage2(IPage<MtrlXpdRespVO> page, @Param("reqVO") MtrlXpdPageReqVO reqVO);
|
||||
|
||||
MtrlXpdDO selectByMaterialId(@Param("materialId") Long materialId);
|
||||
|
||||
|
||||
List<MtrlXpdRespVO> selectMaterialClasses(@Param("materialIds")List<Long> materialIds);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.dal.mysql.bseMngt.rlwyMtrl;
|
||||
|
||||
|
||||
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.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlMainDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 铁路物资对照主 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface RlwyMtrlMainMapper extends BaseMapperX<RlwyMtrlMainDO> {
|
||||
|
||||
default PageResult<RlwyMtrlMainDO> selectPage(RlwyMtrlMainPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RlwyMtrlMainDO>()
|
||||
.betweenIfPresent(RlwyMtrlMainDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getSts, reqVO.getSts())
|
||||
.likeIfPresent(RlwyMtrlMainDO::getRlwyTrpName, reqVO.getRlwyTrpName())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getNameCd, reqVO.getNameCd())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getPyCd, reqVO.getPyCd())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getChrgRte, reqVO.getChrgRte())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getExPrcCd, reqVO.getExPrcCd())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getPrtlPrcCd, reqVO.getPrtlPrcCd())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getBigTpCd, reqVO.getBigTpCd())
|
||||
.likeIfPresent(RlwyMtrlMainDO::getBigTpName, reqVO.getBigTpName())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getMidTpCd, reqVO.getMidTpCd())
|
||||
.likeIfPresent(RlwyMtrlMainDO::getMidTpName, reqVO.getMidTpName())
|
||||
.eqIfPresent(RlwyMtrlMainDO::getSmalTpCd, reqVO.getSmalTpCd())
|
||||
.likeIfPresent(RlwyMtrlMainDO::getSmalTpName, reqVO.getSmalTpName())
|
||||
.orderByDesc(RlwyMtrlMainDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.dal.mysql.bseMngt.rlwyMtrl;
|
||||
|
||||
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.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlSubDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 铁路物资对照子 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface RlwyMtrlSubMapper extends BaseMapperX<RlwyMtrlSubDO> {
|
||||
|
||||
default PageResult<RlwyMtrlSubDO> selectPage(RlwyMtrlSubPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RlwyMtrlSubDO>()
|
||||
.betweenIfPresent(RlwyMtrlSubDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getMainId, reqVO.getMainId())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getMtrlId, reqVO.getMtrlId())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getSapCd, reqVO.getSapCd())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getMdmCd, reqVO.getMdmCd())
|
||||
.likeIfPresent(RlwyMtrlSubDO::getMtrlName, reqVO.getMtrlName())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getDsp, reqVO.getDsp())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getBigTpCd, reqVO.getBigTpCd())
|
||||
.likeIfPresent(RlwyMtrlSubDO::getBigTpName, reqVO.getBigTpName())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getMidTpCd, reqVO.getMidTpCd())
|
||||
.likeIfPresent(RlwyMtrlSubDO::getMidTpName, reqVO.getMidTpName())
|
||||
.eqIfPresent(RlwyMtrlSubDO::getSmalTpCode, reqVO.getSmalTpCode())
|
||||
.likeIfPresent(RlwyMtrlSubDO::getSmalTpName, reqVO.getSmalTpName())
|
||||
.orderByDesc(RlwyMtrlSubDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,6 +28,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Transactional
|
||||
public class MtrlClsServiceImpl implements MtrlClsService {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.service.bseMngt.mtrl;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.mtrl.MtrlXpdDO;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 物资信息扩展 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface MtrlXpdService {
|
||||
|
||||
|
||||
/**
|
||||
* 更新物资信息扩展
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMtrlXpd(@Valid List<MtrlXpdSaveReqVO> updateReqVOs);
|
||||
|
||||
/**
|
||||
* 获得物资信息扩展
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 物资信息扩展
|
||||
*/
|
||||
MtrlXpdDO getMtrlXpd(Long id);
|
||||
|
||||
/**
|
||||
* 获得物资信息扩展分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 物资信息扩展分页
|
||||
*/
|
||||
PageResult<MtrlXpdRespVO> getMtrlXpdPage(MtrlXpdPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.service.bseMngt.mtrl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.mtrl.MtrlXpdDO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.mysql.bseMngt.mtrl.MtrlXpdMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物资信息扩展 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Transactional
|
||||
public class MtrlXpdServiceImpl implements MtrlXpdService {
|
||||
|
||||
@Resource
|
||||
private MtrlXpdMapper mtrlXpdMapper;
|
||||
|
||||
@Override
|
||||
public void updateMtrlXpd(List<MtrlXpdSaveReqVO> updateReqVOs) {
|
||||
|
||||
// 更新
|
||||
for (MtrlXpdSaveReqVO updateReqVO : updateReqVOs){
|
||||
MtrlXpdDO updateObj = BeanUtils.toBean(updateReqVO, MtrlXpdDO.class);
|
||||
mtrlXpdMapper.insertOrUpdate(updateObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MtrlXpdDO getMtrlXpd(Long id) {
|
||||
return mtrlXpdMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MtrlXpdRespVO> getMtrlXpdPage(MtrlXpdPageReqVO pageReqVO) {
|
||||
IPage<MtrlXpdRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
mtrlXpdMapper.selectPage2(page, pageReqVO);
|
||||
// this.queryInfo(page.getRecords());
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
private void queryInfo(List<MtrlXpdRespVO> records) {
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
List<Long> materialIds = records.stream()
|
||||
.filter(record -> record.getMaterialId() != null)
|
||||
.map(MtrlXpdRespVO::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//物资目录
|
||||
List<MtrlXpdRespVO> materialClasses = mtrlXpdMapper.selectMaterialClasses(materialIds);
|
||||
|
||||
Map<Long, MtrlXpdRespVO> materialClassMap = materialClasses.stream()
|
||||
.filter(mc -> mc.getMaterialId() != null)
|
||||
.collect(Collectors.toMap(MtrlXpdRespVO::getMaterialId, mc -> mc, (existing, replacement) -> existing));
|
||||
|
||||
for (MtrlXpdRespVO record : records) {
|
||||
if (record.getId() == null) continue;
|
||||
|
||||
MtrlXpdRespVO mc = materialClassMap.get(record.getId());
|
||||
if (mc != null) {
|
||||
record.setBigTypeCode(mc.getBigTypeCode());
|
||||
record.setBigTypeName(mc.getBigTypeName());
|
||||
record.setMidTypeCode(mc.getMidTypeCode());
|
||||
record.setMidTypeName(mc.getMidTypeName());
|
||||
record.setSmalTypeCode(mc.getSmalTypeCode());
|
||||
record.setSmalTypeName(mc.getSmalTypeName());
|
||||
}
|
||||
|
||||
// 查询详细信息 todo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.service.bseMngt.rlwyMtrl;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlMainDO;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 铁路物资对照主 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface RlwyMtrlMainService {
|
||||
|
||||
/**
|
||||
* 创建铁路物资对照主
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
RlwyMtrlMainRespVO createRlwyMtrlMain(@Valid RlwyMtrlMainSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新铁路物资对照主
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRlwyMtrlMain(@Valid RlwyMtrlMainSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除铁路物资对照主
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRlwyMtrlMain(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除铁路物资对照主
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteRlwyMtrlMainListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得铁路物资对照主
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 铁路物资对照主
|
||||
*/
|
||||
RlwyMtrlMainDO getRlwyMtrlMain(Long id);
|
||||
|
||||
/**
|
||||
* 获得铁路物资对照主分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 铁路物资对照主分页
|
||||
*/
|
||||
PageResult<RlwyMtrlMainDO> getRlwyMtrlMainPage(RlwyMtrlMainPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.service.bseMngt.rlwyMtrl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlMainSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlMainDO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.mysql.bseMngt.rlwyMtrl.RlwyMtrlMainMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
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 static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.backendlogistics.enums.ErrorCodeConstants.RLWY_MTRL_MAIN_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.backendlogistics.enums.ErrorCodeConstants.RLWY_MTRL_MAIN_STATUS_EXISTS;
|
||||
|
||||
|
||||
/**
|
||||
* 铁路物资对照主 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Transactional
|
||||
public class RlwyMtrlMainServiceImpl implements RlwyMtrlMainService {
|
||||
|
||||
@Resource
|
||||
private RlwyMtrlMainMapper rlwyMtrlMainMapper;
|
||||
|
||||
@Resource
|
||||
private RlwyMtrlSubService rlwyMtrlSubService;
|
||||
|
||||
@Override
|
||||
public RlwyMtrlMainRespVO createRlwyMtrlMain(RlwyMtrlMainSaveReqVO createReqVO) {
|
||||
// 插入主项
|
||||
RlwyMtrlMainDO rlwyMtrlMain = BeanUtils.toBean(createReqVO, RlwyMtrlMainDO.class);
|
||||
rlwyMtrlMain.setSts("00");
|
||||
rlwyMtrlMainMapper.insert(rlwyMtrlMain);
|
||||
//插入子项
|
||||
for (RlwyMtrlSubSaveReqVO subSaveReqVO : createReqVO.getItems()){
|
||||
subSaveReqVO.setMainId(rlwyMtrlMain.getId());
|
||||
}
|
||||
rlwyMtrlSubService.createRlwyMtrlSub(createReqVO.getItems());
|
||||
// 返回
|
||||
return BeanUtils.toBean(rlwyMtrlMain, RlwyMtrlMainRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRlwyMtrlMain(RlwyMtrlMainSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRlwyMtrlMainExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RlwyMtrlMainDO updateObj = BeanUtils.toBean(updateReqVO, RlwyMtrlMainDO.class);
|
||||
rlwyMtrlMainMapper.updateById(updateObj);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRlwyMtrlMain(Long id) {
|
||||
// 校验存在
|
||||
validateRlwyMtrlMainExists(id);
|
||||
// 删除
|
||||
rlwyMtrlMainMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRlwyMtrlMainListByIds(List<Long> ids) {
|
||||
for (Long id : ids) {
|
||||
this.deleteRlwyMtrlMain(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void validateRlwyMtrlMainExists(List<Long> ids) {
|
||||
List<RlwyMtrlMainDO> list = rlwyMtrlMainMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(RLWY_MTRL_MAIN_NOT_EXISTS);
|
||||
}
|
||||
for (RlwyMtrlMainDO rlwyMtrlMainDO : list) {
|
||||
//草稿状态才能删除
|
||||
if(rlwyMtrlMainDO.getSts() != "00"){
|
||||
throw exception(RLWY_MTRL_MAIN_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void validateRlwyMtrlMainExists(Long id) {
|
||||
|
||||
RlwyMtrlMainDO rlwyMtrlMainDO = rlwyMtrlMainMapper.selectById(id);
|
||||
if (rlwyMtrlMainDO == null) {
|
||||
throw exception(RLWY_MTRL_MAIN_NOT_EXISTS);
|
||||
}
|
||||
//草稿状态才能操作
|
||||
if(rlwyMtrlMainDO.getSts() != "00"){
|
||||
throw exception(RLWY_MTRL_MAIN_STATUS_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RlwyMtrlMainDO getRlwyMtrlMain(Long id) {
|
||||
return rlwyMtrlMainMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RlwyMtrlMainDO> getRlwyMtrlMainPage(RlwyMtrlMainPageReqVO pageReqVO) {
|
||||
return rlwyMtrlMainMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.service.bseMngt.rlwyMtrl;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlSubDO;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 铁路物资对照子 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface RlwyMtrlSubService {
|
||||
|
||||
/**
|
||||
* 创建铁路物资对照子
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
List<RlwyMtrlSubRespVO> createRlwyMtrlSub(@Valid List<RlwyMtrlSubSaveReqVO> createReqVO);
|
||||
|
||||
/**
|
||||
* 更新铁路物资对照子
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRlwyMtrlSub(@Valid RlwyMtrlSubSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除铁路物资对照子
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRlwyMtrlSub(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除铁路物资对照子
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteRlwyMtrlSubListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得铁路物资对照子
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 铁路物资对照子
|
||||
*/
|
||||
RlwyMtrlSubDO getRlwyMtrlSub(Long id);
|
||||
|
||||
/**
|
||||
* 获得铁路物资对照子分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 铁路物资对照子分页
|
||||
*/
|
||||
PageResult<RlwyMtrlSubDO> getRlwyMtrlSubPage(RlwyMtrlSubPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.iocoder.yudao.module.backendlogistics.service.bseMngt.rlwyMtrl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubPageReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubRespVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.rlwyMtrl.vo.RlwyMtrlSubSaveReqVO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlMainDO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.rlwyMtrl.RlwyMtrlSubDO;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.mysql.bseMngt.rlwyMtrl.RlwyMtrlMainMapper;
|
||||
import cn.iocoder.yudao.module.backendlogistics.dal.mysql.bseMngt.rlwyMtrl.RlwyMtrlSubMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.backendlogistics.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 铁路物资对照子 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Transactional
|
||||
public class RlwyMtrlSubServiceImpl implements RlwyMtrlSubService {
|
||||
|
||||
@Resource
|
||||
private RlwyMtrlSubMapper rlwyMtrlSubMapper;
|
||||
|
||||
@Resource
|
||||
private RlwyMtrlMainMapper rlwyMtrlMainMapper;
|
||||
|
||||
@Override
|
||||
public List<RlwyMtrlSubRespVO> createRlwyMtrlSub(List<RlwyMtrlSubSaveReqVO> createReqVOs) {
|
||||
// 插入
|
||||
|
||||
List<RlwyMtrlSubDO> rlwyMtrlSubDOs = new ArrayList<>();
|
||||
for (RlwyMtrlSubSaveReqVO createReqVO : createReqVOs) {
|
||||
RlwyMtrlSubDO rlwyMtrlSub = BeanUtils.toBean(createReqVO, RlwyMtrlSubDO.class);
|
||||
|
||||
//查询物资是否已经存在对照
|
||||
RlwyMtrlSubPageReqVO rlwyMtrlSubPageReqVO = new RlwyMtrlSubPageReqVO();
|
||||
rlwyMtrlSubPageReqVO.setMtrlId(createReqVO.getMtrlId());
|
||||
PageResult<RlwyMtrlSubDO> result = rlwyMtrlSubMapper.selectPage(rlwyMtrlSubPageReqVO);
|
||||
if (result.getTotal() > 0) {
|
||||
throw exception(RLWY_MTRL_SUB_MATERIAL_EXISTS);
|
||||
}
|
||||
|
||||
rlwyMtrlSubMapper.insert(rlwyMtrlSub);
|
||||
rlwyMtrlSubDOs.add(rlwyMtrlSub);
|
||||
}
|
||||
|
||||
// 返回
|
||||
return BeanUtils.toBean(rlwyMtrlSubDOs, RlwyMtrlSubRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRlwyMtrlSub(RlwyMtrlSubSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRlwyMtrlSubExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RlwyMtrlSubDO updateObj = BeanUtils.toBean(updateReqVO, RlwyMtrlSubDO.class);
|
||||
rlwyMtrlSubMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRlwyMtrlSub(Long id) {
|
||||
// 校验存在
|
||||
validateRlwyMtrlSubExists(id);
|
||||
// 删除
|
||||
rlwyMtrlSubMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRlwyMtrlSubListByIds(List<Long> ids) {
|
||||
for (Long id : ids) {
|
||||
this.deleteRlwyMtrlSub(id);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateRlwyMtrlSubExists(List<Long> ids) {
|
||||
List<RlwyMtrlSubDO> list = rlwyMtrlSubMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(RLWY_MTRL_SUB_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateRlwyMtrlSubExists(Long id) {
|
||||
RlwyMtrlSubDO rlwyMtrlSubDO = rlwyMtrlSubMapper.selectById(id);
|
||||
RlwyMtrlMainDO rlwyMtrlMainDO = rlwyMtrlMainMapper.selectById(rlwyMtrlSubDO.getMainId());
|
||||
|
||||
if (null != rlwyMtrlMainDO && !"00".equals(rlwyMtrlMainDO.getSts())) {
|
||||
throw exception(RLWY_MTRL_MAIN_STATUS_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public RlwyMtrlSubDO getRlwyMtrlSub(Long id) {
|
||||
return rlwyMtrlSubMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RlwyMtrlSubDO> getRlwyMtrlSubPage(RlwyMtrlSubPageReqVO pageReqVO) {
|
||||
return rlwyMtrlSubMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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.backendlogistics.dal.mysql.bseMngt.rlwyMtrl.RlwyMtrlSubMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.backendlogistics.dal.mysql.bseMngt.mtrl.MtrlXpdMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectPage2"
|
||||
resultType="cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdRespVO">
|
||||
SELECT MI.ID AS materialId,
|
||||
MI.CD AS materialCode,
|
||||
MI.NAME AS materialName,
|
||||
MI.RMK AS description,
|
||||
LMX.INSP_FLG AS inspectionFlag,
|
||||
LMX.MTNG_FLG AS meteringFlag,
|
||||
LMX.SPLG_NDE AS samplingNode
|
||||
from MTRL_INF MI
|
||||
LEFT JOIN MTRL_HS_CLS MHC ON MI.ID = MHC.INF_ID
|
||||
LEFT JOIN LGST_MTRL_XPD LMX ON MI.ID = LMX.MTRL_ID
|
||||
<where>
|
||||
<if test="reqVO.classesId != null">
|
||||
AND MHC.CLS_ID = #{reqVO.classesId}
|
||||
</if>
|
||||
<if test="reqVO.deptId != null">
|
||||
AND LMX.DEPT_ID = #{reqVO.deptId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="selectByMaterialId"
|
||||
resultType="cn.iocoder.yudao.module.backendlogistics.dal.dataobject.bseMngt.mtrl.MtrlXpdDO">
|
||||
select * from MTRL_XPD where MTRL_ID = #{materialId}
|
||||
</select>
|
||||
|
||||
<select id="selectMaterialClasses"
|
||||
resultType="cn.iocoder.yudao.module.backendlogistics.controller.admin.backendlogistics.bseMngt.mtrl.vo.MtrlXpdRespVO"
|
||||
flushCache="true"
|
||||
useCache="false">
|
||||
WITH material_class_hierarchy (
|
||||
material_id, class_level, class_id, class_code, class_name, parent_id, hierarchy_level
|
||||
) AS (
|
||||
SELECT mi.ID as material_id,
|
||||
mc.LVL as class_level,
|
||||
mc.ID as class_id,
|
||||
mc.CD as class_code,
|
||||
mc.NAME as class_name,
|
||||
mc.PRN_ID as parent_id,
|
||||
1 as hierarchy_level
|
||||
FROM "RUOYI-VUE-PRO".MTRL_INF mi
|
||||
LEFT JOIN "RUOYI-VUE-PRO".MTRL_HS_CLS mhc ON mi.ID = mhc.INF_ID
|
||||
LEFT JOIN "RUOYI-VUE-PRO".MTRL_CLS mc ON mhc.CLS_ID = mc.ID AND mc.DELETED = 0
|
||||
WHERE mi.id IS NOT NULL
|
||||
<if test="materialIds != null and materialIds.size() > 0">
|
||||
AND mi.ID IN
|
||||
<foreach item="item" index="index" collection="materialIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT mch.material_id,
|
||||
mc.LVL as class_level,
|
||||
mc.ID as class_id,
|
||||
mc.CD as class_code,
|
||||
mc.NAME as class_name,
|
||||
mc.PRN_ID as parent_id,
|
||||
mch.hierarchy_level + 1 as hierarchy_level
|
||||
FROM material_class_hierarchy mch
|
||||
JOIN "RUOYI-VUE-PRO".MTRL_CLS mc ON mch.parent_id = mc.id AND mc.DELETED = 0
|
||||
WHERE mch.parent_id IS NOT NULL)
|
||||
SELECT material_id AS materialId,
|
||||
MAX(CASE WHEN hierarchy_level = 1 THEN class_code END) as bigTypeCode,
|
||||
MAX(CASE WHEN hierarchy_level = 1 THEN class_name END) as bigTypeName,
|
||||
MAX(CASE WHEN hierarchy_level = 2 THEN class_code END) as midTypeCode,
|
||||
MAX(CASE WHEN hierarchy_level = 2 THEN class_name END) as midTypeName,
|
||||
MAX(CASE WHEN hierarchy_level = 3 THEN class_code END) as smalTypeCode,
|
||||
MAX(CASE WHEN hierarchy_level = 3 THEN class_name END) as smalTypeName
|
||||
FROM material_class_hierarchy
|
||||
GROUP BY material_id
|
||||
ORDER BY material_id;
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user