功能优化
This commit is contained in:
parent
577b8fa34c
commit
7636dee74f
|
|
@ -11,11 +11,9 @@ import com.bonus.common.biz.config.ListPagingUtil;
|
||||||
import com.bonus.common.core.utils.ServletUtils;
|
import com.bonus.common.core.utils.ServletUtils;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.material.ma.domain.vo.MaTypeVo;
|
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.java.Log;
|
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
@ -158,4 +156,34 @@ public class PartTypeController extends BaseController
|
||||||
{
|
{
|
||||||
return partTypeService.deletePartTypeByPaId(id);
|
return partTypeService.deletePartTypeByPaId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件信息库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "app配件信息库存查询")
|
||||||
|
//@RequiresPermissions("ma:type:list")
|
||||||
|
@GetMapping("/getTypeStorageNumList")
|
||||||
|
public AjaxResult getTypeStorageNumList(PartLeaseDetails bean)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<PartLeaseDetails> list = partTypeService.getTypeStorageNumList(bean);
|
||||||
|
return AjaxResult.success(getDataTable(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件个人库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "app配件个人库存查询")
|
||||||
|
//@RequiresPermissions("ma:type:list")
|
||||||
|
@GetMapping("/getPersonStorageNumList")
|
||||||
|
public AjaxResult getPersonStorageNumList(PartLeaseDetails bean)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<PartLeaseDetails> list = partTypeService.getPersonStorageNumList(bean);
|
||||||
|
return AjaxResult.success(getDataTable(list));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.bonus.common.biz.domain.TreeNode;
|
import com.bonus.common.biz.domain.TreeNode;
|
||||||
import com.bonus.material.ma.domain.PartType;
|
import com.bonus.material.ma.domain.PartType;
|
||||||
import com.bonus.material.ma.domain.vo.MaTypeVo;
|
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -104,4 +104,18 @@ public interface PartTypeMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PartType> select(PartType partType);
|
List<PartType> select(PartType partType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件信息库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PartLeaseDetails> getTypeStorageNumList(PartLeaseDetails bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件个人库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PartLeaseDetails> getPersonStorageNumList(PartLeaseDetails bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.ma.domain.PartType;
|
import com.bonus.material.ma.domain.PartType;
|
||||||
import com.bonus.material.ma.domain.vo.MaTypeVo;
|
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配件类型管理Service接口
|
* 配件类型管理Service接口
|
||||||
|
|
@ -71,4 +71,18 @@ public interface IPartTypeService
|
||||||
List<Integer> selectParentId(PartType partType);
|
List<Integer> selectParentId(PartType partType);
|
||||||
|
|
||||||
List<PartType> getListByParentId(Long id, PartType type);
|
List<PartType> getListByParentId(Long id, PartType type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件信息库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PartLeaseDetails> getTypeStorageNumList(PartLeaseDetails bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件个人库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PartLeaseDetails> getPersonStorageNumList(PartLeaseDetails bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -232,4 +233,24 @@ public class PartTypeServiceImpl implements IPartTypeService
|
||||||
public List<PartType> getListByParentId(Long id, PartType type) {
|
public List<PartType> getListByParentId(Long id, PartType type) {
|
||||||
return partTypeMapper.getListByTypeName(id, type);
|
return partTypeMapper.getListByTypeName(id, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件信息库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PartLeaseDetails> getTypeStorageNumList(PartLeaseDetails bean) {
|
||||||
|
return partTypeMapper.getTypeStorageNumList(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app配件个人库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PartLeaseDetails> getPersonStorageNumList(PartLeaseDetails bean) {
|
||||||
|
return partTypeMapper.getPersonStorageNumList(bean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -368,8 +368,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id AS typeId,
|
mt.type_id AS typeId,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
mt3.type_id AS secondTypeId,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
mt.unit_name AS unit,
|
mt.unit_name AS unit,
|
||||||
IFNULL(mt.buy_price, 0) AS buyPrice,
|
IFNULL(mt.buy_price, 0) AS buyPrice,
|
||||||
|
|
@ -405,8 +408,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
mt3.type_id AS secondTypeId,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
count(mm.ma_id) AS num
|
count(mm.ma_id) AS num
|
||||||
FROM ma_machine mm
|
FROM ma_machine mm
|
||||||
|
|
@ -433,8 +439,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
mt3.type_id AS secondTypeId,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(IFNULL(lod.out_num, 0)) AS outNum
|
SUM(IFNULL(lod.out_num, 0)) AS outNum
|
||||||
FROM lease_out_details lod
|
FROM lease_out_details lod
|
||||||
|
|
@ -447,8 +456,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
mt3.type_id AS secondTypeId,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(IFNULL(bcd.back_num, 0)) backNum
|
SUM(IFNULL(bcd.back_num, 0)) backNum
|
||||||
FROM back_check_details bcd
|
FROM back_check_details bcd
|
||||||
|
|
@ -464,8 +476,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
mt3.type_id AS secondTypeId,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(
|
SUM(
|
||||||
IFNULL(rad.repair_num, 0) - IFNULL(rad.repaired_num, 0) -
|
IFNULL(rad.repair_num, 0) - IFNULL(rad.repaired_num, 0) -
|
||||||
|
|
@ -483,8 +498,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
mt3.type_id AS secondTypeId,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(
|
SUM(
|
||||||
IFNULL(rid.repair_num, 0) - IFNULL(rid.input_num, 0)) AS repairInputNum
|
IFNULL(rid.repair_num, 0) - IFNULL(rid.input_num, 0)) AS repairInputNum
|
||||||
|
|
@ -500,8 +518,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
mt3.type_id AS secondTypeId,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(
|
SUM(
|
||||||
IFNULL(pcd.check_num, 0) - IFNULL(pcd.input_num, 0)) AS inputNum
|
IFNULL(pcd.check_num, 0) - IFNULL(pcd.input_num, 0)) AS inputNum
|
||||||
|
|
@ -529,6 +550,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||||
WHERE mt.`level` = 4
|
WHERE mt.`level` = 4
|
||||||
and mt.del_flag = '0'
|
and mt.del_flag = '0'
|
||||||
|
<if test="typeId != null">
|
||||||
|
<if test="level == 3">
|
||||||
|
and mt.parent_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
<if test="level == 2">
|
||||||
|
and mt2.parent_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
<if test="keyWord != null and keyWord != ''">
|
<if test="keyWord != null and keyWord != ''">
|
||||||
and (
|
and (
|
||||||
mt4.type_name like concat('%',#{keyWord},'%') or
|
mt4.type_name like concat('%',#{keyWord},'%') or
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="maCode != null and maCode != ''">
|
<if test="maCode != null and maCode != ''">
|
||||||
and ma.ma_code like concat('%', #{maCode}, '%')
|
and ma.ma_code like concat('%', #{maCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qrCode != null and qrCode != ''">
|
||||||
|
and ma.qr_code like concat('%', #{qrCode}, '%')
|
||||||
|
</if>
|
||||||
<if test="materialType != null and materialType != ''">
|
<if test="materialType != null and materialType != ''">
|
||||||
and mt3.type_name like concat('%', #{materialType}, '%')
|
and mt3.type_name like concat('%', #{materialType}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -208,4 +208,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
part_num > 0 and creator = #{createBy}
|
part_num > 0 and creator = #{createBy}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getTypeStorageNumList" resultType="com.bonus.material.part.domain.PartLeaseDetails">
|
||||||
|
SELECT
|
||||||
|
m3.pa_name as partType,
|
||||||
|
m2.pa_name as partName,
|
||||||
|
m1.pa_name as partModel,
|
||||||
|
m1.storage_num as storageNum,
|
||||||
|
m1.buy_price as buyPrice,
|
||||||
|
su.nick_name as createBy,
|
||||||
|
m1.create_time as createTime
|
||||||
|
FROM
|
||||||
|
ma_part_type m1
|
||||||
|
LEFT JOIN ma_part_type m2 ON m1.parent_id = m2.pa_id
|
||||||
|
AND m2.del_flag = '0'
|
||||||
|
LEFT JOIN ma_part_type m3 ON m2.parent_id = m3.pa_id
|
||||||
|
AND m3.del_flag = '0'
|
||||||
|
LEFT JOIN sys_user su on m1.create_by = su.user_id
|
||||||
|
WHERE
|
||||||
|
m1.del_flag = '0'
|
||||||
|
AND m1.`level` = 3
|
||||||
|
<if test="keyWord != null and keyWord !=''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
m1.pa_name like concat('%',#{keyWord},'%')
|
||||||
|
or m2.pa_name like concat('%',#{keyWord},'%')
|
||||||
|
or m3.pa_name like concat('%',#{keyWord},'%')
|
||||||
|
or su.nick_name like concat('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getPersonStorageNumList" resultType="com.bonus.material.part.domain.PartLeaseDetails">
|
||||||
|
SELECT
|
||||||
|
m3.pa_name as partType,
|
||||||
|
m2.pa_name as partName,
|
||||||
|
m1.pa_name as partModel,
|
||||||
|
p1.part_num as storageNum,
|
||||||
|
p1.part_price as buyPrice,
|
||||||
|
su.nick_name as createBy,
|
||||||
|
p1.create_time as createTime
|
||||||
|
FROM
|
||||||
|
pa_person_storage p1
|
||||||
|
LEFT JOIN ma_part_type m1 ON p1.part_id = m1.pa_id
|
||||||
|
AND m1.del_flag = '0'
|
||||||
|
LEFT JOIN ma_part_type m2 ON m1.parent_id = m2.pa_id
|
||||||
|
AND m2.del_flag = '0'
|
||||||
|
LEFT JOIN ma_part_type m3 ON m2.parent_id = m3.pa_id
|
||||||
|
AND m3.del_flag = '0'
|
||||||
|
LEFT JOIN sys_user su on p1.creator = su.user_id
|
||||||
|
WHERE
|
||||||
|
p1.is_active = '1'
|
||||||
|
<if test="keyWord != null and keyWord !=''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
m1.pa_name like concat('%',#{keyWord},'%')
|
||||||
|
or m2.pa_name like concat('%',#{keyWord},'%')
|
||||||
|
or m3.pa_name like concat('%',#{keyWord},'%')
|
||||||
|
or su.nick_name like concat('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue