This commit is contained in:
zhouzy062 2024-01-22 09:18:54 +08:00
commit e77c589cb9
9 changed files with 39 additions and 27 deletions

View File

@ -274,7 +274,7 @@ public class TmTaskController extends BaseController {
* 查询机具领料审核列表
*
* @param task 筛选条件
* @param souceBy app为1
* @param souceBy app为1 web为0
* @return 列表
*/
@Log(title = "查询机具领料审核列表", businessType = BusinessType.QUERY)

View File

@ -49,4 +49,6 @@ public interface LeaseOutDetailsMapper {
String getTaskId(Integer parentId);
int updateTaskStatus(@Param("taskId") String taskId,@Param("status")int status);
String getMachineStatus(LeaseOutDetails record);
}

View File

@ -53,6 +53,10 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
if (StringUtils.isNull(record)) {
return AjaxResult.error("领料出库失败,请检查参数是否填写完整!");
}
String status = leaseOutDetailsMapper.getMachineStatus(record);
if (status.equals("16")){
return AjaxResult.error("领料出库失败,该设备不是在库状态!");
}
if (record.getOutNum() == null || record.getOutNum() < 0.1) {
record.setOutNum(1.00);
}

View File

@ -410,10 +410,9 @@
WHERE tta.agreement_id = #{agreementId}
and tt.task_type = '29'
and mt.`level`='4'
<if test="keyWord != null and keyWord != ''">
and mt.type_name like concat('%', #{keyWord}, '%') or
and mt2.type_name like concat('%', #{keyWord}, '%')
and (mt.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%'))
</if>
GROUP BY mt.type_id
) AS subquery1
@ -435,8 +434,8 @@
and tt.task_type = '36'
and mt.`level`='4'
<if test="keyWord != null and keyWord != ''">
and mt.type_name like concat('%', #{keyWord}, '%') or
and mt2.type_name like concat('%', #{keyWord}, '%')
and (mt.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%'))
</if>
GROUP BY mt.type_id
) AS subquery2
@ -448,18 +447,13 @@
<select id="view" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
SELECT
mt.type_name typeCode,
CONCAT_WS('/', IFNULL(mt3.type_name, '')) AS typeName,
bad.pre_num as num,
mm.ma_code as maCode
CONCAT_WS('/', IFNULL(mt2.type_name, '')) AS typeName,
bad.pre_num as num
FROM
back_apply_details bad
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id
LEFT JOIN ma_type mt on mt.type_id=bad.type_id
LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.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_machine mm on mm.type_id=bad.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id=mt.parent_id
WHERE
bai.id=#{id}
</select>
@ -470,6 +464,7 @@
bai.phone,
bpl.lot_name as lotName,
bui.unit_name as unitName,
bai.back_time as backTime,
bagi.plan_start_time as planStartTime,
tt.task_status as taskStatus,
GROUP_CONCAT(DISTINCT bad.type_id) as typeId,
@ -490,20 +485,19 @@
WHERE
bad.type_id is not null
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
ORDER BY bai.create_time desc
</select>
<select id="examineView" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
SELECT
mt.type_name typeCode,
CONCAT_WS('/', IFNULL(mt2.type_name, '')) AS typeName,
bad.pre_num as num,
mm.ma_code as maCode
bad.pre_num as num
FROM
back_apply_details bad
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id
LEFT JOIN ma_type mt on mt.type_id=bad.type_id
LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id
LEFT JOIN ma_machine mm on mm.type_id=bad.type_id
WHERE
bai.id=#{id}
</select>

View File

@ -19,6 +19,11 @@
from lease_apply_info
where id = #{parentId}
</select>
<select id="getMachineStatus" resultType="java.lang.String">
select ma_status
from ma_machine
where ma_id = #{maId}
</select>
<update id="updateLeaseApplyDetailsOutNum">
UPDATE

View File

@ -339,9 +339,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
1=1
<if test="keyWord != null and keyWord != ''">
and bai.`code` like concat('%', #{keyWord}, '%') or
and (bai.`code` like concat('%', #{keyWord}, '%') or
bai.back_person like concat('%', #{keyWord}, '%') or
bai.phone like concat('%', #{keyWord}, '%')
bai.phone like concat('%', #{keyWord}, '%'))
</if>
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
@ -391,8 +391,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and mt.`level`='4'
<if test="keyWord != null and keyWord != ''">
and mt.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%')
and (mt.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%'))
</if>
GROUP BY mt.type_id
) AS subquery1
@ -416,8 +416,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and tt.task_type = '36'
and mt.`level`='4'
<if test="keyWord != null and keyWord != ''">
and mt.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%')
and (mt.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%'))
</if>
GROUP BY mt.type_id
) AS subquery2
@ -454,6 +454,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
WHERE
bai.id = #{id}
<if test="keyWord != null and keyWord != ''">
and (mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%'))
</if>
</select>
<select id="getUseTypeTree" resultType="com.bonus.sgzb.material.domain.TypeTreeNode">
WITH RECURSIVE cte AS (
@ -565,9 +569,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where
1=1
<if test="keyWord != null and keyWord != ''">
and bai.`code` like concat('%', #{keyWord}, '%') or
and (bai.`code` like concat('%', #{keyWord}, '%') or
bai.back_person like concat('%', #{keyWord}, '%') or
bai.phone like concat('%', #{keyWord}, '%')
bai.phone like concat('%', #{keyWord}, '%'))
</if>
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}

View File

@ -337,8 +337,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_user us on us.user_id = tt.update_by
WHERE pcd.task_id = #{taskId}
<if test="keyWord != null and keyWord != ''">
and mt.pa_name like concat('%',#{keyWord},'%') or
mt1.pa_name like concat('%',#{keyWord},'%')
and (mt.pa_name like concat('%',#{keyWord},'%') or
mt1.pa_name like concat('%',#{keyWord},'%'))
</if>
<if test="modelId != null and modelId != ''">
and mt1.pa_id = #{modelId}

View File

@ -30,6 +30,8 @@ public class TreeNode {
private String code;
private float num;
private String modelCode;
@JsonInclude(JsonInclude.Include.NON_EMPTY)

View File

@ -96,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
unit_name AS unitName,
company_id AS companyId,
code,
num,
model_code modelCode
FROM ma_type
WHERE del_flag = '0'