This commit is contained in:
hayu 2025-08-31 20:51:22 +08:00
parent c7fc7a0cd2
commit fa5a630656
5 changed files with 52 additions and 1 deletions

View File

@ -35,4 +35,6 @@ public class RepairDetails {
@Excel(name = "维修时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "维修时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date repairTime; private Date repairTime;
private String nickName;
} }

View File

@ -93,4 +93,6 @@ public class RepairInfo {
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private Long userId; private Long userId;
private String nickName;
} }

View File

@ -117,4 +117,11 @@ public interface BmReportMapper {
* @return * @return
*/ */
List<ScrapDetailsInfo> getScrapDetailsList(ScrapInfo bean); List<ScrapDetailsInfo> getScrapDetailsList(ScrapInfo bean);
/**
* 查询维修人名称
* @param repairPersonName
* @return
*/
String selectUserNameById(String repairPersonName);
} }

View File

@ -9,6 +9,7 @@ import com.bonus.material.basic.domain.report.*;
import com.bonus.material.basic.mapper.BmFileInfoMapper; import com.bonus.material.basic.mapper.BmFileInfoMapper;
import com.bonus.material.basic.mapper.BmReportMapper; import com.bonus.material.basic.mapper.BmReportMapper;
import com.bonus.material.basic.service.BmReportService; import com.bonus.material.basic.service.BmReportService;
import org.hibernate.validator.internal.util.StringHelper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -227,6 +228,9 @@ public class BmReportServiceImpl implements BmReportService {
List<RepairInfo> list = bmReportMapper.getRepairList(bean); List<RepairInfo> list = bmReportMapper.getRepairList(bean);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (RepairInfo repairInfo : list) { for (RepairInfo repairInfo : list) {
if (!StringHelper.isNullOrEmptyString(repairInfo.getNickName())){
repairInfo.setRepairPersonName(repairInfo.getNickName());
}
totalBackNum = totalBackNum.add(repairInfo.getBackNum()); totalBackNum = totalBackNum.add(repairInfo.getBackNum());
totalRepairedNum = totalRepairedNum.add(repairInfo.getRepairedNum()); totalRepairedNum = totalRepairedNum.add(repairInfo.getRepairedNum());
totalPendingScrapNum = totalPendingScrapNum.add(repairInfo.getPendingScrapNum()); totalPendingScrapNum = totalPendingScrapNum.add(repairInfo.getPendingScrapNum());
@ -252,7 +256,16 @@ public class BmReportServiceImpl implements BmReportService {
*/ */
@Override @Override
public List<RepairDetails> getRepairDetailsList(RepairInfo bean) { public List<RepairDetails> getRepairDetailsList(RepairInfo bean) {
return bmReportMapper.getRepairDetailsList(bean); List<RepairDetails> list = bmReportMapper.getRepairDetailsList(bean);
if (list.size()>0){
//处理数据库中维修人字段既有Id也有人员的问题
for (RepairDetails repairDetails : list){
if (!StringHelper.isNullOrEmptyString(repairDetails.getNickName())){
repairDetails.setRepairPersonName(repairDetails.getNickName());
}
}
}
return list;
} }
/** /**
@ -372,4 +385,19 @@ public class BmReportServiceImpl implements BmReportService {
public List<ScrapDetailsInfo> getScrapDetailsList(ScrapInfo bean) { public List<ScrapDetailsInfo> getScrapDetailsList(ScrapInfo bean) {
return bmReportMapper.getScrapDetailsList(bean); return bmReportMapper.getScrapDetailsList(bean);
} }
/**
* 判断字符串是否为纯数字可用于判断是否为用户ID
*/
private boolean isNumeric(String str) {
if (str == null || str.isEmpty()) {
return false;
}
for (char c : str.toCharArray()) {
if (!Character.isDigit(c)) {
return false;
}
}
return true;
}
} }

View File

@ -356,6 +356,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bu.unit_name as leaseUnitName, bu.unit_name as leaseUnitName,
bp.pro_name as leaseProjectName, bp.pro_name as leaseProjectName,
rad.repairer as repairPersonName, rad.repairer as repairPersonName,
u.nick_name as nickName,
tt.`code` as code, tt.`code` as code,
rad.task_id as taskId, rad.task_id as taskId,
rad.type_id as typeId, rad.type_id as typeId,
@ -377,6 +378,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
left join sys_user u on u.user_id = rad.repairer and u.del_flag = '0'
WHERE WHERE
1 = 1 1 = 1
<if test="userId != null "> <if test="userId != null ">
@ -404,6 +406,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt1.type_name AS typeModelName, mt1.type_name AS typeModelName,
mm.ma_code AS maCode, mm.ma_code AS maCode,
rad.repairer AS repairPersonName, rad.repairer AS repairPersonName,
su.nick_name as nickName,
rar.create_time AS repairTime rar.create_time AS repairTime
FROM FROM
repair_apply_details rad repair_apply_details rad
@ -414,6 +417,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_machine mm ON rad.ma_id = mm.ma_id LEFT JOIN ma_machine mm ON rad.ma_id = mm.ma_id
LEFT JOIN repair_apply_record rar ON rad.task_id = rar.task_id LEFT JOIN repair_apply_record rar ON rad.task_id = rar.task_id
and rad.type_id = rar.type_id and rar.ma_id = rad.ma_id and rad.type_id = rar.type_id and rar.ma_id = rad.ma_id
left join sys_user su on rad.repairer = su.user_id and su.del_flag = '0'
WHERE WHERE
rad.task_id = #{taskId} and rad.type_id = #{typeId} rad.task_id = #{taskId} and rad.type_id = #{typeId}
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
@ -584,5 +588,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) )
</if> </if>
</select> </select>
<select id="selectUserNameById" resultType="java.lang.String">
SELECT
u.nick_name as repairPersonName
FROM
sys_user u
WHERE
u.user_id = #{repairPersonName}
</select>
</mapper> </mapper>