This commit is contained in:
parent
b9c8b4aa67
commit
f4922d8331
|
|
@ -3,6 +3,7 @@ package com.bonus.material.basic.mapper;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.bonus.material.basic.domain.BmAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 协议管理Mapper接口
|
||||
|
|
@ -100,4 +101,12 @@ public interface BmAgreementInfoMapper
|
|||
* @return
|
||||
*/
|
||||
int selectNumByMonthClz(Date nowDate);
|
||||
|
||||
/**
|
||||
* 根据单位及工程id查询是否已经建立项目部协议
|
||||
* @param unitId
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
Long selectProjectUnitAgreementIdByTeamAndProject(@Param("teamId") Long unitId, @Param("projectId") Long projectId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,16 +138,22 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
|
|||
}
|
||||
int count = bmAgreementInfoMapper.insertBmAgreementInfo(bmAgreementInfo);
|
||||
if (count > 0) {
|
||||
if (CollectionUtils.isEmpty(bmAgreementInfo.getBmFileInfos())) {
|
||||
return AjaxResult.success("新增任务成功,无营业执照附件");
|
||||
}
|
||||
AtomicBoolean addFileInfoResult = new AtomicBoolean(false);
|
||||
bmAgreementInfo.getBmFileInfos().forEach(bmFileInfo -> {
|
||||
bmFileInfo.setModelId(bmAgreementInfo.getAgreementId());
|
||||
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
addFileInfoResult.set(bmFileInfoMapper.insertBmFileInfo(bmFileInfo) > 0);
|
||||
});
|
||||
return addFileInfoResult.get() ? AjaxResult.success("新增任务成功") : AjaxResult.error("新增任务失败,附件表插入0条");
|
||||
if (!CollectionUtils.isEmpty(bmAgreementInfo.getBmFileInfos())) {
|
||||
bmAgreementInfo.getBmFileInfos().forEach(bmFileInfo -> {
|
||||
bmFileInfo.setModelId(bmAgreementInfo.getAgreementId());
|
||||
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||
addFileInfoResult.set(bmFileInfoMapper.insertBmFileInfo(bmFileInfo) > 0);
|
||||
});
|
||||
}
|
||||
AjaxResult result = AjaxResult.success("新增任务成功");
|
||||
// 根据单位及工程id查询是否已经建立项目部协议,若没建立,给与提醒
|
||||
Long agreementId = bmAgreementInfoMapper.selectProjectUnitAgreementIdByTeamAndProject(bmAgreementInfo.getUnitId(), bmAgreementInfo.getProjectId());
|
||||
if (agreementId == null) {
|
||||
// 提醒需建立项目部与工程的协议
|
||||
result.put("reminder", "您好,您还需建立项目部与工程的协议");
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return AjaxResult.error("新建任务失败,插入0条");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,11 +137,6 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
@Override
|
||||
public List<RepairInputDetails> selectRepairInputDetailsList(RepairInputDetails repairInputDetails) {
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
// 首先根据用户名去ma_type_manage表查询是否存在绑定物资信息
|
||||
/* List<Long> typeIdList = backApplyInfoMapper.selectTypeIdList(userId);
|
||||
if (org.springframework.util.CollectionUtils.isEmpty(typeIdList)) {
|
||||
repairInputDetails.setUserId(userId == 0 ? null : userId);
|
||||
}*/
|
||||
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
|
||||
// 检查用户是否具有特殊角色
|
||||
boolean hasSpecialRole = hasSpecialRole(userRoles);
|
||||
|
|
@ -178,17 +173,17 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
}
|
||||
if (repairInputDetails.getTaskStatus() != null) {
|
||||
list = list.stream()
|
||||
.filter(item -> item.getTaskStatus().equals(repairInputDetails.getTaskStatus()))
|
||||
.filter(item -> item.getTaskStatus() != null && item.getTaskStatus().equals(repairInputDetails.getTaskStatus()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
if (repairInputDetails.getAppTaskStatus() != null && repairInputDetails.getAppTaskStatus() == 0) {
|
||||
list = list.stream()
|
||||
.filter(item -> item.getTaskStatus().equals(repairInputDetails.getAppTaskStatus()))
|
||||
.filter(item -> item.getTaskStatus() != null && item.getTaskStatus().equals(repairInputDetails.getAppTaskStatus()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
if (repairInputDetails.getAppTaskStatus() != null && repairInputDetails.getAppTaskStatus() == 1) {
|
||||
list = list.stream()
|
||||
.filter(item -> item.getTaskStatus() == 1 || item.getTaskStatus() == 2)
|
||||
.filter(item -> item.getTaskStatus() != null && (item.getTaskStatus() == 1 || item.getTaskStatus() == 2))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return list;
|
||||
|
|
|
|||
|
|
@ -201,4 +201,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectNumByMonthClz" resultType="java.lang.Integer">
|
||||
select count(*) from clz_bm_agreement_info where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m')
|
||||
</select>
|
||||
<select id="selectProjectUnitAgreementIdByTeamAndProject" resultType="java.lang.Long">
|
||||
SELECT
|
||||
baii.agreement_id AS projectUnitAgreementId
|
||||
FROM
|
||||
bm_agreement_info bai
|
||||
LEFT JOIN bm_agreement_info baii ON baii.unit_id = bai.project_unit_id AND baii.project_id = #{projectId}
|
||||
AND baii.status = '1'
|
||||
WHERE
|
||||
bai.unit_id = #{teamId} AND bai.project_id = #{projectId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1357,13 +1357,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND bp.pro_name = #{proName}
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
AND bp.pro_center like concat('%',#{departName},'%')
|
||||
AND bp.pro_center = #{departName}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_name like concat('%',#{typeName},'%')
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
<if test="typeModelName != null and typeModelName != ''">
|
||||
AND mt.type_name like concat('%',#{typeModelName},'%')
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">
|
||||
AND '站内库存' like concat('%',#{teamName},'%')
|
||||
|
|
@ -1424,16 +1424,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and sd.dept_id not in (342,345,347,348,101,344)
|
||||
and bp.pro_id not in (3414,1192,3321,3595)
|
||||
<if test="impUnitName != null and impUnitName != ''">
|
||||
AND sd.dept_name like concat('%',#{impUnitName},'%')
|
||||
AND sd.dept_name = #{impUnitName}
|
||||
</if>
|
||||
<if test="proName != null and proName != ''">
|
||||
AND bp.pro_name like concat('%',#{proName},'%')
|
||||
AND bp.pro_name = #{proName}
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
AND bp.pro_center like concat('%',#{departName},'%')
|
||||
AND bp.pro_center = #{departName}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_name like concat('%',#{typeName},'%')
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">
|
||||
AND '站内库存' like concat('%',#{teamName},'%')
|
||||
|
|
@ -1442,7 +1442,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND '站内库存' like concat('%',#{subUnitName},'%')
|
||||
</if>
|
||||
<if test="typeModelName != null and typeModelName != ''">
|
||||
AND mt.type_name like concat('%',#{typeModelName},'%')
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
|
|
@ -1526,19 +1526,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND bp.pro_name = #{proName}
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
AND bp.pro_center LIKE CONCAT('%', #{departName}, '%')
|
||||
AND bp.pro_center = #{departName}
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">
|
||||
AND bu.unit_name LIKE CONCAT('%', #{teamName}, '%')
|
||||
AND bu.unit_name = #{teamName}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_name LIKE CONCAT('%', #{typeName}, '%')
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
<if test="typeModelName != null and typeModelName != ''">
|
||||
AND mt.type_name LIKE CONCAT('%', #{typeModelName}, '%')
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
<if test="subUnitName != null and subUnitName != ''">
|
||||
AND bz.ssfbdw LIKE CONCAT('%', #{subUnitName}, '%')
|
||||
AND bz.ssfbdw = #{subUnitName}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
AND bp.external_id in
|
||||
|
|
@ -2413,13 +2413,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND bp.pro_name = #{proName}
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
AND bp.pro_center like concat('%',#{departName},'%')
|
||||
AND bp.pro_center = #{departName}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_name like concat('%',#{typeName},'%')
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
<if test="typeModelName != null and typeModelName != ''">
|
||||
AND mt.type_name like concat('%',#{typeModelName},'%')
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
|
|
@ -2437,7 +2437,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND '分包直领' like concat('%',#{subUnitName},'%')
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">
|
||||
AND bu.unit_name LIKE CONCAT('%', #{teamName}, '%')
|
||||
AND bu.unit_name = #{teamName}
|
||||
</if>
|
||||
GROUP BY
|
||||
mt.type_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue