|
@@ -13,6 +13,7 @@ import com.ankaibei.workFlow.common.flow.model.FlowEntryPublish;
|
|
|
import com.ankaibei.workFlow.common.flow.vo.TaskInfoVo;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.entity.*;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.enums.CodeEnum;
|
|
|
+import com.ankaibei.workFlow.webadmin.ankaibei.enums.DataIsDeleteEnum;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.enums.ManHourStatus;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.mapper.*;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.service.ManHourService;
|
|
@@ -87,15 +88,20 @@ public class ManHourServiceImpl implements ManHourService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResMsg addManHour(ManHourInfoEntity manHourInfoEntity, List<ManHourJobVo> jobs) {
|
|
|
- Optional<UserInfoEntity> byId1 = userInfoMapper.findById(manHourInfoEntity.getCreateUser());
|
|
|
- //工时:添加后状态为1,未提交
|
|
|
+ public ResMsg addManHour(ManHourInfoVo manHourInfoVo) {
|
|
|
+ List<ManHourJobVo> jobs = manHourInfoVo.getJobs();
|
|
|
+ Optional<UserInfoEntity> byId1 = userInfoMapper.findById(manHourInfoVo.getCreateUser());
|
|
|
String showName = byId1.orElse(null) != null ? byId1.orElse(null).getShowName() : null;
|
|
|
- manHourInfoEntity.setProjectUser(showName);
|
|
|
- manHourInfoEntity.setCreateUser(showName);
|
|
|
- manHourInfoEntity.setManStatus(ManHourStatus.NO_ALLOCATION.getCode());
|
|
|
for (ManHourJobVo job : jobs) {
|
|
|
+ ManHourInfoEntity manHourInfoEntity = new ManHourInfoEntity();
|
|
|
+ BeanUtils.copyProperties(manHourInfoVo, manHourInfoEntity);
|
|
|
+ //工时:添加后状态为1,未提交
|
|
|
+ manHourInfoEntity.setProjectUser(showName);
|
|
|
+ manHourInfoEntity.setCreateUser(byId1.get().getUserId());
|
|
|
+ manHourInfoEntity.setManStatus(ManHourStatus.NO_ALLOCATION.getCode());
|
|
|
BeanUtils.copyProperties(job, manHourInfoEntity);
|
|
|
+ manHourInfoEntity.setCreateTime(new Date());
|
|
|
+ manHourInfoEntity.setIsDelete(DataIsDeleteEnum.NORMAL.getCode());
|
|
|
manHourMapper.save(manHourInfoEntity);
|
|
|
}
|
|
|
return new ResMsg(CodeEnum.OK);
|