修饰任务审核,报废审核

This commit is contained in:
dingjie 2023-12-16 21:50:54 +08:00
parent 103cf80ceb
commit e2ba7344de
18 changed files with 1344 additions and 90 deletions

View File

@ -0,0 +1,78 @@
package com.bonus.sgzb.material.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.sgzb.material.domain.RepairAuditDetails;
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
import com.bonus.sgzb.material.service.IRepairAuditDetailsService;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import com.bonus.sgzb.material.vo.ScrapAudit;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
/**
* 修试审核详细
*
* @author bonus
* @date 2023-12-16
*/
@RestController
@RequestMapping("/details")
public class RepairAuditDetailsController extends BaseController
{
@Autowired
private IRepairAuditDetailsService repairAuditDetailsService;
/**
* 查询修试审核任务列表
*/
@ApiOperation("查询修试审核任务列表")
@GetMapping("/questList")
public TableDataInfo questList(RepairAuditDetails repairAuditDetails)
{
startPage();
List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(repairAuditDetails);
return getDataTable(list);
}
/**
* 查看修饰审核任务详细列表
*/
@ApiOperation("查看修饰审核任务详细列表")
@GetMapping("/getRepairAuditList")
public TableDataInfo getRepairAuditList(RepairAuditDetails repairAuditDetails)
{
startPage();
List<RepairAuditDetails> list = repairAuditDetailsService.getRepairAuditList(repairAuditDetails);
return getDataTable(list);
}
/**
* 修饰任务审核
*/
@ApiOperation("修饰任务审核")
@Log(title = "修饰任务审核", businessType = BusinessType.UPDATE)
@PostMapping("/audit")
public AjaxResult audit(@RequestBody ScrapAudit scrapAudit)
{
return toAjax(repairAuditDetailsService.auditRepair(scrapAudit));
}
}

View File

@ -5,6 +5,10 @@ import javax.servlet.http.HttpServletResponse;
import com.bonus.sgzb.material.domain.ScrapApplyDetails; import com.bonus.sgzb.material.domain.ScrapApplyDetails;
import com.bonus.sgzb.material.service.IScrapApplyDetailsService; import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import com.bonus.sgzb.material.vo.ScrapAudit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -23,83 +27,52 @@ import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.page.TableDataInfo; import com.bonus.sgzb.common.core.web.page.TableDataInfo;
/** /**
* 报废任务详细scrap_apply_detailsController * 报废任务详细
* *
* @author bonus * @author bonus
* @date 2023-12-15 * @date 2023-12-15
*/ */
@RestController @RestController
@RequestMapping("/details") @Api(value = "报废任务详细")
@RequestMapping("/scrap")
public class ScrapApplyDetailsController extends BaseController public class ScrapApplyDetailsController extends BaseController
{ {
@Autowired @Autowired
private IScrapApplyDetailsService scrapApplyDetailsService; private IScrapApplyDetailsService scrapApplyDetailsService;
/** /**
* 查询报废任务详细scrap_apply_details列表 * 查询报废任务列表
*/ */
@RequiresPermissions("system:details:list") @ApiOperation("查询报废任务列表")
@GetMapping("/list") @GetMapping("/getScrapTaskList")
public TableDataInfo list(ScrapApplyDetails scrapApplyDetails) public TableDataInfo list(ScrapApplyDetails scrapApplyDetails)
{ {
startPage(); startPage();
List<ScrapApplyDetails> list = scrapApplyDetailsService.selectScrapApplyDetailsList(scrapApplyDetails); List<ScrapApplyDetailsVO> list = scrapApplyDetailsService.selectScrapApplyDetailsList(scrapApplyDetails);
return getDataTable(list); return getDataTable(list);
} }
/** /**
* 导出报废任务详细scrap_apply_details列表 * 查看报废任务详细列表
*/ */
@RequiresPermissions("system:details:export") @ApiOperation("查看报废任务详细列表")
@Log(title = "报废任务详细scrap_apply_details", businessType = BusinessType.EXPORT) @GetMapping("/getScrapAuditList")
@PostMapping("/export") public TableDataInfo getScrapAuditList(ScrapApplyDetails scrapApplyDetails)
public void export(HttpServletResponse response, ScrapApplyDetails scrapApplyDetails)
{ {
List<ScrapApplyDetails> list = scrapApplyDetailsService.selectScrapApplyDetailsList(scrapApplyDetails); startPage();
ExcelUtil<ScrapApplyDetails> util = new ExcelUtil<ScrapApplyDetails>(ScrapApplyDetails.class); List<ScrapApplyDetails> list = scrapApplyDetailsService.getScrapAuditList(scrapApplyDetails);
util.exportExcel(response, list, "报废任务详细scrap_apply_details数据"); return getDataTable(list);
} }
/** /**
* 获取报废任务详细scrap_apply_details详细信息 * 报废任务审核
*/ */
@RequiresPermissions("system:details:query") @ApiOperation("报废任务审核")
@GetMapping(value = "/{id}") @Log(title = "报废任务审核", businessType = BusinessType.UPDATE)
public AjaxResult getInfo(@PathVariable("id") Long id) @PostMapping("/audit")
public AjaxResult audit(@RequestBody ScrapAudit scrapAudit)
{ {
return success(scrapApplyDetailsService.selectScrapApplyDetailsById(id)); return toAjax(scrapApplyDetailsService.auditScrap(scrapAudit));
} }
/**
* 新增报废任务详细scrap_apply_details
*/
@RequiresPermissions("system:details:add")
@Log(title = "报废任务详细scrap_apply_details", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ScrapApplyDetails scrapApplyDetails)
{
return toAjax(scrapApplyDetailsService.insertScrapApplyDetails(scrapApplyDetails));
}
/**
* 修改报废任务详细scrap_apply_details
*/
@RequiresPermissions("system:details:edit")
@Log(title = "报废任务详细scrap_apply_details", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ScrapApplyDetails scrapApplyDetails)
{
return toAjax(scrapApplyDetailsService.updateScrapApplyDetails(scrapApplyDetails));
}
/**
* 删除报废任务详细scrap_apply_details
*/
@RequiresPermissions("system:details:remove")
@Log(title = "报废任务详细scrap_apply_details", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(scrapApplyDetailsService.deleteScrapApplyDetailsByIds(ids));
}
} }

View File

@ -0,0 +1,215 @@
package com.bonus.sgzb.material.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.sgzb.common.core.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 修试审核详细repair_apply_details对象 repair_audit_details
*
* @author bonus
* @date 2023-12-16
*/
public class RepairAuditDetails extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 任务ID */
@Excel(name = "任务ID")
private Long taskId;
/** 维修ID */
@Excel(name = "维修ID")
private Long repairId;
/** 机具ID */
@Excel(name = "机具ID")
private Long maId;
/** 规格ID */
@Excel(name = "规格ID")
private Long typeId;
/** 维修总量 */
@Excel(name = "维修总量")
private BigDecimal repairNum;
/** 维修数量 */
@Excel(name = "维修数量")
private BigDecimal repairedNum;
/** 报废数量 */
@Excel(name = "报废数量")
private BigDecimal scrapNum;
/** 审核人 */
@Excel(name = "审核人")
private Long auditBy;
/** 审核时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditTime;
/** 备注备注 */
@Excel(name = "备注备注")
private String auditRemark;
/** 0未审核1已审核2驳回 */
@Excel(name = "0未审核1已审核2驳回")
private String status;
/** 数据所属组织 */
@Excel(name = "数据所属组织")
private Integer companyId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTaskId(Long taskId)
{
this.taskId = taskId;
}
public Long getTaskId()
{
return taskId;
}
public void setRepairId(Long repairId)
{
this.repairId = repairId;
}
public Long getRepairId()
{
return repairId;
}
public void setMaId(Long maId)
{
this.maId = maId;
}
public Long getMaId()
{
return maId;
}
public void setTypeId(Long typeId)
{
this.typeId = typeId;
}
public Long getTypeId()
{
return typeId;
}
public void setRepairNum(BigDecimal repairNum)
{
this.repairNum = repairNum;
}
public BigDecimal getRepairNum()
{
return repairNum;
}
public void setRepairedNum(BigDecimal repairedNum)
{
this.repairedNum = repairedNum;
}
public BigDecimal getRepairedNum()
{
return repairedNum;
}
public void setScrapNum(BigDecimal scrapNum)
{
this.scrapNum = scrapNum;
}
public BigDecimal getScrapNum()
{
return scrapNum;
}
public void setAuditBy(Long auditBy)
{
this.auditBy = auditBy;
}
public Long getAuditBy()
{
return auditBy;
}
public void setAuditTime(Date auditTime)
{
this.auditTime = auditTime;
}
public Date getAuditTime()
{
return auditTime;
}
public void setAuditRemark(String auditRemark)
{
this.auditRemark = auditRemark;
}
public String getAuditRemark()
{
return auditRemark;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setCompanyId(Integer companyId)
{
this.companyId = companyId;
}
public Integer getCompanyId()
{
return companyId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("taskId", getTaskId())
.append("repairId", getRepairId())
.append("maId", getMaId())
.append("typeId", getTypeId())
.append("repairNum", getRepairNum())
.append("repairedNum", getRepairedNum())
.append("scrapNum", getScrapNum())
.append("auditBy", getAuditBy())
.append("auditTime", getAuditTime())
.append("auditRemark", getAuditRemark())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("companyId", getCompanyId())
.toString();
}
}

View File

@ -6,6 +6,7 @@ import java.util.Date;
import com.bonus.sgzb.common.core.web.domain.BaseEntity; import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.sgzb.common.core.annotation.Excel; import com.bonus.sgzb.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -19,66 +20,76 @@ public class ScrapApplyDetails extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** $column.columnComment */ /** 主键id */
@ApiModelProperty(value = "主键id")
private Long id; private Long id;
/** 任务ID */ /** 任务ID */
@Excel(name = "任务ID") @ApiModelProperty(value = "任务ID")
private Long taskId; private Long taskId;
/** 上级ID */ /** 上级ID */
@Excel(name = "上级ID") @ApiModelProperty(value = "上级ID")
private Long parentId; private Long parentId;
/** 机具ID */ /** 机具ID */
@Excel(name = "机具ID") @ApiModelProperty(value = "机具ID")
private Long maId; private Long maId;
/** 规格ID */ /** 规格ID */
@Excel(name = "规格ID") @ApiModelProperty(value = "规格ID")
private Long typeId; private Long typeId;
/** 报废数量 */ /** 报废数量 */
@Excel(name = "报废数量") @ApiModelProperty(value = "报废数量")
private BigDecimal scrapNum; private BigDecimal scrapNum;
/** (1退料2,维修审核3盘点) */ /** (1退料2,维修审核3盘点) */
@Excel(name = "(1退料2,维修审核3盘点)") @ApiModelProperty(value = "(1退料2,维修审核3盘点)")
private String scrapSource; private String scrapSource;
/** 0自然1人为 */ /** 0自然1人为 */
@Excel(name = "", readConverterExp = "0=自然1人为") @ApiModelProperty(value = "0=自然1人为")
private String scrapType; private String scrapType;
/** 状态0进行中1已审核2驳回 */ /** 状态0进行中1已审核2驳回 */
@Excel(name = "状态", readConverterExp = "0=进行中1已审核2驳回") @ApiModelProperty(value = "状态0=进行中1已审核2驳回")
private String status; private String status;
/** 审核人 */ /** 审核人 */
@Excel(name = "审核人") @ApiModelProperty(value = "审核人")
private Long auditBy; private Long auditBy;
/** 审核时间 */ /** 审核时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(value = "审核时间")
private Date auditTime; private Date auditTime;
/** 审核备注 */ /** 审核备注 */
@Excel(name = "审核备注") @ApiModelProperty(value = "审核备注")
private String auditRemark; private String auditRemark;
/** $column.columnComment */ /** 文件路径 */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @ApiModelProperty(value = "文件路径")
private String fileUrl; private String fileUrl;
/** 数据所属组织 */ /** 数据所属组织 */
@Excel(name = "数据所属组织") @ApiModelProperty(value = "数据所属组织")
private Long companyId; private Long companyId;
/** $column.columnComment */ /** 文件名称 */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @ApiModelProperty(value = "文件名称")
private String fileName; private String fileName;
@ApiModelProperty(value = "规格型号")
private String specificationType;
@ApiModelProperty(value = "机具类型名称")
private String machineTypeName;
@ApiModelProperty(value = "机具编号")
private String maCode;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -215,6 +226,30 @@ public class ScrapApplyDetails extends BaseEntity
return fileName; return fileName;
} }
public String getSpecificationType() {
return specificationType;
}
public void setSpecificationType(String specificationType) {
this.specificationType = specificationType;
}
public String getMachineTypeName() {
return machineTypeName;
}
public void setMachineTypeName(String machineTypeName) {
this.machineTypeName = machineTypeName;
}
public String getMaCode() {
return maCode;
}
public void setMaCode(String maCode) {
this.maCode = maCode;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -0,0 +1,70 @@
package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 任务tm_task_agreement对象 tm_task_agreement
*
* @author bonus
* @date 2023-12-16
*/
public class TmTaskAgreement extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 任务ID */
private Long taskId;
/** 协议ID */
@Excel(name = "协议ID")
private Long agreementId;
/** 数据所属组织 */
@Excel(name = "数据所属组织")
private Long companyId;
public void setTaskId(Long taskId)
{
this.taskId = taskId;
}
public Long getTaskId()
{
return taskId;
}
public void setAgreementId(Long agreementId)
{
this.agreementId = agreementId;
}
public Long getAgreementId()
{
return agreementId;
}
public void setCompanyId(Long companyId)
{
this.companyId = companyId;
}
public Long getCompanyId()
{
return companyId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("taskId", getTaskId())
.append("agreementId", getAgreementId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("companyId", getCompanyId())
.toString();
}
}

View File

@ -0,0 +1,72 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.RepairAuditDetails;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 修试审核详细repair_apply_detailsMapper接口
*
* @author bonus
* @date 2023-12-16
*/
@Mapper
public interface RepairAuditDetailsMapper
{
/**
* 查询修试审核详细repair_apply_details
*
* @param id 修试审核详细repair_apply_details主键
* @return 修试审核详细repair_apply_details
*/
public RepairAuditDetails selectRepairAuditDetailsById(Long id);
/**
* 查询修试审核详细repair_apply_details列表
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 修试审核详细repair_apply_details集合
*/
public List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails);
/**
* 新增修试审核详细repair_apply_details
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 结果
*/
public int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails);
/**
* 修改修试审核详细repair_apply_details
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 结果
*/
public int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails);
/**
* 删除修试审核详细repair_apply_details
*
* @param id 修试审核详细repair_apply_details主键
* @return 结果
*/
public int deleteRepairAuditDetailsById(Long id);
/**
* 批量删除修试审核详细repair_apply_details
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRepairAuditDetailsByIds(Long[] ids);
List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails);
List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);
String selectTypeNameByTaskId(Long taskId);
}

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.material.mapper; package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.ScrapApplyDetails; import com.bonus.sgzb.material.domain.ScrapApplyDetails;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -28,7 +29,7 @@ public interface ScrapApplyDetailsMapper
* @param scrapApplyDetails 报废任务详细scrap_apply_details * @param scrapApplyDetails 报废任务详细scrap_apply_details
* @return 报废任务详细scrap_apply_details集合 * @return 报废任务详细scrap_apply_details集合
*/ */
public List<ScrapApplyDetails> selectScrapApplyDetailsList(ScrapApplyDetails scrapApplyDetails); public List<ScrapApplyDetailsVO> selectScrapApplyDetailsList(ScrapApplyDetails scrapApplyDetails);
/** /**
* 新增报废任务详细scrap_apply_details * 新增报废任务详细scrap_apply_details
@ -61,4 +62,12 @@ public interface ScrapApplyDetailsMapper
* @return 结果 * @return 结果
*/ */
public int deleteScrapApplyDetailsByIds(Long[] ids); public int deleteScrapApplyDetailsByIds(Long[] ids);
List<ScrapApplyDetails> selectScrapAuditList(ScrapApplyDetails scrapApplyDetails);
List<ScrapApplyDetails> selectScrapDetailsByTaskId(Long taskId);
int updateMachine(Long maId);
String selectTypeNameByTaskId(Long taskId);
} }

View File

@ -0,0 +1,62 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.TmTaskAgreement;
import java.util.List;
/**
* 任务tm_task_agreementMapper接口
*
* @author bonus
* @date 2023-12-16
*/
public interface TmTaskAgreementMapper
{
/**
* 查询任务tm_task_agreement
*
* @param taskId 任务tm_task_agreement主键
* @return 任务tm_task_agreement
*/
public TmTaskAgreement selectTmTaskAgreementByTaskId(Long taskId);
/**
* 查询任务tm_task_agreement列表
*
* @param tmTaskAgreement 任务tm_task_agreement
* @return 任务tm_task_agreement集合
*/
public List<TmTaskAgreement> selectTmTaskAgreementList(TmTaskAgreement tmTaskAgreement);
/**
* 新增任务tm_task_agreement
*
* @param tmTaskAgreement 任务tm_task_agreement
* @return 结果
*/
public int insertTmTaskAgreement(TmTaskAgreement tmTaskAgreement);
/**
* 修改任务tm_task_agreement
*
* @param tmTaskAgreement 任务tm_task_agreement
* @return 结果
*/
public int updateTmTaskAgreement(TmTaskAgreement tmTaskAgreement);
/**
* 删除任务tm_task_agreement
*
* @param taskId 任务tm_task_agreement主键
* @return 结果
*/
public int deleteTmTaskAgreementByTaskId(Long taskId);
/**
* 批量删除任务tm_task_agreement
*
* @param taskIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteTmTaskAgreementByTaskIds(Long[] taskIds);
}

View File

@ -0,0 +1,70 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.RepairAuditDetails;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import com.bonus.sgzb.material.vo.ScrapAudit;
import java.util.List;
/**
* 修试审核详细repair_apply_detailsService接口
*
* @author bonus
* @date 2023-12-16
*/
public interface IRepairAuditDetailsService
{
/**
* 查询修试审核详细repair_apply_details
*
* @param id 修试审核详细repair_apply_details主键
* @return 修试审核详细repair_apply_details
*/
public RepairAuditDetails selectRepairAuditDetailsById(Long id);
/**
* 查询修试审核详细repair_apply_details列表
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 修试审核详细repair_apply_details集合
*/
public List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails);
/**
* 新增修试审核详细repair_apply_details
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 结果
*/
public int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails);
/**
* 修改修试审核详细repair_apply_details
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 结果
*/
public int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails);
/**
* 批量删除修试审核详细repair_apply_details
*
* @param ids 需要删除的修试审核详细repair_apply_details主键集合
* @return 结果
*/
public int deleteRepairAuditDetailsByIds(Long[] ids);
/**
* 删除修试审核详细repair_apply_details信息
*
* @param id 修试审核详细repair_apply_details主键
* @return 结果
*/
public int deleteRepairAuditDetailsById(Long id);
List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails);
List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails);
int auditRepair(ScrapAudit scrapAudit);
}

View File

@ -1,6 +1,8 @@
package com.bonus.sgzb.material.service; package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.ScrapApplyDetails; import com.bonus.sgzb.material.domain.ScrapApplyDetails;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import com.bonus.sgzb.material.vo.ScrapAudit;
import java.util.List; import java.util.List;
@ -26,7 +28,7 @@ public interface IScrapApplyDetailsService
* @param scrapApplyDetails 报废任务详细scrap_apply_details * @param scrapApplyDetails 报废任务详细scrap_apply_details
* @return 报废任务详细scrap_apply_details集合 * @return 报废任务详细scrap_apply_details集合
*/ */
public List<ScrapApplyDetails> selectScrapApplyDetailsList(ScrapApplyDetails scrapApplyDetails); public List<ScrapApplyDetailsVO> selectScrapApplyDetailsList(ScrapApplyDetails scrapApplyDetails);
/** /**
* 新增报废任务详细scrap_apply_details * 新增报废任务详细scrap_apply_details
@ -59,4 +61,9 @@ public interface IScrapApplyDetailsService
* @return 结果 * @return 结果
*/ */
public int deleteScrapApplyDetailsById(Long id); public int deleteScrapApplyDetailsById(Long id);
List<ScrapApplyDetails> getScrapAuditList(ScrapApplyDetails scrapApplyDetails);
int auditScrap(ScrapAudit scrapAudit);
} }

View File

@ -0,0 +1,229 @@
package com.bonus.sgzb.material.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.bonus.sgzb.base.api.domain.TmTask;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.RepairAuditDetails;
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
import com.bonus.sgzb.material.domain.TmTaskAgreement;
import com.bonus.sgzb.material.mapper.*;
import com.bonus.sgzb.material.service.IRepairAuditDetailsService;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import com.bonus.sgzb.material.vo.ScrapAudit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 修试审核详细repair_apply_detailsService业务层处理
*
* @author bonus
* @date 2023-12-16
*/
@Service
public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
{
@Autowired
private RepairAuditDetailsMapper repairAuditDetailsMapper;
@Resource
private TaskMapper taskMapper;
@Resource
private TmTaskAgreementMapper agreementMapper;
@Resource
private ScrapApplyDetailsMapper scrapApplyDetailsMapper;
/**
* 查询修试审核详细repair_apply_details
*
* @param id 修试审核详细repair_apply_details主键
* @return 修试审核详细repair_apply_details
*/
@Override
public RepairAuditDetails selectRepairAuditDetailsById(Long id)
{
return repairAuditDetailsMapper.selectRepairAuditDetailsById(id);
}
/**
* 查询修试审核详细repair_apply_details列表
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 修试审核详细repair_apply_details
*/
@Override
public List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails)
{
return repairAuditDetailsMapper.selectRepairAuditDetailsList(repairAuditDetails);
}
/**
* 新增修试审核详细repair_apply_details
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 结果
*/
@Override
public int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails)
{
repairAuditDetails.setCreateTime(DateUtils.getNowDate());
return repairAuditDetailsMapper.insertRepairAuditDetails(repairAuditDetails);
}
/**
* 修改修试审核详细repair_apply_details
*
* @param repairAuditDetails 修试审核详细repair_apply_details
* @return 结果
*/
@Override
public int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails)
{
repairAuditDetails.setUpdateTime(DateUtils.getNowDate());
return repairAuditDetailsMapper.updateRepairAuditDetails(repairAuditDetails);
}
/**
* 批量删除修试审核详细repair_apply_details
*
* @param ids 需要删除的修试审核详细repair_apply_details主键
* @return 结果
*/
@Override
public int deleteRepairAuditDetailsByIds(Long[] ids)
{
return repairAuditDetailsMapper.deleteRepairAuditDetailsByIds(ids);
}
/**
* 删除修试审核详细repair_apply_details信息
*
* @param id 修试审核详细repair_apply_details主键
* @return 结果
*/
@Override
public int deleteRepairAuditDetailsById(Long id)
{
return repairAuditDetailsMapper.deleteRepairAuditDetailsById(id);
}
/**
* 查询试验审核列表
* @param repairAuditDetails
* @return
*/
@Override
public List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails) {
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
Long taskId = scrapApplyDetailsVO.getTaskId();
String typeName = repairAuditDetailsMapper.selectTypeNameByTaskId(taskId);
scrapApplyDetailsVO.setItemType(typeName);
}
return repairQuestList;
}
/**
*
* @param repairAuditDetails
* @return
*/
@Override
public List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails) {
List<RepairAuditDetails> repairAuditDetailsList = repairAuditDetailsMapper.selectRepairAuditDetailsList(repairAuditDetails);
return repairAuditDetailsList;
}
/**
* 修饰审核任务审核
* @param scrapAudit 审核信息
* @return 结果
*/
@Override
public int auditRepair(ScrapAudit scrapAudit) {
String checkResult = scrapAudit.getCheckResult();
List<Long> taskIdList = scrapAudit.getTaskIdList();
for (Long taskId : taskIdList) {
// 查询协议表
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
List<RepairAuditDetails> repairAuditDetailsList = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(taskId);
for (RepairAuditDetails repairAuditDetails : repairAuditDetailsList) {
Long typeId = repairAuditDetails.getTypeId();
Long maId = repairAuditDetails.getMaId();
BigDecimal repairNum = repairAuditDetails.getRepairNum();
BigDecimal b = new BigDecimal(0);
// 创建维修任务
if (repairNum.compareTo(b) > 0) {
TmTask task = new TmTask();
task.setCode(purchaseCodeRule("R",50));
task.setTaskStatus(53);
task.setTaskType(50);
task.setCompanyId(repairAuditDetails.getCompanyId());
task.setCreateTime(new Date());
task.setCreateBy(SecurityUtils.getUsername());
taskMapper.insertTmTask(task);
// 添加协议信息表
TmTaskAgreement taskAgreement = new TmTaskAgreement();
taskAgreement.setTaskId(task.getTaskId());
taskAgreement.setAgreementId(tmTaskAgreement.getAgreementId());
agreementMapper.insertTmTaskAgreement(taskAgreement);
// 添加修试后入库任务
}
// 创建报废任务
BigDecimal scrapNum = repairAuditDetails.getScrapNum();
if (scrapNum.compareTo(b) > 0) {
TmTask task = new TmTask();
task.setCode(purchaseCodeRule("BF",57));
task.setTaskStatus(58);
task.setTaskType(57);
task.setCompanyId(repairAuditDetails.getCompanyId());
task.setCreateTime(new Date());
task.setCreateBy(SecurityUtils.getUsername());
taskMapper.insertTmTask(task);
// 添加协议信息表
TmTaskAgreement taskAgreement = new TmTaskAgreement();
taskAgreement.setTaskId(task.getTaskId());
taskAgreement.setAgreementId(tmTaskAgreement.getAgreementId());
agreementMapper.insertTmTaskAgreement(taskAgreement);
// 添加退料任务
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
scrapApplyDetails.setTaskId(task.getTaskId());
scrapApplyDetails.setTypeId(typeId);
scrapApplyDetails.setMaId(maId);
scrapApplyDetails.setScrapNum(scrapNum);
scrapApplyDetails.setScrapSource("1");
scrapApplyDetails.setStatus("0");
scrapApplyDetails.setParentId(taskId);
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
}
}
}
return 0;
}
// 采购单号编码生成规则
private String purchaseCodeRule(String code,Integer taskType) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
int taskNum = taskMapper.selectTaskNumByMonth(nowDate,taskType) + 1;
return code + format + "-000" + taskNum;
}
}

View File

@ -1,13 +1,21 @@
package com.bonus.sgzb.material.service.impl; package com.bonus.sgzb.material.service.impl;
import java.util.List; import java.util.List;
import com.bonus.sgzb.base.api.domain.TmTask;
import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.material.domain.ScrapApplyDetails; import com.bonus.sgzb.material.domain.ScrapApplyDetails;
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
import com.bonus.sgzb.material.mapper.ScrapApplyDetailsMapper; import com.bonus.sgzb.material.mapper.ScrapApplyDetailsMapper;
import com.bonus.sgzb.material.mapper.TaskMapper;
import com.bonus.sgzb.material.service.IScrapApplyDetailsService; import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
import com.bonus.sgzb.material.vo.ScrapAudit;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/** /**
* 报废任务详细scrap_apply_detailsService业务层处理 * 报废任务详细scrap_apply_detailsService业务层处理
* *
@ -20,6 +28,12 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService
@Autowired @Autowired
private ScrapApplyDetailsMapper scrapApplyDetailsMapper; private ScrapApplyDetailsMapper scrapApplyDetailsMapper;
@Resource
private PurchaseCheckInfoMapper purchaseCheckInfoMapper;
@Resource
private TaskMapper taskMapper;
/** /**
* 查询报废任务详细scrap_apply_details * 查询报废任务详细scrap_apply_details
* *
@ -39,9 +53,15 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService
* @return 报废任务详细scrap_apply_details * @return 报废任务详细scrap_apply_details
*/ */
@Override @Override
public List<ScrapApplyDetails> selectScrapApplyDetailsList(ScrapApplyDetails scrapApplyDetails) public List<ScrapApplyDetailsVO> selectScrapApplyDetailsList(ScrapApplyDetails scrapApplyDetails)
{ {
return scrapApplyDetailsMapper.selectScrapApplyDetailsList(scrapApplyDetails); List<ScrapApplyDetailsVO> scrapApplyDetailsList = scrapApplyDetailsMapper.selectScrapApplyDetailsList(scrapApplyDetails);
for (ScrapApplyDetailsVO applyDetails : scrapApplyDetailsList) {
Long taskId = applyDetails.getTaskId();
String typeName = scrapApplyDetailsMapper.selectTypeNameByTaskId(taskId);
applyDetails.setItemType(typeName);
}
return scrapApplyDetailsList;
} }
/** /**
@ -93,4 +113,43 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService
{ {
return scrapApplyDetailsMapper.deleteScrapApplyDetailsById(id); return scrapApplyDetailsMapper.deleteScrapApplyDetailsById(id);
} }
/**
* 查看按钮,查询报废任务详细列表
* @param scrapApplyDetails
* @return
*/
@Override
public List<ScrapApplyDetails> getScrapAuditList(ScrapApplyDetails scrapApplyDetails) {
return scrapApplyDetailsMapper.selectScrapAuditList(scrapApplyDetails);
}
/**
* 报废任务审核
* @param scrapAudit 审核信息列表
* @return 结果
*/
@Override
public int auditScrap(ScrapAudit scrapAudit) {
String checkResult = scrapAudit.getCheckResult();
List<Long> taskIdList = scrapAudit.getTaskIdList();
for (Long taskId : taskIdList) {
TmTask task = new TmTask();
task.setTaskId(taskId);
if ("通过".equals(checkResult)) {
List<ScrapApplyDetails> scrapApplyDetailsList = scrapApplyDetailsMapper.selectScrapDetailsByTaskId(taskId);
for (ScrapApplyDetails scrapApplyDetails : scrapApplyDetailsList) {
Long maId = scrapApplyDetails.getMaId();
if (maId != null && maId > 0) {
scrapApplyDetailsMapper.updateMachine(maId);
}
}
task.setTaskStatus(59);
}else {
task.setTaskStatus(61);
}
taskMapper.updateTmTask(task);
}
return 1;
}
} }

View File

@ -0,0 +1,43 @@
package com.bonus.sgzb.material.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class ScrapApplyDetailsVO {
// 任务id
private Long taskId;
// 报废单号
private String scrapNum;
// 单位名称
private String unitName;
// 工程名称
private String projectName;
// 机具类型
private String itemType;
//任务创建人
private String createBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
// 维修单号
private String repairNum;
// 审核状态
private Integer taskStatus;
// 不通过原因
private String remark;
}

View File

@ -0,0 +1,17 @@
package com.bonus.sgzb.material.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ScrapAudit {
@ApiModelProperty(value = "通过,不通过")
private String checkResult;
@ApiModelProperty(value = "审核任务id")
private List<Long> taskIdList;
}

View File

@ -0,0 +1,151 @@
<?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.sgzb.material.mapper.RepairAuditDetailsMapper">
<resultMap type="com.bonus.sgzb.material.domain.RepairAuditDetails" id="RepairAuditDetailsResult">
<result property="id" column="id" />
<result property="taskId" column="task_id" />
<result property="repairId" column="repair_id" />
<result property="maId" column="ma_id" />
<result property="typeId" column="type_id" />
<result property="repairNum" column="repair_num" />
<result property="repairedNum" column="repaired_num" />
<result property="scrapNum" column="scrap_num" />
<result property="auditBy" column="audit_by" />
<result property="auditTime" column="audit_time" />
<result property="auditRemark" column="audit_remark" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
</resultMap>
<sql id="selectRepairAuditDetailsVo">
select id, task_id, repair_id, ma_id, type_id, repair_num, repaired_num, scrap_num, audit_by, audit_time, audit_remark, status, create_by, create_time, update_by, update_time, remark, company_id from repair_audit_details
</sql>
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.sgzb.material.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
select sad.* ,mt.type_name, mt1.type_name , mma.ma_code
from repair_audit_details rad
left join ma_type mt on rad.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_machine mma on rad.ma_id= mma.ma_id
where rad.task_id = #{taskId}
</select>
<select id="selectRepairAuditDetailsById" parameterType="Long" resultMap="RepairAuditDetailsResult">
<include refid="selectRepairAuditDetailsVo"/>
where id = #{id}
</select>
<insert id="insertRepairAuditDetails" parameterType="com.bonus.sgzb.material.domain.RepairAuditDetails">
insert into repair_audit_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="taskId != null">task_id,</if>
<if test="repairId != null">repair_id,</if>
<if test="maId != null">ma_id,</if>
<if test="typeId != null">type_id,</if>
<if test="repairNum != null">repair_num,</if>
<if test="repairedNum != null">repaired_num,</if>
<if test="scrapNum != null">scrap_num,</if>
<if test="auditBy != null">audit_by,</if>
<if test="auditTime != null">audit_time,</if>
<if test="auditRemark != null">audit_remark,</if>
<if test="status != null">status,</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="id != null">#{id},</if>
<if test="taskId != null">#{taskId},</if>
<if test="repairId != null">#{repairId},</if>
<if test="maId != null">#{maId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="repairNum != null">#{repairNum},</if>
<if test="repairedNum != null">#{repairedNum},</if>
<if test="scrapNum != null">#{scrapNum},</if>
<if test="auditBy != null">#{auditBy},</if>
<if test="auditTime != null">#{auditTime},</if>
<if test="auditRemark != null">#{auditRemark},</if>
<if test="status != null">#{status},</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>
<update id="updateRepairAuditDetails" parameterType="com.bonus.sgzb.material.domain.RepairAuditDetails">
update repair_audit_details
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="repairId != null">repair_id = #{repairId},</if>
<if test="maId != null">ma_id = #{maId},</if>
<if test="typeId != null">type_id = #{typeId},</if>
<if test="repairNum != null">repair_num = #{repairNum},</if>
<if test="repairedNum != null">repaired_num = #{repairedNum},</if>
<if test="scrapNum != null">scrap_num = #{scrapNum},</if>
<if test="auditBy != null">audit_by = #{auditBy},</if>
<if test="auditTime != null">audit_time = #{auditTime},</if>
<if test="auditRemark != null">audit_remark = #{auditRemark},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRepairAuditDetailsById" parameterType="Long">
delete from repair_audit_details where id = #{id}
</delete>
<delete id="deleteRepairAuditDetailsByIds" parameterType="String">
delete from repair_audit_details where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectRepairQuestList" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
select tk.code scrapNum,tk.task_status taskStatus, bui.unit_name unitName,bpl.lot_name projectName,
tk.create_by createBy, tk.create_time createTime, tk.remark ,tk.code repairNum,tk.task_id taskId
from tm_task tk
left join tm_task_agreement tta on tk.task_id = tta.task_id
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
left join bm_project_lot bpl on bai.project_id = bpl.lot_id
left join bm_unit_info bui on bai.unit_id = bui.unit_id
where tk.task_type = 45
</select>
<select id="selectRepairAuditDetailsByTaskId" resultMap="RepairAuditDetailsResult">
<include refid="selectRepairAuditDetailsVo"/>
where task_id = #{taskId}
</select>
<select id="selectTypeNameByTaskId" resultType="java.lang.String">
select GROUP_CONCAT(type_name) typeName from
(select distinct rad.task_id, mt1.type_name
from repair_audit_details rad
left join ma_type mt on rad.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where rad.task_id = #{taskId}
) t
GROUP BY task_id
</select>
</mapper>

View File

@ -31,24 +31,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, task_id, parent_id, ma_id, type_id, scrap_num, scrap_source, scrap_type, status, audit_by, audit_time, audit_remark, create_by, create_time, update_by, update_time, remark, file_url, company_id, file_name from scrap_apply_details select id, task_id, parent_id, ma_id, type_id, scrap_num, scrap_source, scrap_type, status, audit_by, audit_time, audit_remark, create_by, create_time, update_by, update_time, remark, file_url, company_id, file_name from scrap_apply_details
</sql> </sql>
<select id="selectScrapApplyDetailsList" parameterType="com.bonus.sgzb.material.domain.ScrapApplyDetails" resultMap="ScrapApplyDetailsResult"> <select id="selectScrapApplyDetailsList" parameterType="com.bonus.sgzb.material.domain.ScrapApplyDetails" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
<include refid="selectScrapApplyDetailsVo"/> select tk.code scrapNum,tk.task_status taskStatus, bui.unit_name unitName,bpl.lot_name projectName,
<where> tk.create_by createBy, tk.create_time createTime, tk.remark ,tk1.code repairNum,tk.task_id taskId
<if test="taskId != null "> and task_id = #{taskId}</if> from tm_task tk
<if test="parentId != null "> and parent_id = #{parentId}</if> left join tm_task_agreement tta on tk.task_id = tta.task_id
<if test="maId != null "> and ma_id = #{maId}</if> left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
<if test="typeId != null "> and type_id = #{typeId}</if> left join bm_project_lot bpl on bai.project_id = bpl.lot_id
<if test="scrapNum != null "> and scrap_num = #{scrapNum}</if> left join bm_unit_info bui on bai.unit_id = bui.unit_id
<if test="scrapSource != null and scrapSource != ''"> and scrap_source = #{scrapSource}</if> left join scrap_apply_details sad on tk.task_id = sad.task_id
<if test="scrapType != null and scrapType != ''"> and scrap_type = #{scrapType}</if> left join tm_task tk1 on sad.parent_id = tk1.task_id
<if test="status != null and status != ''"> and status = #{status}</if> where sad.scrap_source in ('1','2') and tk.task_type = 57
<if test="auditBy != null "> and audit_by = #{auditBy}</if>
<if test="auditTime != null "> and audit_time = #{auditTime}</if>
<if test="auditRemark != null and auditRemark != ''"> and audit_remark = #{auditRemark}</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
</where>
</select> </select>
<select id="selectScrapApplyDetailsById" parameterType="Long" resultMap="ScrapApplyDetailsResult"> <select id="selectScrapApplyDetailsById" parameterType="Long" resultMap="ScrapApplyDetailsResult">
@ -140,4 +133,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectScrapAuditList" resultMap="ScrapApplyDetailsResult">
select sad.* ,mt.type_name, mt1.type_name , mma.ma_code
from scrap_apply_details sad
left join ma_type mt on pcd.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_machine mma on sad.ma_id= mma.ma_id
where sad.task_id = #{taskId}
</select>
<select id="selectScrapDetailsByTaskId" resultMap="ScrapApplyDetailsResult">
<include refid="selectScrapApplyDetailsVo"/>
where task_id = #{taskId}
</select>
<update id="updateMachine">
update ma_machine set ma_status = 22 where ma_id = #{maId}
</update>
<select id="selectTypeNameByTaskId" resultType="java.lang.String">
select GROUP_CONCAT(type_name) typeName from
(select distinct sad.task_id, mt1.type_name
from scrap_apply_details sad
left join ma_type mt on sad.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where sad.task_id = #{taskId}
) t
GROUP BY task_id
</select>
</mapper> </mapper>

View File

@ -0,0 +1,81 @@
<?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.sgzb.material.mapper.TmTaskAgreementMapper">
<resultMap type="com.bonus.sgzb.material.domain.TmTaskAgreement" id="TmTaskAgreementResult">
<result property="taskId" column="task_id" />
<result property="agreementId" column="agreement_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
</resultMap>
<sql id="selectTmTaskAgreementVo">
select task_id, agreement_id, create_by, create_time, update_by, update_time, remark, company_id from tm_task_agreement
</sql>
<select id="selectTmTaskAgreementList" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement" resultMap="TmTaskAgreementResult">
<include refid="selectTmTaskAgreementVo"/>
<where>
<if test="agreementId != null "> and agreement_id = #{agreementId}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
</where>
</select>
<select id="selectTmTaskAgreementByTaskId" parameterType="Long" resultMap="TmTaskAgreementResult">
<include refid="selectTmTaskAgreementVo"/>
where task_id = #{taskId}
</select>
<insert id="insertTmTaskAgreement" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement" useGeneratedKeys="true" keyProperty="taskId">
insert into tm_task_agreement
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="agreementId != null">agreement_id,</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="agreementId != null">#{agreementId},</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>
<update id="updateTmTaskAgreement" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement">
update tm_task_agreement
<trim prefix="SET" suffixOverrides=",">
<if test="agreementId != null">agreement_id = #{agreementId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if>
</trim>
where task_id = #{taskId}
</update>
<delete id="deleteTmTaskAgreementByTaskId" parameterType="Long">
delete from tm_task_agreement where task_id = #{taskId}
</delete>
<delete id="deleteTmTaskAgreementByTaskIds" parameterType="String">
delete from tm_task_agreement where task_id in
<foreach item="taskId" collection="array" open="(" separator="," close=")">
#{taskId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,61 @@
package com.bonus.sgzb.system.service;
import java.util.List;
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
/**
* 新购短信通知人员purchase_notice_personService接口
*
* @author bonus
* @date 2023-12-16
*/
public interface IPurchaseNoticePersonService
{
/**
* 查询新购短信通知人员purchase_notice_person
*
* @param id 新购短信通知人员purchase_notice_person主键
* @return 新购短信通知人员purchase_notice_person
*/
public PurchaseNoticePerson selectPurchaseNoticePersonById(Long id);
/**
* 查询新购短信通知人员purchase_notice_person列表
*
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
* @return 新购短信通知人员purchase_notice_person集合
*/
public List<PurchaseNoticePerson> selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson);
/**
* 新增新购短信通知人员purchase_notice_person
*
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
* @return 结果
*/
public int insertPurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson);
/**
* 修改新购短信通知人员purchase_notice_person
*
* @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
* @return 结果
*/
public int updatePurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson);
/**
* 批量删除新购短信通知人员purchase_notice_person
*
* @param ids 需要删除的新购短信通知人员purchase_notice_person主键集合
* @return 结果
*/
public int deletePurchaseNoticePersonByIds(Long[] ids);
/**
* 删除新购短信通知人员purchase_notice_person信息
*
* @param id 新购短信通知人员purchase_notice_person主键
* @return 结果
*/
public int deletePurchaseNoticePersonById(Long id);
}