This commit is contained in:
parent
3a0ef44b56
commit
16fe9fedbb
|
|
@ -339,5 +339,10 @@ public class LeaseApplyInfo extends BaseEntity{
|
||||||
@ApiModelProperty(value = "账号")
|
@ApiModelProperty(value = "账号")
|
||||||
private String cno;
|
private String cno;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* i8工程id集合
|
||||||
|
*/
|
||||||
|
private List<String> projectIdList;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,4 +133,25 @@ public class LeaseOutDetails extends BaseEntity {
|
||||||
* 领料出库机具编码集合
|
* 领料出库机具编码集合
|
||||||
*/
|
*/
|
||||||
private List<LeaseOutDetails> maCodeList;
|
private List<LeaseOutDetails> maCodeList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发料单位")
|
||||||
|
private String sendUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领料id")
|
||||||
|
private Integer leaseUnitId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领料工程id")
|
||||||
|
private Integer leaseProjectId;
|
||||||
|
|
||||||
|
/** 退料数量 */
|
||||||
|
@ApiModelProperty(value = "退料数量")
|
||||||
|
private BigDecimal preNum;
|
||||||
|
|
||||||
|
/** 审批数量 */
|
||||||
|
@ApiModelProperty(value = "审批数量")
|
||||||
|
private BigDecimal alNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
import com.bonus.common.biz.domain.lease.LeasePublishInfo;
|
import com.bonus.common.biz.domain.lease.LeasePublishInfo;
|
||||||
import com.bonus.common.biz.domain.lease.WorkApplyInfo;
|
import com.bonus.common.biz.domain.lease.WorkApplyInfo;
|
||||||
import com.bonus.common.biz.domain.lease.WorkPeopleInfo;
|
import com.bonus.common.biz.domain.lease.WorkPeopleInfo;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.LeasePublishDetails;
|
import com.bonus.material.lease.domain.LeasePublishDetails;
|
||||||
import com.bonus.material.lease.domain.vo.LeaseDeptInfo;
|
import com.bonus.material.lease.domain.vo.LeaseDeptInfo;
|
||||||
|
|
@ -197,4 +198,11 @@ public interface LeaseTaskMapper {
|
||||||
LeasePublishDetails selectPublishDetailsByCode();
|
LeasePublishDetails selectPublishDetailsByCode();
|
||||||
|
|
||||||
TmTaskAgreement getAgreementInfo(LeaseApplyInfo leaseApplyInfo);
|
TmTaskAgreement getAgreementInfo(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工程id查询i8工程id
|
||||||
|
* @param leaseApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BmProject selectById(LeaseApplyInfo leaseApplyInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,15 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.material.basic.domain.BmAgreementInfo;
|
import com.bonus.material.basic.domain.BmAgreementInfo;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.basic.domain.dto.SysUserRoleVo;
|
import com.bonus.material.basic.domain.dto.SysUserRoleVo;
|
||||||
import com.bonus.material.basic.mapper.BmAgreementInfoMapper;
|
import com.bonus.material.basic.mapper.BmAgreementInfoMapper;
|
||||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
import com.bonus.material.basic.mapper.BmUserRoleMapper;
|
import com.bonus.material.basic.mapper.BmUserRoleMapper;
|
||||||
|
import com.bonus.material.clz.domain.BmTeam;
|
||||||
|
import com.bonus.material.clz.domain.vo.IwsTeamUserVo;
|
||||||
|
import com.bonus.material.clz.mapper.BmTeamMapper;
|
||||||
|
import com.bonus.material.clz.mapper.IwsTeamUserMapper;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.LeasePublishDetails;
|
import com.bonus.material.lease.domain.LeasePublishDetails;
|
||||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
|
|
@ -100,6 +105,12 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
||||||
@Resource
|
@Resource
|
||||||
private BmAgreementInfoMapper bmAgreementInfoMapper;
|
private BmAgreementInfoMapper bmAgreementInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IwsTeamUserMapper iwsTeamUserMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BmTeamMapper bmTeamMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增领用任务
|
* 新增领用任务
|
||||||
|
|
@ -203,7 +214,34 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
||||||
if (statusFlag != null && statusFlag == 0) {
|
if (statusFlag != null && statusFlag == 0) {
|
||||||
newId = sysWorkflowRecordService.addSysWorkflowRecord(tmTask.getTaskId().intValue(), taskCode, 19);
|
newId = sysWorkflowRecordService.addSysWorkflowRecord(tmTask.getTaskId().intValue(), taskCode, 19);
|
||||||
}
|
}
|
||||||
|
// 根据传入的工程id,查询班组信息,进行数据同步
|
||||||
|
BmProject bmProject = mapper.selectById(leaseApplyInfo);
|
||||||
|
if (bmProject != null && StringUtils.isNotBlank(bmProject.getExternalId())) {
|
||||||
|
List<String> ids = Collections.singletonList(bmProject.getExternalId());
|
||||||
|
List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
||||||
|
if (!CollectionUtils.isEmpty(iwsTeamUserVos)) {
|
||||||
|
for (IwsTeamUserVo iwsTeamUserVo : iwsTeamUserVos) {
|
||||||
|
BmTeam bmTeam = new BmTeam();
|
||||||
|
bmTeam.setTeamName(StringUtils.isNotBlank(iwsTeamUserVo.getTeamName()) ? iwsTeamUserVo.getTeamName() : null);
|
||||||
|
bmTeam.setCreateUser(SecurityUtils.getLoginUser().getUserid().toString());
|
||||||
|
bmTeam.setRelName(StringUtils.isNotBlank(iwsTeamUserVo.getRelName()) ? iwsTeamUserVo.getRelName() : null);
|
||||||
|
bmTeam.setIdCard(StringUtils.isNotBlank(iwsTeamUserVo.getTeamLeaderIdCard()) ? iwsTeamUserVo.getTeamLeaderIdCard() : null);
|
||||||
|
bmTeam.setProjectId(StringUtils.isNotBlank(iwsTeamUserVo.getProjectId()) ? iwsTeamUserVo.getProjectId() : null);
|
||||||
|
bmTeam.setRelPhone(StringUtils.isNotBlank(iwsTeamUserVo.getRelPhone()) ? iwsTeamUserVo.getRelPhone() : null);
|
||||||
|
// 班组类型固定传值
|
||||||
|
bmTeam.setTypeId(1731L);
|
||||||
|
// 根据班组名称去bm_unit表查询班组信息
|
||||||
|
BmTeam bmTeam1 = bmTeamMapper.selectByName(bmTeam);
|
||||||
|
if (bmTeam1 == null) {
|
||||||
|
// 走新增逻辑
|
||||||
|
int result = bmTeamMapper.insert(bmTeam);
|
||||||
|
if (result <= 0) {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
if (statusFlag != null && statusFlag == 0) {
|
if (statusFlag != null && statusFlag == 0) {
|
||||||
createWorkOrderAndPeople(sysUser, leaseApplyInfo, tmTask, newId);
|
createWorkOrderAndPeople(sysUser, leaseApplyInfo, tmTask, newId);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.common.core.domain.R;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.common.mapper.SelectMapper;
|
||||||
import com.bonus.material.materialStation.domain.ProAuthorizeDetails;
|
import com.bonus.material.materialStation.domain.ProAuthorizeDetails;
|
||||||
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
|
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
|
||||||
import com.bonus.material.materialStation.mapper.ProAuthorizeMapper;
|
import com.bonus.material.materialStation.mapper.ProAuthorizeMapper;
|
||||||
|
|
@ -59,10 +60,23 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
||||||
@Resource
|
@Resource
|
||||||
private ProAuthorizeMapper mapper;
|
private ProAuthorizeMapper mapper;
|
||||||
|
|
||||||
|
@Resource(name = "SelectMapper")
|
||||||
|
private SelectMapper selectMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LeasePublishInfo> getPublishList(LeaseApplyInfo leaseApplyInfo) {
|
public List<LeasePublishInfo> getPublishList(LeaseApplyInfo leaseApplyInfo) {
|
||||||
try {
|
try {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
// 根据用户名查询项目部信息
|
||||||
|
String departId = selectMapper.getDepartId(username);
|
||||||
|
// 根据项目部id查询工程信息
|
||||||
|
if (StringUtils.isNotBlank(departId)) {
|
||||||
|
List<String> projectIdList = selectMapper.getProjectId(departId);
|
||||||
|
if (!CollectionUtils.isEmpty(projectIdList)) {
|
||||||
|
leaseApplyInfo.setProjectIdList(projectIdList);
|
||||||
|
}
|
||||||
|
}
|
||||||
List<LeasePublishInfo> list = mapper.getPublishList(leaseApplyInfo);
|
List<LeasePublishInfo> list = mapper.getPublishList(leaseApplyInfo);
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
String keyWord = leaseApplyInfo.getKeyWord();
|
String keyWord = leaseApplyInfo.getKeyWord();
|
||||||
|
|
|
||||||
|
|
@ -457,6 +457,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="proId != null">
|
<if test="proId != null">
|
||||||
AND ba.project_id = #{proId}
|
AND ba.project_id = #{proId}
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY mm.ma_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDetailsById" resultType="com.bonus.material.back.domain.BackApplyDetails">
|
<select id="getDetailsById" resultType="com.bonus.material.back.domain.BackApplyDetails">
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createUser != null">
|
<if test="createUser != null">
|
||||||
and t.create_by = #{createUser}
|
and t.create_by = #{createUser}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="typeId != null">
|
||||||
|
and t.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
<if test="idCard != null and idCard != ''">
|
<if test="idCard != null and idCard != ''">
|
||||||
and t.bzz_idcard = #{idCard}
|
and t.bzz_idcard = #{idCard}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -809,14 +809,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND ba.project_id = #{proId}
|
AND ba.project_id = #{proId}
|
||||||
GROUP BY mm.type_id
|
GROUP BY mm.type_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTeamList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
<select id="getTeamList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
||||||
SELECT
|
SELECT DISTINCT bu.unit_id AS id,
|
||||||
unit_id as id,
|
bzgl_bz.bzmc AS name
|
||||||
unit_name AS name
|
FROM bm_unit bu
|
||||||
FROM
|
LEFT JOIN `micro-tool`.bzgl_bz bzgl_bz ON bzgl_bz.bzmc = bu.unit_name
|
||||||
bm_unit
|
LEFT JOIN `uni_org`.org_user org_user ON bzgl_bz.bzz_idcard = org_user.id_card
|
||||||
WHERE
|
WHERE bu.del_flag = '0'
|
||||||
del_flag = '0'
|
and bzgl_bz.project_id = #{externalId}
|
||||||
and type_id = 1731
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -759,10 +759,8 @@
|
||||||
FROM
|
FROM
|
||||||
lease_apply_details lad
|
lease_apply_details lad
|
||||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||||
AND mt.`level` = '4'
|
|
||||||
AND mt.del_flag = '0'
|
AND mt.del_flag = '0'
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
AND mt2.`level` = '3'
|
|
||||||
AND mt2.del_flag = '0'
|
AND mt2.del_flag = '0'
|
||||||
LEFT JOIN ( SELECT parent_id, type_id, sum( num ) AS num FROM lease_publish_details GROUP BY parent_id, type_id ) a
|
LEFT JOIN ( SELECT parent_id, type_id, sum( num ) AS num FROM lease_publish_details GROUP BY parent_id, type_id ) a
|
||||||
ON a.parent_id = lad.parent_id AND a.type_id = lad.type_id
|
ON a.parent_id = lad.parent_id AND a.type_id = lad.type_id
|
||||||
|
|
@ -1052,4 +1050,11 @@
|
||||||
where unit_id = #{unitId} and project_id = #{projectId}
|
where unit_id = #{unitId} and project_id = #{projectId}
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectById" resultType="com.bonus.material.basic.domain.BmProject">
|
||||||
|
select pro_id as proId,
|
||||||
|
pro_name as proName,
|
||||||
|
external_id as externalId
|
||||||
|
from bm_project
|
||||||
|
where pro_id = #{projectId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
||||||
</if>
|
</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>
|
||||||
GROUP BY lai.id
|
GROUP BY lai.id
|
||||||
ORDER BY tt.task_status,tt.create_time desc
|
ORDER BY tt.task_status,tt.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue