package cn.com.goldenwater.dcproj.service.impl; import cn.com.goldenwater.core.service.AbstractCrudService; import cn.com.goldenwater.dcproj.dao.AttProjectInsuranceParticipDao; import cn.com.goldenwater.dcproj.model.AttProjectInsuranceParticip; import cn.com.goldenwater.dcproj.param.AttProjectInsuranceParticipParam; import cn.com.goldenwater.dcproj.service.AttProjectInsuranceParticipService; import cn.com.goldenwater.id.util.UuidUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; /** * @author lql * @date 2026-4-21 */ @Service @Transactional public class AttProjectInsuranceParticipServiceImpl extends AbstractCrudService implements AttProjectInsuranceParticipService { @Autowired private AttProjectInsuranceParticipDao attProjectInsuranceParticipDao; public AttProjectInsuranceParticipServiceImpl(AttProjectInsuranceParticipDao attProjectInsuranceParticipDao) { super(attProjectInsuranceParticipDao); this.attProjectInsuranceParticipDao = attProjectInsuranceParticipDao; } @Override public int insert(AttProjectInsuranceParticip attProjectInsuranceParticip) { AttProjectInsuranceParticipParam param = new AttProjectInsuranceParticipParam(); param.setProjectId(attProjectInsuranceParticip.getProjectId()); AttProjectInsuranceParticip particip = getBy(param); if (particip != null) { attProjectInsuranceParticip.setId(particip.getId()); return update(attProjectInsuranceParticip); } String uuid = UuidUtil.uuid(); // 生成uuid attProjectInsuranceParticip.setId(uuid); attProjectInsuranceParticip.setDataStat("0"); attProjectInsuranceParticip.setIntm(new Date()); attProjectInsuranceParticip.setUptm(new Date()); return this.attProjectInsuranceParticipDao.insert(attProjectInsuranceParticip); } @Override public int update(AttProjectInsuranceParticip attProjectInsuranceParticip) { attProjectInsuranceParticip.setUptm(new Date()); return this.attProjectInsuranceParticipDao.update(attProjectInsuranceParticip); } @Override public int delete(String id) { // 删除 return this.attProjectInsuranceParticipDao.delete(id); } }