This commit is contained in:
parent
c7fc7a0cd2
commit
fa5a630656
|
|
@ -35,4 +35,6 @@ public class RepairDetails {
|
|||
@Excel(name = "维修时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date repairTime;
|
||||
|
||||
private String nickName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,4 +93,6 @@ public class RepairInfo {
|
|||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
private String nickName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,4 +117,11 @@ public interface BmReportMapper {
|
|||
* @return
|
||||
*/
|
||||
List<ScrapDetailsInfo> getScrapDetailsList(ScrapInfo bean);
|
||||
|
||||
/**
|
||||
* 查询维修人名称
|
||||
* @param repairPersonName
|
||||
* @return
|
||||
*/
|
||||
String selectUserNameById(String repairPersonName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.bonus.material.basic.domain.report.*;
|
|||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.basic.mapper.BmReportMapper;
|
||||
import com.bonus.material.basic.service.BmReportService;
|
||||
import org.hibernate.validator.internal.util.StringHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -227,6 +228,9 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
List<RepairInfo> list = bmReportMapper.getRepairList(bean);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (RepairInfo repairInfo : list) {
|
||||
if (!StringHelper.isNullOrEmptyString(repairInfo.getNickName())){
|
||||
repairInfo.setRepairPersonName(repairInfo.getNickName());
|
||||
}
|
||||
totalBackNum = totalBackNum.add(repairInfo.getBackNum());
|
||||
totalRepairedNum = totalRepairedNum.add(repairInfo.getRepairedNum());
|
||||
totalPendingScrapNum = totalPendingScrapNum.add(repairInfo.getPendingScrapNum());
|
||||
|
|
@ -252,7 +256,16 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,6 +356,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bu.unit_name as leaseUnitName,
|
||||
bp.pro_name as leaseProjectName,
|
||||
rad.repairer as repairPersonName,
|
||||
u.nick_name as nickName,
|
||||
tt.`code` as code,
|
||||
rad.task_id as taskId,
|
||||
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 mt4 ON mt4.type_id = mt3.parent_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
|
||||
1 = 1
|
||||
<if test="userId != null ">
|
||||
|
|
@ -404,6 +406,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt1.type_name AS typeModelName,
|
||||
mm.ma_code AS maCode,
|
||||
rad.repairer AS repairPersonName,
|
||||
su.nick_name as nickName,
|
||||
rar.create_time AS repairTime
|
||||
FROM
|
||||
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 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
|
||||
left join sys_user su on rad.repairer = su.user_id and su.del_flag = '0'
|
||||
WHERE
|
||||
rad.task_id = #{taskId} and rad.type_id = #{typeId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
|
|
@ -584,5 +588,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
</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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue