6ea60cf5f291329d8258a172ad62049f7b395b75.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package cn.com.goldenwater.dcproj.service.impl.other;
  2. import cn.com.goldenwater.dcproj.dao.AttOtherBaseDao;
  3. import cn.com.goldenwater.dcproj.dao.BisInspAllObjDao;
  4. import cn.com.goldenwater.dcproj.dao.BisInspFscRgstrDao;
  5. import cn.com.goldenwater.dcproj.dao.BisInspOtherRgstrDao;
  6. import cn.com.goldenwater.dcproj.dto.AttOtherBaseDtos;
  7. import cn.com.goldenwater.dcproj.model.AttOtherBase;
  8. import cn.com.goldenwater.dcproj.model.BisInspAllObj;
  9. import cn.com.goldenwater.dcproj.model.BisInspOtherRgstr;
  10. import cn.com.goldenwater.dcproj.param.AttOtherBaseParam;
  11. import cn.com.goldenwater.dcproj.service.AttOtherBaseService;
  12. import cn.com.goldenwater.core.service.AbstractCrudService;
  13. import cn.com.goldenwater.id.util.UuidUtil;
  14. import com.github.pagehelper.PageHelper;
  15. import com.github.pagehelper.PageInfo;
  16. import org.apache.commons.lang3.StringUtils;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.stereotype.Service;
  19. import org.springframework.transaction.annotation.Transactional;
  20. import java.util.Date;
  21. import java.util.List;
  22. /**
  23. * @author lune
  24. * @date 2019-7-19
  25. */
  26. @Service
  27. @Transactional(rollbackFor = Exception.class)
  28. public class AttOtherBaseServiceImpl extends AbstractCrudService<AttOtherBase, AttOtherBaseParam> implements AttOtherBaseService {
  29. @Autowired
  30. private AttOtherBaseDao attOtherBaseDao;
  31. @Autowired
  32. private BisInspOtherRgstrDao bisInspOtherRgstrDao;
  33. @Autowired
  34. private BisInspAllObjDao bisInspAllObjDao;
  35. public AttOtherBaseServiceImpl(AttOtherBaseDao attOtherBaseDao) {
  36. super(attOtherBaseDao);
  37. this.attOtherBaseDao = attOtherBaseDao;
  38. }
  39. @Override
  40. public int insertList(AttOtherBaseDtos dtos) {
  41. for (AttOtherBase base : dtos.getBaseList()) {
  42. base.setId(UuidUtil.uuid());
  43. attOtherBaseDao.insert(base);
  44. }
  45. return 1;
  46. }
  47. @Override
  48. public PageInfo getBasePageInfoNotInFsc(AttOtherBaseParam attOtherBaseParam) {
  49. PageHelper.startPage(attOtherBaseParam);
  50. List<AttOtherBase> list = attOtherBaseDao.getBasePageInfoNotInFsc(attOtherBaseParam);
  51. PageInfo<AttOtherBase> pageInfo = new PageInfo<>(list);
  52. return pageInfo;
  53. }
  54. @Override
  55. public int updateOtherBase(AttOtherBase attOtherBase) {
  56. if (StringUtils.isNotBlank(attOtherBase.getRgstrId())) {
  57. BisInspAllObj obj = bisInspAllObjDao.get(attOtherBase.getId());
  58. if (obj != null) {
  59. obj.setNm(attOtherBase.getName());
  60. bisInspAllObjDao.update(obj);
  61. }
  62. BisInspOtherRgstr rgstr = bisInspOtherRgstrDao.get(attOtherBase.getRgstrId());
  63. if (rgstr != null) {
  64. rgstr.setName(attOtherBase.getName());
  65. rgstr.setAdCode(attOtherBase.getAdCode());
  66. rgstr.setAdmOrg(attOtherBase.getAdmOrg());
  67. rgstr.setCenterX(attOtherBase.getCenterX());
  68. rgstr.setCenterY(attOtherBase.getCenterY());
  69. rgstr.setType(attOtherBase.getType());
  70. rgstr.setLocation(attOtherBase.getLocation());
  71. rgstr.setUpTm(new Date());
  72. bisInspOtherRgstrDao.updateOtherRgstr(rgstr);
  73. }
  74. }
  75. return attOtherBaseDao.updateOtherBase(attOtherBase);
  76. }
  77. }