This commit is contained in:
parent
f08ce31bd0
commit
ed8924f9bc
|
|
@ -153,6 +153,14 @@ public class RepairAuditDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "关键字")
|
@ApiModelProperty(value = "关键字")
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关键字
|
||||||
|
*/
|
||||||
|
private String keys;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具状态")
|
||||||
|
private String maStatus;
|
||||||
|
|
||||||
public String getKeyWord() {
|
public String getKeyWord() {
|
||||||
return keyWord;
|
return keyWord;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,4 +65,14 @@ public class RepairInputInfo extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "一级类型id")
|
@ApiModelProperty(value = "一级类型id")
|
||||||
private Long firstId;
|
private Long firstId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修饰入库时间
|
||||||
|
*/
|
||||||
|
private String auditTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修饰入库人
|
||||||
|
*/
|
||||||
|
private String auditBy;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,5 +165,10 @@ public class RepairPartDetails extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码状态
|
||||||
|
*/
|
||||||
|
private String maStatus;
|
||||||
|
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,4 +145,11 @@ public interface RepairInputDetailsMapper {
|
||||||
List<RepairInputDetails> selectRepairListByBoxId(RepairInputDetails input);
|
List<RepairInputDetails> selectRepairListByBoxId(RepairInputDetails input);
|
||||||
|
|
||||||
int updateBoxStatus(RepairInputDetails input);
|
int updateBoxStatus(RepairInputDetails input);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询auditId是否存在入库表中
|
||||||
|
* @param input
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int selectRepairInputDetailsByAuditId(RepairInputDetails input);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -568,8 +568,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
try {
|
try {
|
||||||
if ("1".equals(status)) {
|
if ("1".equals(status)) {
|
||||||
for (final RepairAuditDetails repairAuditDetail : repairAuditDetails) {
|
for (final RepairAuditDetails repairAuditDetail : repairAuditDetails) {
|
||||||
// 删除repair_input_details 维修入库明细?
|
// // 删除repair_input_details 维修入库明细?
|
||||||
repairInputDetailsMapper.deleteRepairInputDetailsByTaskId(repairAuditDetail.getTaskId());
|
// repairInputDetailsMapper.deleteRepairInputDetailsByTaskId(repairAuditDetail.getTaskId());
|
||||||
// 查询协议ID
|
// 查询协议ID
|
||||||
Long agreementId = taskAgreementMapper.selectAgreementIdByTaskId(repairAuditDetail.getTaskId());
|
Long agreementId = taskAgreementMapper.selectAgreementIdByTaskId(repairAuditDetail.getTaskId());
|
||||||
// 查询维修审核明细
|
// 查询维修审核明细
|
||||||
|
|
|
||||||
|
|
@ -172,31 +172,6 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (CollectionUtils.isNotEmpty(list)) {
|
|
||||||
// for (RepairInputDetails inputDetails : list) {
|
|
||||||
// List<RepairInputInfo> inputInfos = repairInputDetailsMapper.selectRepairInputDetailsById(inputDetails);
|
|
||||||
// if (CollectionUtils.isNotEmpty(inputInfos)) {
|
|
||||||
// BigDecimal totalRepairNum = BigDecimal.ZERO.setScale(3, BigDecimal.ROUND_HALF_UP);
|
|
||||||
// BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, BigDecimal.ROUND_HALF_UP);
|
|
||||||
// BigDecimal totalPendingInputNum = BigDecimal.ZERO.setScale(3, BigDecimal.ROUND_HALF_UP);
|
|
||||||
// for (RepairInputInfo inputInfo : inputInfos) {
|
|
||||||
// totalRepairNum = totalRepairNum.add(inputInfo.getRepairNum());
|
|
||||||
// totalInputNum = totalInputNum.add(inputInfo.getInputNum());
|
|
||||||
// totalPendingInputNum = totalPendingInputNum.add(inputInfo.getPendingInputNum());
|
|
||||||
// }
|
|
||||||
// inputDetails.setRepairNum(totalRepairNum);
|
|
||||||
// inputDetails.setInputNum(totalInputNum);
|
|
||||||
// inputDetails.setPendingInputNum(totalPendingInputNum);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// String keyWord = repairInputDetails.getKeyWord();
|
|
||||||
// // 如果关键字不为空,进行过滤
|
|
||||||
// if (!StringUtils.isBlank(keyWord)) {
|
|
||||||
// list = list.stream()
|
|
||||||
// .filter(item -> containsKeyword(item, keyWord))
|
|
||||||
// .collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
String keyWord = repairInputDetails.getKeyWord();
|
String keyWord = repairInputDetails.getKeyWord();
|
||||||
// 如果关键字不为空,进行过滤
|
// 如果关键字不为空,进行过滤
|
||||||
if (!StringUtils.isBlank(keyWord)) {
|
if (!StringUtils.isBlank(keyWord)) {
|
||||||
|
|
@ -926,7 +901,8 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
||||||
|
|
||||||
private int updateInputNum(RepairInputDetails inputApplyDetails) {
|
private int updateInputNum(RepairInputDetails inputApplyDetails) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
String auditBy = SecurityUtils.getLoginUser().getUserid().toString();
|
Long auditBy = SecurityUtils.getLoginUser().getUserid();
|
||||||
|
inputApplyDetails.setAuditBy(auditBy);
|
||||||
result = repairInputDetailsMapper.updateInputNum(inputApplyDetails);
|
result = repairInputDetailsMapper.updateInputNum(inputApplyDetails);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1561,10 +1561,10 @@ public class RepairServiceImpl implements RepairService {
|
||||||
@Override
|
@Override
|
||||||
public List<RepairPartDetails> getDetailsListApp(RepairPartDetails bean) {
|
public List<RepairPartDetails> getDetailsListApp(RepairPartDetails bean) {
|
||||||
try {
|
try {
|
||||||
List<RepairPartDetails> list = repairMapper.getDetailsListApp(bean);
|
// List<RepairPartDetails> list = repairMapper.getDetailsListApp(bean);
|
||||||
if (list.size()<=0){
|
// if (list.size()<=0){
|
||||||
list=repairMapper.getDetailsListAppTwo(bean);
|
List<RepairPartDetails> list=repairMapper.getDetailsListAppTwo(bean);
|
||||||
}
|
// }
|
||||||
return list;
|
return list;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
||||||
select
|
select
|
||||||
rad.* ,mt.type_name as specification_type, mt1.type_name as machine_type_name, mma.ma_code as maCode,
|
rad.* ,mt.type_name as specification_type, mt1.type_name as machine_type_name, mma.ma_code as maCode,sdd.dict_label as maStatus,
|
||||||
rad.ma_id as maId
|
rad.ma_id as maId
|
||||||
,mt.manage_type as manageType,
|
,mt.manage_type as manageType,
|
||||||
su.nick_name as auditName,
|
su.nick_name as auditName,
|
||||||
|
|
@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join ma_type mt on rad.type_id = mt.type_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_type mt1 on mt.parent_id = mt1.type_id
|
||||||
left join ma_machine mma on rad.ma_id= mma.ma_id
|
left join ma_machine mma on rad.ma_id= mma.ma_id
|
||||||
|
LEFT JOIN sys_dict_data sdd on mma.ma_status=sdd.dict_value and sdd.dict_type='ma_machine_status'
|
||||||
LEFT JOIN sys_user su on rad.audit_by = su.user_id
|
LEFT JOIN sys_user su on rad.audit_by = su.user_id
|
||||||
left join ma_type mt3 ON mt1.parent_id = mt3.type_id and mt3.del_flag = '0'
|
left join ma_type mt3 ON mt1.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||||
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
|
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
|
||||||
|
|
@ -54,10 +55,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where
|
where
|
||||||
rad.task_id = #{taskId}
|
rad.task_id = #{taskId}
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
AND (locate(#{keyword}, mma.ma_code) > 0
|
and (
|
||||||
or locate(#{keyword}, mt.type_name) > 0
|
mt.type_name like concat('%',#{keyword},'%')
|
||||||
or locate(#{keyword}, mt1.type_name) > 0
|
or mt1.type_name like concat('%',#{keyword},'%')
|
||||||
or locate(#{keyword}, su.nick_name) > 0
|
or mma.ma_code like concat('%',#{keyword},'%')
|
||||||
|
or su.nick_name like concat('%',#{keyword},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="keys != null and keys != ''">
|
||||||
|
and (
|
||||||
|
mt.type_name like concat('%',#{keys},'%')
|
||||||
|
or mt1.type_name like concat('%',#{keys},'%')
|
||||||
|
or mma.ma_code like concat('%',#{keys},'%')
|
||||||
|
or su.nick_name like concat('%',#{keys},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null and type != ''">
|
<if test="type != null and type != ''">
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.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 tm_task tt on rd.task_id = tt.task_id
|
||||||
LEFT JOIN tm_task tt1 on rd.repair_id = tt1.task_id
|
LEFT JOIN tm_task tt1 on rd.repair_id = tt1.task_id
|
||||||
|
LEFT JOIN (
|
||||||
LEFT JOIN repair_apply_details rad ON rad.task_id = rd.repair_id
|
SELECT
|
||||||
|
rad.task_id,
|
||||||
|
rad.back_id,
|
||||||
|
rad.create_time
|
||||||
|
FROM
|
||||||
|
repair_apply_details rad
|
||||||
|
GROUP BY rad.task_id
|
||||||
|
) rad ON rad.task_id = rd.repair_id
|
||||||
LEFT JOIN back_apply_info bai ON rad.back_id = bai.id
|
LEFT JOIN back_apply_info bai ON rad.back_id = bai.id
|
||||||
LEFT JOIN tm_task_agreement tta ON rd.repair_id = tta.task_id
|
LEFT JOIN tm_task_agreement tta ON rd.repair_id = tta.task_id
|
||||||
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
|
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
|
||||||
|
|
@ -553,6 +560,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_machine mm on bbb.ma_id = mm.ma_id
|
LEFT JOIN ma_machine mm on bbb.ma_id = mm.ma_id
|
||||||
WHERE bqb.box_code = #{boxCode}
|
WHERE bqb.box_code = #{boxCode}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectRepairInputDetailsByAuditId" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from repair_input_details
|
||||||
|
where audit_id = #{auditId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateBoxStatus">
|
<update id="updateBoxStatus">
|
||||||
update bm_qrcode_box set box_status = 6
|
update bm_qrcode_box set box_status = 6
|
||||||
|
|
|
||||||
|
|
@ -1342,26 +1342,58 @@
|
||||||
order by rad.create_time desc
|
order by rad.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getDetailsListAppTwo" resultType="com.bonus.material.repair.domain.RepairPartDetails">
|
<select id="getDetailsListAppTwo" resultType="com.bonus.material.repair.domain.RepairPartDetails">
|
||||||
|
<![CDATA[
|
||||||
SELECT mm.ma_code as maCode,
|
SELECT mm.ma_code as maCode,
|
||||||
|
sdd.dict_label as maStatus,
|
||||||
mt.type_name as typeModelName,
|
mt.type_name as typeModelName,
|
||||||
mt1.type_name as typeName,
|
mt1.type_name as typeName,
|
||||||
su.nick_name as repairer,
|
CASE
|
||||||
rad.update_time as createTime,
|
WHEN rar.create_by is not null THEN
|
||||||
rad.repairer as createBy
|
rar.create_by
|
||||||
|
ELSE
|
||||||
|
su.nick_name
|
||||||
|
END createBy,
|
||||||
|
CASE
|
||||||
|
WHEN rar.create_time is not null THEN
|
||||||
|
rar.create_time
|
||||||
|
ELSE
|
||||||
|
rad.update_time
|
||||||
|
END createTime,
|
||||||
|
CASE
|
||||||
|
WHEN rad.repairer REGEXP '^[0-9]+$' THEN su2.nick_name
|
||||||
|
ELSE rad.repairer
|
||||||
|
END AS repairer,
|
||||||
|
mpt2.pa_id as partId,
|
||||||
|
GROUP_CONCAT(DISTINCT mpt2.pa_name) as partName
|
||||||
FROM repair_apply_details rad
|
FROM repair_apply_details rad
|
||||||
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_dict_data sdd on mm.ma_status=sdd.dict_value and sdd.dict_type='ma_machine_status'
|
||||||
LEFT JOIN ma_type mt on mt.type_id = rad.type_id
|
LEFT JOIN ma_type mt on mt.type_id = rad.type_id
|
||||||
LEFT JOIN ma_type mt1 on mt1.type_id = mt.parent_id
|
LEFT JOIN ma_type mt1 on mt1.type_id = mt.parent_id
|
||||||
LEFT JOIN sys_user su on rad.update_by = su.user_id
|
LEFT JOIN sys_user su on rad.update_by = su.user_id
|
||||||
|
LEFT JOIN sys_user su2 on su2.user_id = rad.repairer
|
||||||
|
LEFT JOIN repair_apply_record rar
|
||||||
|
on rar.task_id = rad.task_id and rar.type_id = rad.type_id and rad.ma_id<=>rar.ma_id and rar.is_ds='0'
|
||||||
|
LEFT JOIN ma_part_type mpt
|
||||||
|
ON mpt.pa_id = rar.part_id
|
||||||
|
LEFT JOIN ma_part_type mpt2 ON mpt2.pa_id = mpt.parent_id
|
||||||
|
]]>
|
||||||
WHERE rad.task_id = #{taskId}
|
WHERE rad.task_id = #{taskId}
|
||||||
and rad.type_id = #{typeId}
|
and rad.type_id = #{typeId}
|
||||||
and (
|
and (
|
||||||
rad.repaired_num!=0 or
|
rad.repaired_num!=0
|
||||||
rad.this_repaired_num!=0 or
|
or
|
||||||
rad.scrap_num!=0 or
|
rad.this_repaired_num!=0
|
||||||
|
or
|
||||||
|
rad.scrap_num!=0
|
||||||
|
or
|
||||||
rad.this_repaired_num!=0
|
rad.this_repaired_num!=0
|
||||||
)
|
)
|
||||||
and rad.is_ds = '0'
|
and rad.is_ds = '0'
|
||||||
|
<if test="keyWord!=null and keyWord!=''">
|
||||||
|
AND mm.ma_code LIKE CONCAT('%', #{keyWord}, '%')
|
||||||
|
</if>
|
||||||
|
GROUP BY rad.task_id, rad.type_id, rad.ma_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateRepairedAndScrapNum">
|
<update id="updateRepairedAndScrapNum">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue