项目部出库接口开发

This commit is contained in:
bonus 2025-09-27 14:54:37 +08:00
parent ba3470bc26
commit e61f7590df
11 changed files with 61 additions and 5 deletions

View File

@ -398,6 +398,18 @@ public class MaterialMachineController extends BaseController {
return AjaxResult.success(list);
}
/**
* 获取领料项目部下拉选
* @param bean
* @return
*/
@ApiOperation(value = "获取领料项目部下拉选")
@GetMapping("/getPickDepartList")
public AjaxResult getPickDepartList(MaterialRetainedEquipmentInfo bean) {
List<MaterialRetainedEquipmentInfo> list = materialMachineService.getPickDepartList(bean);
return AjaxResult.success(list);
}
/**
* 获取工程下拉选
* @param bean

View File

@ -34,6 +34,10 @@ public class BmTeam {
* 所属项目部id
*/
private Long departId;
/**
* 所属分公司id
*/
private Long deptId;
/**
* 所属项目部

View File

@ -332,4 +332,7 @@ public class MaterialLeaseApplyInfo extends BaseEntity {
@ApiModelProperty(value = "是否人为修改01")
private Integer isUpdate;
@ApiModelProperty(value = "领料类型0班组1项目部")
private String pickType;
}

View File

@ -46,8 +46,12 @@ public class MaterialRetainedEquipmentInfo {
@Excel(name = "项目部", width = 25)
private String departName;
@ApiModelProperty(value = "项目部id")
@Excel(name = "项目部id", width = 40)
private String departId;
@ApiModelProperty(value = "工程名称")
@Excel(name = "工程名称", width = 40)
@Excel(name = "工程名称", width = 100)
private String proName;
@ApiModelProperty(value = "分包单位")

View File

@ -260,4 +260,6 @@ public interface MaterialMachineMapper {
* @return
*/
List<MaterialStorageAndUseNumInfo> getStoreNumAndUseList(MaterialRetainedEquipmentInfo bean);
List<MaterialRetainedEquipmentInfo> getPickDepartList(MaterialRetainedEquipmentInfo bean);
}

View File

@ -182,4 +182,6 @@ public interface MaterialMachineService {
* @return
*/
List<MaterialStorageAndUseNumInfo> getStoreNumAndUseList(MaterialRetainedEquipmentInfo bean);
List<MaterialRetainedEquipmentInfo> getPickDepartList(MaterialRetainedEquipmentInfo bean);
}

View File

@ -938,6 +938,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
}
leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
String createBy = SecurityUtils.getLoginUser().getSysUser().getNickName();
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(createBy);
try {
int thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_MATERIAL_LEASE.getTaskTypeId());
@ -968,9 +969,18 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
tbTeam.setRelName(StringUtils.isNotBlank(leaseApplyRequestVo.getLeaseApplyInfo().getRelName()) ? leaseApplyRequestVo.getLeaseApplyInfo().getRelName() : null);
tbTeam.setIdCard(StringUtils.isNotBlank(leaseApplyRequestVo.getLeaseApplyInfo().getTeamLeaderIdCard()) ? leaseApplyRequestVo.getLeaseApplyInfo().getTeamLeaderIdCard() : null);
tbTeam.setProjectId(leaseApplyRequestVo.getLeaseApplyInfo().getProjectId());
tbTeam.setDeptId(deptId);
tbTeam.setRelPhone(StringUtils.isNotBlank(leaseApplyRequestVo.getLeaseApplyInfo().getRelPhone()) ? leaseApplyRequestVo.getLeaseApplyInfo().getRelPhone() : null);
// 班组类型固定传值
tbTeam.setTypeId(1731L);
String pickType = leaseApplyRequestVo.getLeaseApplyInfo().getPickType();
if("1".equals(pickType)){
// 项目部类型固定传值
tbTeam.setTypeId(36L);
}else{
// 班组类型固定传值
tbTeam.setTypeId(1731L);
}
BmTeam bmTeam = bmTeamMapper.selectByName(tbTeam);
if (bmTeam == null) {
// 新增班组

View File

@ -1192,6 +1192,11 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
return recordList;
}
@Override
public List<MaterialRetainedEquipmentInfo> getPickDepartList(MaterialRetainedEquipmentInfo bean) {
return materialMachineMapper.getPickDepartList(bean);
}
/**
* 设置分公司名称如果有
* @param impUnit

View File

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="teamName != null">unit_name,</if>
<if test="departId != null">depart_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="relName != null">link_man,</if>
<if test="relPhone != null">telphone,</if>
create_time,
@ -20,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="teamName != null">#{teamName},</if>
<if test="departId != null">#{departId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="relName != null">#{relName},</if>
<if test="relPhone != null">#{relPhone},</if>
NOW(),

View File

@ -160,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="teamId != null">team_id,</if>
<if test="proId != null">project_id,</if>
<if test="leaseStyle != null">lease_style,</if>
<if test="pickType != null">pick_type,</if>
<if test="subUnitName != null and subUnitName != ''">sub_unit_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -190,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="teamId != null">#{teamId},</if>
<if test="proId != null">#{proId},</if>
<if test="leaseStyle != null">#{leaseStyle},</if>
<if test="pickType != null">#{pickType},</if>
<if test="subUnitName != null and subUnitName != ''">#{subUnitName},</if>
</trim>
</insert>

View File

@ -1642,7 +1642,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND sp.`name` LIKE CONCAT('%', #{departName}, '%')
</if>
<if test="projectIdList != null and projectIdList.size() > 0">
AND bp.external_id in
in
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
#{item}
</foreach>
@ -1935,4 +1935,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
subquery1.proId
</select>
<select id="getPickDepartList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
SELECT DISTINCT
df.project_dept_id as departId,
df.project_dept AS departName
FROM
bm_project bp
LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id
WHERE
bp.external_id = #{proId}
</select>
</mapper>