4ad7a8de546af834568a2449196f040819eb467d.svn-base 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package cn.com.goldenwater.dcproj.service.impl;
  2. import cn.com.goldenwater.core.service.AbstractCrudService;
  3. import cn.com.goldenwater.dcproj.dao.AttProjectInsuranceParticipDao;
  4. import cn.com.goldenwater.dcproj.model.AttProjectInsuranceParticip;
  5. import cn.com.goldenwater.dcproj.param.AttProjectInsuranceParticipParam;
  6. import cn.com.goldenwater.dcproj.service.AttProjectInsuranceParticipService;
  7. import cn.com.goldenwater.id.util.UuidUtil;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.stereotype.Service;
  10. import org.springframework.transaction.annotation.Transactional;
  11. import java.util.Date;
  12. /**
  13. * @author lql
  14. * @date 2026-4-21
  15. */
  16. @Service
  17. @Transactional
  18. public class AttProjectInsuranceParticipServiceImpl extends AbstractCrudService<AttProjectInsuranceParticip, AttProjectInsuranceParticipParam> implements AttProjectInsuranceParticipService {
  19. @Autowired
  20. private AttProjectInsuranceParticipDao attProjectInsuranceParticipDao;
  21. public AttProjectInsuranceParticipServiceImpl(AttProjectInsuranceParticipDao attProjectInsuranceParticipDao) {
  22. super(attProjectInsuranceParticipDao);
  23. this.attProjectInsuranceParticipDao = attProjectInsuranceParticipDao;
  24. }
  25. @Override
  26. public int insert(AttProjectInsuranceParticip attProjectInsuranceParticip) {
  27. AttProjectInsuranceParticipParam param = new AttProjectInsuranceParticipParam();
  28. param.setProjectId(attProjectInsuranceParticip.getProjectId());
  29. AttProjectInsuranceParticip particip = getBy(param);
  30. if (particip != null) {
  31. attProjectInsuranceParticip.setId(particip.getId());
  32. return update(attProjectInsuranceParticip);
  33. }
  34. String uuid = UuidUtil.uuid(); // 生成uuid
  35. attProjectInsuranceParticip.setId(uuid);
  36. attProjectInsuranceParticip.setDataStat("0");
  37. attProjectInsuranceParticip.setIntm(new Date());
  38. attProjectInsuranceParticip.setUptm(new Date());
  39. return this.attProjectInsuranceParticipDao.insert(attProjectInsuranceParticip);
  40. }
  41. @Override
  42. public int update(AttProjectInsuranceParticip attProjectInsuranceParticip) {
  43. attProjectInsuranceParticip.setUptm(new Date());
  44. return this.attProjectInsuranceParticipDao.update(attProjectInsuranceParticip);
  45. }
  46. @Override
  47. public int delete(String id) {
  48. // 删除
  49. return this.attProjectInsuranceParticipDao.delete(id);
  50. }
  51. }