This commit is contained in:
parent
2dc94f20b8
commit
150b01d3cc
|
|
@ -144,7 +144,7 @@ public class DirectRotationImpl implements DirectRotationService {
|
|||
if (directApplyInfos.getBackAgreementId()==directApplyInfos.getLeaseAgreementId()){
|
||||
return AjaxResult.error("申请失败,不能转入同单位同工程");
|
||||
}
|
||||
// 根据退料协议ID查询该协议是否还有未审核单据待处理,若有,则无法申请
|
||||
// 根据退料协议ID查询该协议是否还有未审核单据待处理,若有,则无法申请,剔除工地直转
|
||||
int result = workSiteDirectManageService.checkLeaseApply(directApplyInfos);
|
||||
if (result > 0) {
|
||||
return AjaxResult.error("申请失败,该转出单位和转出工程下有未审核单据待处理,请处理完毕后再重新提交");
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
String format = simpleDateFormat.format(date);
|
||||
List<DirectApplyInfo> list = workSiteDirectManageMapper.getListAll();
|
||||
int i = list.size() + 1;
|
||||
return "ZZ" + format + "-" + list.size() + i;
|
||||
return "ZZ" + format + "-" + i;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -175,8 +175,6 @@ public interface TmTaskMapper {
|
|||
*/
|
||||
TmTask selectTaskByCode(String code);
|
||||
|
||||
TmTask selectTaskByCodeAndType(@Param("code") String code,@Param("type") String type);
|
||||
|
||||
/**
|
||||
* 根据任务编号查询任务信息
|
||||
* @param backApplyInfo
|
||||
|
|
|
|||
|
|
@ -52,11 +52,6 @@ public class TmTaskServiceImpl implements ITmTaskService {
|
|||
public int insertTmTask(TmTask tmTask) {
|
||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
//TODO: 2024/10/16 根据任务编号和任务类型,判断次时任务编号是否已存在,若已存在,不予创建
|
||||
TmTask tmTaskByCode = tmTaskMapper.selectTaskByCodeAndType(tmTask.getCode(),tmTask.getTaskType()+"");
|
||||
if(tmTaskByCode !=null){
|
||||
throw new ServiceException("此任务已创建,请重新刷新页面查看!");
|
||||
}
|
||||
return tmTaskMapper.insertTmTask(tmTask);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
|
|
|
|||
|
|
@ -1152,7 +1152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_unit bu ON ba.unit_id = bu.unit_id and bu.del_flag = '0'
|
||||
WHERE
|
||||
sai.status = '0'
|
||||
AND bu.type_id in ('32', '36')
|
||||
AND bu.type_id = '36'
|
||||
AND mt.type_id = #{typeId}
|
||||
AND ba.project_id = #{proId}
|
||||
<if test="maCode != null and maCode != ''">
|
||||
|
|
|
|||
|
|
@ -753,7 +753,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt.manage_type AS manageType,
|
||||
-- 计算status的CASE表达式
|
||||
CASE
|
||||
-- WHEN mm.next_check_time < CURDATE() THEN 3 -- 已超过当前时间
|
||||
WHEN mm.next_check_time < CURDATE() THEN 3 -- 已超过当前时间
|
||||
WHEN DATEDIFF(mm.next_check_time, CURDATE()) <= 30 THEN 2 -- 相差不足1个月
|
||||
WHEN DATEDIFF(mm.next_check_time, CURDATE()) <= 90 THEN 1 -- 相差不足3个月
|
||||
ELSE 0 -- 相差3个月以上
|
||||
|
|
@ -2023,6 +2023,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND sai.end_time IS NULL
|
||||
AND sai.back_id IS NULL
|
||||
AND bp.external_id IS NOT NULL
|
||||
AND bu.type_id = 36
|
||||
<if test="impUnitName != null and impUnitName != ''">
|
||||
AND sd.dept_name = #{impUnitName}
|
||||
</if>
|
||||
|
|
@ -2144,8 +2145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
WHERE mt.`level` = 4 and mt.del_flag = '0'
|
||||
AND subquery1.proName IS NOT NULL
|
||||
GROUP BY mt.type_id,
|
||||
GROUP BY
|
||||
mt.type_id,
|
||||
subquery1.proId
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getLeaseDemandNum" resultType="com.bonus.material.clz.domain.vo.MaterialProvideNumInfo">
|
||||
|
|
@ -2259,18 +2262,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="batchQueryUseDemand" resultType="com.bonus.material.clz.domain.vo.MaterialProvideNumInfo">
|
||||
select
|
||||
lpd.project_id AS proId,
|
||||
lpd.type_id AS typeId,
|
||||
bai.project_id AS proId,
|
||||
lpd.new_type AS typeId,
|
||||
IFNULL(sum(lpd.num),0) AS businessNum
|
||||
from
|
||||
lease_publish_details lpd
|
||||
LEFT JOIN bm_agreement_info bai ON lpd.project_id = bai.project_id
|
||||
AND lpd.unit_id = bai.unit_id
|
||||
LEFT JOIN (SELECT lease_id,agreement_id FROM slt_agreement_info GROUP BY lease_id,agreement_id) sai ON sai.lease_id = lpd.parent_id
|
||||
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
|
||||
WHERE
|
||||
lpd.type_id IS NOT NULL
|
||||
lpd.new_type IS NOT NULL
|
||||
<foreach collection="list" item="item" separator="OR" open="AND (" close=")">
|
||||
(
|
||||
lpd.type_id = #{item.typeId}
|
||||
lpd.new_type = #{item.typeId}
|
||||
AND bai.agreement_id IN (
|
||||
<foreach collection="item.agreementIds" item="aid" separator=",">
|
||||
#{aid}
|
||||
|
|
@ -2279,13 +2282,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</foreach>
|
||||
GROUP BY
|
||||
lpd.project_id,
|
||||
lpd.type_id
|
||||
bai.project_id,
|
||||
lpd.new_type
|
||||
</select>
|
||||
|
||||
<select id="getSubInfoList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
mt.type_id,
|
||||
mt.type_id AS typeId,
|
||||
mt4.type_name AS constructionType,
|
||||
mt4.type_id AS firstTypeId,
|
||||
mt3.type_name AS materialType,
|
||||
|
|
@ -2367,4 +2370,125 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt.type_id,
|
||||
bp.pro_id
|
||||
</select>
|
||||
|
||||
<select id="getSubDemandAndSupply" resultType="com.bonus.material.clz.domain.vo.MaterialSecondInfo">
|
||||
SELECT
|
||||
bu.unit_name AS subUnitName,
|
||||
bp.pro_name AS proName,
|
||||
sai.type_id AS typeId,
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt.unit_name AS unit,
|
||||
SUM( sai.num ) AS leaseNum,
|
||||
SUM( CASE WHEN sai.STATUS = 0 THEN sai.num ELSE 0 END ) AS useNum,
|
||||
SUM( CASE WHEN sai.STATUS = 1 THEN sai.num ELSE 0 END ) AS backNum,
|
||||
'/' AS teamName
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.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 bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
|
||||
LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id
|
||||
WHERE
|
||||
sai.is_slt = '0'
|
||||
AND bu.type_id in(32,33)
|
||||
AND bp.pro_id = #{proId}
|
||||
AND sai.type_id = #{typeId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt2.type_name LIKE CONCAT('%',#{keyWord},'%') OR
|
||||
mt.type_name LIKE CONCAT('%',#{keyWord},'%') OR
|
||||
bu.unit_name LIKE CONCAT('%',#{keyWord},'%') OR
|
||||
bp.pro_name LIKE CONCAT('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
bp.pro_id,
|
||||
sai.type_id,
|
||||
bu.unit_name
|
||||
</select>
|
||||
|
||||
<select id="getSubAgreementIds" resultType="com.bonus.material.clz.domain.vo.MaterialProvideNumInfo">
|
||||
SELECT
|
||||
mt.type_id AS typeId,
|
||||
mt4.type_name AS constructionType,
|
||||
mt4.type_id AS firstTypeId,
|
||||
mt3.type_name AS materialType,
|
||||
mt3.type_id AS secondTypeId,
|
||||
mt2.type_name AS typeName,
|
||||
mt2.type_id AS thirdTypeId,
|
||||
mt.type_name AS typeModelName,
|
||||
SUM(IFNULL( sai.num, 0 )) AS usNum,
|
||||
bp.pro_name as proName,
|
||||
bp.pro_id as proId,
|
||||
bp.external_id as externalId,
|
||||
bp.imp_unit AS impUnit,
|
||||
bu.bzz_idcard AS idCard,
|
||||
df.project_dept AS proCenter,
|
||||
sd.dept_name AS departName,
|
||||
GROUP_CONCAT(DISTINCT sai.agreement_id) AS agreementIds
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.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 bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
|
||||
LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id
|
||||
WHERE
|
||||
sai.`status` = '0'
|
||||
AND sai.is_slt = '0'
|
||||
AND sai.end_time IS NULL
|
||||
AND sai.back_id IS NULL
|
||||
AND bp.external_id IS NOT NULL
|
||||
<if test="impUnitName != null and impUnitName != ''">
|
||||
AND sd.dept_name = #{impUnitName}
|
||||
</if>
|
||||
<if test="proName != null and proName != ''">
|
||||
AND bp.pro_name = #{proName}
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
AND bp.pro_center = #{departName}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
<if test="typeModelName != null and typeModelName != ''">
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
AND bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="impUnit != null and impUnit != ''">
|
||||
AND bp.imp_unit = #{impUnit}
|
||||
</if>
|
||||
<if test="jiJuType != null and jiJuType != ''">
|
||||
AND mt.jiju_type = #{jiJuType}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%') or
|
||||
bp.pro_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="unitValue != null and unitValue != ''">
|
||||
AND mt.unit_value = #{unitValue}
|
||||
</if>
|
||||
GROUP BY mt.type_id,
|
||||
bp.pro_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1153,14 +1153,13 @@
|
|||
|
||||
<select id="getAgreementInfo" resultType="com.bonus.material.task.domain.TmTaskAgreement">
|
||||
SELECT
|
||||
bai.agreement_id AS agreementId
|
||||
agreement_id AS agreementId
|
||||
FROM
|
||||
bm_agreement_info bai
|
||||
LEFT JOIN slt_agreement_info sai ON bai.agreement_id = sai.agreement_id
|
||||
bm_agreement_info
|
||||
WHERE
|
||||
sai.is_slt = '0'
|
||||
AND bai.unit_id = #{unitId}
|
||||
AND bai.project_id = #{projectId}
|
||||
is_slt = '0'
|
||||
AND unit_id = #{unitId}
|
||||
AND project_id = #{projectId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectById" resultType="com.bonus.material.basic.domain.BmProject">
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
<if test="keyWord != null and keyWord != ''">
|
||||
and (mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.ma_code like concat('%', #{keyWord}, '%')
|
||||
mm.ma_code like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
|
|
|
|||
|
|
@ -286,7 +286,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
</select>
|
||||
|
||||
<select id="selectTaskByCodeAndType" resultMap="TmTaskResult">
|
||||
select * from tm_task where code = #{code} and task_type = #{type} limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -243,10 +243,11 @@
|
|||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
direct_apply_info
|
||||
direct_apply_info da
|
||||
WHERE
|
||||
`status` = '0'
|
||||
AND back_agreement_id = #{backAgreementId}
|
||||
da.`status` = '0'
|
||||
AND da.id IN ( SELECT task_id FROM sys_workflow_record )
|
||||
AND da.back_agreement_id = #{backAgreementId}
|
||||
</select>
|
||||
|
||||
<select id="getDirectList" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue