Merge remote-tracking branch 'origin/branch_syruan'
This commit is contained in:
commit
a412b1e706
|
|
@ -77,9 +77,9 @@ public class RepairController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取维修任务物资设备列表
|
||||
* 获取维修任务物资设备列表--不分页
|
||||
*/
|
||||
@ApiOperation(value = "获取维修物资设备列表")
|
||||
@ApiOperation(value = "获取维修物资设备列表---分页")
|
||||
@GetMapping("/getRepairMaTypeList")
|
||||
@RequiresPermissions("repair:manage:preview")
|
||||
public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean) {
|
||||
|
|
@ -91,7 +91,7 @@ public class RepairController extends BaseController {
|
|||
/**
|
||||
* 获取维修任务机具列表
|
||||
*/
|
||||
@ApiOperation(value = "获取维修任务机具列表")
|
||||
@ApiOperation(value = "获取维修物资设备列表---不分页")
|
||||
@GetMapping("/getAppRepairMaTypeList")
|
||||
public AjaxResult getAppRepairMaTypeList(RepairTaskDetails bean) {
|
||||
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "规格ID")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String specificationType;
|
||||
|
||||
@ApiModelProperty(value = "机具类型名称")
|
||||
private String machineTypeName;
|
||||
|
||||
/** 维修总量 */
|
||||
@Excel(name = "维修总量")
|
||||
@ApiModelProperty(value = "维修总量")
|
||||
|
|
|
|||
|
|
@ -147,4 +147,6 @@ public class RepairTask {
|
|||
@ApiModelProperty(value = "导出选中列表")
|
||||
private List<Long> dataCondition;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public class RepairTaskDetails extends BaseEntity {
|
|||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
|
|
@ -38,6 +39,13 @@ public class RepairTaskDetails extends BaseEntity {
|
|||
*/
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "物资单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "管理模式")
|
||||
private Integer manageType;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
|
|
@ -73,5 +81,12 @@ public class RepairTaskDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "组织id")
|
||||
private Long companyId;
|
||||
|
||||
@ApiModelProperty(value = "退料id")
|
||||
private Long backId;
|
||||
|
||||
@ApiModelProperty(value = "维修人员")
|
||||
private String repairer;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyword;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ 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;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 修试审核详细Mapper接口
|
||||
|
|
@ -88,7 +89,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* 根据taskIds批量查询规格名称---批量
|
||||
* @param taskIds 任务id集合
|
||||
*/
|
||||
Map<Long, String> selectTypeNamesByTaskIds(List<Long> taskIds);
|
||||
Map<Long, String> selectTypeNamesByTaskIds(@Param("taskIds") List<Long> taskIds);
|
||||
|
||||
List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ 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.jetbrains.annotations.NotNull;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.repair.mapper.RepairAuditDetailsMapper;
|
||||
import com.bonus.material.repair.service.IRepairAuditDetailsService;
|
||||
|
|
@ -103,9 +103,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
|
||||
// 通过流过滤掉空对象 并转换为 List集合
|
||||
List<Long> taskIds = repairQuestList.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉空的 ScrapApplyDetailsVO 对象
|
||||
.filter(Objects::nonNull)
|
||||
.map(ScrapApplyDetailsVO::getTaskId)
|
||||
.filter(Objects::nonNull) // 过滤掉空的 taskId
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
|
@ -113,16 +113,17 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
Map<Long, String> typeNameMap = repairAuditDetailsMapper.selectTypeNamesByTaskIds(taskIds);
|
||||
|
||||
// 设置 itemType
|
||||
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
||||
Long taskId = scrapApplyDetailsVO.getTaskId();
|
||||
if (taskId != null) {
|
||||
String typeName = typeNameMap.get(taskId);
|
||||
if (typeName != null) {
|
||||
scrapApplyDetailsVO.setItemType(typeName);
|
||||
if (CollectionUtil.isNotEmpty(typeNameMap)) {
|
||||
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
||||
Long taskId = scrapApplyDetailsVO.getTaskId();
|
||||
if (taskId != null) {
|
||||
String typeName = typeNameMap.get(taskId);
|
||||
if (typeName != null) {
|
||||
scrapApplyDetailsVO.setItemType(typeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return repairQuestList;
|
||||
} catch (Exception e) {
|
||||
// 异常处理
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="repairId" column="repair_id" />
|
||||
<result property="maId" column="ma_id" />
|
||||
<result property="typeId" column="type_id" />
|
||||
<result property="specificationType" column="specification_type" />
|
||||
<result property="machineTypeName" column="machine_type_name" />
|
||||
<result property="repairNum" column="repair_num" />
|
||||
<result property="repairedNum" column="repaired_num" />
|
||||
<result property="scrapNum" column="scrap_num" />
|
||||
|
|
@ -31,21 +33,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
<where>
|
||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
||||
<if test="repairId != null "> and repair_id = #{repairId}</if>
|
||||
<if test="maId != null "> and ma_id = #{maId}</if>
|
||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
||||
<if test="repairNum != null "> and repair_num = #{repairNum}</if>
|
||||
<if test="repairedNum != null "> and repaired_num = #{repairedNum}</if>
|
||||
<if test="scrapNum != null "> and scrap_num = #{scrapNum}</if>
|
||||
<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="status != null and status != ''"> and `status` = #{status}</if>
|
||||
<if test="companyId != null "> and company_id = #{companyId}</if>
|
||||
</where>
|
||||
select
|
||||
rad.* ,mt.type_name as specification_type, mt1.type_name as machine_type_name, mma.ma_code as ma_id
|
||||
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}
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, mma.ma_code) > 0
|
||||
or locate(#{keyword}, mt.type_name) > 0
|
||||
or locate(#{keyword}, mt1.type_name) > 0)
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
AND mt.type_id = #{type}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt1.type_id = #{typeName}
|
||||
</if>
|
||||
order by rad.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRepairAuditDetailsById" parameterType="Long" resultMap="RepairAuditDetailsResult">
|
||||
|
|
|
|||
|
|
@ -80,53 +80,54 @@
|
|||
|
||||
<select id="getRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask">
|
||||
SELECT
|
||||
rd.task_id,
|
||||
tt.CODE AS repairCode,
|
||||
bui.unit_name AS backUnit,
|
||||
bpi.lot_name AS backPro,
|
||||
su.nick_name AS createName,
|
||||
tt.create_time AS createTime,
|
||||
bai.CODE AS backCode,
|
||||
sd.name AS repairStatus,
|
||||
tt.task_status AS repairStatusCode,
|
||||
tt.company_id AS companyId,
|
||||
GROUP_CONCAT(DISTINCT mt2.type_name) as type
|
||||
rd.task_id as taskId,
|
||||
rd.repairer,
|
||||
tt.CODE AS repairCode,
|
||||
tt.create_time AS createTime,
|
||||
tt.task_status AS repairStatusCode,
|
||||
tt.company_id AS companyId,
|
||||
tt.remark,
|
||||
bui.unit_name AS backUnit,
|
||||
bpi.pro_name AS backPro,
|
||||
su.nick_name AS createName,
|
||||
bai.CODE AS backCode,
|
||||
GROUP_CONCAT(DISTINCT mt2.type_name) as type
|
||||
FROM
|
||||
repair_apply_details rd
|
||||
repair_apply_details rd
|
||||
LEFT JOIN ma_type mt on rd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
LEFT JOIN tm_task tt on rd.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_info bai ON rd.back_id = bai.id
|
||||
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
|
||||
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id
|
||||
LEFT JOIN bm_project_lot bpi ON bai2.project_id = bpi.lot_id and bpi.status = '0' and bpi.del_flag = '0'
|
||||
LEFT JOIN bm_unit bui ON bai2.unit_id = bui.unit_id
|
||||
LEFT JOIN bm_project bpi ON bai2.project_id = bpi.pro_id and bpi.del_flag = '0'
|
||||
left join sys_user su on rd.create_by = su.user_id
|
||||
left join sys_dic sd on sd.id = tt.task_status
|
||||
where 1=1
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
or locate(#{keyword}, tt.CODE) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
AND bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
AND bpi.lot_id = #{backPro}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
AND mt2.type_id = #{type}
|
||||
</if>
|
||||
<if test="backCode != null and backCode != ''">
|
||||
AND locate(#{backCode}, bai.CODE) > 0
|
||||
</if>
|
||||
<if test="repairStatus != null and repairStatus != ''">
|
||||
AND tt.task_status = #{repairStatus}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||
</if>
|
||||
GROUP BY rd.task_id,bui.unit_name,bpi.lot_name,bai.code,su.nick_name
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
AND bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
AND bpi.pro_id = #{backPro}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
AND mt2.type_id = #{type}
|
||||
</if>
|
||||
<if test="backCode != null and backCode != ''">
|
||||
AND locate(#{backCode}, bai.CODE) > 0
|
||||
</if>
|
||||
<if test="repairStatus != null and repairStatus != ''">
|
||||
AND tt.task_status = #{repairStatus}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.nick_name
|
||||
order by tt.create_time desc
|
||||
</select>
|
||||
|
||||
|
|
@ -139,7 +140,6 @@
|
|||
su.nick_name AS createName,
|
||||
tt.create_time AS createTime,
|
||||
bai.CODE AS backCode,
|
||||
sd.NAME AS repairStatus,
|
||||
tt.task_status AS repairStatusCode,
|
||||
tt.company_id AS companyId,
|
||||
mt2.type_name AS type,
|
||||
|
|
@ -157,13 +157,12 @@
|
|||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN tm_task tt ON rd.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_info bai ON rd.back_id = bai.id
|
||||
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
|
||||
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id
|
||||
LEFT JOIN bm_project_lot bpi ON bai2.project_id = bpi.lot_id AND bpi.STATUS = '0' AND bpi.del_flag = '0'
|
||||
LEFT JOIN sys_user su ON rd.create_by = su.user_id
|
||||
left join sys_user su2 on rd.repairer = su2.user_id
|
||||
LEFT JOIN sys_dic sd ON sd.id = tt.task_status
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = rd.ma_id
|
||||
where 1=1
|
||||
<if test="keyword != null and keyword != ''">
|
||||
|
|
@ -205,6 +204,8 @@
|
|||
rad.ma_id as maId,
|
||||
mt2.type_name as typeName,
|
||||
mt.type_name as type,
|
||||
mt.unit_name as unitName,
|
||||
mt.manage_type as manageType,
|
||||
mm.ma_code as code,
|
||||
rad.repair_num as repairNum,
|
||||
rad.repaired_num as repairedNum,
|
||||
|
|
|
|||
Loading…
Reference in New Issue