Merge branch 'master' of http://192.168.0.56:3000/bonus/Bonus-Cloud-Material
This commit is contained in:
commit
ea1840925e
|
|
@ -0,0 +1,30 @@
|
|||
package com.bonus.common.biz.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @time : 2024-11-14 10:17
|
||||
* @Description: 维修任务整体状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum RepairTaskStatusEnum {
|
||||
|
||||
TASK_STATUS_PROCESSING(0, "维修管理--进行中"),
|
||||
TASK_STATUS_COMPLETE(1, "维修管理--已完成"),
|
||||
TASK_STATUS_REJECT(2, "维修管理--被驳回"),
|
||||
TASK_STATUS_TO_EXAM(3, "修饰审核--待审核"),
|
||||
TASK_STATUS_REVIEW(4, "修饰审核--审核通过"),
|
||||
TASK_STATUS_NO_REVIEW(5, "修饰审核--审核不通过"),
|
||||
SCRAP_UNDER_REVIEW(6, "报废审核--待审核");
|
||||
|
||||
private final Integer status;
|
||||
private final String statusName;
|
||||
|
||||
RepairTaskStatusEnum(Integer status, String statusName) {
|
||||
this.status = status;
|
||||
this.statusName = statusName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,18 @@
|
|||
package com.bonus.material.repair.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.repair.domain.RepairPart;
|
||||
import com.bonus.material.repair.domain.RepairRecord;
|
||||
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapAudit;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
|
|
@ -27,16 +33,104 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 修试审核详细Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
* @author syruan
|
||||
*/
|
||||
@Api(tags = "修试审核详细接口")
|
||||
@RestController
|
||||
@RequestMapping("/repair_audit_details")
|
||||
public class RepairAuditDetailsController extends BaseController {
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private IRepairAuditDetailsService repairAuditDetailsService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询修试审核任务列表
|
||||
*/
|
||||
@ApiOperation("查询修试审核任务列表")
|
||||
@GetMapping("/questList")
|
||||
@RequiresPermissions("service:auditing:list")
|
||||
public TableDataInfo questList(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
Map<String, Object> params = repairAuditDetails.getParams();
|
||||
if (params != null && !params.isEmpty()) {
|
||||
String beginTime = (String) params.get("beginTime");
|
||||
String endTime = (String) params.get("endTime");
|
||||
params.put("beginTime", beginTime + " 00:00:00");
|
||||
params.put("endTime", endTime + " 23:59:59");
|
||||
repairAuditDetails.setParams(params);
|
||||
}
|
||||
List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出修试审核任务列表
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void exportAudit(HttpServletResponse response, RepairAuditDetails bean) {
|
||||
Map<String, Object> params = bean.getParams();
|
||||
if (!params.isEmpty()) {
|
||||
String beginTime = (String) params.get("beginTime");
|
||||
String endTime = (String) params.get("endTime");
|
||||
params.put("beginTime", beginTime + " 00:00:00");
|
||||
params.put("endTime", endTime + " 23:59:59");
|
||||
bean.setParams(params);
|
||||
}
|
||||
List<RepairAuditDetailsVO> list = repairAuditDetailsService.exportRepairQuestList(bean);
|
||||
ExcelUtil<RepairAuditDetailsVO> util = new ExcelUtil<>(RepairAuditDetailsVO.class);
|
||||
util.exportExcel(response, list, "修试审核任务列表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看修饰审核任务详细列表
|
||||
*/
|
||||
@ApiOperation("查看修饰审核任务详细列表")
|
||||
@GetMapping("/getRepairAuditList")
|
||||
@RequiresPermissions("service:auditing")
|
||||
public TableDataInfo getRepairAuditList(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
List<RepairAuditDetails> list = repairAuditDetailsService.getRepairAuditList(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看维修记录
|
||||
*/
|
||||
@ApiOperation("查看维修记录")
|
||||
@GetMapping("/getRepairRecord")
|
||||
public TableDataInfo getRepairRecord(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
List<RepairRecord> list = repairAuditDetailsService.getRepairRecord(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看配件记录
|
||||
*/
|
||||
@ApiOperation("查看配件记录")
|
||||
@GetMapping("/getPartRecord")
|
||||
public TableDataInfo getPartRecord(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
List<RepairPart> list = repairAuditDetailsService.getPartRecord(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修饰任务审核
|
||||
*/
|
||||
@ApiOperation("修饰任务审核")
|
||||
@PostMapping("/audit")
|
||||
public AjaxResult audit(@RequestBody ScrapAudit scrapAudit) throws Exception {
|
||||
return toAjax(repairAuditDetailsService.auditRepair(scrapAudit));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------TOP--COPY--------------------------BUTTON--GENDER---------------
|
||||
|
||||
|
||||
/**
|
||||
* 查询修试审核详细列表
|
||||
*/
|
||||
|
|
@ -56,7 +150,7 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("repair:details:export")
|
||||
@SysLog(title = "修试审核详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出修试审核详细")
|
||||
@PostMapping("/export")
|
||||
@PostMapping("/exportEasyExcel")
|
||||
public void export(HttpServletResponse response, RepairAuditDetails repairAuditDetails) {
|
||||
List<RepairAuditDetails> list = repairAuditDetailsService.selectRepairAuditDetailsList(repairAuditDetails);
|
||||
ExcelUtil<RepairAuditDetails> util = new ExcelUtil<RepairAuditDetails>(RepairAuditDetails.class);
|
||||
|
|
|
|||
|
|
@ -5,21 +5,21 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 修试审核详细对象 repair_audit_details
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
* @author syruan
|
||||
*/
|
||||
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@ToString
|
||||
public class RepairAuditDetails extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final long serialVersionUID = -8752731235584328836L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
|
@ -47,17 +47,17 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
/** 维修总量 */
|
||||
@Excel(name = "维修总量")
|
||||
@ApiModelProperty(value = "维修总量")
|
||||
private Long repairNum;
|
||||
private Integer repairNum;
|
||||
|
||||
/** 维修合格数量 */
|
||||
@Excel(name = "维修合格数量")
|
||||
@ApiModelProperty(value = "维修合格数量")
|
||||
private Long repairedNum;
|
||||
private Integer repairedNum;
|
||||
|
||||
/** 维修报废数量 */
|
||||
@Excel(name = "维修报废数量")
|
||||
@ApiModelProperty(value = "维修报废数量")
|
||||
private Long scrapNum;
|
||||
private Integer scrapNum;
|
||||
|
||||
/** 审核人 */
|
||||
@Excel(name = "审核人")
|
||||
|
|
@ -71,8 +71,8 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
private Date auditTime;
|
||||
|
||||
/** 备注备注 */
|
||||
@Excel(name = "备注备注")
|
||||
@ApiModelProperty(value = "备注备注")
|
||||
@Excel(name = "审核备注")
|
||||
@ApiModelProperty(value = "审核备注")
|
||||
private String auditRemark;
|
||||
|
||||
/** 0未审核1已审核2驳回 */
|
||||
|
|
@ -83,7 +83,22 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
/** 数据所属组织 */
|
||||
@Excel(name = "数据所属组织")
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
private Integer companyId;
|
||||
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
/**传入参数*/
|
||||
@ApiModelProperty(value = "单位id")
|
||||
private Integer backUnit;
|
||||
@ApiModelProperty(value = "工程id")
|
||||
private Integer backPro;
|
||||
@ApiModelProperty(value = "工机具类型id")
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "维修单号")
|
||||
private String backCode;
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyword;
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ public class RepairInputDetails extends BaseEntity {
|
|||
/** 维修合格数量 */
|
||||
@Excel(name = "维修合格数量")
|
||||
@ApiModelProperty(value = "维修合格数量")
|
||||
private Long repairNum;
|
||||
private Integer repairNum;
|
||||
|
||||
/** 入库数量 */
|
||||
@Excel(name = "入库数量")
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private Long inputNum;
|
||||
private Integer inputNum;
|
||||
|
||||
/** 0未审核,1已入库,2驳回 */
|
||||
@Excel(name = "0未审核,1已入库,2驳回")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
package com.bonus.material.repair.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author syruan
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="维修配件")
|
||||
public class RepairPart {
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private String taskId;
|
||||
/**
|
||||
* 机具ID
|
||||
*/
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private String maId;
|
||||
/**
|
||||
* 规格ID
|
||||
*/
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private String typeId;
|
||||
/**
|
||||
* 配件ID
|
||||
*/
|
||||
@ApiModelProperty(value = "配件ID")
|
||||
private Long partId;
|
||||
/**
|
||||
* 配件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "配件名称")
|
||||
private String partName;
|
||||
/**
|
||||
* 返厂id
|
||||
*/
|
||||
@ApiModelProperty(value = "返厂id")
|
||||
private String supplierId;
|
||||
/**
|
||||
* 配件数量
|
||||
*/
|
||||
@ApiModelProperty(value = "配件数量")
|
||||
private int partNum;
|
||||
/**
|
||||
* 配件费用
|
||||
*/
|
||||
@ApiModelProperty(value = "配件费用")
|
||||
private BigDecimal partCost;
|
||||
/**
|
||||
* 配件单价
|
||||
*/
|
||||
@ApiModelProperty(value = "配件单价")
|
||||
private BigDecimal partPrice;
|
||||
/**
|
||||
* 类型(0不收费,1收费)
|
||||
*/
|
||||
@ApiModelProperty(value = "类型(0不收费,1收费)")
|
||||
private String partType;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private Long createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createTime;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private String updateTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 维修内容
|
||||
*/
|
||||
@ApiModelProperty(value = "维修内容")
|
||||
private String repairContent;
|
||||
|
||||
private Long companyId;
|
||||
|
||||
private Long repairer;
|
||||
|
||||
@ApiModelProperty(value = "维修数量")
|
||||
private int repairNum;
|
||||
}
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
package com.bonus.material.repair.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author syruan
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="维修任务详细")
|
||||
public class RepairRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private String taskId;
|
||||
/**
|
||||
* 机具ID
|
||||
*/
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private String maId;
|
||||
/**
|
||||
* 规格ID
|
||||
*/
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private String typeId;
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
@ApiModelProperty(value = "维修数量")
|
||||
private int repairNum;
|
||||
/**
|
||||
* 报废数量
|
||||
*/
|
||||
@ApiModelProperty(value = "报废数量")
|
||||
private int scrapNum;
|
||||
/**
|
||||
* 维修方式(1内部2返厂3报废)
|
||||
*/
|
||||
@ApiModelProperty(value = "维修方式(1内部2返厂3报废)")
|
||||
private String repairType;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private Long createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createTime;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private String updateTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 报废原因
|
||||
*/
|
||||
@ApiModelProperty(value = "报废原因")
|
||||
private String scrapReason;
|
||||
/**
|
||||
* 报废类型(0:自然报废,1任务报废)
|
||||
*/
|
||||
@ApiModelProperty(value = "报废类型(0:自然报废,1任务报废)")
|
||||
private String scrapType;
|
||||
/**
|
||||
* 返厂id
|
||||
*/
|
||||
@ApiModelProperty(value = "返厂id")
|
||||
private String supplierId;
|
||||
/**
|
||||
* 返厂名称
|
||||
*/
|
||||
@ApiModelProperty(value = "返厂名称")
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 维修内容
|
||||
*/
|
||||
@ApiModelProperty(value = "维修内容")
|
||||
private String repairContent;
|
||||
/**
|
||||
* 类型(0不收费,1收费)
|
||||
*/
|
||||
@ApiModelProperty(value = "类型(0不收费,1收费)")
|
||||
private String partType;
|
||||
|
||||
/**
|
||||
* 维修人
|
||||
*/
|
||||
@ApiModelProperty(value = "维修人")
|
||||
private String repairer;
|
||||
private String partStrList;
|
||||
private Long companyId;
|
||||
/**
|
||||
* 损坏照片id
|
||||
*/
|
||||
@ApiModelProperty(value = "损坏照片id")
|
||||
private String fileIds;
|
||||
|
||||
/**
|
||||
* 维修单号
|
||||
*/
|
||||
@Excel(name = "维修单号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 机具类型
|
||||
*/
|
||||
@Excel(name = "机具类型")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
/**
|
||||
* 配件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "配件名称")
|
||||
@Excel(name = "配件名称")
|
||||
private String partName;
|
||||
|
||||
/**
|
||||
* 配件数量
|
||||
*/
|
||||
@ApiModelProperty(value = "配件数量")
|
||||
@Excel(name = "配件数量",cellType = Excel.ColumnType.NUMERIC)
|
||||
private int partNum;
|
||||
|
||||
/**
|
||||
* 配件单价
|
||||
*/
|
||||
@ApiModelProperty(value = "配件单价")
|
||||
@Excel(name = "配件单价")
|
||||
private String partPrice;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
@Excel(name = "退料工程")
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
@Excel(name = "退料单位")
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
/**
|
||||
* unitId
|
||||
*/
|
||||
@ApiModelProperty(value = "unitId")
|
||||
private Integer unitId;
|
||||
|
||||
/**
|
||||
* proId
|
||||
*/
|
||||
@ApiModelProperty(value = "proId")
|
||||
private Integer proId;
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package com.bonus.material.repair.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author 阮世耀
|
||||
* @Create 2023/12/13 15:45
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class RepairAuditDetailsVO {
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 报废单号
|
||||
*/
|
||||
@Excel(name = "修饰审核单号",sort = 1)
|
||||
private String scrapNum;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@Excel(name = "单位名称",sort = 2)
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称",sort = 3)
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 任务创建人
|
||||
*/
|
||||
@Excel(name = "任务创建人",sort = 4)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 机具类型
|
||||
*/
|
||||
private String itemType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "任务创建时间",sort = 5)
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 维修单号
|
||||
*/
|
||||
@Excel(name = "维修单号",sort = 6)
|
||||
private String repairNum;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer taskStatus;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@Excel(name = "审核状态",sort = 7)
|
||||
private String taskStatusName;
|
||||
|
||||
/**
|
||||
* 不通过原因
|
||||
*/
|
||||
@Excel(name = "不通过原因",sort = 8)
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 机具类型
|
||||
*/
|
||||
@Excel(name = "机具类型",sort = 9)
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@Excel(name = "规格型号",sort = 10)
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "机具编号")
|
||||
@Excel(name = "机具编号",sort = 11)
|
||||
private String maCode;
|
||||
|
||||
/** 维修总量 */
|
||||
@Excel(name = "维修总量")
|
||||
private Integer repairNum2;
|
||||
|
||||
/** 维修数量 */
|
||||
@Excel(name = "维修数量")
|
||||
private Integer repairedNum2;
|
||||
|
||||
/** 报废数量 */
|
||||
@Excel(name = "报废数量")
|
||||
private Integer scrapNum2;
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
package com.bonus.material.repair.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.material.scrap.domain.ScrapAuditorSet;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 阮世耀
|
||||
* @Create 2023/12/13 15:45
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ScrapApplyDetailsVO {
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 报废审核单号
|
||||
*/
|
||||
@Excel(name = "报废审核单号",sort = 1)
|
||||
private String scrapNum;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@Excel(name = "单位名称",sort = 2)
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称",sort = 3)
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
@ApiModelProperty(value = "班组名称")
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 任务创建人
|
||||
*/
|
||||
@Excel(name = "任务创建人",sort = 4)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 机具类型
|
||||
*/
|
||||
private String itemType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "任务创建时间",sort = 5)
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 维修单号
|
||||
*/
|
||||
@Excel(name = "维修单号",sort = 6)
|
||||
private String repairNum;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer taskStatus;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@Excel(name = "审核状态",sort = 7)
|
||||
private String taskStatusName;
|
||||
|
||||
/**
|
||||
* 不通过原因
|
||||
*/
|
||||
@Excel(name = "不通过原因",sort = 8)
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 机具类型
|
||||
*/
|
||||
@Excel(name = "机具类型",sort = 9)
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@Excel(name = "规格型号",sort = 10)
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "机具编号")
|
||||
@Excel(name = "机具编号",sort = 11)
|
||||
private String maCode;
|
||||
|
||||
|
||||
/** 报废数量 */
|
||||
@Excel(name = "报废数量")
|
||||
private Integer scrapNum2;
|
||||
|
||||
|
||||
/**
|
||||
* 报废来源
|
||||
*/
|
||||
private Integer scrapSource;
|
||||
|
||||
/**
|
||||
*退料单号
|
||||
*/
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 审核部门列表
|
||||
*/
|
||||
private List<ScrapAuditorSet> scrapAuditorSetList;
|
||||
|
||||
/**
|
||||
* 处置
|
||||
*/
|
||||
private Integer disposition;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String dispositionFileUrl;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String dispositionFileName;
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.bonus.material.repair.domain.vo;
|
||||
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.scrap.domain.ScrapApplyDetails;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ScrapAudit {
|
||||
|
||||
@ApiModelProperty(value = "通过,不通过")
|
||||
private String checkResult;
|
||||
|
||||
@ApiModelProperty(value = "审核任务id")
|
||||
private List<Long> taskIdList;
|
||||
|
||||
@ApiModelProperty(value = "不通过原因")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "审核任务明细")
|
||||
private List<RepairAuditDetails> auditDetailList;
|
||||
|
||||
@ApiModelProperty(value = "报废任务明细")
|
||||
private List<ScrapApplyDetails> scrapDetailList;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty(value = "审核部门列表id")
|
||||
private List<Integer> deptIds;
|
||||
|
||||
@ApiModelProperty(value = "组织id")
|
||||
private Integer companyId;
|
||||
|
||||
@ApiModelProperty(value = "处置情况")
|
||||
private Integer disposition;
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,11 @@ package com.bonus.material.repair.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.repair.domain.RepairPart;
|
||||
import com.bonus.material.repair.domain.RepairRecord;
|
||||
import com.bonus.material.repair.domain.RepairTaskDetails;
|
||||
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||
|
||||
/**
|
||||
* 修试审核详细Mapper接口
|
||||
|
|
@ -10,6 +15,18 @@ import com.bonus.material.repair.domain.RepairAuditDetails;
|
|||
* @date 2024-10-16
|
||||
*/
|
||||
public interface RepairAuditDetailsMapper {
|
||||
|
||||
RepairAuditDetails getRepairId(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
List<RepairPart> getPartRecord(RepairAuditDetails bean);
|
||||
|
||||
List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
List<RepairAuditDetailsVO> exportRepairQuestList(RepairAuditDetails bean);
|
||||
|
||||
/**
|
||||
* 查询修试审核详细
|
||||
*
|
||||
|
|
@ -57,4 +74,28 @@ public interface RepairAuditDetailsMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteRepairAuditDetailsByIds(Long[] ids);
|
||||
|
||||
List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
String selectTypeNameByTaskId(Long taskId);
|
||||
|
||||
List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);
|
||||
|
||||
List<RepairAuditDetails> selectnotAuditByTaskId(Long taskId);
|
||||
|
||||
List<RepairAuditDetails> selectRepairInputByTaskId(Long taskId);
|
||||
|
||||
List<RepairAuditDetails> selectScrapNumByTaskId(Long taskId);
|
||||
|
||||
void updateStatus(RepairAuditDetails bean);
|
||||
|
||||
void updateRepairCost(RepairAuditDetails inputDetails, String status);
|
||||
|
||||
void insertRepairDetails(RepairTaskDetails repairTaskDetails);
|
||||
|
||||
Long getBackId(Long repairId);
|
||||
|
||||
List<String> getRepairApplyRecordId(Long repairId);
|
||||
|
||||
void updateRecodeStatus(String id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@ package com.bonus.material.repair.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.repair.domain.RepairPart;
|
||||
import com.bonus.material.repair.domain.RepairRecord;
|
||||
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapAudit;
|
||||
|
||||
/**
|
||||
* 修试审核详细Service接口
|
||||
|
|
@ -18,6 +23,32 @@ public interface IRepairAuditDetailsService {
|
|||
*/
|
||||
public RepairAuditDetails selectRepairAuditDetailsById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询修试审核任务列表
|
||||
*/
|
||||
List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 导出修试审核任务列表
|
||||
*/
|
||||
List<RepairAuditDetailsVO> exportRepairQuestList(RepairAuditDetails bean);
|
||||
|
||||
/**
|
||||
* 查看修饰审核任务详细列表
|
||||
*/
|
||||
List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
List<RepairPart> getPartRecord(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 修饰任务审核
|
||||
*/
|
||||
int auditRepair(ScrapAudit scrapAudit) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 查询修试审核详细列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,13 +1,34 @@
|
|||
package com.bonus.material.repair.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.biz.enums.RepairTaskStatusEnum;
|
||||
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.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.repair.domain.*;
|
||||
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapAudit;
|
||||
import com.bonus.material.repair.mapper.RepairInputDetailsMapper;
|
||||
import com.bonus.material.scrap.domain.ScrapApplyDetails;
|
||||
import com.bonus.material.scrap.mapper.ScrapApplyDetailsMapper;
|
||||
import com.bonus.material.task.domain.TmTaskAgreement;
|
||||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.repair.mapper.RepairAuditDetailsMapper;
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.repair.service.IRepairAuditDetailsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 修试审核详细Service业务层处理
|
||||
|
|
@ -17,9 +38,318 @@ import com.bonus.material.repair.service.IRepairAuditDetailsService;
|
|||
*/
|
||||
@Service
|
||||
public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService {
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private RepairAuditDetailsMapper repairAuditDetailsMapper;
|
||||
|
||||
@Resource
|
||||
private TmTaskMapper taskMapper;
|
||||
|
||||
@Resource
|
||||
private TmTaskAgreementMapper agreementMapper;
|
||||
|
||||
@Resource
|
||||
private ScrapApplyDetailsMapper scrapApplyDetailsMapper;
|
||||
|
||||
// @Resource
|
||||
// private RepairTestInputMapper repairTestInputMapper;
|
||||
|
||||
@Resource
|
||||
private RepairInputDetailsMapper repairInputDetailsMapper;
|
||||
|
||||
@Override
|
||||
public List<RepairPart> getPartRecord(RepairAuditDetails repairAuditDetails) {
|
||||
RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
|
||||
return repairAuditDetailsMapper.getPartRecord(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails) {
|
||||
RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
|
||||
List<RepairRecord> list = repairAuditDetailsMapper.getRepairRecord(bean);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param repairAuditDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails) {
|
||||
List<RepairAuditDetails> repairAuditDetailsList = repairAuditDetailsMapper.selectRepairAuditDetailsList(repairAuditDetails);
|
||||
return repairAuditDetailsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairAuditDetailsVO> exportRepairQuestList(RepairAuditDetails bean) {
|
||||
return repairAuditDetailsMapper.exportRepairQuestList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询试验审核列表
|
||||
*
|
||||
* @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 scrapAudit 审核信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int auditRepair(ScrapAudit scrapAudit) throws Exception {
|
||||
String checkResult = scrapAudit.getCheckResult();
|
||||
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
|
||||
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
||||
Integer b = 0;
|
||||
for (Long taskId : taskIdList) {
|
||||
String status = "0";
|
||||
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
||||
if (task1.getTaskStatus() == 47) {
|
||||
throw new Exception("任务已审核已通过");
|
||||
}
|
||||
|
||||
List<RepairAuditDetails> auditAllList = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(taskId);
|
||||
List<RepairAuditDetails> notAuditList = repairAuditDetailsMapper.selectnotAuditByTaskId(taskId);
|
||||
// 查询协议表
|
||||
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
|
||||
String taskCode = "";
|
||||
int taskStatus = 0;
|
||||
int taskType = 0;
|
||||
int companyId = 0;
|
||||
if ("通过".equals(checkResult)) {
|
||||
status = "1";
|
||||
List<RepairAuditDetails> repairInputList = new ArrayList<>();
|
||||
List<RepairAuditDetails> scrapNumList = new ArrayList<>();
|
||||
if (auditDetailList != null && auditDetailList.size() > 0) {
|
||||
for (RepairAuditDetails bean : auditDetailList) {
|
||||
if (bean.getRepairedNum().compareTo(b) > 0) {
|
||||
repairInputList.add(bean);
|
||||
}
|
||||
if (bean.getScrapNum().compareTo(b) > 0) {
|
||||
scrapNumList.add(bean);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
repairInputList = repairAuditDetailsMapper.selectRepairInputByTaskId(taskId);
|
||||
//获取维修报废列表
|
||||
scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
|
||||
}
|
||||
|
||||
if (repairInputList != null && repairInputList.size() > 0) {
|
||||
if (repairInputList.get(0).getCompanyId() != null) {
|
||||
companyId = repairInputList.get(0).getCompanyId();
|
||||
}
|
||||
|
||||
taskCode = purchaseCodeRule("R", 50);
|
||||
taskStatus = 53;
|
||||
taskType = 50;
|
||||
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
for (RepairAuditDetails inputDetails : repairInputList) {
|
||||
Long typeId = inputDetails.getTypeId();
|
||||
Long maId = inputDetails.getMaId();
|
||||
Integer repairNum = inputDetails.getRepairedNum();
|
||||
// 创建修饰后入库任务
|
||||
if (repairNum.compareTo(b) > 0) {
|
||||
// 添加修试后入库任务
|
||||
RepairInputDetails repairInputDetails = new RepairInputDetails();
|
||||
repairInputDetails.setTaskId(inputTaskId);
|
||||
repairInputDetails.setAuditId(inputDetails.getId());
|
||||
repairInputDetails.setRepairId(inputDetails.getRepairId());
|
||||
repairInputDetails.setRepairNum(inputDetails.getRepairedNum());
|
||||
repairInputDetails.setTypeId(inputDetails.getTypeId());
|
||||
repairInputDetails.setMaId(inputDetails.getMaId());
|
||||
repairInputDetails.setStatus("0");
|
||||
repairInputDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
repairInputDetails.setCreateTime(new Date());
|
||||
repairInputDetails.setCompanyId((long) companyId);
|
||||
repairInputDetailsMapper.insertRepairInputDetails(repairInputDetails);
|
||||
}
|
||||
repairAuditDetailsMapper.updateRepairCost(inputDetails,status);
|
||||
// 根据repairId找到taskId和 typeId 、maid
|
||||
List<String> repairApplyRecordId = repairAuditDetailsMapper.getRepairApplyRecordId(inputDetails.getRepairId());
|
||||
// 再去repair_apply_record 中查,并给一个标识表示审核完成
|
||||
for (String id : repairApplyRecordId) {
|
||||
repairAuditDetailsMapper.updateRecodeStatus(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (scrapNumList != null && scrapNumList.size() > 0) {
|
||||
if (scrapNumList.get(0).getCompanyId() != null) {
|
||||
companyId = scrapNumList.get(0).getCompanyId();
|
||||
}
|
||||
taskCode = purchaseCodeRule("BF", TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId());
|
||||
/*taskStatus = 58;
|
||||
taskType = 57;*/
|
||||
//创建报废任务
|
||||
long scrapTaskId = genTask(taskCode, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(), RepairTaskStatusEnum.SCRAP_UNDER_REVIEW.getStatus(), tmTaskAgreement, companyId);
|
||||
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
||||
RepairAuditDetails byRepairId = scrapApplyDetailsMapper.getByRepairId(String.valueOf(scrapDetails.getRepairId()));
|
||||
List<RepairRecord> repairRecord = scrapApplyDetailsMapper.getGyoupRepairRecord(byRepairId);
|
||||
Long typeId = scrapDetails.getTypeId();
|
||||
Long maId = scrapDetails.getMaId();
|
||||
// 创建报废任务
|
||||
Integer scrapNum = scrapDetails.getScrapNum();
|
||||
if (scrapNum.compareTo(b) > 0) {
|
||||
for (RepairRecord bean : repairRecord){
|
||||
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
||||
scrapApplyDetails.setTaskId(scrapTaskId);
|
||||
scrapApplyDetails.setTypeId(typeId);
|
||||
scrapApplyDetails.setMaId(maId);
|
||||
scrapApplyDetails.setScrapNum(bean.getScrapNum());
|
||||
scrapApplyDetails.setScrapType(bean.getScrapType());
|
||||
scrapApplyDetails.setScrapSource("2");
|
||||
scrapApplyDetails.setStatus("0");
|
||||
scrapApplyDetails.setParentId(scrapDetails.getId());
|
||||
scrapApplyDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
scrapApplyDetails.setCreateTime(new Date());
|
||||
scrapApplyDetails.setCompanyId((long) companyId);
|
||||
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 修饰审核通过时改修任务为已通过审核
|
||||
if (auditDetailList != null) {
|
||||
if (auditDetailList.size() == notAuditList.size()) {
|
||||
task1.setTaskStatus(47);
|
||||
}
|
||||
} else if (auditAllList != null) {
|
||||
if (auditAllList.size() == notAuditList.size()) {
|
||||
task1.setTaskStatus(47);
|
||||
}
|
||||
}
|
||||
task1.setUpdateTime(new Date());
|
||||
task1.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
taskMapper.updateTmTask(task1);
|
||||
} else {
|
||||
status = "2";
|
||||
List<RepairAuditDetails> repairDetailList = new ArrayList<>();
|
||||
if (auditDetailList != null && auditDetailList.size() > 0) {
|
||||
repairDetailList.addAll(auditDetailList);
|
||||
} else {
|
||||
repairDetailList.addAll(auditAllList);
|
||||
}
|
||||
if (repairDetailList.size() > 0) {
|
||||
if (repairDetailList.get(0).getCompanyId() != null) {
|
||||
companyId = repairDetailList.get(0).getCompanyId();
|
||||
}
|
||||
taskCode = purchaseCodeRule("WX", 41);
|
||||
taskStatus = 43;
|
||||
taskType = 41;
|
||||
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
for (RepairAuditDetails inputDetails : repairDetailList) {
|
||||
Long backId = repairAuditDetailsMapper.getBackId(inputDetails.getRepairId());
|
||||
/* 添加驳回后维修详细表数据*/
|
||||
RepairTaskDetails repairTaskDetails = new RepairTaskDetails();
|
||||
repairTaskDetails.setTaskId(String.valueOf(inputTaskId));
|
||||
repairTaskDetails.setMaId(String.valueOf(inputDetails.getMaId()));
|
||||
repairTaskDetails.setTypeId(String.valueOf(inputDetails.getTypeId()));
|
||||
Integer repairNum = inputDetails.getRepairNum();
|
||||
repairTaskDetails.setRepairNum(repairNum);
|
||||
repairTaskDetails.setStatus("0");
|
||||
repairTaskDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
repairTaskDetails.setCompanyId((long) companyId);
|
||||
// repairTaskDetails.setBackId(backId);
|
||||
repairAuditDetailsMapper.insertRepairDetails(repairTaskDetails);
|
||||
|
||||
repairAuditDetailsMapper.updateRepairCost(inputDetails,status);
|
||||
}
|
||||
}
|
||||
// 修饰审核任务不通过时
|
||||
TmTask tmTask = new TmTask();
|
||||
tmTask.setTaskId(taskId);
|
||||
tmTask.setRemark(scrapAudit.getRemark());
|
||||
if (repairDetailList.size() == notAuditList.size()) {
|
||||
tmTask.setTaskStatus(48);
|
||||
}
|
||||
tmTask.setUpdateTime(new Date());
|
||||
tmTask.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
taskMapper.updateTmTask(tmTask);
|
||||
}
|
||||
if (scrapAudit.getAuditDetailList() != null && scrapAudit.getAuditDetailList().size() > 0) {
|
||||
if (auditDetailList != null) {
|
||||
for (RepairAuditDetails bean : auditDetailList) {
|
||||
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid());
|
||||
bean.setStatus(status);
|
||||
bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
bean.setAuditRemark(scrapAudit.getRemark());
|
||||
repairAuditDetailsMapper.updateStatus(bean);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (auditAllList != null) {
|
||||
for (RepairAuditDetails bean : auditAllList) {
|
||||
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid());
|
||||
bean.setStatus(status);
|
||||
bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
bean.setAuditRemark(scrapAudit.getRemark());
|
||||
repairAuditDetailsMapper.updateStatus(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**采购单号编码生成规则*/
|
||||
private String purchaseCodeRule(String code, Integer taskType) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType);
|
||||
if (StringUtils.isNotEmpty(taskNum)){
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
}else {
|
||||
taskNum = "0001";
|
||||
}
|
||||
String codeNum = code + format + "-" + taskNum;
|
||||
return codeNum;
|
||||
}
|
||||
|
||||
private long genTask(String taskCode, int taskType, int taskStatus, TmTaskAgreement tmTaskAgreement, int companyId) {
|
||||
TmTask task = new TmTask();
|
||||
task.setCode(taskCode);
|
||||
task.setTaskStatus(taskStatus);
|
||||
task.setTaskType(taskType);
|
||||
task.setCompanyId((long) companyId);
|
||||
task.setCreateTime(new Date());
|
||||
task.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
taskMapper.insertTmTask(task);
|
||||
// 添加协议信息表
|
||||
TmTaskAgreement taskAgreement = new TmTaskAgreement();
|
||||
long taskId = task.getTaskId();
|
||||
taskAgreement.setTaskId(taskId);
|
||||
if (tmTaskAgreement.getAgreementId() == null) {
|
||||
throw new ServiceException("缺少协议数据");
|
||||
} else {
|
||||
taskAgreement.setAgreementId(tmTaskAgreement.getAgreementId());
|
||||
}
|
||||
taskAgreement.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
agreementMapper.insertTmTaskAgreement(taskAgreement);
|
||||
return taskId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询修试审核详细
|
||||
*
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class ScrapApplyDetails extends BaseEntity {
|
|||
/** 报废数量 */
|
||||
@Excel(name = "报废数量")
|
||||
@ApiModelProperty(value = "报废数量")
|
||||
private Long scrapNum;
|
||||
private Integer scrapNum;
|
||||
|
||||
/** (1退料2,维修审核,3盘点) */
|
||||
@Excel(name = "(1退料2,维修审核,3盘点)")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.bonus.material.scrap.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.repair.domain.RepairRecord;
|
||||
import com.bonus.material.scrap.domain.ScrapApplyDetails;
|
||||
|
||||
/**
|
||||
|
|
@ -57,4 +60,8 @@ public interface ScrapApplyDetailsMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteScrapApplyDetailsByIds(Long[] ids);
|
||||
|
||||
RepairAuditDetails getByRepairId(String s);
|
||||
|
||||
List<RepairRecord> getGyoupRepairRecord(RepairAuditDetails byRepairId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.task.domain;
|
|||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
|
|
@ -16,9 +17,11 @@ import java.util.Date;
|
|||
*/
|
||||
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@ToString
|
||||
public class TmTaskAgreement extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 任务ID */
|
||||
|
|
@ -38,4 +41,8 @@ public class TmTaskAgreement extends BaseEntity {
|
|||
this.taskId = taskId;
|
||||
this.agreementId = agreementId;
|
||||
}
|
||||
|
||||
public TmTaskAgreement() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.task.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -85,6 +86,15 @@ public interface TmTaskMapper {
|
|||
|
||||
int deleteTmTaskByPurchaseIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取任务编号
|
||||
*
|
||||
* @param nowDate
|
||||
* @param taskType
|
||||
* @return
|
||||
*/
|
||||
String selectTaskNumByMonths(Date nowDate, Integer taskType);
|
||||
|
||||
// List<TmTaskRequestVo> getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||
//
|
||||
// List<TmTaskRequestVo> getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||
|
|
|
|||
|
|
@ -50,6 +50,125 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getRepairId" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
||||
select task_id as taskId,
|
||||
ma_id as maId,
|
||||
type_id as typeId
|
||||
from repair_apply_details
|
||||
where id = #{repairId}
|
||||
</select>
|
||||
|
||||
<select id="getPartRecord" resultType="com.bonus.material.repair.domain.RepairPart">
|
||||
select concat(mpt2.pa_name,'-',mpt1.pa_name,'-',mpt.pa_name) as partName,
|
||||
rpd.part_num as partNum,
|
||||
rpd.part_cost as partCost,
|
||||
rpd.part_type as partType,
|
||||
rpd.remark as remark,
|
||||
rpd.repair_content as repairContent
|
||||
from repair_part_details rpd
|
||||
left join ma_part_type mpt on mpt.pa_id = rpd.part_id
|
||||
left join ma_part_type mpt1 on mpt1.pa_id = mpt.parent_id
|
||||
left join ma_part_type mpt2 on mpt2.pa_id = mpt1.parent_id
|
||||
where 1=1
|
||||
<if test="taskId != null and taskId != ''">
|
||||
and rpd.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
and rpd.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and rpd.type_id = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="exportRepairQuestList" resultType="com.bonus.material.repair.domain.vo.RepairAuditDetailsVO">
|
||||
SELECT DISTINCT
|
||||
tk.task_id taskId,
|
||||
tk.CODE scrapNum,
|
||||
tk.task_status taskStatus,
|
||||
bui.unit_name unitName,
|
||||
bpl.pro_name projectName,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
tk.CODE repairNum,
|
||||
mt1.type_name as type,
|
||||
mt.type_name as typeName,
|
||||
mma.ma_code as maCode,
|
||||
rad.repair_num as repairNum2,
|
||||
rad.repaired_num as repairedNum2,
|
||||
rad.scrap_num as scrapNum2
|
||||
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 bpl ON bai.project_id = bpl.pro_id
|
||||
LEFT JOIN bm_unit bui ON bai.unit_id = bui.unit_id
|
||||
LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id
|
||||
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
|
||||
LEFT JOIN sys_user su ON su.user_id = tk.create_by
|
||||
WHERE
|
||||
tk.task_type = 45
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
or locate(#{keyword}, bui.unit_name) > 0
|
||||
or locate(#{keyword}, bpl.pro_name) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
and bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">
|
||||
and tk.task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
and bpl.pro_id = #{backPro}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and mt1.type_id = #{type}
|
||||
</if>
|
||||
<if test="backCode != null and backCode != ''">
|
||||
and locate(#{backCode}, tk.code) > 0
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
||||
and tk.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
ORDER BY
|
||||
tk.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getRepairRecord" resultType="com.bonus.material.repair.domain.RepairRecord">
|
||||
select repair_num as repairNum,
|
||||
scrap_num as scrapNum,
|
||||
repair_type as repairType,
|
||||
scrap_reason as scrapReason,
|
||||
scrap_type as scrapType,
|
||||
msi.supplier as supplier,
|
||||
part_num as partNum,
|
||||
part_price as partPrice,
|
||||
repair_content as repairContent,
|
||||
part_type as partType,
|
||||
part_name as partName,
|
||||
file_ids as fileIds,
|
||||
su.nick_name as repairer,
|
||||
rar.remark
|
||||
from repair_apply_record rar
|
||||
left join ma_supplier_info msi on msi.supplier_id = rar.supplier_id
|
||||
left join sys_user su on su.user_id = rar.repairer
|
||||
where 1=1
|
||||
<if test="taskId != null and taskId != ''">
|
||||
and rar.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
and rar.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and rar.type_id = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertRepairAuditDetails" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into repair_audit_details
|
||||
|
|
@ -127,4 +246,190 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectRepairQuestList" resultType="com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO">
|
||||
SELECT DISTINCT
|
||||
tk.task_id taskId,
|
||||
tk.CODE scrapNum,
|
||||
tk.task_status taskStatus,
|
||||
bui.unit_name unitName,
|
||||
bpl.pro_name projectName,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
tk.CODE repairNum
|
||||
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 bpl ON bai.project_id = bpl.pro_id
|
||||
LEFT JOIN bm_unit bui ON bai.unit_id = bui.unit_id
|
||||
LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id
|
||||
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 sys_user su ON su.user_id = tk.create_by
|
||||
WHERE
|
||||
tk.task_type = 45
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
or locate(#{keyword}, bui.unit_name) > 0
|
||||
or locate(#{keyword}, bpl.pro_name) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
and bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">
|
||||
and tk.task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
and bpl.pro_id = #{backPro}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and mt1.type_id = #{type}
|
||||
</if>
|
||||
<if test="backCode != null and backCode != ''">
|
||||
and locate(#{backCode}, tk.code) > 0
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
||||
and tk.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
order by tk.create_time desc
|
||||
</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>
|
||||
|
||||
<select id="selectRepairAuditDetailsByTaskId" resultMap="RepairAuditDetailsResult">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<select id="selectnotAuditByTaskId" resultMap="RepairAuditDetailsResult">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId} and rd.STATUS = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectRepairInputByTaskId" resultMap="RepairAuditDetailsResult">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId} and repaired_num > 0
|
||||
</select>
|
||||
|
||||
<select id="selectScrapNumByTaskId" resultMap="RepairAuditDetailsResult">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId} and scrap_num > 0
|
||||
</select>
|
||||
|
||||
<update id="updateStatus">
|
||||
update repair_audit_details
|
||||
set audit_by = #{auditBy},
|
||||
audit_time = now(),
|
||||
status = #{status},
|
||||
update_by = #{updateBy},
|
||||
update_time = now(),
|
||||
audit_remark = #{auditRemark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateRepairCost">
|
||||
update repair_cost
|
||||
set part_type = #{status}
|
||||
where repair_id = #{inputDetails.repairId}
|
||||
</update>
|
||||
|
||||
<insert id="insertRepairDetails">
|
||||
insert into repair_apply_details
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_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="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
<if test="backId != null">
|
||||
back_id,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="repairNum != null">
|
||||
#{repairNum},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
<if test="backId != null">
|
||||
#{backId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="getBackId" resultType="java.lang.Long">
|
||||
select back_id
|
||||
from repair_apply_details
|
||||
where id = #{repairId}
|
||||
</select>
|
||||
|
||||
<select id="getRepairApplyRecordId" resultType="java.lang.String">
|
||||
SELECT DISTINCT
|
||||
rar.id
|
||||
FROM
|
||||
repair_apply_record rar
|
||||
LEFT JOIN repair_cost rc ON rar.task_id = rc.task_id
|
||||
AND rar.type_id = rc.type_id
|
||||
AND ( rar.ma_id = rc.ma_id OR rar.ma_id IS NULL )
|
||||
WHERE
|
||||
rc.repair_id = #{repairId}
|
||||
</select>
|
||||
|
||||
<update id="updateRecodeStatus">
|
||||
update repair_apply_record set status = 1,update_time = now() where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -27,7 +27,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectScrapApplyDetailsVo">
|
||||
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, company_id, file_name, file_url 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, company_id, file_name, file_url
|
||||
from scrap_apply_details
|
||||
</sql>
|
||||
|
||||
<select id="selectScrapApplyDetailsList" parameterType="com.bonus.material.scrap.domain.ScrapApplyDetails" resultMap="ScrapApplyDetailsResult">
|
||||
|
|
@ -137,4 +139,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getByRepairId" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
||||
select task_id as taskId,
|
||||
ma_id as maId,
|
||||
type_id as typeId
|
||||
from repair_apply_details
|
||||
where id = #{repairId}
|
||||
</select>
|
||||
|
||||
<select id="getGyoupRepairRecord" resultType="com.bonus.material.repair.domain.RepairRecord">
|
||||
select sum(scrap_num) as scrapNum,
|
||||
scrap_reason as scrapReason,
|
||||
scrap_type as scrapType,
|
||||
file_ids as fileIds
|
||||
from repair_apply_record rar
|
||||
where repair_type = '3'
|
||||
<if test="taskId != null and taskId != ''">
|
||||
and rar.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
and rar.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and rar.type_id = #{typeId}
|
||||
</if>
|
||||
group by scrap_type
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -129,7 +129,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</delete>
|
||||
|
||||
<!-- <select id="getAuditListByLeaseTmTask" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">-->
|
||||
<select id="selectTaskNumByMonths" resultType="java.lang.String">
|
||||
SELECT SUBSTRING(`code`, - 4) as code
|
||||
FROM tm_task
|
||||
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||
AND task_type = #{taskType}
|
||||
ORDER BY create_time DESC LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- <select id="getAuditListByLeaseTmTask" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">-->
|
||||
<!-- SELECT DISTINCT-->
|
||||
<!-- tt.task_id as taskId, tt.task_type as taskType, tt.task_status as taskStatus, tt.status, tt.code,-->
|
||||
<!-- su.phonenumber AS phoneNumber, sd.dept_name as deptName,-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue