后台维修代码提交
This commit is contained in:
parent
b49dcb447d
commit
48008bcf69
|
|
@ -53,7 +53,7 @@ public class RepairController extends BaseController {
|
||||||
@ApiOperation(value = "获取维修任务机具列表")
|
@ApiOperation(value = "获取维修任务机具列表")
|
||||||
@Log(title = "维修任务机具列表", businessType = BusinessType.QUERY)
|
@Log(title = "维修任务机具列表", businessType = BusinessType.QUERY)
|
||||||
@GetMapping("/getRepairMaTypeList")
|
@GetMapping("/getRepairMaTypeList")
|
||||||
public TableDataInfo getRepairMaTypeList(RepairTask bean)
|
public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
|
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.bonus.sgzb.base.domain;
|
package com.bonus.sgzb.base.domain;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,7 +14,8 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(value="维修任务详细")
|
@ApiModel(value="维修任务详细")
|
||||||
public class RepairApplyRecord {
|
public class RepairApplyRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 任务ID
|
* 任务ID
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,7 @@ public interface RepairMapper {
|
||||||
|
|
||||||
List<RepairTask> getRepairTaskList(RepairTask bean);
|
List<RepairTask> getRepairTaskList(RepairTask bean);
|
||||||
|
|
||||||
List<RepairTaskDetails> getRepairMaTypeList(RepairTask bean);
|
List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean);
|
||||||
|
|
||||||
List<String> getTypeList(String taskId);
|
|
||||||
|
|
||||||
String getType(String typeId);
|
|
||||||
|
|
||||||
|
|
||||||
int addRecord(RepairApplyRecord bean);
|
int addRecord(RepairApplyRecord bean);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public interface RepairService {
|
||||||
List<RepairTask> getRepairTaskList(RepairTask bean);
|
List<RepairTask> getRepairTaskList(RepairTask bean);
|
||||||
|
|
||||||
|
|
||||||
List<RepairTaskDetails> getRepairMaTypeList(RepairTask bean);
|
List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean);
|
||||||
|
|
||||||
AjaxResult submitRepairApply(RepairApplyRecord bean);
|
AjaxResult submitRepairApply(RepairApplyRecord bean);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class RepairServiceImpl implements RepairService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RepairTaskDetails> getRepairMaTypeList(RepairTask bean) {
|
public List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean) {
|
||||||
List<RepairTaskDetails> repairMaTypeList = mapper.getRepairMaTypeList(bean);
|
List<RepairTaskDetails> repairMaTypeList = mapper.getRepairMaTypeList(bean);
|
||||||
return repairMaTypeList;
|
return repairMaTypeList;
|
||||||
}
|
}
|
||||||
|
|
@ -128,6 +128,9 @@ public class RepairServiceImpl implements RepairService {
|
||||||
if (repairedNum <= 0){
|
if (repairedNum <= 0){
|
||||||
return AjaxResult.error("选中的数据中包含待维修数量为0的机具,请重新选择");
|
return AjaxResult.error("选中的数据中包含待维修数量为0的机具,请重新选择");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
for (RepairTaskDetails bean : list){
|
||||||
|
int repairedNum = bean.getRepairNum() - bean.getRepairedNum() - bean.getScrapNum();
|
||||||
RepairApplyRecord partDetails = new RepairApplyRecord();
|
RepairApplyRecord partDetails = new RepairApplyRecord();
|
||||||
partDetails.setTaskId(bean.getTaskId());
|
partDetails.setTaskId(bean.getTaskId());
|
||||||
partDetails.setMaId(bean.getMaId());
|
partDetails.setMaId(bean.getMaId());
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="addTask" useGeneratedKeys="true" keyProperty="taskId">
|
<insert id="addTask" useGeneratedKeys="true" keyProperty="taskId">
|
||||||
insert into tm_task (task_status,task_type,code,create_by,create_time,company_id)
|
insert into tm_task (task_status,task_type,code,create_by,create_time,company_id)
|
||||||
values (45,46,#{repairCode},#{createBy},now(),#{companyId});
|
values (46,45,#{repairCode},#{createBy},now(),#{companyId});
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="createAgreementTask">
|
<insert id="createAgreementTask">
|
||||||
insert into tm_task_agreement (task_id,agreement_id,create_by,create_time,company_id)
|
insert into tm_task_agreement (task_id,agreement_id,create_by,create_time,company_id)
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id
|
LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id
|
||||||
left join sys_user su on rd.create_by = su.user_id
|
left join sys_user su on rd.create_by = su.user_id
|
||||||
left join sys_dic sd on sd.id = tt.task_status
|
left join sys_dic sd on sd.id = tt.task_status
|
||||||
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.user_name
|
where 1=1
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
AND (locate(#{keyword}, su.user_name) > 0
|
AND (locate(#{keyword}, su.user_name) > 0
|
||||||
or locate(#{keyword}, tt.CODE) > 0)
|
or locate(#{keyword}, tt.CODE) > 0)
|
||||||
|
|
@ -95,8 +95,11 @@
|
||||||
<if test="backPro != null and backPro != ''">
|
<if test="backPro != null and backPro != ''">
|
||||||
AND bpi.pro_id = #{backPro}
|
AND bpi.pro_id = #{backPro}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="type != null and type != ''">
|
||||||
|
AND mt2.type_id = #{type}
|
||||||
|
</if>
|
||||||
<if test="backCode != null and backCode != ''">
|
<if test="backCode != null and backCode != ''">
|
||||||
AND locate(#{backCode}, bai.CODE) > 0)
|
AND locate(#{backCode}, bai.CODE) > 0
|
||||||
</if>
|
</if>
|
||||||
<if test="repairStatus != null and repairStatus != ''">
|
<if test="repairStatus != null and repairStatus != ''">
|
||||||
AND tt.task_status = #{repairStatus}
|
AND tt.task_status = #{repairStatus}
|
||||||
|
|
@ -104,6 +107,7 @@
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
AND ts.create_time between #{startTime} and #{endTime}
|
AND ts.create_time between #{startTime} and #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.user_name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRepairMaTypeList" resultType="com.bonus.sgzb.base.domain.RepairTaskDetails">
|
<select id="getRepairMaTypeList" resultType="com.bonus.sgzb.base.domain.RepairTaskDetails">
|
||||||
|
|
@ -125,38 +129,19 @@
|
||||||
left join ma_machine mm on mm.ma_id = rad.ma_id
|
left join ma_machine mm on mm.ma_id = rad.ma_id
|
||||||
left join sys_user su on rad.repairer = su.user_id
|
left join sys_user su on rad.repairer = su.user_id
|
||||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||||
where rad.task_id = '4'
|
where rad.task_id = #{taskId}
|
||||||
</select>
|
<if test="keyword != null and keyword != ''">
|
||||||
<select id="getTypeList" resultType="java.lang.String">
|
AND (locate(#{keyword}, mm.ma_code) > 0
|
||||||
SELECT
|
or locate(#{keyword}, su.user_name) > 0)
|
||||||
m.type_name
|
</if>
|
||||||
FROM
|
<if test="type != null and type != ''">
|
||||||
ma_type m
|
AND mt.type_id = #{type}
|
||||||
WHERE
|
</if>
|
||||||
m.type_id IN (
|
<if test="typeName != null and typeName != ''">
|
||||||
SELECT
|
AND mt2.type_id = #{typeName}
|
||||||
mt.parent_id
|
</if>
|
||||||
FROM
|
|
||||||
ma_type mt
|
|
||||||
WHERE
|
|
||||||
mt.type_id IN ( SELECT ad.type_id FROM repair_apply_details ad WHERE ad.task_id = #{taskId}))
|
|
||||||
GROUP BY
|
|
||||||
m.type_name
|
|
||||||
</select>
|
|
||||||
<select id="getType" resultType="java.lang.String">
|
|
||||||
SELECT
|
|
||||||
m.type_name
|
|
||||||
FROM
|
|
||||||
ma_type m
|
|
||||||
WHERE
|
|
||||||
m.type_id = (
|
|
||||||
SELECT
|
|
||||||
mt.parent_id
|
|
||||||
FROM
|
|
||||||
ma_type mt
|
|
||||||
WHERE
|
|
||||||
mt.type_id = #{typeId})
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getById" resultType="com.bonus.sgzb.base.domain.RepairTaskDetails">
|
<select id="getById" resultType="com.bonus.sgzb.base.domain.RepairTaskDetails">
|
||||||
select rad.id as id,
|
select rad.id as id,
|
||||||
rad.repair_num as repairNum,
|
rad.repair_num as repairNum,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue