app联调代码提交
This commit is contained in:
parent
a8d0461e37
commit
c2aaa44f1b
|
|
@ -69,7 +69,7 @@ public class LeaseOutDetailsController extends BaseController {
|
|||
if (i == 0) {
|
||||
return AjaxResult.success("绑定成功");
|
||||
} else {
|
||||
return AjaxResult.error("编号已存在,绑定失败");
|
||||
return AjaxResult.error("二维码已绑定或编号已存在,绑定失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public interface BackReceiveMapper {
|
|||
* @param taskType
|
||||
* @return String
|
||||
*/
|
||||
String selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||
Integer selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||
|
||||
/**
|
||||
* 添加维修任务
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public int endBack(BackApplyInfo record) {
|
||||
int res;
|
||||
try {
|
||||
// try {
|
||||
int taskId = record.getTaskId();
|
||||
//先判断是否已经完成退料了
|
||||
int taskStatus = selectTaskStatus(taskId);
|
||||
|
|
@ -212,9 +212,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
throw new RuntimeException("该机具未被领料使用");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
// } catch (Exception e) {
|
||||
// throw new RuntimeException(e.getMessage());
|
||||
// }
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -498,16 +498,17 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
String taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType);
|
||||
if (StringHelper.isNotEmpty(taskNum)) {
|
||||
Integer taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType);
|
||||
String taskNumStr = "";
|
||||
if (taskNum != null) {
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
taskNum++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
taskNumStr = String.format("%04d", taskNum);
|
||||
} else {
|
||||
taskNum = "0001";
|
||||
taskNumStr = "0001";
|
||||
}
|
||||
String code = "";
|
||||
if (GlobalConstants.INT_41 == taskType) {
|
||||
|
|
@ -516,7 +517,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (GlobalConstants.INT_57 == taskType) {
|
||||
code = "BF";
|
||||
}
|
||||
code = code + format + "-" + taskNum;
|
||||
code = code + format + "-" + taskNumStr;
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("您已提交,请勿重复点击");
|
||||
return AjaxResult.error("已领数量大于预领数量或该机具未在库");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -415,56 +415,27 @@
|
|||
</select>
|
||||
|
||||
<select id="materialList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT subquery1.type_id as typeId,subquery1.company_id as companyId,
|
||||
subquery1.typeName typeCode,
|
||||
subquery1.typeNames as typeName,
|
||||
subquery1.out_num - COALESCE(subquery2.audit_num, 0) AS num
|
||||
FROM (
|
||||
-- 第一个查询作为子查询
|
||||
SELECT mt.type_id,mt.company_id,
|
||||
mt.type_name as typeName,
|
||||
mt2.type_name AS typeNames,
|
||||
SUM(lod.out_num) as out_num
|
||||
FROM lease_apply_info lai
|
||||
LEFT JOIN tm_task_agreement tta on lai.task_id = tta.task_id
|
||||
LEFT JOIN lease_out_details lod on lod.parent_id = lai.id
|
||||
LEFT JOIN tm_task tt on tt.task_id = tta.task_id
|
||||
LEFT JOIN ma_type mt on lod.type_id=mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = lod.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
|
||||
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
|
||||
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
|
||||
mt.type_id,
|
||||
mt.type_name as typeCode,
|
||||
mt.parent_id,
|
||||
mt.unit_name,
|
||||
mt.company_id,
|
||||
mt2.type_name,
|
||||
SUM(CASE WHEN sai.agreement_id = #{agreementId} AND sai.status = '0' THEN sai.num ELSE 0 END) AS num,
|
||||
mt.level
|
||||
FROM
|
||||
ma_type mt
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
|
||||
WHERE
|
||||
EXISTS (
|
||||
SELECT 1
|
||||
FROM slt_agreement_info sai2
|
||||
WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId} AND sai2.status = '0'
|
||||
)
|
||||
GROUP BY
|
||||
mt.type_id
|
||||
</select>
|
||||
|
||||
<select id="view" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
|
|
|
|||
|
|
@ -784,7 +784,8 @@
|
|||
mm.ma_code as maCode,
|
||||
mt.type_name as typeCode,
|
||||
mt2.type_name as typeName,
|
||||
sd.`name` as sdStatus
|
||||
sd.`name` as sdStatus,
|
||||
sd.id as sdId
|
||||
FROM
|
||||
ma_machine mm
|
||||
LEFT JOIN ma_type mt on mt.type_id=mm.type_id
|
||||
|
|
|
|||
|
|
@ -976,12 +976,14 @@
|
|||
mt.manage_type as manageType,
|
||||
mt.num as num,
|
||||
su.user_name as userName,
|
||||
mm.ma_code as maCode,
|
||||
lad.type_id as typeId
|
||||
FROM
|
||||
lease_apply_details lad
|
||||
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 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 sys_user su on mtk.user_id = su.user_id
|
||||
WHERE
|
||||
|
|
|
|||
|
|
@ -353,6 +353,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE a.parentId is not null
|
||||
</select>
|
||||
<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>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue