package cn.com.goldenwater.dcproj.service.impl.gdyjhtc; import cn.com.goldenwater.dcproj.dao.BisInspPlanMonthAreaDao; import cn.com.goldenwater.dcproj.model.BisInspPlanMonth; import cn.com.goldenwater.dcproj.model.BisInspPlanMonthArea; import cn.com.goldenwater.dcproj.param.BisInspPlanMonthAreaParam; import cn.com.goldenwater.dcproj.service.BisInspPlanMonthAreaService; import cn.com.goldenwater.core.service.AbstractCrudService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import cn.com.goldenwater.id.util.UuidUtil; import java.util.ArrayList; import java.util.List; import java.util.Date; @Service @Transactional public class BisInspPlanMonthAreaServiceImpl extends AbstractCrudService implements BisInspPlanMonthAreaService { @Autowired private BisInspPlanMonthAreaDao bisInspPlanMonthAreaDao; public BisInspPlanMonthAreaServiceImpl(BisInspPlanMonthAreaDao bisInspPlanMonthAreaDao) { super(bisInspPlanMonthAreaDao); this.bisInspPlanMonthAreaDao = bisInspPlanMonthAreaDao; } @Override public int insert(BisInspPlanMonthArea bisInspPlanMonthArea) { String uuid = UuidUtil.uuid(); // 生成uuid bisInspPlanMonthArea.setId(uuid); bisInspPlanMonthArea.setIntm(new Date()); bisInspPlanMonthArea.setUptm(new Date()); bisInspPlanMonthArea.setDataStat("0"); return this.bisInspPlanMonthAreaDao.insert(bisInspPlanMonthArea); } @Override public int update(BisInspPlanMonthArea bisInspPlanMonthArea) { bisInspPlanMonthArea.setUptm(new Date()); return this.bisInspPlanMonthAreaDao.update(bisInspPlanMonthArea); } @Override public int delete(String id) { return this.bisInspPlanMonthAreaDao.delete(id); } @Override public void deleteByplanMonth(String planMonth) { bisInspPlanMonthAreaDao.deleteByPlanMonth(planMonth); } @Override public void insertByplanMonth(BisInspPlanMonth o) { List insertList = new ArrayList<>(); String[] cityCode = o.getChkCityCode() == null ? new String[0] : o.getChkCityCode().split(","); String[] countryCode = o.getChkCountryCode() == null ? new String[0] : o.getChkCountryCode().split(","); String[] cityName = o.getChkCity() == null ? new String[0] : o.getChkCity().split(","); String[] countryName = o.getChkCountry() == null ? new String[0] : o.getChkCountry().split(","); for (int i=0; i this.insert(a)); } @Override public void updateByplanMonth(BisInspPlanMonth o) { bisInspPlanMonthAreaDao.deleteByPlanMonth(o.getId()); this.insertByplanMonth(o); } }