This commit is contained in:
parent
6c7bf4bf72
commit
639cdc3af7
|
|
@ -207,7 +207,8 @@ public class TypeController extends BaseController {
|
|||
@ApiOperation(value = "获取领用物资类型连动式下拉框")
|
||||
@GetMapping("/equipmentTypeLease")
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,5 +286,5 @@ public interface TypeMapper {
|
|||
* @param typeName
|
||||
* @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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ public interface ITypeService {
|
|||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
List<Type> equipmentTypeLease(Long typeId, String typeName);
|
||||
List<Type> equipmentTypeLease(Long typeId, String typeName, Long deptId);
|
||||
|
||||
Long getUserDeptId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -654,6 +654,10 @@ public class DirectRotationImpl implements DirectRotationService {
|
|||
BmAgreementInfo bmAgreementInfo = new BmAgreementInfo();
|
||||
bmAgreementInfo.setUnitId(Long.valueOf(directApplyInfos.getLeaseUnitId()));
|
||||
bmAgreementInfo.setProjectId(Long.valueOf(directApplyInfos.getLeaseProId()));
|
||||
bmAgreementInfo.setCreateTime(DateUtils.getNowDate());
|
||||
bmAgreementInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
bmAgreementInfo.setSignTime(DateUtils.getNowDate());
|
||||
bmAgreementInfo.setAgreementCode(getAgreementCode());
|
||||
// 先根据班组和工程id查询,若存在则直接返回,不存在则新增
|
||||
Long agreementId = null;
|
||||
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
|
||||
|
|
|
|||
|
|
@ -356,8 +356,8 @@ public class TypeServiceImpl implements ITypeService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Type> equipmentTypeLease(Long typeId, String typeName) {
|
||||
List<Type> maTypes = typeMapper.equipmentTypeLease(typeId, typeName);
|
||||
public List<Type> equipmentTypeLease(Long typeId, String typeName, Long deptId) {
|
||||
List<Type> maTypes = typeMapper.equipmentTypeLease(typeId, typeName, deptId);
|
||||
List<Type> roots = maTypes.stream()
|
||||
.filter(t -> t.getParentId() == 0)
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -1524,6 +1524,13 @@
|
|||
<if test="typeId != null and typeId !=''">
|
||||
AND m.type_id = #{typeId}
|
||||
</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>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue