change - 优化分时单价

main
yinq 5 months ago
parent 5a8921b103
commit d7ddafc370

@ -34,16 +34,16 @@ public class EmsBaseSharePrice extends BaseEntity {
private String priceType;
/**
*
*
*/
@Excel(name = "用电起始小时")
private Long startHour;
@Excel(name = "用电起始小时")
private String startHour;
/**
*
*
*/
@Excel(name = "用电结束小时")
private Long endHour;
@Excel(name = "用电结束小时")
private String endHour;
/**
*
@ -75,19 +75,19 @@ public class EmsBaseSharePrice extends BaseEntity {
return priceType;
}
public void setStartHour(Long startHour) {
public void setStartHour(String startHour) {
this.startHour = startHour;
}
public Long getStartHour() {
public String getStartHour() {
return startHour;
}
public void setEndHour(Long endHour) {
public void setEndHour(String endHour) {
this.endHour = endHour;
}
public Long getEndHour() {
public String getEndHour() {
return endHour;
}

@ -5,9 +5,12 @@ import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import com.os.common.exception.ServiceException;
import com.os.common.utils.DateUtils;
import com.os.common.utils.StringUtils;
import com.os.ems.base.domain.EmsBaseMonitorWorkUnit;
import com.os.ems.base.domain.TreeSelects;
import com.os.ems.base.mapper.EmsBaseMonitorWorkUnitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.ems.base.mapper.EmsBaseWorkUnitMapper;
@ -26,6 +29,9 @@ public class EmsBaseWorkUnitServiceImpl implements IEmsBaseWorkUnitService
@Autowired
private EmsBaseWorkUnitMapper emsBaseWorkUnitMapper;
@Autowired
private EmsBaseMonitorWorkUnitMapper emsBaseMonitorWorkUnitMapper;
/**
*
*
@ -85,6 +91,15 @@ public class EmsBaseWorkUnitServiceImpl implements IEmsBaseWorkUnitService
@Override
public int deleteEmsBaseWorkUnitByObjIds(Long[] objIds)
{
for (Long objId : objIds) {
EmsBaseWorkUnit baseWorkUnit = this.selectEmsBaseWorkUnitByObjId(objId);
EmsBaseMonitorWorkUnit monitorWorkUnit = new EmsBaseMonitorWorkUnit();
monitorWorkUnit.setWorkUnitCode(baseWorkUnit.getWorkUnitCode());
List<EmsBaseMonitorWorkUnit> workUnits = emsBaseMonitorWorkUnitMapper.selectEmsBaseMonitorWorkUnitList(monitorWorkUnit);
if (workUnits.size() > 0){
throw new ServiceException(baseWorkUnit.getWorkUnitName() + "已关联计量设备,无法删除!");
}
}
return emsBaseWorkUnitMapper.deleteEmsBaseWorkUnitByObjIds(objIds);
}

Loading…
Cancel
Save