|
|
@ -11,10 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
|
|
|
|
import com.hnac.hzims.safeproduct.constants.SafeProductConstant; |
|
|
|
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; |
|
|
|
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; |
|
|
|
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; |
|
|
|
|
|
|
|
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; |
|
|
|
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; |
|
|
|
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; |
|
|
|
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; |
|
|
|
|
|
|
|
import com.hnac.hzims.safeproduct.enums.TrainStatusEnum; |
|
|
|
|
|
|
|
import com.hnac.hzims.safeproduct.mapper.TrainPlanMapper; |
|
|
|
import com.hnac.hzims.safeproduct.mapper.TrainRecordMapper; |
|
|
|
import com.hnac.hzims.safeproduct.mapper.TrainRecordMapper; |
|
|
|
import com.hnac.hzims.safeproduct.service.ITestService; |
|
|
|
import com.hnac.hzims.safeproduct.service.ITestService; |
|
|
|
import com.hnac.hzims.safeproduct.service.ITrainRecordService; |
|
|
|
import com.hnac.hzims.safeproduct.service.ITrainRecordService; |
|
|
@ -23,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
@ -43,9 +46,13 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
ITestService testService; |
|
|
|
ITestService testService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
TrainPlanMapper trainPlanMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 新增培训记录 |
|
|
|
* 新增培训记录 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean saveTrainRecord(TrainRecordEntity trainRecordEntity) { |
|
|
|
public boolean saveTrainRecord(TrainRecordEntity trainRecordEntity) { |
|
|
|
// 获取当月时间(yyyymm)
|
|
|
|
// 获取当月时间(yyyymm)
|
|
|
@ -69,7 +76,14 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
trainRecordEntity.setCode(code); |
|
|
|
trainRecordEntity.setCode(code); |
|
|
|
return this.save(trainRecordEntity); |
|
|
|
boolean save = this.save(trainRecordEntity); |
|
|
|
|
|
|
|
// 若培训记录新增成功,修改培训计划状态为已完成
|
|
|
|
|
|
|
|
if (save) { |
|
|
|
|
|
|
|
TrainPlanEntity trainPlanEntity = trainPlanMapper.selectById(trainRecordEntity.getTrainPlanId()); |
|
|
|
|
|
|
|
trainPlanEntity.setTrainStatus(TrainStatusEnum.FINISHED.getValue()); |
|
|
|
|
|
|
|
return trainPlanMapper.updateById(trainPlanEntity) == SafeProductConstant.SUCCESS; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|