提交修改
This commit is contained in:
commit
ae819e0599
@ -81,17 +81,23 @@ public class EquipmentController extends AbstractController {
|
||||
model.setBrandId(equipmentInfo.getBrandId());
|
||||
model.setSpecId(equipmentInfo.getSpecsId());
|
||||
|
||||
Long departmentId = -1L;
|
||||
if(equipmentInfo.getSaiId()!=null){
|
||||
SpecialApplyInfo specialApplyInfo = specialApplyInfoService.selectSpecialApplyInfoById(equipmentInfo.getSaiId());
|
||||
}
|
||||
if(equipmentInfo.getUserId()!=null){
|
||||
DepartmentsStaffRelateEntity entity = departmentsStaffRelateService.selectByStaffId(equipmentInfo.getUserId());
|
||||
}
|
||||
model.setDepartId(departmentId);
|
||||
|
||||
int i = tCountMapper.selectMaxNum();
|
||||
if(equipmentInfo.getCount()<i){
|
||||
logger.info("第" + i + "次盘点" + code);
|
||||
Long departmentId = -1L;
|
||||
if(equipmentInfo.getSaiId()!=null){
|
||||
SpecialApplyInfo specialApplyInfo = specialApplyInfoService.selectSpecialApplyInfoById(equipmentInfo.getSaiId());
|
||||
if(specialApplyInfo != null){
|
||||
equipmentInfo.setDepartId(Long.valueOf(specialApplyInfo.getId()));
|
||||
}
|
||||
}
|
||||
if(equipmentInfo.getUserId()!=null){
|
||||
DepartmentsStaffRelateEntity entity = departmentsStaffRelateService.selectByStaffId(equipmentInfo.getUserId());
|
||||
if(entity != null && StringUtil.isNotBlank(entity.getDepartmentId())){
|
||||
equipmentInfo.setDepartId(Long.valueOf(entity.getDepartmentId()));
|
||||
}
|
||||
}
|
||||
equipmentInfo.setCount(i);
|
||||
iEquipmentInfoService.insertEquipmentInfo(equipmentInfo);
|
||||
}
|
||||
|
||||
@ -88,6 +88,4 @@ public class FindEquipmentResModel {
|
||||
@ApiModelProperty(value = "是否为员工使用", name = "employee")
|
||||
private boolean employee = true;
|
||||
|
||||
private Long departId;
|
||||
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ import com.lz.common.exception.ZSException;
|
||||
import com.lz.common.utils.ISelect;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.equipment.dao.*;
|
||||
import com.lz.modules.equipment.entity.*;
|
||||
@ -56,6 +58,8 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
private EquipmentSpecsMapper equipmentSpecsMapper;
|
||||
@Autowired
|
||||
private TCountMapper tCountMapper;
|
||||
@Autowired
|
||||
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||
|
||||
|
||||
|
||||
@ -137,6 +141,10 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
insert.setUser(employeesInfo.getName());
|
||||
insert.setUserId(employeesInfo.getId());
|
||||
insert.setSaiId(null);
|
||||
DepartmentsStaffRelateEntity entity = departmentsStaffRelateService.selectByStaffId(employeesInfo.getId());
|
||||
if(entity != null && StringUtil.isNotBlank(entity.getDepartmentId())){
|
||||
insert.setDepartId(Long.valueOf(entity.getDepartmentId()));
|
||||
}
|
||||
}else {
|
||||
SpecialApplyInfo specialApplyInfo = specialApplyInfoMapper.selectSpecialApplyInfoById(dto.getUserId());
|
||||
if(specialApplyInfo==null){
|
||||
@ -145,6 +153,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
insert.setUser(specialApplyInfo.getTypeDesc());
|
||||
insert.setSaiId(specialApplyInfo.getId());
|
||||
insert.setUserId(null);
|
||||
insert.setDepartId(specialApplyInfo.getId());
|
||||
}
|
||||
insert.setCount(i);
|
||||
equipmentInfoMapper.insert(insert);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user