This commit is contained in:
mashuai 2026-01-15 14:12:00 +08:00
parent 6c7bf4bf72
commit 639cdc3af7
6 changed files with 31 additions and 5 deletions

View File

@ -207,7 +207,8 @@ public class TypeController extends BaseController {
@ApiOperation(value = "获取领用物资类型连动式下拉框") @ApiOperation(value = "获取领用物资类型连动式下拉框")
@GetMapping("/equipmentTypeLease") @GetMapping("/equipmentTypeLease")
public AjaxResult equipmentTypeLease(@RequestParam(required = false) Long typeId, @RequestParam(required = false) String typeName) { public AjaxResult equipmentTypeLease(@RequestParam(required = false) Long typeId, @RequestParam(required = false) String typeName) {
List<Type> listByMaType = typeService.equipmentTypeLease(typeId, typeName); Long deptId = typeService.getUserDeptId();
List<Type> listByMaType = typeService.equipmentTypeLease(typeId, typeName, deptId);
return success(listByMaType); return success(listByMaType);
} }

View File

@ -286,5 +286,5 @@ public interface TypeMapper {
* @param typeName * @param typeName
* @return * @return
*/ */
List<Type> equipmentTypeLease(@Param("typeId") Long typeId, @Param("typeName") String typeName); List<Type> equipmentTypeLease(@Param("typeId") Long typeId, @Param("typeName") String typeName, @Param("companyId") Long companyId);
} }

View File

@ -172,7 +172,7 @@ public interface ITypeService {
* @param typeName * @param typeName
* @return * @return
*/ */
List<Type> equipmentTypeLease(Long typeId, String typeName); List<Type> equipmentTypeLease(Long typeId, String typeName, Long deptId);
Long getUserDeptId(); Long getUserDeptId();
} }

View File

@ -654,6 +654,10 @@ public class DirectRotationImpl implements DirectRotationService {
BmAgreementInfo bmAgreementInfo = new BmAgreementInfo(); BmAgreementInfo bmAgreementInfo = new BmAgreementInfo();
bmAgreementInfo.setUnitId(Long.valueOf(directApplyInfos.getLeaseUnitId())); bmAgreementInfo.setUnitId(Long.valueOf(directApplyInfos.getLeaseUnitId()));
bmAgreementInfo.setProjectId(Long.valueOf(directApplyInfos.getLeaseProId())); bmAgreementInfo.setProjectId(Long.valueOf(directApplyInfos.getLeaseProId()));
bmAgreementInfo.setCreateTime(DateUtils.getNowDate());
bmAgreementInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
bmAgreementInfo.setSignTime(DateUtils.getNowDate());
bmAgreementInfo.setAgreementCode(getAgreementCode());
// 先根据班组和工程id查询若存在则直接返回不存在则新增 // 先根据班组和工程id查询若存在则直接返回不存在则新增
Long agreementId = null; Long agreementId = null;
BmAgreementInfo bmAgreementInfo1 = bmAgreementInfoMapper.queryByTeamIdAndProjectIdCl(bmAgreementInfo); BmAgreementInfo bmAgreementInfo1 = bmAgreementInfoMapper.queryByTeamIdAndProjectIdCl(bmAgreementInfo);
@ -714,6 +718,20 @@ public class DirectRotationImpl implements DirectRotationService {
} }
} }
/**
* 获取协议编号
*
* @return
*/
private String getAgreementCode() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
String result = format.replace("-", "");
int num = bmAgreementInfoMapper.selectNumByMonthClz(nowDate);
return MaterialConstants.AGREEMENT_PREFIX + result + String.format("-%03d", num + GlobalConstants.INT_1);
}
/** /**
* 获取材料站领料任务编号 * 获取材料站领料任务编号
* @param clzMonthMaxOrder * @param clzMonthMaxOrder

View File

@ -356,8 +356,8 @@ public class TypeServiceImpl implements ITypeService {
* @return * @return
*/ */
@Override @Override
public List<Type> equipmentTypeLease(Long typeId, String typeName) { public List<Type> equipmentTypeLease(Long typeId, String typeName, Long deptId) {
List<Type> maTypes = typeMapper.equipmentTypeLease(typeId, typeName); List<Type> maTypes = typeMapper.equipmentTypeLease(typeId, typeName, deptId);
List<Type> roots = maTypes.stream() List<Type> roots = maTypes.stream()
.filter(t -> t.getParentId() == 0) .filter(t -> t.getParentId() == 0)
.collect(Collectors.toList()); .collect(Collectors.toList());

View File

@ -1524,6 +1524,13 @@
<if test="typeId != null and typeId !=''"> <if test="typeId != null and typeId !=''">
AND m.type_id = #{typeId} AND m.type_id = #{typeId}
</if> </if>
<if test="companyId != null and companyId !='' ">
AND CASE
WHEN (#{companyId} = 102 or #{companyId} = 327) THEN mt.company_id= 101
WHEN #{companyId} = 309 THEN (mt.company_id=#{companyId}) or (mt.company_id=101 and mt.jiju_type=1)
ELSE mt.type_id=-1
END
</if>
</where> </where>
</select> </select>
</mapper> </mapper>