功能优化
This commit is contained in:
parent
1b60cf6927
commit
93690125a3
|
|
@ -21,6 +21,9 @@ public class RetainedEquipmentInfo {
|
|||
|
||||
private static final long serialVersionUID = 2227217051604273598L;
|
||||
|
||||
@ApiModelProperty(value = "是否app 0 是,1 否")
|
||||
private Integer isApp;
|
||||
|
||||
@ApiModelProperty(value = "是否导出 0 是,1 否")
|
||||
private Integer isExport;
|
||||
|
||||
|
|
@ -137,4 +140,13 @@ public class RetainedEquipmentInfo {
|
|||
|
||||
private String maTypeName;
|
||||
|
||||
@ApiModelProperty(value = "一级类型id")
|
||||
private Integer firstTypeId;
|
||||
|
||||
@ApiModelProperty(value = "二级类型id")
|
||||
private Integer secondTypeId;
|
||||
|
||||
@ApiModelProperty(value = "三级类型id")
|
||||
private Integer thirdTypeId;
|
||||
|
||||
}
|
||||
|
|
@ -42,6 +42,17 @@ public class SelectController {
|
|||
return service.getMaTypeData(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机具类型下拉选
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "机具类型下拉选")
|
||||
@PostMapping("getMaType")
|
||||
public AjaxResult getMaType(@RequestBody SelectDto dto){
|
||||
return service.getMaType(dto);
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "数据字典下拉选")
|
||||
// @PostMapping("getDictByPidCbx")
|
||||
// public AjaxResult getDictByPidCbx(@RequestBody SelectDto dto){
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ public class SelectDto {
|
|||
/** 2.物品种类 3.设备类型 4.规格型号*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/** 字典表 父类值*/
|
||||
private String parentValue;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ public class SelectVo {
|
|||
/** id*/
|
||||
private long id;
|
||||
|
||||
private Long typeId;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/** 名称*/
|
||||
private String name;
|
||||
|
||||
/** 层级*/
|
||||
private String level;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,4 +158,11 @@ public interface SelectMapper {
|
|||
* @return
|
||||
*/
|
||||
List<TypeTreeNode> getUseTypeTreeApp(BackApplyInfo bean);
|
||||
|
||||
/**
|
||||
* 获取机具类型app
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<SelectVo> getMaType(SelectDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,4 +192,11 @@ public interface SelectService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult getUseType(BackApplyInfo bean);
|
||||
|
||||
/**
|
||||
* 获取设备类型
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getMaType(SelectDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,6 +312,22 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(listL3);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机具类型查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getMaType(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getMaType(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("机具类型-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getGoodsShelvesCbx(SelectDto dto) {
|
||||
List<TreeNode> groupList = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -46,4 +46,11 @@ public class PartLeaseDetails extends BaseEntity implements java.io.Serializable
|
|||
private String remarks;
|
||||
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "单位部门")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty(value = "发料单位")
|
||||
private String sendDeptName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.material.part.domain.vo;
|
||||
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件领料详情返回vo
|
||||
* @Author ma_sh
|
||||
* @create 2025/1/21 15:42
|
||||
*/
|
||||
@Data
|
||||
public class PartLeaseVo {
|
||||
|
||||
/**
|
||||
* 配件领料单位部门及发料单位
|
||||
*/
|
||||
private PartLeaseDetails details;
|
||||
|
||||
/**
|
||||
* 领料明细
|
||||
*/
|
||||
private List<PartLeaseDetails> detailsList;
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import com.bonus.material.part.domain.PartLeaseInfo;
|
||||
import com.bonus.material.part.domain.vo.PartLeaseVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -35,7 +36,7 @@ public interface PartLeaseService {
|
|||
* @param partLeaseDetails
|
||||
* @return
|
||||
*/
|
||||
List<PartLeaseDetails> selectPartLeaseDetailsList(PartLeaseDetails partLeaseDetails);
|
||||
PartLeaseVo selectPartLeaseDetailsList(PartLeaseDetails partLeaseDetails);
|
||||
|
||||
/**
|
||||
* 查询配件申请级别列表
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import com.bonus.material.part.domain.PartLeaseInfo;
|
||||
import com.bonus.material.part.domain.vo.PartLeaseVo;
|
||||
import com.bonus.material.part.mapper.PartLeaseMapper;
|
||||
import com.bonus.material.part.service.PartLeaseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -19,10 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -70,7 +68,7 @@ public class PartLeaseServiceImpl implements PartLeaseService {
|
|||
}
|
||||
int thisMonthMaxOrder = partLeaseMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth());
|
||||
final String taskCode = genderTaskCode(thisMonthMaxOrder);
|
||||
partLeaseInfo.setCode(taskCode).setMonthOrder(thisMonthMaxOrder + 1).setCreator(SecurityUtils.getLoginUser().getUsername())
|
||||
partLeaseInfo.setCode(taskCode).setMonthOrder(thisMonthMaxOrder + 1).setCreator(SecurityUtils.getUserId().toString())
|
||||
.setCreateTime(DateUtils.getNowDate());
|
||||
final int insertPartLeaseInfo = partLeaseMapper.insertPartLeaseInfo(partLeaseInfo);
|
||||
final int batchDetailsNum;
|
||||
|
|
@ -107,8 +105,27 @@ public class PartLeaseServiceImpl implements PartLeaseService {
|
|||
* @param partLeaseDetails 任务id
|
||||
*/
|
||||
@Override
|
||||
public List<PartLeaseDetails> selectPartLeaseDetailsList(PartLeaseDetails partLeaseDetails) {
|
||||
return partLeaseMapper.selectPartLeaseDetailsList(partLeaseDetails);
|
||||
public PartLeaseVo selectPartLeaseDetailsList(PartLeaseDetails partLeaseDetails) {
|
||||
PartLeaseVo partLeaseVo = new PartLeaseVo();
|
||||
List<PartLeaseDetails> list = partLeaseMapper.selectPartLeaseDetailsList(partLeaseDetails);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
partLeaseVo.setDetailsList(list);
|
||||
PartLeaseDetails details = new PartLeaseDetails();
|
||||
String deptName = list.stream()
|
||||
.map(PartLeaseDetails::getDeptName)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.joining(","));
|
||||
String sendDeptName = list.stream()
|
||||
.map(PartLeaseDetails::getSendDeptName)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.joining(","));
|
||||
details.setDeptName(deptName);
|
||||
details.setSendDeptName(sendDeptName);
|
||||
partLeaseVo.setDetails(details);
|
||||
}
|
||||
return partLeaseVo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -204,6 +221,7 @@ public class PartLeaseServiceImpl implements PartLeaseService {
|
|||
// 修改详情表的状态
|
||||
partLeaseDetails.setStatus(PartLeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
|
||||
partLeaseDetails.setUpdateBy(userId);
|
||||
partLeaseDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
int res = partLeaseMapper.updatePartLeaseDetails(partLeaseDetails);
|
||||
if (res == 0) {
|
||||
throw new ServiceException("领用信息审核失败");
|
||||
|
|
|
|||
|
|
@ -373,4 +373,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY
|
||||
mt.type_id
|
||||
</select>
|
||||
|
||||
<select id="getMaType" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT type_id AS typeId,
|
||||
type_name AS name,
|
||||
parent_id AS parentId,
|
||||
level AS level
|
||||
FROM ma_type
|
||||
WHERE del_flag = '0'
|
||||
<if test="level != null and level != ''">
|
||||
and level = #{level}
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
and parent_id = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<select id="selectPartLeaseInfoList" resultType="com.bonus.material.part.domain.PartLeaseInfo">
|
||||
SELECT
|
||||
p1.task_id as taskId,
|
||||
p1.creator as creator,
|
||||
su1.nick_name as creator,
|
||||
p1.create_time as createTime,
|
||||
GROUP_CONCAT( mp.pa_name ) as partName,
|
||||
p1.`code` as code,
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
LEFT JOIN pa_collar_apply_details p2 ON p1.task_id = p2.task_id
|
||||
LEFT JOIN ma_part_type mp ON p2.part_id = mp.pa_id and mp.del_flag = '0'
|
||||
LEFT JOIN sys_user su on p2.auditor = su.user_id
|
||||
LEFT JOIN sys_user su1 on p1.creator = su1.user_id
|
||||
AND mp.del_flag = '0'
|
||||
<where>
|
||||
<if test="taskStatus != null">
|
||||
|
|
@ -77,7 +78,9 @@
|
|||
mp1.pa_name as partModel,
|
||||
pcad.pre_num as preNum,
|
||||
pcad.status as status,
|
||||
mp1.buy_price as bugPrice
|
||||
mp1.buy_price as bugPrice,
|
||||
dept.companyName as deptName,
|
||||
dept1.companyName as sendDeptName
|
||||
FROM
|
||||
pa_collar_apply_details pcad
|
||||
LEFT JOIN ma_part_type mp1 ON pcad.part_id = mp1.pa_id
|
||||
|
|
@ -86,6 +89,47 @@
|
|||
AND mp2.del_flag = '0'
|
||||
LEFT JOIN ma_part_type mp3 ON mp2.parent_id = mp3.pa_id
|
||||
AND mp3.del_flag = '0'
|
||||
LEFT JOIN pa_collar_apply p1 on pcad.task_id = p1.task_id
|
||||
LEFT JOIN sys_user su on p1.creator = su.user_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sd.dept_id AS deptId,
|
||||
sd1.dept_name AS companyName
|
||||
FROM
|
||||
sys_dept sd
|
||||
JOIN (
|
||||
SELECT
|
||||
CASE
|
||||
ancestors
|
||||
WHEN ( '0' ) THEN
|
||||
dept_id ELSE SUBSTRING_INDEX( SUBSTRING_INDEX( ancestors, ',', 2 ), ',', - 1 )
|
||||
END AS first_ancestor,
|
||||
dept_id
|
||||
FROM
|
||||
sys_dept
|
||||
) AS subquery ON sd.dept_id = subquery.dept_id
|
||||
LEFT JOIN sys_dept sd1 ON sd1.dept_id = subquery.first_ancestor
|
||||
) dept ON dept.deptId = su.dept_id
|
||||
LEFT JOIN sys_user su1 on pcad.auditor = su1.user_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sd.dept_id AS deptId,
|
||||
sd1.dept_name AS companyName
|
||||
FROM
|
||||
sys_dept sd
|
||||
JOIN (
|
||||
SELECT
|
||||
CASE
|
||||
ancestors
|
||||
WHEN ( '0' ) THEN
|
||||
dept_id ELSE SUBSTRING_INDEX( SUBSTRING_INDEX( ancestors, ',', 2 ), ',', - 1 )
|
||||
END AS first_ancestor,
|
||||
dept_id
|
||||
FROM
|
||||
sys_dept
|
||||
) AS subquery ON sd.dept_id = subquery.dept_id
|
||||
LEFT JOIN sys_dept sd1 ON sd1.dept_id = subquery.first_ancestor
|
||||
) dept1 ON dept1.deptId = su1.dept_id
|
||||
<where>
|
||||
<if test="taskId != null ">
|
||||
and pcad.task_id = #{taskId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue