新购验收绑定
This commit is contained in:
parent
eb3cc94fbb
commit
ca817bb3ab
|
|
@ -16,7 +16,8 @@ public enum TmTaskTypeEnum {
|
||||||
TM_TASK_CHECK(8, "检验任务"),
|
TM_TASK_CHECK(8, "检验任务"),
|
||||||
TM_TASK_FACTORY_MANAGEMENT(9, "物资厂家管理任务"),
|
TM_TASK_FACTORY_MANAGEMENT(9, "物资厂家管理任务"),
|
||||||
TM_TASK_AGREEMENT_MANAGEMENT(10, "新增协议任务"),
|
TM_TASK_AGREEMENT_MANAGEMENT(10, "新增协议任务"),
|
||||||
TM_TASK_REPAIR_INPUT(11, "修饰后入库任务");
|
TM_TASK_REPAIR_INPUT(11, "修饰后入库任务"),
|
||||||
|
TM_TASK_PART_LEASE(12, "配件领料任务");
|
||||||
|
|
||||||
private final Integer taskTypeId;
|
private final Integer taskTypeId;
|
||||||
private final String taskTypeName;
|
private final String taskTypeName;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ import com.bonus.common.core.annotation.Excel;
|
||||||
import com.bonus.material.basic.domain.BmFileInfo;
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -17,7 +19,8 @@ import java.util.List;
|
||||||
* @date 2024-10-16
|
* @date 2024-10-16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class BackApplyDetails extends BaseEntity {
|
public class BackApplyDetails extends BaseEntity {
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,11 @@ public interface BackApplyInfoMapper {
|
||||||
*/
|
*/
|
||||||
int updateBackApplyDetails(BackApplyDetails applyDetail);
|
int updateBackApplyDetails(BackApplyDetails applyDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修驳回--回退在用量
|
||||||
|
*/
|
||||||
|
int updateBackApplyDetailsTwo(Long taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除详情
|
* 删除详情
|
||||||
* @param backApplyInfo
|
* @param backApplyInfo
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.bonus.material.lease.controller;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseDetails;
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseInfo;
|
||||||
|
import com.bonus.material.lease.service.PartLeaseService;
|
||||||
|
import com.bonus.material.lease.service.impl.PartLeaseServiceImpl;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.lease.controller
|
||||||
|
* @CreateTime: 2024-12-27 13:42
|
||||||
|
* @Description: 描述
|
||||||
|
*/
|
||||||
|
@Api(tags = "配件领用接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/part_lease")
|
||||||
|
public class PartLeaseController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PartLeaseService partLeaseService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询配件领料任务列表")
|
||||||
|
@GetMapping("/selectPartLeaseInfoList")
|
||||||
|
public TableDataInfo selectPartLeaseInfoList(PartLeaseInfo partLeaseInfo) {
|
||||||
|
startPage();
|
||||||
|
final List<PartLeaseInfo> partLeaseInfos = partLeaseService.selectPartLeaseInfoList(partLeaseInfo);
|
||||||
|
return getDataTable(partLeaseInfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据任务id查询配件领料明细")
|
||||||
|
@GetMapping("/selectPartLeaseByTaskId")
|
||||||
|
public AjaxResult selectPartLeaseByTaskId(PartLeaseDetails partDto) {
|
||||||
|
return AjaxResult.success(partLeaseService.selectPartLeaseDetailsList(partDto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增配件领料任务")
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody PartLeaseInfo partLeaseInfo) {
|
||||||
|
return toAjax(partLeaseService.insertPartLeaseInfo(partLeaseInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改配件领料任务")
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@NotNull(message = "领料任务不能为空") @RequestBody PartLeaseInfo partLeaseInfo) {
|
||||||
|
return toAjax(partLeaseService.updatePartLeaseInfo(partLeaseInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "审核领料任务")
|
||||||
|
@PutMapping("/audit")
|
||||||
|
public AjaxResult audit(@NotNull(message = "领料任务不能为空") @RequestBody PartLeaseInfo partLeaseInfo) {
|
||||||
|
return toAjax(partLeaseService.updatePartLeaseInfo(partLeaseInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据taskId删除配件领料任务--支持批量")
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(partLeaseService.removePartLeaseInfoByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据id删除配件领料明细--支持批量")
|
||||||
|
@DeleteMapping("/details/{ids}")
|
||||||
|
public AjaxResult removeDetails(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(partLeaseService.removePartLeaseDetailsByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.bonus.material.lease.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.lease.domain
|
||||||
|
* @CreateTime: 2024-12-27 13:09
|
||||||
|
* @Description: 描述
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PartLeaseDetails implements java.io.Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
private Long partId;
|
||||||
|
|
||||||
|
private String partName;
|
||||||
|
|
||||||
|
private Integer preNum;
|
||||||
|
|
||||||
|
private Integer alNum;
|
||||||
|
|
||||||
|
private String remarks;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.bonus.material.lease.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.lease.domain
|
||||||
|
* @CreateTime: 2024-12-27 13:09
|
||||||
|
* @Description: 描述
|
||||||
|
*/
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Data
|
||||||
|
public class PartLeaseInfo implements java.io.Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务id")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private String auditor;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime auditTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态,0待审批 1通过 2驳回")
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
private String companyId;
|
||||||
|
|
||||||
|
private List<PartLeaseDetails> partLeaseDetailsList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.bonus.material.lease.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.lease.domain
|
||||||
|
* @CreateTime: 2024-12-27 13:15
|
||||||
|
* @Description: 配件领用人员信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PartLeasePersonStorage {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
private Long partId;
|
||||||
|
|
||||||
|
private String partName;
|
||||||
|
|
||||||
|
private Integer partNum;
|
||||||
|
|
||||||
|
private BigDecimal partPrice;
|
||||||
|
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private boolean isActive;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.bonus.material.lease.mapper;
|
||||||
|
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseDetails;
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.lease.mapper
|
||||||
|
* @CreateTime: 2024-12-27 13:20
|
||||||
|
* @Description: 配件领用dao层
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PartLeaseMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用信息
|
||||||
|
* @param id 任务id
|
||||||
|
*/
|
||||||
|
PartLeaseInfo selectPartLeaseInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用信息列表
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
List<PartLeaseInfo> selectPartLeaseInfoList(PartLeaseInfo partLeaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用信息
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
int insertPartLeaseInfo(PartLeaseInfo partLeaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件领用
|
||||||
|
* @param ids 任务id
|
||||||
|
*/
|
||||||
|
int removePartLeaseInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改配件领用信息
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
int updatePartLeaseInfo(PartLeaseInfo partLeaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用详情
|
||||||
|
* @param partLeaseDetails 任务id
|
||||||
|
*/
|
||||||
|
List<PartLeaseDetails> selectPartLeaseDetailsList(PartLeaseDetails partLeaseDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用详情 -- 批量
|
||||||
|
* @param partLeaseDetailsList 领用明细
|
||||||
|
*/
|
||||||
|
int batchPartLeaseDetails(List<PartLeaseDetails> partLeaseDetailsList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用详情 -- 单条
|
||||||
|
* @param leaseDetails 领用明细
|
||||||
|
*/
|
||||||
|
int insertPartLeaseDetails(PartLeaseDetails leaseDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件领用详情
|
||||||
|
* @param ids 任务id
|
||||||
|
*/
|
||||||
|
int removePartLeaseDetailsByIds(Long[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.bonus.material.lease.service;
|
||||||
|
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseDetails;
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.lease.service
|
||||||
|
* @CreateTime: 2024-12-27 13:40
|
||||||
|
* @Description: 描述
|
||||||
|
*/
|
||||||
|
public interface PartLeaseService {
|
||||||
|
/**
|
||||||
|
* 查询配件领用信息
|
||||||
|
* @param id 任务id
|
||||||
|
*/
|
||||||
|
PartLeaseInfo selectPartLeaseInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用信息列表
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
List<PartLeaseInfo> selectPartLeaseInfoList(PartLeaseInfo partLeaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用信息
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
int insertPartLeaseInfo(PartLeaseInfo partLeaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件领用
|
||||||
|
* @param ids 任务id
|
||||||
|
*/
|
||||||
|
int removePartLeaseInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改配件领用信息
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
int updatePartLeaseInfo(PartLeaseInfo partLeaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用详情
|
||||||
|
* @param partLeaseDetails 任务id
|
||||||
|
*/
|
||||||
|
List<PartLeaseDetails> selectPartLeaseDetailsList(PartLeaseDetails partLeaseDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用详情 -- 批量
|
||||||
|
* @param partLeaseDetailsList 领用明细
|
||||||
|
*/
|
||||||
|
int batchPartLeaseDetails(List<PartLeaseDetails> partLeaseDetailsList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用详情 -- 单条
|
||||||
|
* @param leaseDetails 领用明细
|
||||||
|
*/
|
||||||
|
int insertPartLeaseDetails(PartLeaseDetails leaseDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件领用详情
|
||||||
|
* @param ids 任务id
|
||||||
|
*/
|
||||||
|
int removePartLeaseDetailsByIds(Long[] ids);
|
||||||
|
}
|
||||||
|
|
@ -129,7 +129,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
|
public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
|
||||||
if (leaseApplyRequestVo.getLeaseApplyInfo() == null) {
|
if (null == leaseApplyRequestVo.getLeaseApplyInfo()) {
|
||||||
return AjaxResult.error("请先填写领料任务信息");
|
return AjaxResult.error("请先填写领料任务信息");
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
|
if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,172 @@
|
||||||
|
package com.bonus.material.lease.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.config.DateTimeHelper;
|
||||||
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
|
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.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseDetails;
|
||||||
|
import com.bonus.material.lease.domain.PartLeaseInfo;
|
||||||
|
import com.bonus.material.lease.mapper.PartLeaseMapper;
|
||||||
|
import com.bonus.material.lease.service.PartLeaseService;
|
||||||
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.lease.service.impl
|
||||||
|
* @CreateTime: 2024-12-27 13:40
|
||||||
|
* @Description: 描述
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PartLeaseServiceImpl implements PartLeaseService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PartLeaseMapper partLeaseMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmTaskMapper tmTaskMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用信息
|
||||||
|
*
|
||||||
|
* @param id 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PartLeaseInfo selectPartLeaseInfoById(Long id) {
|
||||||
|
return partLeaseMapper.selectPartLeaseInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用信息列表
|
||||||
|
*
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PartLeaseInfo> selectPartLeaseInfoList(PartLeaseInfo partLeaseInfo) {
|
||||||
|
return partLeaseMapper.selectPartLeaseInfoList(partLeaseInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用信息
|
||||||
|
*
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int insertPartLeaseInfo(PartLeaseInfo partLeaseInfo) {
|
||||||
|
if (null == partLeaseInfo || null == partLeaseInfo.getPartLeaseDetailsList()) {
|
||||||
|
throw new ServiceException("领用信息不能为空");
|
||||||
|
}
|
||||||
|
final int thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_PART_LEASE.getTaskTypeId());
|
||||||
|
final String taskCode = genderTaskCode(thisMonthMaxOrder);
|
||||||
|
partLeaseInfo.setCode(taskCode).setCreator(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
final int insertPartLeaseInfo = partLeaseMapper.insertPartLeaseInfo(partLeaseInfo);
|
||||||
|
final int batchDetailsNum;
|
||||||
|
if (0 < insertPartLeaseInfo) {
|
||||||
|
batchDetailsNum = partLeaseMapper.batchPartLeaseDetails(partLeaseInfo.getPartLeaseDetailsList());
|
||||||
|
} else {
|
||||||
|
throw new ServiceException("领用信息新增失败");
|
||||||
|
}
|
||||||
|
if (batchDetailsNum != partLeaseInfo.getPartLeaseDetailsList().size()) {
|
||||||
|
throw new ServiceException("领用明细未全部新增完成,数据已回滚");
|
||||||
|
}
|
||||||
|
return insertPartLeaseInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成任务编号并构造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 MaterialConstants.LEASE_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件领用
|
||||||
|
*
|
||||||
|
* @param ids 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int removePartLeaseInfoByIds(Long[] ids) {
|
||||||
|
return partLeaseMapper.removePartLeaseInfoByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改配件领用信息
|
||||||
|
*
|
||||||
|
* @param partLeaseInfo 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updatePartLeaseInfo(PartLeaseInfo partLeaseInfo) {
|
||||||
|
partLeaseInfo.setCode(null);
|
||||||
|
switch (partLeaseInfo.getStatus()) {
|
||||||
|
case 1:
|
||||||
|
partLeaseInfo.setAuditor(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
partLeaseInfo.setAuditTime(LocalDateTime.now());
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
partLeaseInfo.setAuditor(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
partLeaseInfo.setAuditTime(LocalDateTime.now());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
partLeaseInfo.setAuditor(null);
|
||||||
|
partLeaseInfo.setAuditTime(null);
|
||||||
|
}
|
||||||
|
return partLeaseMapper.updatePartLeaseInfo(partLeaseInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询配件领用详情
|
||||||
|
*
|
||||||
|
* @param partLeaseDetails 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PartLeaseDetails> selectPartLeaseDetailsList(PartLeaseDetails partLeaseDetails) {
|
||||||
|
return partLeaseMapper.selectPartLeaseDetailsList(partLeaseDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用详情 -- 批量
|
||||||
|
*
|
||||||
|
* @param partLeaseDetailsList 领用明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int batchPartLeaseDetails(List<PartLeaseDetails> partLeaseDetailsList) {
|
||||||
|
return partLeaseMapper.batchPartLeaseDetails(partLeaseDetailsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增配件领用详情 -- 单条
|
||||||
|
*
|
||||||
|
* @param leaseDetails 领用明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertPartLeaseDetails(PartLeaseDetails leaseDetails) {
|
||||||
|
return partLeaseMapper.insertPartLeaseDetails(leaseDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件领用详情
|
||||||
|
*
|
||||||
|
* @param ids 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int removePartLeaseDetailsByIds(Long[] ids) {
|
||||||
|
return partLeaseMapper.removePartLeaseDetailsByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -44,7 +44,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询新购验收任务列表
|
* 查询新购验收任务列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询新购验收任务列表")
|
@ApiOperation("查询新购验收任务列表")
|
||||||
//@RequiresPermissions("purchase:info:list")
|
//@RequiresPermissions("purchase:info:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(PurchaseQueryDto purchaseQueryDto) {
|
public AjaxResult list(PurchaseQueryDto purchaseQueryDto) {
|
||||||
|
|
@ -58,7 +58,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 获取新购验收任务详细信息
|
* 获取新购验收任务详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取新购验收任务详细信息")
|
@ApiOperation("获取新购验收任务详细信息")
|
||||||
//@RequiresPermissions("purchase:info:query")
|
//@RequiresPermissions("purchase:info:query")
|
||||||
@GetMapping(value = "/getInfo")
|
@GetMapping(value = "/getInfo")
|
||||||
public AjaxResult getInfo(@NotNull(message = "请求对象不能为空") PurchaseQueryDto purchaseQueryDto) {
|
public AjaxResult getInfo(@NotNull(message = "请求对象不能为空") PurchaseQueryDto purchaseQueryDto) {
|
||||||
|
|
@ -68,7 +68,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 新增新购验收任务
|
* 新增新购验收任务
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "新增新购验收任务")
|
@ApiOperation("新增新购验收任务")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("purchase:info:add")
|
//@RequiresPermissions("purchase:info:add")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.INSERT, module = "物资新购->新增新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.INSERT, module = "物资新购->新增新购验收任务")
|
||||||
|
|
@ -84,7 +84,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改新购验收任务
|
* 修改新购验收任务
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改新购验收任务")
|
@ApiOperation("修改新购验收任务")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("purchase:info:edit")
|
//@RequiresPermissions("purchase:info:edit")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->修改新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->修改新购验收任务")
|
||||||
|
|
@ -100,7 +100,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 外层批量验收API
|
* 外层批量验收API
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "外层批量验收API")
|
@ApiOperation("外层批量验收API")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("purchase:info:edit")
|
//@RequiresPermissions("purchase:info:edit")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->外层批量验收API")
|
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->外层批量验收API")
|
||||||
|
|
@ -112,7 +112,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 外层批量验收API
|
* 外层批量验收API
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "内层批量验收API")
|
@ApiOperation("内层批量验收API")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("purchase:info:edit")
|
//@RequiresPermissions("purchase:info:edit")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->内层批量验收API")
|
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->内层批量验收API")
|
||||||
|
|
@ -125,12 +125,12 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 根据任务id查询验收单
|
* 根据任务id查询验收单
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "根据任务id查询验收单--taskId")
|
@ApiOperation("根据任务id查询验收单--taskId")
|
||||||
//@RequiresPermissions("purchase:info:query")
|
//@RequiresPermissions("purchase:info:query")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->查询验收单API")
|
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->查询验收单API")
|
||||||
@GetMapping("/getPurchaseCheckFormByTaskId/{taskId}")
|
@GetMapping("/getPurchaseCheckFormByTaskId/{taskId}")
|
||||||
public AjaxResult getPurchaseCheckFormByTaskId(@PathVariable("taskId") Long taskId) {
|
public AjaxResult getPurchaseCheckFormByTaskId(@PathVariable("taskId") Long taskId) {
|
||||||
PurchaseCheckFormVo purchaseCheckFormVo = purchaseCheckInfoService.selectPurchaseCheckFormVoByTaskId(taskId);
|
final PurchaseCheckFormVo purchaseCheckFormVo = purchaseCheckInfoService.selectPurchaseCheckFormVoByTaskId(taskId);
|
||||||
return AjaxResult.success(purchaseCheckFormVo);
|
return AjaxResult.success(purchaseCheckFormVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 删除新购验收任务
|
* 删除新购验收任务
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除新购验收任务")
|
@ApiOperation("删除新购验收任务")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("purchase:info:remove")
|
//@RequiresPermissions("purchase:info:remove")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.DELETE, module = "物资新购->删除新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.DELETE, module = "物资新购->删除新购验收任务")
|
||||||
|
|
@ -153,28 +153,28 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 导出新购验收任务列表
|
* 导出新购验收任务列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "导出新购验收任务列表")
|
@ApiOperation("导出新购验收任务列表")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("purchase:info:export")
|
//@RequiresPermissions("purchase:info:export")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.EXPORT, module = "物资新购->导出新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.EXPORT, module = "物资新购->导出新购验收任务")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, PurchaseQueryDto purchaseQueryDto) {
|
public void export(HttpServletResponse response, PurchaseQueryDto purchaseQueryDto) {
|
||||||
List<PurchaseCheckInfo> list = purchaseCheckInfoService.selectPurchaseCheckInfoList(purchaseQueryDto);
|
List<PurchaseCheckInfo> list = purchaseCheckInfoService.selectPurchaseCheckInfoList(purchaseQueryDto);
|
||||||
ExcelUtil<PurchaseCheckInfo> util = new ExcelUtil<PurchaseCheckInfo>(PurchaseCheckInfo.class);
|
ExcelUtil<PurchaseCheckInfo> util = new ExcelUtil<>(PurchaseCheckInfo.class);
|
||||||
util.exportExcel(response, list, "新购验收任务数据");
|
util.exportExcel(response, list, "新购验收任务数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出新购验收任务详细列表
|
* 导出新购验收任务详细列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "导出新购验收任务详细列表")
|
@ApiOperation("导出新购验收任务详细列表")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("purchase:info:export")
|
//@RequiresPermissions("purchase:info:export")
|
||||||
@SysLog(title = "新购验收任务详细", businessType = OperaType.EXPORT, logType = 1,module = "物资新购->导出新购验收任务详细")
|
@SysLog(title = "新购验收任务详细", businessType = OperaType.EXPORT, logType = 1,module = "物资新购->导出新购验收任务详细")
|
||||||
@PostMapping("/exportDetails")
|
@PostMapping("/exportDetails")
|
||||||
public void exportDetails(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo) {
|
public void exportDetails(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo) {
|
||||||
List<PurchaseCheckDetails> list = purchaseCheckInfoService.selectPurchaseCheckDetailsList(purchaseCheckInfo);
|
List<PurchaseCheckDetails> list = purchaseCheckInfoService.selectPurchaseCheckDetailsList(purchaseCheckInfo);
|
||||||
ExcelUtil<PurchaseCheckDetails> util = new ExcelUtil<PurchaseCheckDetails>(PurchaseCheckDetails.class);
|
ExcelUtil<PurchaseCheckDetails> util = new ExcelUtil<>(PurchaseCheckDetails.class);
|
||||||
util.exportExcel(response, list, "新购验收任务详细数据");
|
util.exportExcel(response, list, "新购验收任务详细数据");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,18 +71,6 @@ public class RepairController extends BaseController {
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取维修任务物资设备列表--不分页
|
|
||||||
*/
|
|
||||||
// @ApiOperation(value = "获取维修物资设备列表---分页")
|
|
||||||
// @GetMapping("/getRepairMaTypeList")
|
|
||||||
//// @RequiresPermissions("repair:manage:preview")
|
|
||||||
// public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean) {
|
|
||||||
// startPage();
|
|
||||||
// List<RepairDeviceListVo> list = service.getRepairMaTypeList(bean);
|
|
||||||
// return getDataTable(list);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取维修任务机具列表--Ⅱ级页面详情列表
|
* 获取维修任务机具列表--Ⅱ级页面详情列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.back.domain.BackApplyDetails;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.back.mapper.BackApplyInfoMapper;
|
import com.bonus.material.back.mapper.BackApplyInfoMapper;
|
||||||
import com.bonus.material.basic.domain.BmFileInfo;
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
|
|
@ -880,18 +881,28 @@ public class RepairServiceImpl implements RepairService {
|
||||||
try {
|
try {
|
||||||
taskList.forEach(taskId -> {
|
taskList.forEach(taskId -> {
|
||||||
// 判断维修明细是否有已经维修的数据
|
// 判断维修明细是否有已经维修的数据
|
||||||
int repairedScrapNumber = repairMapper.getRepairedScrapNumByTaskId(taskId);
|
final int repairedScrapNumber = repairMapper.getRepairedScrapNumByTaskId(taskId);
|
||||||
if (repairedScrapNumber <= 0) {
|
if (0 >= repairedScrapNumber) {
|
||||||
// 1.修改维修task状态为已驳回
|
// 1.修改维修task状态为已驳回
|
||||||
taskMapper.updateTaskStatus(String.valueOf(taskId), RepairTaskStatusEnum.TASK_STATUS_REJECT.getStatus());
|
taskMapper.updateTaskStatus(String.valueOf(taskId), RepairTaskStatusEnum.TASK_STATUS_REJECT.getStatus());
|
||||||
TmTask tmTask = taskMapper.selectTmTaskByTaskId(taskId);
|
final TmTask tmTask = taskMapper.selectTmTaskByTaskId(taskId);
|
||||||
if (tmTask != null && tmTask.getPreTaskId() != null) {
|
if (null != tmTask && null != tmTask.getPreTaskId()) {
|
||||||
// 2.修改退料任务状态为被维修驳回
|
// 2.修改退料任务状态为被维修驳回
|
||||||
backApplyInfoMapper.updateTaskStatus(new BackApplyInfo().setTaskId(tmTask.getPreTaskId()).setTaskStatus(1));
|
backApplyInfoMapper.updateTaskStatus(new BackApplyInfo()
|
||||||
|
.setTaskId(tmTask.getPreTaskId())
|
||||||
|
.setTaskStatus(BackTaskStatusEnum.BACK_TASK_TO_REJECT.getStatus())
|
||||||
|
);
|
||||||
|
// 3.退料的在用数量恢复
|
||||||
|
backApplyInfoMapper.updateBackApplyDetailsTwo(tmTask.getPreTaskId());
|
||||||
|
// 4.更新退料明细状态
|
||||||
|
backApplyInfoMapper.updateBackApplyDetails(new BackApplyDetails()
|
||||||
|
.setParentId(tmTask.getPreTaskId())
|
||||||
|
.setStatus(String.valueOf(BackTaskStatusEnum.BACK_TASK_TO_REJECT.getStatus()))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (DataAccessException e) {
|
} catch (final DataAccessException e) {
|
||||||
System.err.println(e.getMessage());
|
System.err.println(e.getMessage());
|
||||||
return AjaxResult.error("数据库SQL修改执行失败" + e.getMessage());
|
return AjaxResult.error("数据库SQL修改执行失败" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -903,8 +914,7 @@ public class RepairServiceImpl implements RepairService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int batchQualified(ArrayList<Long> ids) {
|
public int batchQualified(ArrayList<Long> ids) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
return repairMapper.batchQualified(ids, SecurityUtils.getLoginUser().getUserid());
|
||||||
return repairMapper.batchQualified(ids, loginUser.getUserid());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bai.id = #{id}
|
bai.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBackApplyDetailsListByTaskId"
|
<select id="selectBackApplyDetailsListByTaskId" resultType="com.bonus.material.back.domain.BackApplyDetails">
|
||||||
resultType="com.bonus.material.back.domain.BackApplyDetails">
|
|
||||||
SELECT
|
SELECT
|
||||||
ba.id AS id,
|
ba.id AS id,
|
||||||
ba.CODE AS CODE,
|
ba.CODE AS CODE,
|
||||||
|
|
@ -685,4 +684,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and ma_id = #{maId}
|
and ma_id = #{maId}
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateBackApplyDetailsTwo">
|
||||||
|
UPDATE back_apply_details bad
|
||||||
|
JOIN back_apply_info bai ON bad.parent_id = bai.id
|
||||||
|
SET bad.use_num = IFNULL(bad.use_num, 0) + IFNULL(bad.audit_num, 0)
|
||||||
|
WHERE bai.task_id = #{taskId};
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
<?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.lease.mapper.PartLeaseMapper">
|
||||||
|
|
||||||
|
<select id="selectPartLeaseInfoById" resultType="com.bonus.material.lease.domain.PartLeaseInfo">
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPartLeaseInfoList" resultType="com.bonus.material.lease.domain.PartLeaseInfo">
|
||||||
|
select task_id, code, creator, create_time, auditor, audit_time, status, remarks, company_id
|
||||||
|
from pa_collar_apply
|
||||||
|
<where>
|
||||||
|
<if test="taskId != null ">
|
||||||
|
and task_id = #{taskId}
|
||||||
|
</if>
|
||||||
|
<if test="code != null and code != ''">
|
||||||
|
and `code` = #{code}
|
||||||
|
</if>
|
||||||
|
<if test="creator != null and creator != ''">
|
||||||
|
and creator = #{creator}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
orber by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPartLeaseInfo">
|
||||||
|
insert into pa_collar_apply(task_id, code, creator, create_time, status, remarks, company_id)
|
||||||
|
values (#{taskId}, #{code}, #{creator}, now(), 0, #{remarks}, #{companyId})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="removePartLeaseInfoByIds">
|
||||||
|
delete from pa_collar_apply where task_id in
|
||||||
|
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{taskId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectPartLeaseDetailsList" resultType="com.bonus.material.lease.domain.PartLeaseDetails">
|
||||||
|
select pcad.id, pcad.task_id, pcad.part_id, mpt.pa_name as partName, pcad.pre_num, pcad.al_num, pcad.remarks
|
||||||
|
from pa_collar_apply_details pcad
|
||||||
|
left join ma_part_type mpt on pcad.part_id = mpt.pa_id
|
||||||
|
<where>
|
||||||
|
<if test="taskId != null ">
|
||||||
|
and pcad.task_id = #{taskId}
|
||||||
|
</if>
|
||||||
|
<if test="partId != null ">
|
||||||
|
and pcad.part_id = #{partId}
|
||||||
|
</if>
|
||||||
|
<if test="partName != null and partName != ''">
|
||||||
|
and pcad.part_name = #{partName}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPartLeaseDetails">
|
||||||
|
insert into pa_collar_apply_details(task_id, part_id, pre_num, al_num, remarks)
|
||||||
|
values (#{taskId}, #{partId}, #{preNum}, #{alNum}, #{remarks})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchPartLeaseDetails">
|
||||||
|
insert into pa_collar_apply_details(task_id, part_id, pre_num, al_num, remarks)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.taskId}, #{item.partId}, #{item.preNum}, #{item.alNum}, #{item.remarks})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatePartLeaseInfo">
|
||||||
|
update pa_collar_apply
|
||||||
|
<set>
|
||||||
|
<if test="code != null and code != ''">
|
||||||
|
`code` = #{code},
|
||||||
|
</if>
|
||||||
|
<if test="auditor !=null">
|
||||||
|
auditor = #{auditor},
|
||||||
|
</if>
|
||||||
|
<if test="audit_time != null">
|
||||||
|
audit_time = #{auditTime},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status` = #{status},
|
||||||
|
</if>
|
||||||
|
<if test="remarks != null and remarks != ''">
|
||||||
|
remarks = #{remarks}
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where task_id = #{taskId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="removePartLeaseDetailsByIds">
|
||||||
|
delete pa_collar_apply_details where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue