物资需求计划
This commit is contained in:
@ -40,7 +40,6 @@ import java.util.List;
|
||||
public class BusCailiaoshebeiController extends BaseController {
|
||||
|
||||
private final IBusCailiaoshebeiService busCailiaoshebeiService;
|
||||
private final IBusSuppliespriceService busSuppliespriceService;
|
||||
private final IBusCailiaoshebeiPiciService busCailiaoshebeiPiciService;
|
||||
|
||||
|
||||
@ -50,13 +49,14 @@ public class BusCailiaoshebeiController extends BaseController {
|
||||
* 设计-新增批次号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:cailiaoshebei:pcAdd")
|
||||
@Log(title = "物资-批次号", businessType = BusinessType.INSERT)
|
||||
@Log(title = "设计-批次号列表", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/pcAdd")
|
||||
public R<Void> pcAdd(@Validated(AddGroup.class) @RequestBody BusCailiaoshebeiPiciAddReq bo) {
|
||||
BusCailiaoshebeiPici busCailiaoshebeiPici = new BusCailiaoshebeiPici().
|
||||
setProjectId(bo.getProjectId()).
|
||||
setBatchNumber(BatchNumberGenerator.generateBatchNumber("PC-"));
|
||||
setProjectId(bo.getProjectId()).
|
||||
setBatchType("1").
|
||||
setBatchNumber(BatchNumberGenerator.generateBatchNumber("PC-"));
|
||||
return toAjax( busCailiaoshebeiPiciService.save(busCailiaoshebeiPici));
|
||||
}
|
||||
|
||||
@ -67,14 +67,26 @@ public class BusCailiaoshebeiController extends BaseController {
|
||||
@GetMapping("/pcList")
|
||||
public TableDataInfo<BusCailiaoshebeiPiciVo> pcList(BusCailiaoshebeiPiciPcListReq bo, PageQuery pageQuery) {
|
||||
BusCailiaoshebeiPiciBo busCailiaoshebeiPiciBo = BeanUtil.copyProperties(bo, BusCailiaoshebeiPiciBo.class);
|
||||
busCailiaoshebeiPiciBo.setBatchType("1");
|
||||
return busCailiaoshebeiPiciService.queryPageList(busCailiaoshebeiPiciBo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设计-删除批次号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:cailiaoshebei:pcDelete")
|
||||
@Log(title = "设计-删除批次号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> pcDelete(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busCailiaoshebeiPiciService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设计-新增材料设备
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:cailiaoshebei:add")
|
||||
@Log(title = "物资-材料设备", businessType = BusinessType.INSERT)
|
||||
@Log(title = "设计-新增材料设备", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusCailiaoshebeiAddReq req) {
|
||||
@ -147,6 +159,7 @@ public class BusCailiaoshebeiController extends BaseController {
|
||||
@GetMapping("/pcPlanList")
|
||||
public TableDataInfo<BusCailiaoshebeiPiciVo> pcPlanList(BusCailiaoshebeiPiciPcListReq bo, PageQuery pageQuery) {
|
||||
BusCailiaoshebeiPiciBo busCailiaoshebeiPiciBo = BeanUtil.copyProperties(bo, BusCailiaoshebeiPiciBo.class);
|
||||
busCailiaoshebeiPiciBo.setBatchType("1");
|
||||
return busCailiaoshebeiPiciService.queryPageList(busCailiaoshebeiPiciBo, pageQuery);
|
||||
}
|
||||
|
||||
@ -159,6 +172,18 @@ public class BusCailiaoshebeiController extends BaseController {
|
||||
return busCailiaoshebeiService.queryPageListPlan(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划-删除批次号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:cailiaoshebei:deletePlan")
|
||||
@Log(title = "计划-删除批次号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> deletePlan(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busCailiaoshebeiPiciService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 计划-材料设备清单子列表
|
||||
// */
|
||||
|
@ -0,0 +1,176 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebeiPici;
|
||||
import org.dromara.cailiaoshebei.domain.bo.*;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusCailiaoshebeiPiciVo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.MasterDataListRes;
|
||||
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiPiciService;
|
||||
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiService;
|
||||
import org.dromara.common.utils.BatchNumberGenerator;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/materialbatchdemandplan")
|
||||
public class BusMaterialbatchdemandplanController extends BaseController {
|
||||
|
||||
private final IBusMaterialbatchdemandplanService busMaterialbatchdemandplanService;
|
||||
private final IBusCailiaoshebeiPiciService busCailiaoshebeiPiciService;
|
||||
private final IBusCailiaoshebeiService busCailiaoshebeiService;
|
||||
|
||||
/**
|
||||
* 设计-新增批次号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:materialbatchdemandplan:pcAdd")
|
||||
@Log(title = "物资-批次号", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/pcAdd")
|
||||
public R<Void> pcAdd(@Validated(AddGroup.class) @RequestBody BusCailiaoshebeiPiciAddReq bo) {
|
||||
BusCailiaoshebeiPici busCailiaoshebeiPici = new BusCailiaoshebeiPici().
|
||||
setProjectId(bo.getProjectId()).
|
||||
setBatchType("2").
|
||||
setBatchNumber(BatchNumberGenerator.generateBatchNumber("PC-"));
|
||||
return toAjax( busCailiaoshebeiPiciService.save(busCailiaoshebeiPici));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设计-批次号列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:materialbatchdemandplan:pcList")
|
||||
@GetMapping("/pcList")
|
||||
public TableDataInfo<BusCailiaoshebeiPiciVo> pcList(BusCailiaoshebeiPiciPcListReq bo, PageQuery pageQuery) {
|
||||
BusCailiaoshebeiPiciBo busCailiaoshebeiPiciBo = BeanUtil.copyProperties(bo, BusCailiaoshebeiPiciBo.class);
|
||||
busCailiaoshebeiPiciBo.setBatchType("2 ");
|
||||
return busCailiaoshebeiPiciService.queryPageList(busCailiaoshebeiPiciBo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设计-删除物资批次号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:materialbatchdemandplan:pcDelete")
|
||||
@Log(title = "设计-删除批次号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busCailiaoshebeiPiciService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到所有的物资信息
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:materialbatchdemandplan:masterDataList")
|
||||
@Log(title = "获取到所有的物资信息", businessType = BusinessType.INSERT)
|
||||
@GetMapping("/masterDataList")
|
||||
public TableDataInfo<MasterDataListRes> masterDataList(MasterDataListReq bo, PageQuery pageQuery) {
|
||||
return busCailiaoshebeiService.masterDataList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量新增物资批次需求计划
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:materialbatchdemandplan:addBatch")
|
||||
@Log(title = "批量新增物资批次需求计划", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> addBatch(@Validated(AddGroup.class) @RequestBody BusMaterialbatchdemandplanAddReq bo) {
|
||||
return toAjax(busMaterialbatchdemandplanService.add(bo));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 查询物资-批次需求计划列表
|
||||
// */
|
||||
// @SaCheckPermission("cailiaoshebei:materialbatchdemandplan:list")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo<BusMaterialbatchdemandplanVo> list(BusMaterialbatchdemandplanBo bo, PageQuery pageQuery) {
|
||||
// return busMaterialbatchdemandplanService.queryPageList(bo, pageQuery);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出物资-批次需求计划列表
|
||||
// */
|
||||
// @SaCheckPermission("cailiaoshebei:materialbatchdemandplan:export")
|
||||
// @Log(title = "物资-批次需求计划", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(BusMaterialbatchdemandplanBo bo, HttpServletResponse response) {
|
||||
// List<BusMaterialbatchdemandplanVo> list = busMaterialbatchdemandplanService.queryList(bo);
|
||||
// ExcelUtil.exportExcel(list, "物资-批次需求计划", BusMaterialbatchdemandplanVo.class, response);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取物资-批次需求计划详细信息
|
||||
// *
|
||||
// * @param id 主键
|
||||
// */
|
||||
// @SaCheckPermission("cailiaoshebei:materialbatchdemandplan:query")
|
||||
// @GetMapping("/{id}")
|
||||
// public R<BusMaterialbatchdemandplanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
// @PathVariable Long id) {
|
||||
// return R.ok(busMaterialbatchdemandplanService.queryById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增物资-批次需求计划
|
||||
// */
|
||||
// @SaCheckPermission("cailiaoshebei:materialbatchdemandplan:add")
|
||||
// @Log(title = "物资-批次需求计划", businessType = BusinessType.INSERT)
|
||||
// @RepeatSubmit()
|
||||
// @PostMapping()
|
||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody BusMaterialbatchdemandplanBo bo) {
|
||||
// return toAjax(busMaterialbatchdemandplanService.insertByBo(bo));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改物资-批次需求计划
|
||||
// */
|
||||
// @SaCheckPermission("cailiaoshebei:materialbatchdemandplan:edit")
|
||||
// @Log(title = "物资-批次需求计划", businessType = BusinessType.UPDATE)
|
||||
// @RepeatSubmit()
|
||||
// @PutMapping()
|
||||
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusMaterialbatchdemandplanBo bo) {
|
||||
// return toAjax(busMaterialbatchdemandplanService.updateByBo(bo));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除物资-批次需求计划
|
||||
// *
|
||||
// * @param ids 主键串
|
||||
// */
|
||||
// @SaCheckPermission("cailiaoshebei:materialbatchdemandplan:remove")
|
||||
// @Log(title = "物资-批次需求计划", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
// @PathVariable Long[] ids) {
|
||||
// return toAjax(busMaterialbatchdemandplanService.deleteWithValidByIds(List.of(ids), true));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
@ -41,6 +41,11 @@ public class BusCailiaoshebeiPici extends BaseEntity {
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 批次需求
|
||||
*/
|
||||
private String batchType;
|
||||
|
||||
/**
|
||||
* 审批设计
|
||||
*/
|
||||
|
@ -0,0 +1,98 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划对象 bus_materialbatchdemandplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_materialbatchdemandplan")
|
||||
public class BusMaterialbatchdemandplan extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private String batchId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 材料设备ID
|
||||
*/
|
||||
private Long cailiaoshebeiId;
|
||||
|
||||
/**
|
||||
* 物资清单ID
|
||||
*/
|
||||
private Long suppliespriceId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 设备材料名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 供货公司
|
||||
*/
|
||||
private String supplierCompany;
|
||||
|
||||
/**
|
||||
* 预估供应周期
|
||||
*/
|
||||
private Long estimatedCycle;
|
||||
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
private Long demandQuantity;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
private Date arrivalTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
//@AutoMapper(target = BusCailiaoshebei.class, reverseConvertGenerate = false)
|
||||
@AutoMapper(target = BusCailiaoshebei.class, reverseConvertGenerate = false)
|
||||
@Accessors(chain = true)
|
||||
public class BusCailiaoshebeiAddReq extends BaseEntity {
|
||||
/**
|
||||
|
@ -38,6 +38,11 @@ public class BusCailiaoshebeiPiciBo extends BaseEntity {
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 批次类型
|
||||
*/
|
||||
private String batchType;
|
||||
|
||||
/**
|
||||
* 审批设计
|
||||
*/
|
||||
|
@ -0,0 +1,31 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/2 16:08
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BusMaterialbatchdemandplanAddReq implements Serializable {
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private String batchId;
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据信息
|
||||
*/
|
||||
private List<BusMaterialbatchdemandplanBo> addDataList;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划业务对象 bus_materialbatchdemandplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusMaterialbatchdemandplan.class, reverseConvertGenerate = false)
|
||||
public class BusMaterialbatchdemandplanBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private String batchId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 材料设备ID
|
||||
*/
|
||||
private Long cailiaoshebeiId;
|
||||
|
||||
/**
|
||||
* 物资清单ID
|
||||
*/
|
||||
private Long suppliespriceId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 设备材料名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 供货公司
|
||||
*/
|
||||
private String supplierCompany;
|
||||
|
||||
/**
|
||||
* 预估供应周期
|
||||
*/
|
||||
private Long estimatedCycle;
|
||||
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
private Long demandQuantity;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
private Date arrivalTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/2 14:08
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MasterDataListReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 项目id(必填)
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private String batchId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 设备材料名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排除的数据(填写返回主键ID)
|
||||
*/
|
||||
private Long[] excludeIds;
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划视图对象 bus_materialbatchdemandplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusMaterialbatchdemandplan.class)
|
||||
public class BusMaterialbatchdemandplanVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
@ExcelProperty(value = "批次ID")
|
||||
private String batchId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 材料设备ID
|
||||
*/
|
||||
@ExcelProperty(value = "材料设备ID")
|
||||
private Long cailiaoshebeiId;
|
||||
|
||||
/**
|
||||
* 物资清单ID
|
||||
*/
|
||||
@ExcelProperty(value = "物资清单ID")
|
||||
private Long suppliespriceId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@ExcelProperty(value = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 设备材料名称
|
||||
*/
|
||||
@ExcelProperty(value = "设备材料名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ExcelProperty(value = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
@ExcelProperty(value = "计量单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 供货公司
|
||||
*/
|
||||
@ExcelProperty(value = "供货公司")
|
||||
private String supplierCompany;
|
||||
|
||||
/**
|
||||
* 预估供应周期
|
||||
*/
|
||||
@ExcelProperty(value = "预估供应周期")
|
||||
private Long estimatedCycle;
|
||||
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
@ExcelProperty(value = "需求数量")
|
||||
private Long demandQuantity;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划到场时间")
|
||||
private Date arrivalTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/2 14:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MasterDataListRes implements Serializable {
|
||||
|
||||
/**
|
||||
* 物资主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private String batchId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 材料设备ID
|
||||
*/
|
||||
private Long cailiaoshebeiId;
|
||||
|
||||
/**
|
||||
* 物资清单ID
|
||||
*/
|
||||
private Long suppliespriceId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 设备材料名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 供货公司
|
||||
*/
|
||||
private String supplierCompany;
|
||||
|
||||
/**
|
||||
* 预估供应周期
|
||||
*/
|
||||
private Long estimatedCycle;
|
||||
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
private Long demandQuantity;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
private Date arrivalTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
@ -1,8 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebei;
|
||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataListReq;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusCailiaoshebeiVo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.MasterDataListRes;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-材料设备Mapper接口
|
||||
@ -11,5 +18,5 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
* @date 2025-07-31
|
||||
*/
|
||||
public interface BusCailiaoshebeiMapper extends BaseMapperPlus<BusCailiaoshebei, BusCailiaoshebeiVo> {
|
||||
|
||||
Page<MasterDataListRes> masterDataList(@Param("bo") MasterDataListReq bo,@Param("ew") PageQuery pageQuery);
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
public interface BusMaterialbatchdemandplanMapper extends BaseMapperPlus<BusMaterialbatchdemandplan, BusMaterialbatchdemandplanVo> {
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ import org.dromara.cailiaoshebei.domain.vo.BusCailiaoshebeiListPlanRes;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusCailiaoshebeiVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebei;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusSuppliespriceAddPlanSonRes;
|
||||
import org.dromara.cailiaoshebei.domain.vo.MasterDataListRes;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
@ -94,4 +95,12 @@ public interface IBusCailiaoshebeiService extends IService<BusCailiaoshebei>{
|
||||
* @return 物资-材料设备
|
||||
*/
|
||||
BusSuppliespriceAddPlanSonRes getInfoPlanSon(Long id);
|
||||
|
||||
/**
|
||||
* 获取到所有的物资信息
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
TableDataInfo<MasterDataListRes> masterDataList(MasterDataListReq bo, PageQuery pageQuery);
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanAddReq;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
public interface IBusMaterialbatchdemandplanService extends IService<BusMaterialbatchdemandplan>{
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-批次需求计划
|
||||
*/
|
||||
BusMaterialbatchdemandplanVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-批次需求计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-批次需求计划分页列表
|
||||
*/
|
||||
TableDataInfo<BusMaterialbatchdemandplanVo> queryPageList(BusMaterialbatchdemandplanBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-批次需求计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-批次需求计划列表
|
||||
*/
|
||||
List<BusMaterialbatchdemandplanVo> queryList(BusMaterialbatchdemandplanBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划
|
||||
*
|
||||
* @param bo 物资-批次需求计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusMaterialbatchdemandplanBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划
|
||||
*
|
||||
* @param bo 物资-批次需求计划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusMaterialbatchdemandplanBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-批次需求计划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划(批量新增)
|
||||
*
|
||||
* @param bo 物资-批次需求计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean add(@Validated(AddGroup.class) @RequestBody BusMaterialbatchdemandplanAddReq bo);
|
||||
}
|
@ -52,7 +52,6 @@ public class BusCailiaoshebeiPiciServiceImpl extends ServiceImpl<BusCailiaoshebe
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusCailiaoshebeiPiciVo> queryPageList(BusCailiaoshebeiPiciBo bo, PageQuery pageQuery) {
|
||||
System.out.println("?????? "+bo);
|
||||
LambdaQueryWrapper<BusCailiaoshebeiPici> lqw = buildQueryWrapper(bo);
|
||||
Page<BusCailiaoshebeiPiciVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
@ -75,6 +74,7 @@ public class BusCailiaoshebeiPiciServiceImpl extends ServiceImpl<BusCailiaoshebe
|
||||
LambdaQueryWrapper<BusCailiaoshebeiPici> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BusCailiaoshebeiPici::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusCailiaoshebeiPici::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBatchType()), BusCailiaoshebeiPici::getBatchType, bo.getBatchType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getApprovalDesign()), BusCailiaoshebeiPici::getApprovalDesign, bo.getApprovalDesign());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getApprovalPlan()), BusCailiaoshebeiPici::getApprovalPlan, bo.getApprovalPlan());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getApprovalProject()), BusCailiaoshebeiPici::getApprovalProject, bo.getApprovalProject());
|
||||
|
@ -7,6 +7,7 @@ import org.dromara.cailiaoshebei.domain.bo.*;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusCailiaoshebeiEditPlanDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusCailiaoshebeiListPlanRes;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusSuppliespriceAddPlanSonRes;
|
||||
import org.dromara.cailiaoshebei.domain.vo.MasterDataListRes;
|
||||
import org.dromara.cailiaoshebei.service.IBusSuppliespriceService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
@ -187,6 +188,12 @@ public class BusCailiaoshebeiServiceImpl extends ServiceImpl<BusCailiaoshebeiMap
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<MasterDataListRes> masterDataList(MasterDataListReq bo, PageQuery pageQuery) {
|
||||
Page<MasterDataListRes> masterDataListResPage = baseMapper.masterDataList(bo, pageQuery);
|
||||
return TableDataInfo.build(masterDataListResPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
|
@ -0,0 +1,164 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanAddReq;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.cailiaoshebei.mapper.BusMaterialbatchdemandplanMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusMaterialbatchdemandplanServiceImpl extends ServiceImpl<BusMaterialbatchdemandplanMapper, BusMaterialbatchdemandplan> implements IBusMaterialbatchdemandplanService {
|
||||
|
||||
private final BusMaterialbatchdemandplanMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-批次需求计划
|
||||
*/
|
||||
@Override
|
||||
public BusMaterialbatchdemandplanVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-批次需求计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-批次需求计划分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusMaterialbatchdemandplanVo> queryPageList(BusMaterialbatchdemandplanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusMaterialbatchdemandplan> lqw = buildQueryWrapper(bo);
|
||||
Page<BusMaterialbatchdemandplanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-批次需求计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-批次需求计划列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusMaterialbatchdemandplanVo> queryList(BusMaterialbatchdemandplanBo bo) {
|
||||
LambdaQueryWrapper<BusMaterialbatchdemandplan> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusMaterialbatchdemandplan> buildQueryWrapper(BusMaterialbatchdemandplanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusMaterialbatchdemandplan> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BusMaterialbatchdemandplan::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBatchId()), BusMaterialbatchdemandplan::getBatchId, bo.getBatchId());
|
||||
lqw.eq(bo.getProjectId() != null, BusMaterialbatchdemandplan::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getCailiaoshebeiId() != null, BusMaterialbatchdemandplan::getCailiaoshebeiId, bo.getCailiaoshebeiId());
|
||||
lqw.eq(bo.getSuppliespriceId() != null, BusMaterialbatchdemandplan::getSuppliespriceId, bo.getSuppliespriceId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCode()), BusMaterialbatchdemandplan::getMaterialCode, bo.getMaterialCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BusMaterialbatchdemandplan::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecification()), BusMaterialbatchdemandplan::getSpecification, bo.getSpecification());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), BusMaterialbatchdemandplan::getUnit, bo.getUnit());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplierCompany()), BusMaterialbatchdemandplan::getSupplierCompany, bo.getSupplierCompany());
|
||||
lqw.eq(bo.getEstimatedCycle() != null, BusMaterialbatchdemandplan::getEstimatedCycle, bo.getEstimatedCycle());
|
||||
lqw.eq(bo.getDemandQuantity() != null, BusMaterialbatchdemandplan::getDemandQuantity, bo.getDemandQuantity());
|
||||
lqw.eq(bo.getArrivalTime() != null, BusMaterialbatchdemandplan::getArrivalTime, bo.getArrivalTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划
|
||||
*
|
||||
* @param bo 物资-批次需求计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusMaterialbatchdemandplanBo bo) {
|
||||
BusMaterialbatchdemandplan add = MapstructUtils.convert(bo, BusMaterialbatchdemandplan.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划
|
||||
*
|
||||
* @param bo 物资-批次需求计划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusMaterialbatchdemandplanBo bo) {
|
||||
BusMaterialbatchdemandplan update = MapstructUtils.convert(bo, BusMaterialbatchdemandplan.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusMaterialbatchdemandplan entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-批次需求计划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean add(BusMaterialbatchdemandplanAddReq bo) {
|
||||
//1、删除数据
|
||||
LambdaQueryWrapper<BusMaterialbatchdemandplan> eq = new LambdaQueryWrapper<BusMaterialbatchdemandplan>()
|
||||
.eq(BusMaterialbatchdemandplan::getBatchId, bo.getBatchId());
|
||||
int delete = baseMapper.delete(eq);
|
||||
if (delete != 1) {
|
||||
throw new RuntimeException("删除失败");
|
||||
}
|
||||
//2、新增数据
|
||||
List<BusMaterialbatchdemandplan> ts = BeanUtil.copyToList(bo.getAddDataList(), BusMaterialbatchdemandplan.class);
|
||||
boolean b = baseMapper.insertBatch(ts);
|
||||
if (b) {
|
||||
return true;
|
||||
}
|
||||
throw new RuntimeException("新增失败");
|
||||
}
|
||||
}
|
@ -4,4 +4,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.cailiaoshebei.mapper.BusCailiaoshebeiMapper">
|
||||
|
||||
<select id="masterDataList" resultType="org.dromara.cailiaoshebei.domain.vo.MasterDataListRes">
|
||||
select
|
||||
bc.batch_id as batchId,
|
||||
bc.project_id as projectId,
|
||||
bc.supplier_id as supplierId,
|
||||
bc.supplier as supplier,
|
||||
bc.name as name,
|
||||
bc.specification as specification,
|
||||
bc.signalment as signalment,
|
||||
bc.material_code as materialCode,
|
||||
bsp.id as id,
|
||||
bsp.cailiaoshebei_id as cailiaoshebeiId,
|
||||
bsp.unit_price as unit_price,
|
||||
bsp.num as num,
|
||||
bsp.contract_num as contractNum,
|
||||
bsp.estimated_cycle as estimatedCycle,
|
||||
bsp.supplier_company as supplierCompany
|
||||
from
|
||||
bus_suppliesprice as bsp
|
||||
left join bus_cailiaoshebei as bc on bc.id = bsp.cailiaoshebei_id
|
||||
<where>
|
||||
<if test="bo.projectId != null">
|
||||
and bc.project_id = #{bo.projectId}
|
||||
</if>
|
||||
<if test="bo.batchId != null">
|
||||
and bc.batch_id = #{bo.batchId}
|
||||
</if>
|
||||
<if test="bo.materialCode != null">
|
||||
and bc.material_code like concat('%', #{bo.materialCode}, '%')
|
||||
</if>
|
||||
<if test="bo.name != null">
|
||||
and bc.name like concat('%', #{bo.name}, '%')
|
||||
</if>
|
||||
<if test="bo.excludeIds != null">
|
||||
and bsp.id not in
|
||||
<foreach collection="bo.excludeIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.cailiaoshebei.mapper.BusMaterialbatchdemandplanMapper">
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user