配件管理
This commit is contained in:
parent
4093544cb5
commit
9313ac3c2d
|
|
@ -67,6 +67,9 @@ public class MaterialConstants {
|
|||
/** 修饰入库单号的开头字母 */
|
||||
public static final String REPAIR_INPUT_TASK_TYPE_LABEL = "R";
|
||||
|
||||
/** 配件新购号的开头字母 */
|
||||
public final static String PART_TASK_TYPE_LABEL = "PJXG";
|
||||
|
||||
/**
|
||||
* 内部单位协议
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ public enum TmTaskTypeEnum {
|
|||
TM_TASK_FACTORY_MANAGEMENT(9, "物资厂家管理任务"),
|
||||
TM_TASK_AGREEMENT_MANAGEMENT(10, "新增协议任务"),
|
||||
TM_TASK_REPAIR_INPUT(11, "修饰后入库任务"),
|
||||
TM_TASK_PART_LEASE(12, "配件领料任务");
|
||||
TM_TASK_PART_LEASE(12, "配件领料任务"),
|
||||
TM_TASK_PART_TYPE(13, "配件新购");
|
||||
|
||||
private final Integer taskTypeId;
|
||||
private final String taskTypeName;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,98 @@
|
|||
package com.bonus.material.part.controller;
|
||||
|
||||
|
||||
import com.bonus.common.biz.annotation.StoreLog;
|
||||
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.ma.domain.TypeKeeper;
|
||||
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||
import com.bonus.material.part.domain.PartTypeCheckInfo;
|
||||
import com.bonus.material.part.domain.PartTypeDto;
|
||||
|
||||
import com.bonus.material.part.service.IPartAcceptService;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 配件入库管理Controller
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Api(tags = "配件入库管理接口")
|
||||
@RestController
|
||||
@RequestMapping("/part_accept")
|
||||
public class partAcceptController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IPartAcceptService partAcceptService;
|
||||
|
||||
/**
|
||||
* 获取配件入库类型下拉框
|
||||
*/
|
||||
@ApiOperation(value = "获取配件入库类型下拉框")
|
||||
// @RequiresPermissions("scrap:details:list")
|
||||
@GetMapping("/partTypeThree")
|
||||
public AjaxResult partTypeThree(PartTypeDto partTypeDto) {
|
||||
return partAcceptService.getTypeTree(partTypeDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库
|
||||
* @param partTypeCheckDetails
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "入库操作")
|
||||
// @RequiresPermissions("purchase:storage:add")
|
||||
@PostMapping("/partTypeWarehouse")
|
||||
public AjaxResult partTypeWarehouse(@RequestBody List<PartTypeCheckDetails> partTypeCheckDetails) {
|
||||
return partAcceptService.partTypeWarehouse(partTypeCheckDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
* @param partTypeCheckDetails
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "驳回操作")
|
||||
// @RequiresPermissions("purchase:storage:add")
|
||||
@PostMapping("/partTypeReject")
|
||||
public AjaxResult partTypeReject(@RequestBody List<PartTypeCheckDetails> partTypeCheckDetails) {
|
||||
return partAcceptService.partTypeReject(partTypeCheckDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 外层入库
|
||||
* @param partTypeCheckInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "入库操作")
|
||||
// @RequiresPermissions("purchase:storage:add")
|
||||
@PostMapping("/passAll")
|
||||
public AjaxResult passAll(@RequestBody List<PartTypeCheckInfo> partTypeCheckInfo) {
|
||||
return partAcceptService.passAll(partTypeCheckInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 外层驳回
|
||||
* @param partTypeCheckInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "入库操作")
|
||||
// @RequiresPermissions("purchase:storage:add")
|
||||
@PostMapping("/rejectAll")
|
||||
public AjaxResult rejectAll(@RequestBody List<PartTypeCheckInfo> partTypeCheckInfo) {
|
||||
return partAcceptService.rejectAll(partTypeCheckInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
package com.bonus.material.part.controller;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.bonus.common.biz.config.ListPagingUtil;
|
||||
import com.bonus.common.core.utils.ServletUtils;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.part.domain.*;
|
||||
import com.bonus.material.part.mapper.PartArrivedMapper;
|
||||
import com.bonus.material.part.service.IPartArrivedService;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseCheckDto;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseQueryDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
import static com.bonus.common.core.web.page.TableSupport.PAGE_NUM;
|
||||
import static com.bonus.common.core.web.page.TableSupport.PAGE_SIZE;
|
||||
|
||||
/**
|
||||
* 配件新购管理Controller
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
@Api(tags = "配件新购管理接口")
|
||||
@RestController
|
||||
@RequestMapping("/part_arrived")
|
||||
public class partArrivedController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IPartArrivedService partArrivedService;
|
||||
|
||||
@Autowired
|
||||
private PartArrivedMapper partArrivedMapper;
|
||||
|
||||
/**
|
||||
* 获取配件新购类型树结构
|
||||
*/
|
||||
@ApiOperation(value = "获取配件新购类型树结构")
|
||||
// @RequiresPermissions("scrap:details:list")
|
||||
@GetMapping("/typeTree")
|
||||
public AjaxResult getTypeTree(@RequestParam(required = false) Long partId, @RequestParam(required = false) String partName) {
|
||||
List<PartTypeDto> listByMaType = partArrivedService.getTypeTree(partId, partName);
|
||||
return success(listByMaType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增新购验收任务
|
||||
*/
|
||||
@ApiOperation("新增新购验收任务")
|
||||
@PreventRepeatSubmit
|
||||
//@RequiresPermissions("purchase:info:add")
|
||||
@SysLog(title = "新购验收任务", businessType = OperaType.INSERT, module = "配件新购->新增新购验收任务")
|
||||
@PostMapping
|
||||
public AjaxResult add(@Valid @NotNull @RequestBody PartTypeCheckDto partTypeCheckDto) {
|
||||
try {
|
||||
return partArrivedService.insertPartTypeCheckInfo(partTypeCheckDto);
|
||||
} catch (final Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表
|
||||
*/
|
||||
@ApiOperation("查询新购验收任务列表")
|
||||
//@RequiresPermissions("purchase:info:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(PartTypeQueryDto partTypeQueryDto) {
|
||||
final List<PartTypeCheckInfo> list = partArrivedService.selectPartTypeCheckInfoList(partTypeQueryDto);
|
||||
final Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
|
||||
final Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新购验收任务详细信息
|
||||
*/
|
||||
@ApiOperation("获取新购验收任务详细信息")
|
||||
//@RequiresPermissions("purchase:info:query")
|
||||
@GetMapping(value = "/getInfo")
|
||||
public AjaxResult getInfo(@NotNull(message = "请求对象不能为空") PartTypeQueryDto partTypeQueryDto) {
|
||||
return success(partArrivedService.selectPartTypeCheckInfoById(partTypeQueryDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改新购验收任务
|
||||
*/
|
||||
@ApiOperation("修改新购验收任务")
|
||||
@PreventRepeatSubmit
|
||||
//@RequiresPermissions("purchase:info:edit")
|
||||
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "配件新购->修改新购验收任务")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody @NotNull(message = "请求参数不能为空") @Valid PartTypeCheckDto partTypeCheckDto) {
|
||||
try {
|
||||
return toAjax(partArrivedService.updatePartTypeCheckInfo(partTypeCheckDto));
|
||||
} catch (final Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配件新购任务列表
|
||||
*/
|
||||
@ApiOperation("导出配件新购任务列表")
|
||||
@PreventRepeatSubmit
|
||||
//@RequiresPermissions("purchase:info:export")
|
||||
@SysLog(title = "配件新购任务", businessType = OperaType.EXPORT, module = "配件新购->导出配件新购任务")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PartTypeQueryDto partTypeQueryDto) {
|
||||
List<PartTypeCheckInfo> list = partArrivedService.selectPartTypeCheckInfoList(partTypeQueryDto);
|
||||
ExcelUtil<PartTypeCheckInfo> util = new ExcelUtil<>(PartTypeCheckInfo.class);
|
||||
util.exportExcel(response, list, "配件新购任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配件新购任务详细列表
|
||||
*/
|
||||
@ApiOperation("导出配件新购任务详细列表")
|
||||
@PreventRepeatSubmit
|
||||
//@RequiresPermissions("purchase:info:export")
|
||||
@SysLog(title = "配件新购任务详细", businessType = OperaType.EXPORT, logType = 1,module = "配件新购->导出配件新购任务详细")
|
||||
@PostMapping("/exportDetails")
|
||||
public void exportDetails(HttpServletResponse response, PartTypeQueryDto partTypeQueryDto) {
|
||||
List<PartTypeCheckDetails> list = partArrivedMapper.selectPartTypeCheckDetailsListByQueryDto(partTypeQueryDto);
|
||||
ExcelUtil<PartTypeCheckDetails> util = new ExcelUtil<>(PartTypeCheckDetails.class);
|
||||
util.exportExcel(response, list, "配件新购任务详细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配件新购任务
|
||||
*/
|
||||
@ApiOperation("删除配件新购任务")
|
||||
//@RequiresPermissions("purchase:info:remove")
|
||||
@PostMapping("/delete")
|
||||
public AjaxResult deletePartInfo(@RequestBody PartTypeQueryDto partTypeQueryDto) {
|
||||
return toAjax(partArrivedService.deletePartInfo(partTypeQueryDto));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.material.basic.domain.BmFileInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新购验收任务详细对象 purchase_check_details
|
||||
* @author xsheng
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class PartTypeCheckDetails extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
//@Excel(name = "任务ID")
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
/** 规格id */
|
||||
//@Excel(name = "规格id")
|
||||
@ApiModelProperty(value = "规格id")
|
||||
private Long partId;
|
||||
|
||||
@Excel(name = "规格名称", sort = 3)
|
||||
@ApiModelProperty(value = "规格名称")
|
||||
private String partName;
|
||||
|
||||
@ApiModelProperty(value = "机具编号")
|
||||
private String maCode;
|
||||
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "数值")
|
||||
private String unitValue;
|
||||
|
||||
@Excel(name = "配件名称", sort = 2)
|
||||
@ApiModelProperty(value = "物资名称--规格parent类型")
|
||||
private String maTypeName;
|
||||
|
||||
@Excel(name = "配件类型", sort = 1)
|
||||
@ApiModelProperty(value = "配件类型--规格parent类型")
|
||||
private String maName;
|
||||
|
||||
/** 采购单价(不含税) */
|
||||
@Excel(name = "购置单价(不含税)", sort = 6)
|
||||
@ApiModelProperty(value = "采购单价(不含税)")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 采购单价(含税) */
|
||||
@Excel(name = "购置单价(含税)", sort = 5)
|
||||
@ApiModelProperty(value = "采购单价(含税)")
|
||||
private BigDecimal purchaseTaxPrice;
|
||||
|
||||
/** 采购数量 */
|
||||
@Excel(name = "采购数量", sort = 4)
|
||||
@ApiModelProperty(value = "采购数量")
|
||||
private BigDecimal purchaseNum;
|
||||
|
||||
/** 验收数量 */
|
||||
@ApiModelProperty(value = "验收数量")
|
||||
private BigDecimal checkNum;
|
||||
|
||||
/** 绑定数量 */
|
||||
@ApiModelProperty(value = "绑定数量")
|
||||
private BigDecimal bindNum;
|
||||
|
||||
/** 验收结论 */
|
||||
//@Excel(name = "验收结论")
|
||||
@ApiModelProperty(value = "验收结论")
|
||||
private String checkResult;
|
||||
|
||||
/** 质保材料 */
|
||||
@ApiModelProperty(value = "质保材料")
|
||||
private String warnDocuments;
|
||||
|
||||
/** 原因 */
|
||||
@ApiModelProperty(value = "原因")
|
||||
private String reason;
|
||||
|
||||
/** 物资厂家id */
|
||||
//@Excel(name = "物资厂家id")
|
||||
@ApiModelProperty(value = "物资厂家id")
|
||||
private Long supplierId;
|
||||
|
||||
/** 物资厂家名称 */
|
||||
@ApiModelProperty(value = "物资厂家名称")
|
||||
//@Excel(name = "物资厂家名称")
|
||||
private String supplierName;
|
||||
|
||||
/** 状态,参考数据字典purchase_task_status键值 */
|
||||
@Excel(name = "状态", readConverterExp = "0=待验收,1=已入库,2=已驳回", sort = 8)
|
||||
@ApiModelProperty(value = "状态,参考数据字典purchase_task_status键值")
|
||||
private Integer status;
|
||||
|
||||
/** 出厂日期 */
|
||||
@ApiModelProperty(value = "出厂日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "出厂日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 7)
|
||||
private Date productionTime;
|
||||
|
||||
/** 验收图片 */
|
||||
//@Excel(name = "验收图片")
|
||||
@ApiModelProperty(value = "验收图片")
|
||||
private String checkUrlName;
|
||||
|
||||
/** 验收图片名称 */
|
||||
//@Excel(name = "验收图片名称")
|
||||
@ApiModelProperty(value = "验收图片名称")
|
||||
private String checkUrl;
|
||||
|
||||
/** 入库数量 */
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private BigDecimal inputNum;
|
||||
|
||||
/** 是否入库 */
|
||||
@ApiModelProperty(value = "是否入库")
|
||||
private String inputStatus;
|
||||
|
||||
/** 入库时间 */
|
||||
@ApiModelProperty(value = "入库时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date inputTime;
|
||||
|
||||
/** 验收附件名称 */
|
||||
//@Excel(name = "验收附件名称")
|
||||
@ApiModelProperty(value = "验收附件名称")
|
||||
private String fileName;
|
||||
|
||||
/** 验收附件 */
|
||||
//@Excel(name = "验收附件")
|
||||
@ApiModelProperty(value = "验收附件")
|
||||
private String fileUrl;
|
||||
|
||||
/** 数据所属组织 */
|
||||
//@Excel(name = "数据所属组织")
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
/** 是否是固定资产编号(0 否,1 是) */
|
||||
@ApiModelProperty(value = "是否是固定资产编号(0 否,1 是)")
|
||||
private String fixCode;
|
||||
|
||||
/** 管理方式(0编号 1计数) */
|
||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||
private Integer manageType;
|
||||
|
||||
/** 验收附件列表 */
|
||||
//@Excel(name = "验收附件列表")
|
||||
@ApiModelProperty(value = "验收附件列表")
|
||||
private List<BmFileInfo> bmFileInfos;
|
||||
|
||||
/** 是否有附件 */
|
||||
@ApiModelProperty(value = "是否有附件 0 是, 1 否")
|
||||
private Integer isExitFile;
|
||||
|
||||
/** 租赁价格 */
|
||||
@ApiModelProperty(value = "租赁价格")
|
||||
private BigDecimal rentPrice;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||
import com.bonus.material.part.domain.PartTypeCheckInfo;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class PartTypeCheckDto {
|
||||
|
||||
/**
|
||||
* 采购验收任务info
|
||||
*/
|
||||
@ApiModelProperty(value = "采购验收任务info")
|
||||
@NotNull(message = "采购验收任务info对象不能为空")
|
||||
private PartTypeCheckInfo partTypeCheckInfo;
|
||||
|
||||
/**
|
||||
* 采购验收任务详情集合
|
||||
*/
|
||||
@ApiModelProperty(value = "采购验收任务详情集合")
|
||||
private List<PartTypeCheckDetails> partTypeCheckDetailsList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 新购验收任务对象 purchase_check_info
|
||||
* @author syruan
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@ToString
|
||||
public class PartTypeCheckInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1335730477657434485L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
//@Excel(name = "任务ID")
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
private Integer taskStatus;
|
||||
|
||||
@Excel(name = "状态", sort = 8)
|
||||
@ApiModelProperty(value = "任务状态名称,未完成/已完成")
|
||||
private String taskStatusName;
|
||||
|
||||
@Excel(name = "采购单号", sort = 1)
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
private String code;
|
||||
|
||||
/** 采购日期 */
|
||||
@ApiModelProperty(value = "采购日期")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date purchaseTime;
|
||||
|
||||
/** 到货日期 */
|
||||
@ApiModelProperty(value = "到货日期")
|
||||
@NotNull(message = "到货日期不能为空")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "到货时间", width = 30, dateFormat = "yyyy-MM-dd", sort = 1)
|
||||
private Date arrivalTime;
|
||||
|
||||
/** 采购员 */
|
||||
//@Excel(name = "采购员")
|
||||
@ApiModelProperty(value = "采购员")
|
||||
private Long purchaser;
|
||||
|
||||
/** 物资厂家id */
|
||||
//@Excel(name = "物资厂家id")
|
||||
@ApiModelProperty(value = "物资厂家id")
|
||||
private Long supplierId;
|
||||
|
||||
/** 物资厂家名称 */
|
||||
@Excel(name = "物资厂家", sort = 7)
|
||||
@ApiModelProperty(value = "物资厂家名称")
|
||||
private String supplier;
|
||||
|
||||
/** 数据所属组织 */
|
||||
//@Excel(name = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 采购物资
|
||||
*/
|
||||
@Excel(name = "采购物资", sort = 2)
|
||||
@ApiModelProperty(value = "采购物资--外层Table字段")
|
||||
private String purchaseMaTypeName;
|
||||
|
||||
/**
|
||||
* 采购数量
|
||||
*/
|
||||
@Excel(name = "采购数量", sort = 3)
|
||||
@ApiModelProperty(value = "采购数量--外层Table字段")
|
||||
private BigDecimal purchaseMaNumber;
|
||||
|
||||
/**
|
||||
* 验收数量
|
||||
*/
|
||||
@ApiModelProperty(value = "验收数量--外层Table字段")
|
||||
private BigDecimal checkMaNumber;
|
||||
|
||||
/**
|
||||
* 绑定数量
|
||||
*/
|
||||
@ApiModelProperty(value = "绑定数量--外层Table字段")
|
||||
private BigDecimal bindMaNumber;
|
||||
|
||||
@ApiModelProperty(value = "入库数量--外层Table字段")
|
||||
private BigDecimal inputMaNumber;
|
||||
|
||||
@ApiModelProperty(value = "待入库数量--外层Table字段")
|
||||
private BigDecimal waitInputNumber;
|
||||
|
||||
/**
|
||||
* 采购单价(不含税)
|
||||
*/
|
||||
@Excel(name = "采购单价(不含税)", sort = 5)
|
||||
@ApiModelProperty(value = "采购单价(不含税)--外层Table字段")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/**
|
||||
* 采购单价(含税)
|
||||
*/
|
||||
@Excel(name = "采购单价(含税)", sort = 4)
|
||||
@ApiModelProperty(value = "采购单价(含税)--外层Table字段")
|
||||
private BigDecimal purchaseTaxPrice;
|
||||
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
@Excel(name = "税率", sort = 6)
|
||||
@ApiModelProperty(value = "税率 0~100")
|
||||
@Size(max = 100, message = "税率长度必须介于 0 和 100 之间")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
//@Excel(name = "购买人", sort = 9)
|
||||
@ApiModelProperty(value = "购买人名称")
|
||||
private String purchaseName;
|
||||
|
||||
@ApiModelProperty(value = "新购模块阶段名称")
|
||||
private String modelName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件类型对象 ma_part_type
|
||||
* @author hongchao
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@ToString
|
||||
public class PartTypeDto extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 类型ID */
|
||||
@ApiModelProperty(value = "类型ID")
|
||||
private Long partId;
|
||||
|
||||
@NotBlank(message = "名称不能为空")
|
||||
@Size(max=30, message = "名称长度不能超过30")
|
||||
private String partName;
|
||||
|
||||
|
||||
/** 上级ID */
|
||||
@ApiModelProperty(value = "上级ID")
|
||||
private Long parentId;
|
||||
|
||||
/** 实时库存 */
|
||||
@Excel(name = "实时库存")
|
||||
@ApiModelProperty(value = "实时库存")
|
||||
private BigDecimal storageNum;
|
||||
|
||||
/** 类型编号 */
|
||||
@ApiModelProperty(value = "类型编号")
|
||||
private String typeCode;
|
||||
|
||||
/** 规格编号 */
|
||||
@ApiModelProperty(value = "规格编号")
|
||||
private String modelCode;
|
||||
|
||||
/** 计量单位ID */
|
||||
@ApiModelProperty(value = "计量单位ID")
|
||||
private Long unitId;
|
||||
|
||||
/** 计量单位名称 */
|
||||
@ApiModelProperty(value = "计量单位名称")
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
|
||||
/** 排序 */
|
||||
@ApiModelProperty(value = "排序")
|
||||
@Excel(name = "排序")
|
||||
private int sortNum;
|
||||
|
||||
|
||||
/** 租赁费用生效时间 */
|
||||
@ApiModelProperty(value = "租赁费用生效时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "租赁费用生效时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date effTime;
|
||||
|
||||
/** 租赁单价 */
|
||||
@Excel(name = "租赁单价")
|
||||
@ApiModelProperty(value = "租赁单价")
|
||||
private BigDecimal rentPrice;
|
||||
|
||||
/** 采购价原值 */
|
||||
@Excel(name = "采购价原值")
|
||||
@ApiModelProperty(value = "采购价原值")
|
||||
private BigDecimal buyPrice;
|
||||
|
||||
|
||||
/** 税率 */
|
||||
@ApiModelProperty(value = "税率")
|
||||
private BigDecimal taxRatio;
|
||||
|
||||
/** 层级 */
|
||||
@ApiModelProperty(value = "层级")
|
||||
private String level;
|
||||
|
||||
|
||||
/** 库存预警数量 */
|
||||
@Excel(name = "库存预警数量")
|
||||
@ApiModelProperty(value = "库存预警数量")
|
||||
private Long warnNum;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
private String keyword;
|
||||
|
||||
/** 子节点 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<PartTypeDto> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class PartTypeQueryDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty(value = "登录用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "任务单号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "任务阶段,对应新购阶段枚举")
|
||||
private Integer taskStage;
|
||||
|
||||
@ApiModelProperty(value = "是否完成")
|
||||
private Integer isFinish;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "外层任务状态")
|
||||
private Integer taskStatus;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private Long partId;
|
||||
|
||||
@ApiModelProperty(value = "物资厂家ID")
|
||||
private Long supplierId;
|
||||
|
||||
@ApiModelProperty(value = "出场日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date productionTime;
|
||||
|
||||
/** 采购日期 */
|
||||
@ApiModelProperty(value = "采购日期")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date purchaseTime;
|
||||
|
||||
/** 到货日期 */
|
||||
@ApiModelProperty(value = "到货日期")
|
||||
@NotNull(message = "到货日期不能为空")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "到货日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date arrivalTime;
|
||||
|
||||
/** 采购员 */
|
||||
@Excel(name = "采购员")
|
||||
@ApiModelProperty(value = "采购员")
|
||||
private Long purchaser;
|
||||
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
@ApiModelProperty(value = "税率 0~100")
|
||||
@Size(max = 100, message = "税率长度必须介于 0 和 100 之间")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 子任务状态列表, 比如待验收:0 已入库:1 已驳回:2,
|
||||
*/
|
||||
@ApiModelProperty(value = "子任务状态列表")
|
||||
private List<Integer> statusList;
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.bonus.material.part.mapper;
|
||||
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||
import com.bonus.material.part.domain.PartTypeCheckInfo;
|
||||
import com.bonus.material.part.domain.PartTypeDto;
|
||||
import com.bonus.material.part.domain.PartTypeQueryDto;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件入库管理Mapper接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2024-01-09
|
||||
*/
|
||||
public interface PartAcceptMapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询配件类型三级树
|
||||
*
|
||||
* @param partTypeDto 查询配件类型三级树
|
||||
* @return 查询配件类型三级树
|
||||
*/
|
||||
List<PartTypeDto> getTypeTree(PartTypeDto partTypeDto);
|
||||
|
||||
/**
|
||||
* 查询库存数量
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int getStorageNum(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 入库
|
||||
* @param partTypeCheckDetail
|
||||
* @return
|
||||
*/
|
||||
int partTypeWarehouse(PartTypeCheckDetails partTypeCheckDetail);
|
||||
|
||||
/**
|
||||
* 修改库存
|
||||
* @param partTypeCheckDetail
|
||||
* @return
|
||||
*/
|
||||
int updatePartTypeStorage(PartTypeCheckDetails partTypeCheckDetail);
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
* @param partTypeCheckDetail
|
||||
* @return
|
||||
*/
|
||||
int partTypeReject(PartTypeCheckDetails partTypeCheckDetail);
|
||||
|
||||
/**
|
||||
* 获取待验收的数量
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
int selectStatus(Long taskId);
|
||||
|
||||
/**
|
||||
* 修改任务状态未已完成
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
void updateStatus(Long taskId);
|
||||
|
||||
|
||||
/**
|
||||
* 外层入库
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
int passAll(Long taskId);
|
||||
|
||||
/**
|
||||
* 外层驳回
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
int rejectAll(Long taskId);
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.bonus.material.part.mapper;
|
||||
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||
import com.bonus.material.part.domain.PartTypeCheckInfo;
|
||||
import com.bonus.material.part.domain.PartTypeDto;
|
||||
import com.bonus.material.part.domain.PartTypeQueryDto;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseQueryDto;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件新购管理Mapper接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2024-01-08
|
||||
*/
|
||||
public interface PartArrivedMapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询配件类型三级树
|
||||
*
|
||||
* @param partName 查询配件类型三级树
|
||||
* @return 查询配件类型三级树
|
||||
*/
|
||||
List<PartTypeDto> getTypeTree(String partName);
|
||||
|
||||
/**
|
||||
* 查询当年当月最大任务序号,用于生成任务编号 by 分类型查询
|
||||
* @param year 年
|
||||
* @param month 月
|
||||
* @param taskType 任务类型(字典表中获取,例如新购是:16)
|
||||
*/
|
||||
int getMonthMaxOrderByDate(@Param("year") String year, @Param("month") String month, @Param("taskType") Integer taskType);
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param tmTask 任务
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTmTask(TmTask tmTask);
|
||||
|
||||
/**
|
||||
* 新增新购验收任务
|
||||
*
|
||||
* @param partTypeCheckInfo 新购验收任务
|
||||
* @return 结果
|
||||
*/
|
||||
int insertPartTypeCheckInfo(PartTypeCheckInfo partTypeCheckInfo);
|
||||
|
||||
/**
|
||||
* 批量新增新购验收任务详细
|
||||
* @param partTypeCheckDetailsList 新购验收任务详细集合
|
||||
*/
|
||||
int insertPartTypeCheckDetailsList(List<PartTypeCheckDetails> partTypeCheckDetailsList);
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表--多表关联查询
|
||||
*
|
||||
* @param partTypeQueryDto 新购验收任务
|
||||
* @return 新购验收任务集合
|
||||
*/
|
||||
List<PartTypeCheckInfo> selectPartTypeCheckInfoJoinList(PartTypeQueryDto partTypeQueryDto);
|
||||
|
||||
/**
|
||||
* 查询新购验收任务详细列表
|
||||
*
|
||||
* @param taskId 新购验收任务主键
|
||||
* @return 新购验收任务详细集合
|
||||
*/
|
||||
List<PartTypeCheckDetails> selectPartTypeCheckDetailsList(Long taskId);
|
||||
|
||||
List<PartTypeCheckDetails> selectPartTypeCheckDetailsListByQueryDto(PartTypeQueryDto partTypeQueryDto);
|
||||
|
||||
PartTypeCheckInfo selectPartTypeCheckInfoById(Long id);
|
||||
|
||||
int deletePartTypeCheckDetailsByParentIds(Long taskId);
|
||||
|
||||
int deleteTmTask(Long taskId);
|
||||
|
||||
/**
|
||||
* 删除新购验收任务
|
||||
*
|
||||
* @param id 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePartTypCheckInfoById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.bonus.material.part.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.part.domain.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件入库管理Service接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
public interface IPartAcceptService {
|
||||
|
||||
/**
|
||||
* 获取配件入库类型下拉框
|
||||
*
|
||||
* @param partTypeDto 配件入库管理
|
||||
* @return 配件入库管理集合
|
||||
*/
|
||||
|
||||
AjaxResult getTypeTree(PartTypeDto partTypeDto);
|
||||
|
||||
/**
|
||||
* 入库
|
||||
* @param partTypeCheckDetails
|
||||
* @return
|
||||
*/
|
||||
AjaxResult partTypeWarehouse(List<PartTypeCheckDetails> partTypeCheckDetails);
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
* @param partTypeCheckDetails
|
||||
* @return
|
||||
*/
|
||||
AjaxResult partTypeReject(List<PartTypeCheckDetails> partTypeCheckDetails);
|
||||
|
||||
|
||||
/**
|
||||
* 外层入库
|
||||
* @param partTypeCheckInfo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult passAll(List<PartTypeCheckInfo> partTypeCheckInfo);
|
||||
|
||||
/**
|
||||
* 外层驳回
|
||||
* @param partTypeCheckInfo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult rejectAll(List<PartTypeCheckInfo> partTypeCheckInfo);
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.bonus.material.part.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.part.domain.PartTypeCheckDto;
|
||||
import com.bonus.material.part.domain.PartTypeCheckInfo;
|
||||
import com.bonus.material.part.domain.PartTypeDto;
|
||||
import com.bonus.material.part.domain.PartTypeQueryDto;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseCheckDto;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseQueryDto;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件新购管理Service接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
public interface IPartArrivedService {
|
||||
|
||||
/**
|
||||
* 获取配件新购类型树结构
|
||||
*
|
||||
* @param partId,partName 配件新购管理
|
||||
* @return 配件新购管理集合
|
||||
*/
|
||||
List<PartTypeDto> getTypeTree(Long partId, String partName);
|
||||
|
||||
/**
|
||||
* 新增新购验收任务
|
||||
*
|
||||
* @param partTypeCheckDto 新购验收任务dto
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertPartTypeCheckInfo(PartTypeCheckDto partTypeCheckDto);
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表
|
||||
*
|
||||
* @param partTypeQueryDto 新购验收任务
|
||||
* @return 新购验收任务集合
|
||||
*/
|
||||
List<PartTypeCheckInfo> selectPartTypeCheckInfoList(PartTypeQueryDto partTypeQueryDto);
|
||||
|
||||
/**
|
||||
* 查询新购验收任务
|
||||
*
|
||||
* @param partTypeQueryDto 新购验收请求条件封装dto
|
||||
* @return 新购验收任务
|
||||
*/
|
||||
PartTypeCheckDto selectPartTypeCheckInfoById(PartTypeQueryDto partTypeQueryDto);
|
||||
|
||||
/**
|
||||
* 修改新购验收任务
|
||||
*
|
||||
* @param partTypeCheckDto 新购验收任务
|
||||
* @return 结果
|
||||
*/
|
||||
boolean updatePartTypeCheckInfo(PartTypeCheckDto partTypeCheckDto);
|
||||
|
||||
/**
|
||||
* 删除新购验收任务
|
||||
*
|
||||
* @param partTypeQueryDto 需要删除的新购验收任务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePartInfo(PartTypeQueryDto partTypeQueryDto);
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
package com.bonus.material.part.service.impl;
|
||||
|
||||
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.basic.domain.BmFileInfo;
|
||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.part.domain.*;
|
||||
import com.bonus.material.part.mapper.PartAcceptMapper;
|
||||
|
||||
import com.bonus.material.part.service.IPartAcceptService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 配件新购管理Service业务层处理
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
@Service
|
||||
public class PartAcceptServiceImpl implements IPartAcceptService
|
||||
{
|
||||
@Autowired
|
||||
private PartAcceptMapper partAcceptMapper;
|
||||
|
||||
@Resource
|
||||
BmFileInfoMapper bmFileInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询配件类型三级树
|
||||
* @param partTypeDto
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getTypeTree(PartTypeDto partTypeDto) {
|
||||
List<PartTypeDto> typeList = partAcceptMapper.getTypeTree(partTypeDto);
|
||||
return AjaxResult.success(typeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库
|
||||
* @param partTypeCheckDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult partTypeWarehouse(List<PartTypeCheckDetails> partTypeCheckDetails) {
|
||||
if (partTypeCheckDetails.size() == 0){
|
||||
return AjaxResult.error("请选择要操作的记录");
|
||||
}
|
||||
for (PartTypeCheckDetails partTypeCheckDetail : partTypeCheckDetails) {
|
||||
int count = partAcceptMapper.partTypeWarehouse(partTypeCheckDetail);
|
||||
int countTwo = partAcceptMapper.updatePartTypeStorage(partTypeCheckDetail);
|
||||
|
||||
if((count+countTwo) != 2){
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
}
|
||||
int countThree = partAcceptMapper.selectStatus(partTypeCheckDetails.get(0).getTaskId());
|
||||
if(countThree == 0) {
|
||||
partAcceptMapper.updateStatus(partTypeCheckDetails.get(0).getTaskId());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
* @param partTypeCheckDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult partTypeReject(List<PartTypeCheckDetails> partTypeCheckDetails) {
|
||||
if (partTypeCheckDetails.size() == 0){
|
||||
return AjaxResult.error("请选择要操作的记录");
|
||||
}
|
||||
for (PartTypeCheckDetails partTypeCheckDetail : partTypeCheckDetails) {
|
||||
int count = partAcceptMapper.partTypeReject(partTypeCheckDetail);
|
||||
|
||||
if(count != 1){
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
}
|
||||
int countThree = partAcceptMapper.selectStatus(partTypeCheckDetails.get(0).getTaskId());
|
||||
if(countThree == 0) {
|
||||
partAcceptMapper.updateStatus(partTypeCheckDetails.get(0).getTaskId());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 外层入库
|
||||
* @param partTypeCheckInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult passAll(List<PartTypeCheckInfo> partTypeCheckInfo) {
|
||||
if (partTypeCheckInfo.size() == 0){
|
||||
return AjaxResult.error("请选择要操作的记录");
|
||||
}
|
||||
for (PartTypeCheckInfo vo : partTypeCheckInfo) {
|
||||
int count = partAcceptMapper.passAll(vo.getTaskId());
|
||||
if(count == 0){
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
partAcceptMapper.updateStatus(vo.getTaskId());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 外层驳回
|
||||
* @param partTypeCheckInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult rejectAll(List<PartTypeCheckInfo> partTypeCheckInfo) {
|
||||
if (partTypeCheckInfo.size() == 0){
|
||||
return AjaxResult.error("请选择要操作的记录");
|
||||
}
|
||||
for (PartTypeCheckInfo vo : partTypeCheckInfo) {
|
||||
int count = partAcceptMapper.rejectAll(vo.getTaskId());
|
||||
if(count == 0){
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
partAcceptMapper.updateStatus(vo.getTaskId());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,281 @@
|
|||
package com.bonus.material.part.service.impl;
|
||||
|
||||
|
||||
import com.bonus.common.biz.constant.BmConfigItems;
|
||||
import com.bonus.common.biz.enums.MaTypeManageTypeEnum;
|
||||
import com.bonus.common.biz.enums.PurchaseTaskStageEnum;
|
||||
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmFileInfo;
|
||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.part.domain.*;
|
||||
import com.bonus.material.part.mapper.PartArrivedMapper;
|
||||
import com.bonus.material.part.service.IPartArrivedService;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseCheckDto;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseQueryDto;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.bonus.common.biz.constant.MaterialConstants.PART_TASK_TYPE_LABEL;
|
||||
import static com.bonus.common.biz.constant.MaterialConstants.PURCHASE_TASK_TYPE_LABEL;
|
||||
|
||||
/**
|
||||
* 配件新购管理Service业务层处理
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
@Service
|
||||
public class PartArrivedServiceImpl implements IPartArrivedService
|
||||
{
|
||||
@Autowired
|
||||
private PartArrivedMapper partArrivedMapper;
|
||||
|
||||
@Resource
|
||||
BmFileInfoMapper bmFileInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询配件类型三级树--前端联动式下拉框
|
||||
* @param partId 类型id
|
||||
* @param partName 类型名称
|
||||
*/
|
||||
@Override
|
||||
public List<PartTypeDto> getTypeTree(Long partId, String partName) {
|
||||
List<PartTypeDto> maTypes = partArrivedMapper.getTypeTree("");
|
||||
List<PartTypeDto> list = new ArrayList<>();
|
||||
for (PartTypeDto maType : maTypes) {
|
||||
if (maType.getParentId() == 0) {
|
||||
list.add(maType);
|
||||
}
|
||||
}
|
||||
//根据父节点获取对应的儿子节点
|
||||
for (PartTypeDto maType : list) {
|
||||
List<PartTypeDto> child = getChild(maTypes, maType.getPartId());
|
||||
maType.setChildren(child);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归调用获取子级
|
||||
* @param list 集合
|
||||
* @param parentId 父级id
|
||||
*/
|
||||
public List<PartTypeDto> getChild(List<PartTypeDto> list, Long parentId) {
|
||||
List<PartTypeDto> childList = new ArrayList<PartTypeDto>();
|
||||
for (PartTypeDto maType : list) {
|
||||
Long partId = maType.getPartId();
|
||||
Long pid = maType.getParentId();
|
||||
if (parentId.equals(pid)) {
|
||||
List<PartTypeDto> childLists = getChild(list, partId);
|
||||
maType.setChildren(childLists);
|
||||
childList.add(maType);
|
||||
}
|
||||
}
|
||||
return childList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增新购验收任务
|
||||
*
|
||||
* @param partTypeCheckDto 新购验收任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult insertPartTypeCheckInfo(PartTypeCheckDto partTypeCheckDto) {
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setCreateTime(DateUtils.getNowDate());
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setCreateBy(SecurityUtils.getUsername());
|
||||
try {
|
||||
final int thisMonthMaxOrder = partArrivedMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_PART_TYPE.getTaskTypeId());
|
||||
String taskCode = genderTaskCode(thisMonthMaxOrder);
|
||||
final TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_PART_TYPE.getTaskTypeId(),
|
||||
0,
|
||||
partTypeCheckDto.getPartTypeCheckInfo().getCompanyId(), thisMonthMaxOrder + 1, taskCode);
|
||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||
partArrivedMapper.insertTmTask(tmTask);
|
||||
Long taskId = tmTask.getTaskId();
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setTaskId(taskId);
|
||||
final int count = partArrivedMapper.insertPartTypeCheckInfo(partTypeCheckDto.getPartTypeCheckInfo());
|
||||
if (0 < count) {
|
||||
return insertPartTypeCheckDetails(partTypeCheckDto.getPartTypeCheckDetailsList(), taskId);
|
||||
} else {
|
||||
return AjaxResult.error("新增任务失败,purchase_part_info表插入0条");
|
||||
}
|
||||
} catch (final DataAccessException e) {
|
||||
return AjaxResult.error("数据库操作失败:" + e.getMessage());
|
||||
} catch (final Exception e) {
|
||||
return AjaxResult.error("新增任务失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private AjaxResult insertPartTypeCheckDetails(List<PartTypeCheckDetails> partTypeCheckDetailsList, Long taskId) {
|
||||
if (!CollectionUtils.isEmpty(partTypeCheckDetailsList)) {
|
||||
for (PartTypeCheckDetails details : partTypeCheckDetailsList) {
|
||||
details.setTaskId(taskId);
|
||||
details.setStatus(0);
|
||||
details.setInputStatus("0");
|
||||
final List<BmFileInfo> bmFileInfos = details.getBmFileInfos();
|
||||
if (!CollectionUtils.isEmpty(bmFileInfos)) {
|
||||
bmFileInfos.forEach(o -> o.setTaskId(taskId));
|
||||
bmFileInfoMapper.insertBmFileInfos(bmFileInfos);
|
||||
}
|
||||
}
|
||||
// 批量插入详情数据
|
||||
final int count = partArrivedMapper.insertPartTypeCheckDetailsList(partTypeCheckDetailsList);
|
||||
if (0 < count) {
|
||||
return AjaxResult.success("新增任务成功");
|
||||
} else {
|
||||
return AjaxResult.error("新增任务失败,purchase_part_detail详情表插入0条");
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.success("新增任务成功");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成任务编号并构造Tm_Task任务对象
|
||||
* @param thisMonthMaxOrder 当月最大单号
|
||||
* @return 任务对象
|
||||
*/
|
||||
private static String genderTaskCode(Integer thisMonthMaxOrder) {
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
final Date nowDate = DateUtils.getNowDate();
|
||||
final String format = dateFormat.format(nowDate);
|
||||
final String result = format.replace("-", "");
|
||||
return PART_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表
|
||||
*
|
||||
* @param partTypeQueryDto 新购验收任务请求参数
|
||||
* @return 新购验收任务
|
||||
*/
|
||||
@Override
|
||||
public List<PartTypeCheckInfo> selectPartTypeCheckInfoList(PartTypeQueryDto partTypeQueryDto) {
|
||||
List<PartTypeCheckInfo> partTypeCheckInfos = partArrivedMapper.selectPartTypeCheckInfoJoinList(partTypeQueryDto);
|
||||
int count = 0;
|
||||
for (int i = 0; i < partTypeCheckInfos.size(); i++) {
|
||||
List<PartTypeCheckDetails> partTypeCheckDetails = partArrivedMapper.selectPartTypeCheckDetailsList(partTypeCheckInfos.get(i).getTaskId());
|
||||
if(partTypeCheckDetails.size()>0){
|
||||
count = (int) partTypeCheckDetails.stream()
|
||||
.filter(details -> details.getStatus() == 0)
|
||||
.count();
|
||||
if(count>0){
|
||||
partTypeCheckInfos.get(i).setTaskStatusName("未完成");
|
||||
}else{
|
||||
partTypeCheckInfos.get(i).setTaskStatusName("已完成");
|
||||
}
|
||||
}
|
||||
|
||||
BigDecimal purchaseNum = new BigDecimal(0);
|
||||
BigDecimal purchasePrice = new BigDecimal(0);
|
||||
BigDecimal purchaseTaxPrice = new BigDecimal(0);
|
||||
String partName = "";
|
||||
for (int j = 0; j < partTypeCheckDetails.size(); j++) {
|
||||
purchaseNum = purchaseNum.add(partTypeCheckDetails.get(j).getPurchaseNum());
|
||||
purchasePrice = purchasePrice.add(partTypeCheckDetails.get(j).getPurchasePrice().multiply(partTypeCheckDetails.get(j).getPurchaseNum()));
|
||||
purchaseTaxPrice = purchaseTaxPrice.add(partTypeCheckDetails.get(j).getPurchaseTaxPrice().multiply(partTypeCheckDetails.get(j).getPurchaseNum()));
|
||||
partName = partName + partTypeCheckDetails.get(j).getMaTypeName();
|
||||
if (j < partTypeCheckDetails.size() - 1) {
|
||||
partName += ",";
|
||||
}
|
||||
}
|
||||
partTypeCheckInfos.get(i).setPurchaseMaNumber(purchaseNum);
|
||||
partTypeCheckInfos.get(i).setPurchasePrice(purchasePrice);
|
||||
partTypeCheckInfos.get(i).setPurchaseTaxPrice(purchaseTaxPrice);
|
||||
partTypeCheckInfos.get(i).setPurchaseMaTypeName(partName);
|
||||
}
|
||||
return partTypeCheckInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表详情
|
||||
*
|
||||
* @param partTypeQueryDto 新购验收任务请求参数
|
||||
* @return 新购验收任务
|
||||
*/
|
||||
@Override
|
||||
public PartTypeCheckDto selectPartTypeCheckInfoById(PartTypeQueryDto partTypeQueryDto) {
|
||||
PartTypeCheckInfo partTypeCheckInfo = partArrivedMapper.selectPartTypeCheckInfoById(partTypeQueryDto.getId());
|
||||
PartTypeCheckDto PartTypeCheckDto = new PartTypeCheckDto();
|
||||
PartTypeCheckDto.setPartTypeCheckInfo(partTypeCheckInfo);
|
||||
if(null != partTypeCheckInfo){
|
||||
List<PartTypeCheckDetails> partTypeCheckDetailsList = partArrivedMapper.selectPartTypeCheckDetailsListByQueryDto(partTypeQueryDto);
|
||||
PartTypeCheckDto.setPartTypeCheckDetailsList(partTypeCheckDetailsList);
|
||||
}
|
||||
return PartTypeCheckDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改新购验收任务
|
||||
*
|
||||
* @param partTypeCheckDto 新购验收任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean updatePartTypeCheckInfo(PartTypeCheckDto partTypeCheckDto) {
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setUpdateTime(DateUtils.getNowDate());
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setUpdateBy(SecurityUtils.getUsername());
|
||||
if (!CollectionUtils.isEmpty(partTypeCheckDto.getPartTypeCheckDetailsList())) {
|
||||
partTypeCheckDto.getPartTypeCheckDetailsList().removeIf(Objects::isNull);
|
||||
partTypeCheckDto.getPartTypeCheckDetailsList().removeIf(o -> Objects.isNull(o.getStatus()));
|
||||
partTypeCheckDto.getPartTypeCheckDetailsList().removeIf(o ->
|
||||
!Objects.equals(o.getStatus(), 0));
|
||||
}
|
||||
try {
|
||||
Long[] ids = new Long[partTypeCheckDto.getPartTypeCheckDetailsList().size()];
|
||||
int index = 0;
|
||||
for (PartTypeCheckDetails details : partTypeCheckDto.getPartTypeCheckDetailsList()) {
|
||||
ids[index] = details.getId();
|
||||
index++;
|
||||
}
|
||||
partArrivedMapper.deletePartTypeCheckDetailsByParentIds(partTypeCheckDto.getPartTypeCheckInfo().getTaskId());
|
||||
if (ids.length > 0) {
|
||||
insertPartTypeCheckDetails(partTypeCheckDto.getPartTypeCheckDetailsList(), partTypeCheckDto.getPartTypeCheckInfo().getTaskId());
|
||||
}
|
||||
return true;
|
||||
} catch (final Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除新购验收任务
|
||||
*
|
||||
* @param partTypeQueryDto 需要删除的新购验收任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int deletePartInfo(PartTypeQueryDto partTypeQueryDto) {
|
||||
int count = partArrivedMapper.deleteTmTask(partTypeQueryDto.getTaskId());
|
||||
if(count==0){
|
||||
AjaxResult.error("删除失败");
|
||||
}
|
||||
partArrivedMapper.deletePartTypeCheckDetailsByParentIds(partTypeQueryDto.getTaskId());
|
||||
return partArrivedMapper.deletePartTypCheckInfoById(partTypeQueryDto.getId());
|
||||
}
|
||||
}
|
||||
|
|
@ -15,10 +15,10 @@ import org.springframework.stereotype.Service;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库管理Service业务层处理
|
||||
* 报废原因Service业务层处理
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-27
|
||||
* @author hongchao
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Service
|
||||
public class ScrapReasonServiceImpl implements IScrapReasonService
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
<?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="com.bonus.material.part.mapper.PartAcceptMapper">
|
||||
|
||||
<select id="getTypeTree" resultType="com.bonus.material.part.domain.PartTypeDto">
|
||||
SELECT
|
||||
pa_id as partId,
|
||||
pa_name as partName,
|
||||
parent_id as parentId,
|
||||
storage_num as storageNum,
|
||||
level as level
|
||||
FROM
|
||||
ma_part_type
|
||||
WHERE del_flag = '0'
|
||||
<if test="level != null and level != ''">
|
||||
and level = 3
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getStorageNum" resultType="int">
|
||||
SELECT
|
||||
purchase_num
|
||||
FROM
|
||||
purchase_part_details
|
||||
WHERE id = #{id} and del_flag = '0'
|
||||
|
||||
</select>
|
||||
|
||||
<update id="partTypeWarehouse">
|
||||
update purchase_part_details
|
||||
set status = 1
|
||||
where id = #{id} and del_flag = 0
|
||||
</update>
|
||||
|
||||
<update id="updatePartTypeStorage">
|
||||
update ma_part_type
|
||||
set storage_num = storage_num + #{purchaseNum}
|
||||
where pa_id = #{partId} and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="partTypeReject">
|
||||
update purchase_part_details
|
||||
set status = 2
|
||||
where id = #{id} and del_flag = 0
|
||||
</update>
|
||||
|
||||
<select id="selectStatus" resultType="int">
|
||||
select
|
||||
count(id)
|
||||
from purchase_part_details
|
||||
where task_id = #{taskId} and status = 0 and del_flag = 0
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updateStatus">
|
||||
update tm_task
|
||||
set task_status = 1
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<update id="passAll">
|
||||
update purchase_part_details
|
||||
set status = 1
|
||||
where task_id = #{taskId} and status = 0 and del_flag = 0
|
||||
</update>
|
||||
|
||||
<update id="rejectAll">
|
||||
update purchase_part_details
|
||||
set status = 2
|
||||
where task_id = #{taskId} and status = 0 and del_flag = 0
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
<?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="com.bonus.material.part.mapper.PartArrivedMapper">
|
||||
|
||||
<select id="getTypeTree" resultType="com.bonus.material.part.domain.PartTypeDto">
|
||||
select DISTINCT m.pa_id as partId, m.pa_name as partName, m.parent_id as parentId, m.unit_id as unitId, m.unit_name as unitName, m.storage_num as storageNum,
|
||||
m.rent_price as rentPrice, m.buy_price as buyPrice, m.level,m.del_flag as delFlag,m.remark
|
||||
from ma_part_type m
|
||||
where
|
||||
m.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="getMonthMaxOrderByDate" resultType="java.lang.Integer">
|
||||
select COALESCE(max(month_order), 0) from tm_task
|
||||
where
|
||||
month(create_time) = #{month} and year(create_time) = #{year}
|
||||
<if test="taskType != null and taskType !=''">
|
||||
and task_type = #{taskType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertTmTask" parameterType="com.bonus.material.task.domain.TmTask" useGeneratedKeys="true" keyProperty="taskId">
|
||||
insert into tm_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="preTaskId != null">pre_task_id,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="taskStatus != null">task_status,</if>
|
||||
<if test="code != null">`code`,</if>
|
||||
<if test="monthOrder != null">month_order,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="preTaskId != null">#{preTaskId},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="taskStatus != null">#{taskStatus},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="monthOrder != null">#{monthOrder},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertPartTypeCheckInfo" parameterType="com.bonus.material.part.domain.PartTypeCheckInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into purchase_part_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="purchaseTime != null">purchase_time,</if>
|
||||
<if test="arrivalTime != null">arrival_time,</if>
|
||||
<if test="purchaser != null">purchaser,</if>
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="taxRate != null">tax_rate,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="purchaseTime != null">#{purchaseTime},</if>
|
||||
<if test="arrivalTime != null">#{arrivalTime},</if>
|
||||
<if test="purchaser != null">#{purchaser},</if>
|
||||
<if test="supplierId != null">#{supplierId},</if>
|
||||
<if test="taxRate != null">#{taxRate},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertPartTypeCheckDetailsList">
|
||||
insert into purchase_part_details(task_id,part_id,purchase_price,purchase_tax_price,
|
||||
purchase_num,check_num,check_result,supplier_id,
|
||||
status,production_time,create_by,create_time,update_by,
|
||||
update_time,remark,input_num,
|
||||
input_time,company_id,del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.taskId},#{item.partId},#{item.purchasePrice},#{item.purchaseTaxPrice},
|
||||
#{item.purchaseNum},#{item.checkNum},#{item.checkResult},#{item.supplierId},
|
||||
#{item.status},#{item.productionTime},#{item.createBy},NOW(),#{item.updateBy},
|
||||
#{item.updateTime},#{item.remark},#{item.inputNum},
|
||||
#{item.inputTime},#{item.companyId},0)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectPartTypeCheckInfoJoinList" resultType="com.bonus.material.part.domain.PartTypeCheckInfo">
|
||||
select
|
||||
ppi.id, ppi.task_id as taskId, ppi.purchase_time as purchasePrice, ppi.arrival_time as arrivalTime, ppi.purchaser, ppi.supplier_id as supplierId, ppi.tax_rate as taxRate,
|
||||
ppi.create_by as createBy, ppi.create_time as createTime, ppi.update_by as updateBy, ppi.update_time as updateTime, ppi.remark, ppi.company_id as companyId,
|
||||
t.task_status as taskStatus,t.code,msi.supplier
|
||||
from
|
||||
purchase_part_info ppi
|
||||
left join tm_task t on t.task_id = ppi.task_id
|
||||
left join sys_user su ON ppi.create_by = su.user_id
|
||||
left join ma_supplier_info msi on ppi.supplier_id = msi.supplier_id
|
||||
<where>
|
||||
<if test="startTime != null "> and date_format(ppi.create_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')</if>
|
||||
<if test="endTime != null "> and date_format(ppi.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
||||
<if test="taskStatus != null "> and t.task_status = #{taskStatus}</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
t.code like concat('%', #{keyWord}, '%') or
|
||||
msi.supplier like concat('%', #{keyWord}, '%') or
|
||||
ppi.create_by like concat('%', #{keyWord}, '%') or
|
||||
ppi.arrival_time like concat('%', #{keyWord}, '%') or
|
||||
ppi.create_time like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by ppi.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectPartTypeCheckDetailsList" resultType="com.bonus.material.part.domain.PartTypeCheckDetails">
|
||||
select part_id as partId,mpt.pa_name as maTypeName,purchase_price as purchasePrice,purchase_tax_price as purchaseTaxPrice,
|
||||
purchase_num as purchaseNum,ppd.status
|
||||
from purchase_part_details ppd
|
||||
left join ma_part_type mpt on ppd.part_id = mpt.pa_id and mpt.del_flag = 0
|
||||
where ppd.task_id = #{taskId} and ppd.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectPartTypeCheckDetailsListByQueryDto" resultType="com.bonus.material.part.domain.PartTypeCheckDetails">
|
||||
select ppd.id as id,part_id as partId,mpt.pa_name as partName,ppd.task_id as taskId,purchase_price as purchasePrice,purchase_tax_price as purchaseTaxPrice,purchase_num as purchaseNum,
|
||||
mpt.unit_name as unitName,mpt.rent_price as rentPrice,ppd.production_time as productionTime,mpt2.pa_name as maTypeName,ppd.status,
|
||||
mpt3.pa_name as maName,msi.supplier as supplierName
|
||||
from purchase_part_details ppd
|
||||
left join ma_part_type mpt on ppd.part_id = mpt.pa_id and mpt.del_flag = 0
|
||||
left join purchase_part_info ppi on ppi.id = 2
|
||||
left join ma_supplier_info msi on ppi.supplier_id = msi.supplier_id
|
||||
left join ma_part_type mpt2 on mpt.parent_id = mpt2.pa_id and mpt2.del_flag = 0
|
||||
left join ma_part_type mpt3 on mpt2.parent_id = mpt3.pa_id and mpt3.del_flag = 0
|
||||
where ppd.task_id = #{taskId} and ppd.del_flag = 0
|
||||
</select>
|
||||
<select id="selectPartTypeCheckInfoById" resultType="com.bonus.material.part.domain.PartTypeCheckInfo">
|
||||
select
|
||||
id, task_id as taskId, purchase_time purchaseTime, arrival_time as arrivalTime, purchaser, supplier_id supplierId,
|
||||
tax_rate as taxRate, create_by as createBy,create_time as createTime, update_by as updateBy, update_time as updateTime, remark, company_id as companyId
|
||||
from
|
||||
purchase_part_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 限制条件 严格匹配字典表及枚举类中定义的状态码 -->
|
||||
<delete id="deletePartTypeCheckDetailsByParentIds" parameterType="Long">
|
||||
delete from purchase_part_details ppd where task_id = #{taskId} and ppd.status = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTmTask" parameterType="Long">
|
||||
delete from tm_task where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePartTypCheckInfoById" parameterType="Long">
|
||||
delete from purchase_part_info where id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue