| | |
| | | import com.cl.pojo.vo.EditDataDTO; |
| | | import com.cl.pojo.vo.screen.*; |
| | | import com.cl.service.DataService; |
| | | import io.swagger.models.auth.In; |
| | | import net.bytebuddy.asm.Advice; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import java.text.DecimalFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DataServiceImpl extends ServiceImpl<DataMapper, DataEntity> implements DataService { |
| | |
| | | |
| | | @Override |
| | | public ScreenVO screen(Integer county) { |
| | | |
| | | ScreenVO screenVO = new ScreenVO(); |
| | | DataEntity data =dataMapper.screen(county); |
| | | if (null== data) { |
| | | return screenVO; |
| | | } |
| | | screenVO.setAssistiveDeviceTotal(data.getAssistiveDeviceTotal()); |
| | | screenVO.setCreateTime(data.getCreateTime()); |
| | | screenVO.setTechnicalTraining(data.getTechnicalTraining()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<DataVO> pageList(IPage<DataEntity> page, Integer county, String name) { |
| | | public IPage<DataVO> pageList(IPage<DataEntity> page, List<Integer> county, String name) { |
| | | return dataMapper.pageList(page,county,name); |
| | | } |
| | | |
| | |
| | | return dataDetailVO; |
| | | } |
| | | |
| | | @Override |
| | | public DataDetailVO addDetail(Integer county) { |
| | | DataDetailVO dataDetailVO = new DataDetailVO(); |
| | | //通过区县获取上一次数据 |
| | | DataEntity dataEntity = dataMapper.getAddDetail(county); |
| | | EditDataDTO editDataDTO=new EditDataDTO(); |
| | | BeanUtils.copyProperties(dataEntity,editDataDTO); |
| | | dataDetailVO.setBeforeData(editDataDTO); |
| | | return dataDetailVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> getYearList(Integer county) { |
| | | return dataMapper.getYearList( county); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Integer getAssistiveDeviceTotal(Integer county, Integer year) { |
| | | LocalDateTime createTime = LocalDateTime.of(year, 12, 31, 23, 59, 59); |
| | | return dataMapper.getAssistiveDeviceTotal(county,createTime); |
| | | } |
| | | |
| | | private DataRateVO getRateVO(EditDataDTO data, EditDataDTO beforeData) { |
| | | if (beforeData == null || beforeData.equals(new EditDataDTO())) { |
| | | return null; |