app联调代码提交

This commit is contained in:
liang.chao 2024-04-28 16:16:29 +08:00
parent a8d0461e37
commit c2aaa44f1b
8 changed files with 118 additions and 143 deletions

View File

@ -69,7 +69,7 @@ public class LeaseOutDetailsController extends BaseController {
if (i == 0) { if (i == 0) {
return AjaxResult.success("绑定成功"); return AjaxResult.success("绑定成功");
} else { } else {
return AjaxResult.error("编号已存在,绑定失败"); return AjaxResult.error("二维码已绑定或编号已存在,绑定失败");
} }
} }

View File

@ -45,7 +45,7 @@ public interface BackReceiveMapper {
* @param taskType * @param taskType
* @return String * @return String
*/ */
String selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType); Integer selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType);
/** /**
* 添加维修任务 * 添加维修任务

View File

@ -144,7 +144,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int endBack(BackApplyInfo record) { public int endBack(BackApplyInfo record) {
int res; int res;
try { // try {
int taskId = record.getTaskId(); int taskId = record.getTaskId();
//先判断是否已经完成退料了 //先判断是否已经完成退料了
int taskStatus = selectTaskStatus(taskId); int taskStatus = selectTaskStatus(taskId);
@ -212,9 +212,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
throw new RuntimeException("该机具未被领料使用"); throw new RuntimeException("该机具未被领料使用");
} }
} }
} catch (Exception e) { // } catch (Exception e) {
throw new RuntimeException(e.getMessage()); // throw new RuntimeException(e.getMessage());
} // }
return res; return res;
} }
@ -498,16 +498,17 @@ public class BackReceiveServiceImpl implements BackReceiveService {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
Date nowDate = DateUtils.getNowDate(); Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate); String format = dateFormat.format(nowDate);
String taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType); Integer taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType);
if (StringHelper.isNotEmpty(taskNum)) { String taskNumStr = "";
if (taskNum != null) {
// 将字符串转换为整数 // 将字符串转换为整数
int num = Integer.parseInt(taskNum); // int num = Integer.parseInt(taskNum);
// 执行加一操作 // 执行加一操作
num++; taskNum++;
// 将结果转换回字符串格式并确保结果是四位数不足四位则在前面补0 // 将结果转换回字符串格式并确保结果是四位数不足四位则在前面补0
taskNum = String.format("%04d", num); taskNumStr = String.format("%04d", taskNum);
} else { } else {
taskNum = "0001"; taskNumStr = "0001";
} }
String code = ""; String code = "";
if (GlobalConstants.INT_41 == taskType) { if (GlobalConstants.INT_41 == taskType) {
@ -516,7 +517,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
if (GlobalConstants.INT_57 == taskType) { if (GlobalConstants.INT_57 == taskType) {
code = "BF"; code = "BF";
} }
code = code + format + "-" + taskNum; code = code + format + "-" + taskNumStr;
return code; return code;
} }
} }

View File

@ -189,7 +189,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
return AjaxResult.error("领料出库失败,机具库存不足"); return AjaxResult.error("领料出库失败,机具库存不足");
} }
} else { } else {
return AjaxResult.error("您已提交,请勿重复点击"); return AjaxResult.error("已领数量大于预领数量或该机具未在库");
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -415,56 +415,27 @@
</select> </select>
<select id="materialList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo"> <select id="materialList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
SELECT subquery1.type_id as typeId,subquery1.company_id as companyId, SELECT
subquery1.typeName typeCode, mt.type_id,
subquery1.typeNames as typeName, mt.type_name as typeCode,
subquery1.out_num - COALESCE(subquery2.audit_num, 0) AS num mt.parent_id,
FROM ( mt.unit_name,
-- 第一个查询作为子查询 mt.company_id,
SELECT mt.type_id,mt.company_id, mt2.type_name,
mt.type_name as typeName, SUM(CASE WHEN sai.agreement_id = #{agreementId} AND sai.status = '0' THEN sai.num ELSE 0 END) AS num,
mt2.type_name AS typeNames, mt.level
SUM(lod.out_num) as out_num FROM
FROM lease_apply_info lai ma_type mt
LEFT JOIN tm_task_agreement tta on lai.task_id = tta.task_id LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN lease_out_details lod on lod.parent_id = lai.id LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
LEFT JOIN tm_task tt on tt.task_id = tta.task_id WHERE
LEFT JOIN ma_type mt on lod.type_id=mt.type_id EXISTS (
LEFT JOIN ma_type mt1 ON mt1.type_id = lod.type_id SELECT 1
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id FROM slt_agreement_info sai2
WHERE tta.agreement_id = #{agreementId} WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId} AND sai2.status = '0'
and tt.task_type = '29' )
and mt.`level`='4' GROUP BY
<if test="keyWord != null and keyWord != ''"> mt.type_id
and (mt.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%'))
</if>
GROUP BY mt.type_id
) AS subquery1
LEFT JOIN
(
-- 第二个查询作为子查询
SELECT mt.type_id,mt.company_id,
mt.type_name,
mt2.type_name AS typeNames,
SUM(bad.audit_num) as audit_num
FROM back_apply_info bai
LEFT JOIN tm_task tt on tt.task_id=bai.task_id
LEFT JOIN back_apply_details bad on bad.parent_id = bai.id
LEFT JOIN tm_task_agreement tta on tta.task_id = tt.task_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
WHERE tta.agreement_id = #{agreementId}
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}, '%'))
</if>
GROUP BY mt.type_id
) AS subquery2
ON subquery1.type_id = subquery2.type_id
</select> </select>
<select id="view" resultType="com.bonus.sgzb.app.domain.BackApplyInfo"> <select id="view" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">

View File

@ -784,7 +784,8 @@
mm.ma_code as maCode, mm.ma_code as maCode,
mt.type_name as typeCode, mt.type_name as typeCode,
mt2.type_name as typeName, mt2.type_name as typeName,
sd.`name` as sdStatus sd.`name` as sdStatus,
sd.id as sdId
FROM FROM
ma_machine mm ma_machine mm
LEFT JOIN ma_type mt on mt.type_id=mm.type_id LEFT JOIN ma_type mt on mt.type_id=mm.type_id

View File

@ -976,12 +976,14 @@
mt.manage_type as manageType, mt.manage_type as manageType,
mt.num as num, mt.num as num,
su.user_name as userName, su.user_name as userName,
mm.ma_code as maCode,
lad.type_id as typeId lad.type_id as typeId
FROM FROM
lease_apply_details lad lease_apply_details lad
LEFT JOIN lease_apply_info lai on lad.parennt_id = lai.id LEFT JOIN lease_apply_info lai on lad.parennt_id = lai.id
LEFT JOIN ma_type mt on lad.type_id = mt.type_id LEFT JOIN ma_type mt on lad.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN ma_machine mm on mt.type_id = mm.type_id
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
LEFT JOIN sys_user su on mtk.user_id = su.user_id LEFT JOIN sys_user su on mtk.user_id = su.user_id
WHERE WHERE

View File

@ -353,6 +353,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE a.parentId is not null WHERE a.parentId is not null
</select> </select>
<select id="getMaMachineByMaTypeAndMaCode" resultType="com.bonus.sgzb.base.api.domain.MaMachine"> <select id="getMaMachineByMaTypeAndMaCode" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
select * from ma_machine where qr_code = #{qrCode} select * from ma_machine where qr_code = #{qrCode} or ma_code = #{maCode}
</select> </select>
</mapper> </mapper>