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