孔祥富
2021-03-01 c97fe0e22ac0a2c38b0636f619d3bcf030870c0c
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpLaborTroubleServiceImpl.java
@@ -3,9 +3,9 @@
import cc.mrbird.febs.common.core.constant.DicCode;
import cc.mrbird.febs.common.core.constant.ModuleCode;
import cc.mrbird.febs.common.core.entity.system.DicItem;
import cc.mrbird.febs.server.hr.entity.EmpLaborTrouble;
import cc.mrbird.febs.server.hr.entity.EmpLeaveInfo;
import cc.mrbird.febs.server.hr.entity.EmpOccupational;
import cc.mrbird.febs.common.core.exception.FebsException;
import cc.mrbird.febs.server.hr.constant.MyConstant;
import cc.mrbird.febs.server.hr.entity.*;
import cc.mrbird.febs.server.hr.entity.EmpLaborTrouble;
import cc.mrbird.febs.server.hr.mapper.EmpLaborTroubleMapper;
import cc.mrbird.febs.server.hr.service.IEmpLaborTroubleService;
@@ -101,7 +101,14 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createEmpLabortrouble(EmpLaborTrouble empLabortrouble) {
    public void createEmpLabortrouble(EmpLaborTrouble empLabortrouble) throws FebsException {
      LambdaQueryWrapper<EmpLaborTrouble> lambdaQueryWrapper = new LambdaQueryWrapper<>();
      lambdaQueryWrapper.eq(EmpLaborTrouble::getEmpId, empLabortrouble.getEmpId());
      lambdaQueryWrapper.eq(EmpLaborTrouble::getArbitrationDate, empLabortrouble.getArbitrationDate());
      lambdaQueryWrapper.ne(EmpLaborTrouble::getDelFlag,1);
      if (this.count(lambdaQueryWrapper) > 0) {
         throw new FebsException(MyConstant.MESSAGE);
      }
        empLabortrouble.setArbitrationId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
        empLabortrouble.setCreator(operatorId);
        empLabortrouble.setModifier(operatorId);
@@ -110,7 +117,15 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateEmpLabortrouble(EmpLaborTrouble empLabortrouble) {
    public void updateEmpLabortrouble(EmpLaborTrouble empLabortrouble) throws FebsException {
      LambdaQueryWrapper<EmpLaborTrouble> lambdaQueryWrapper = new LambdaQueryWrapper<>();
      lambdaQueryWrapper.eq(EmpLaborTrouble::getEmpId, empLabortrouble.getEmpId());
      lambdaQueryWrapper.eq(EmpLaborTrouble::getArbitrationDate, empLabortrouble.getArbitrationDate());
      lambdaQueryWrapper.ne(EmpLaborTrouble::getDelFlag,1);
      lambdaQueryWrapper.ne(EmpLaborTrouble::getArbitrationId,empLabortrouble.getArbitrationId());
      if (this.count(lambdaQueryWrapper) > 0) {
         throw new FebsException(MyConstant.MESSAGE);
      }
        EmpLaborTrouble dbData = this.getById(empLabortrouble.getArbitrationId());
        empLabortrouble.setCreateTime(dbData.getCreateTime());
        empLabortrouble.setCreator(dbData.getCreator());
@@ -200,4 +215,4 @@
        return  list;
    }
}
}