DyeRuleCustomServiceImpl.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.persagy.dye.service.impl;
  2. import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
  3. import com.persagy.common.utils.DateUtil;
  4. import com.persagy.db.service.impl.SuperServiceImpl;
  5. import com.persagy.dye.constant.DyeConstant;
  6. import com.persagy.dye.mapper.DyeRuleCustomMapper;
  7. import com.persagy.dye.pojo.dto.DyeRuleCustom;
  8. import com.persagy.dye.service.IDyeRuleCustomService;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Service;
  11. import java.util.Date;
  12. /**
  13. * 染色规则自定义表
  14. *
  15. * @author yangwanyi
  16. * @version v1.0.0
  17. * @company persagy
  18. * @date 2021-10-25 15:58:56
  19. */
  20. @Service
  21. public class DyeRuleCustomServiceImpl extends SuperServiceImpl<DyeRuleCustomMapper, DyeRuleCustom> implements IDyeRuleCustomService {
  22. @Autowired
  23. private DyeRuleCustomMapper dyeRuleCustomMapper;
  24. /**
  25. * 根据主键逻辑删除染色规则自定义表信息
  26. *
  27. * @param dyeRuleCustomId 染色规则自定义表主键
  28. * @param updateUserId 修改人ID
  29. * @return boolean
  30. */
  31. @Override
  32. public boolean deleteDyeRuleCustomById(String dyeRuleCustomId, String updateUserId) {
  33. DyeRuleCustom dyeRuleCustom = this.dyeRuleCustomMapper.selectById(dyeRuleCustomId);
  34. if (dyeRuleCustom == null) {
  35. throw new RuntimeException("要删除的主键为" + dyeRuleCustomId + "的染色规则自定义表数据不存在");
  36. }
  37. dyeRuleCustom.setUpdateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
  38. dyeRuleCustom.setUpdateUserId(updateUserId);
  39. dyeRuleCustom.setIsDelete(DyeConstant.DELETED);
  40. return SqlHelper.retBool(this.dyeRuleCustomMapper.updateById(dyeRuleCustom));
  41. }
  42. }