Ver código fonte

去除已删除的表影响

wangli 4 anos atrás
pai
commit
9a3a6ee708
27 arquivos alterados com 47 adições e 263 exclusões
  1. 3 1
      smart-city-platform/src/main/java/com/bz/smart_city/commom/security/WebSecurityConfig.java
  2. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayChargeSurveyController.java
  3. 25 10
      smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PaySyncDataController.java
  4. 0 11
      smart-city-platform/src/main/java/com/bz/smart_city/controller/system/ChannelController.java
  5. 0 40
      smart-city-platform/src/main/java/com/bz/smart_city/controller/system/PersonTypeDefController.java
  6. 0 5
      smart-city-platform/src/main/java/com/bz/smart_city/dao/PersonTypeChannelMapper.java
  7. 0 2
      smart-city-platform/src/main/java/com/bz/smart_city/dao/PersonTypeDimensionMapper.java
  8. 0 3
      smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/AmountWaterUsedAmountMapper.java
  9. 0 4
      smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/archives/PayBaseCustomerandmeterrelaMapper.java
  10. 0 2
      smart-city-platform/src/main/java/com/bz/smart_city/service/ChannelService.java
  11. 0 2
      smart-city-platform/src/main/java/com/bz/smart_city/service/PersonTypeChannelService.java
  12. 0 4
      smart-city-platform/src/main/java/com/bz/smart_city/service/PersonTypeDefService.java
  13. 0 28
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/ChannelServiceImpl.java
  14. 0 5
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/PersonTypeChannelServiceImpl.java
  15. 0 34
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/PersonTypeDefServiceImpl.java
  16. 0 12
      smart-city-platform/src/main/java/com/bz/smart_city/service/importfile/AsyncTaskImportService.java
  17. 1 4
      smart-city-platform/src/main/java/com/bz/smart_city/service/pay/PayBaseAccountService.java
  18. 0 9
      smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java
  19. 6 12
      smart-city-platform/src/main/resources/mapper/ChannelMapper.xml
  20. 6 12
      smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml
  21. 0 22
      smart-city-platform/src/main/resources/mapper/PersonTypeChannelMapper.xml
  22. 0 3
      smart-city-platform/src/main/resources/mapper/PersonTypeDimensionMapper.xml
  23. 0 1
      smart-city-platform/src/main/resources/mapper/ProgramItemMapper.xml
  24. 0 1
      smart-city-platform/src/main/resources/mapper/ProgramMapper.xml
  25. 0 1
      smart-city-platform/src/main/resources/mapper/SiteMapper.xml
  26. 3 29
      smart-city-platform/src/main/resources/mapper/pay/AmountWaterUsedAmountMapper.xml
  27. 2 5
      smart-city-platform/src/main/resources/mapper/pay/PayChargeSurveyMapper.xml

+ 3 - 1
smart-city-platform/src/main/java/com/bz/smart_city/commom/security/WebSecurityConfig.java

@@ -90,11 +90,13 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/watermeter/getMeterReadData","/watermeter/getDeviceCustomerInfo","/watermeter/getPeriodMeterReadData","/data/clearingData","/data/meterReadData")
                 .antMatchers("/apply/register","/apply/detail","/apply/approve")
                 .antMatchers("/payFee/payFee")
+                .antMatchers("/amount/synDeviceReplaceRecord")
+                .antMatchers("/pay/synAccountInfo")
                 .antMatchers("/printinvoice/InvoicePrintRequest")
                 .antMatchers("/waterMeter/getMeterByDeviceNo")
                 .antMatchers("/device/synArchies")
                 .antMatchers("/druid/**")
-                .antMatchers("/SyncData/synReplaceRecord");
+				.antMatchers("/SyncData/synReplaceRecord");;
     }
 
 

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayChargeSurveyController.java

@@ -36,7 +36,7 @@ public class PayChargeSurveyController {
 
         PayChargeSurveyDto payChargeSurveyDto = payChargeSurveyService.accountSurvey();
 
-        return new AjaxMessage<PayChargeSurveyDto>(ResultStatus.OK, payChargeSurveyDto);
+        return new AjaxMessage<>(ResultStatus.OK, payChargeSurveyDto);
     }
 
     @ResponseBody

+ 25 - 10
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PaySyncDataController.java

@@ -5,9 +5,11 @@ import com.bz.smart_city.commom.model.ResultStatus;
 import com.bz.smart_city.dto.AreaDto;
 import com.bz.smart_city.dto.CommunityDto;
 import com.bz.smart_city.dto.DeviceTypeDto;
+import com.bz.smart_city.dto.pay.DeviceReplaceRecordDto;
 import com.bz.smart_city.dto.pay.InstallPlanInputDTO;
 import com.bz.smart_city.entity.Community;
 import com.bz.smart_city.entity.WaterMeterReplaceLog;
+import com.bz.smart_city.service.pay.AmountWaterUsedAmountService;
 import com.bz.smart_city.service.pay.PaySyncDataService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -29,6 +31,8 @@ public class PaySyncDataController {
 
     @Autowired
     private PaySyncDataService paySyncDataService;
+    @Autowired
+    private AmountWaterUsedAmountService amountWaterUsedAmountService;
 
     @PostMapping("installPlan/addJF")
     @PreAuthorize("hasAuthority('sys:installPlan:add')")
@@ -77,17 +81,28 @@ public class PaySyncDataController {
         return paySyncDataService.queryWaterMeterType(parentId);
     }
 
+//    @PostMapping("/amount/synDeviceReplaceRecord")
+//    @ApiOperation(value = "同步换表信息")
+//    public AjaxMessage syncReplaceRecord(
+//            @ApiParam(value = "同步换表信息", required = true) @RequestBody(required = true) WaterMeterReplaceLog waterMeterReplaceLog
+//    ) {
+//
+//        int result = paySyncDataService.addReplaceRecord(waterMeterReplaceLog);
+//        if(result > 0)
+//            return new AjaxMessage(ResultStatus.OK);
+//        else
+//            return new AjaxMessage(ResultStatus.ERROR);
+//    }
+    //换表接口
+
+    @ResponseBody
     @PostMapping("/amount/synDeviceReplaceRecord")
-    @ApiOperation(value = "同步换表信息")
-    public AjaxMessage syncReplaceRecord(
-            @ApiParam(value = "同步换表信息", required = true) @RequestBody(required = true) WaterMeterReplaceLog waterMeterReplaceLog
-    ) {
+    @ApiOperation(value = "换表记录同步接口")
+    public AjaxMessage synDeviceReplaceRecord(
+            @ApiParam(value = "换表记录")@RequestBody(required = true) DeviceReplaceRecordDto deviceReplaceRecordDto
+    ){
+        amountWaterUsedAmountService.saveDeviceReplaceRecord(deviceReplaceRecordDto);
 
-        int result = paySyncDataService.addReplaceRecord(waterMeterReplaceLog);
-        if(result > 0)
-            return new AjaxMessage(ResultStatus.OK);
-        else
-            return new AjaxMessage(ResultStatus.ERROR);
+        return new AjaxMessage<>(ResultStatus.OK);
     }
-
 }

+ 0 - 11
smart-city-platform/src/main/java/com/bz/smart_city/controller/system/ChannelController.java

@@ -77,15 +77,4 @@ public class ChannelController {
         List<Integer> list = channelService.deleteQuery(id);
         return new AjaxMessage<>(ResultStatus.OK, list);
     }
-
-    @PostMapping("allocation")
-    @PreAuthorize("hasAuthority('sys:channel:allocation')")
-    @ApiOperation(value = "设备类型分配", notes = "权限:sys:channel:allocation")
-    public AjaxMessage allocation(
-            @ApiParam(value = "场景id", required = true) @RequestParam(required = true) Integer channelId,
-            @ApiParam(value = "设备类型ids,多个英文逗号隔开", required = true) @RequestParam(required = true) List<Integer> deviceTypeIds
-    ) {
-        channelService.allocation(channelId, deviceTypeIds);
-        return new AjaxMessage(ResultStatus.OK);
-    }
 }

+ 0 - 40
smart-city-platform/src/main/java/com/bz/smart_city/controller/system/PersonTypeDefController.java

@@ -59,46 +59,6 @@ public class PersonTypeDefController {
         return new AjaxMessage(ResultStatus.OK, list);
     }
 
-    @PostMapping("edit")
-    @ApiOperation(value = "修改人员类型")
-    public AjaxMessage edit(
-            @ApiParam(value = "人员类型", required = true) @RequestBody(required = true) @Validated PersonTypeDefDto personTypeDefDto) {
-        int count = personTypeDefService.updateByPrimaryKeySelective(personTypeDefDto);
-        if(0 != count) {
-            return new AjaxMessage<>(-997, "该人员类型名称已存在!", null);
-        } else {
-            return new AjaxMessage(ResultStatus.OK);
-        }
-    }
-
-    @PostMapping("add")
-    @ApiOperation(value = "添加人员类型")
-    public AjaxMessage add(
-            @ApiParam(value = "人员类型", required = true) @RequestBody(required = true) @Validated PersonTypeDefDto personTypeDefDto
-            ) {
-        int count = personTypeDefService.insert(personTypeDefDto);
-        if(0 != count) {
-            return new AjaxMessage<>(-997, "该人员类型名称已存在!", null);
-        } else {
-            return new AjaxMessage(ResultStatus.OK);
-        }
-    }
-    @DeleteMapping("delete")
-    @ApiOperation(value = "删除人员类型")
-    public AjaxMessage delete(
-            @ApiParam(value = "人员类型id", required = true) @RequestParam int id
-    ) {
-        int result = personTypeDefService.delete(id);
-        return new AjaxMessage(ResultStatus.OK, result);
-    }
-
-    @GetMapping("getChannelPersonType")
-    @ApiOperation(value = "获取场景绑定的人员类型")
-    public AjaxMessage getChannelPersonType(
-            @ApiParam(value = "场景id", required = true) @RequestParam int channelId
-    ) {
-        return new AjaxMessage(ResultStatus.OK, personTypeChannelService.getBindTypePerson(channelId));
-    }
 
     @PostMapping("channelBindPersonType")
     @ApiOperation(value = "场景绑定人员类型")

+ 0 - 5
smart-city-platform/src/main/java/com/bz/smart_city/dao/PersonTypeChannelMapper.java

@@ -17,9 +17,4 @@ public interface PersonTypeChannelMapper {
 
     int updateByPrimaryKeySelective(@Param("personTypeChannel") PersonTypeChannel personTypeChannel);
 
-    int isBindChannel(@Param("personTypeDefId") int personTypeDefId);
-
-    List<PersonTypeChannelListDto> getBindTypePerson(@Param("channelId") int channelId);
-
-    int updateStatus(@Param("status") int status, @Param("channelId") int channelId, @Param("personTypeIds") int[] personTypeIds);
 }

+ 0 - 2
smart-city-platform/src/main/java/com/bz/smart_city/dao/PersonTypeDimensionMapper.java

@@ -11,7 +11,5 @@ public interface PersonTypeDimensionMapper {
 
     int updateStatus(@Param("personTypeDefId") int personTypeDefId, @Param("dimensionIdList") int[] dimensionIdList, @Param("status")int status);
 
-    int insertAllDimension(@Param("personTypeDefId") int personTypeDefId);
-
     List<PersonTypeDimension> queryDimensionListById(@Param("personTypeDefId") int personTypeDefId);
 }

+ 0 - 3
smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/AmountWaterUsedAmountMapper.java

@@ -63,9 +63,6 @@ public interface AmountWaterUsedAmountMapper {
 
     List<PayBaseCustomerandmeterrela> getCustIdAndSiteId();
 
-    //换表明细 list:设备ID
-    List<ReplaceMeterDto> getRepalceRecordDetail(@Param("stTime")LocalDateTime stTime,@Param("etTime")LocalDateTime etTime,@Param("list")List<BigInteger> list,@Param("siteId")Integer siteId,@Param("customerId")Integer customerId);
-
     AmountWaterUsedAmount getLastReadrecord(@Param("metercode") String metercode, @Param("siteId") Integer siteId,@Param("customerId")Integer customerId);
 
     //插入换表信息

+ 0 - 4
smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/archives/PayBaseCustomerandmeterrelaMapper.java

@@ -82,8 +82,6 @@ public interface PayBaseCustomerandmeterrelaMapper {
 
     PayBaseCustomerandmeterrela get(@Param("id") BigInteger id);
 
-    void updateMeterInstallOpen(@Param("isAccepted")Integer isAccepted, @Param("updateBy")String updateBy,@Param("date") LocalDateTime date, @Param("id") BigInteger id);
-
     void update(PayBaseCustomerandmeterrela payBaseCustomerandmeterrela);
 
     public  List<PayBaseCustomerandmeterrelaDto> getResetLadderList(@Param("siteId") Integer siteId, @Param("customerId")Integer customerId);
@@ -94,8 +92,6 @@ public interface PayBaseCustomerandmeterrelaMapper {
     public PayBaseCustomerandmeterrela queryCancelInfo(@Param("siteId") Integer siteId, @Param("customerId")Integer customerId,
                                                        @Param("accountnumber")String accountnumber,@Param("metercode")String metercode);
 
-    public Integer queryMeterState( @Param("customerId")Integer customerId,@Param("accountId")BigInteger accountId);
-
     public Organization getParentOfficeId( @Param("siteId")Integer siteId,@Param("id")Integer id,@Param("name") String name);
 
     public PayBaseCustomerandmeterrela findAccountByAccountNumber(@Param("siteId") Integer siteId, @Param("customerId")Integer customerId,@Param("accountnumber")String accountnumber);

+ 0 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/ChannelService.java

@@ -17,8 +17,6 @@ public interface ChannelService {
 
     int updateByPrimaryKeySelective(Channel channel);
 
-    void allocation(Integer channelId, List<Integer> deviceTypeIds);
-
     Pagination<ChannelDto> getChannelPage(String name, int pageNum, int pageSize);
 
     void add(Channel channel);

+ 0 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/PersonTypeChannelService.java

@@ -14,6 +14,4 @@ public interface PersonTypeChannelService{
 
     int updateByPrimaryKeySelective(PersonTypeChannel personTypeChannel);
 
-    List<PersonTypeChannelListDto> getBindTypePerson(int channelId);
-
 }

+ 0 - 4
smart-city-platform/src/main/java/com/bz/smart_city/service/PersonTypeDefService.java

@@ -7,8 +7,6 @@ import com.bz.smart_city.dto.PersonTypeDefDto;
 import com.bz.smart_city.entity.PersonTypeDef;
 public interface PersonTypeDefService{
 
-    int insert(PersonTypeDefDto personTypeDefDto);
-
     int insertSelective(PersonTypeDef personTypeDef);
 
     int insertList(List<PersonTypeDef> personTypeDefs);
@@ -17,8 +15,6 @@ public interface PersonTypeDefService{
 
     Pagination<PersonTypeDefDto> getList(String name, int pageNum, int pageSize);
 
-    int delete(int id);
-
     List<PersonTypeDefDto> getAll();
 
     int channelBindPersonType(int channelId, int[] insertPersonTypeId, int[] delPersonTypeIds, int[] updPersonTypeIds);

+ 0 - 28
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/ChannelServiceImpl.java

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
 import com.bz.smart_city.commom.exception.ServiceException;
 import com.bz.smart_city.commom.model.Pagination;
 import com.bz.smart_city.commom.util.UserUtil;
-import com.bz.smart_city.dao.ChannelDeviceTypeUseMapper;
 import com.bz.smart_city.dao.ChannelMapper;
 import com.bz.smart_city.dao.PermissionMapper;
 import com.bz.smart_city.dao.SiteChannelMapper;
@@ -12,7 +11,6 @@ import com.bz.smart_city.dto.ChannelDeviceCountDto;
 import com.bz.smart_city.dto.ChannelDto;
 import com.bz.smart_city.dto.LoginUser;
 import com.bz.smart_city.entity.Channel;
-import com.bz.smart_city.entity.ChannelDeviceTypeUse;
 import com.bz.smart_city.service.ChannelService;
 import com.bz.smart_city.service.DeviceService;
 import com.github.pagehelper.PageHelper;
@@ -26,7 +24,6 @@ import java.time.LocalDateTime;
 import java.util.Collections;
 import java.util.List;
 
-import static com.google.common.collect.Lists.newArrayList;
 
 @Slf4j
 @Service
@@ -35,8 +32,6 @@ public class ChannelServiceImpl implements ChannelService {
     @Resource
     private ChannelMapper channelMapper;
     @Resource
-    private ChannelDeviceTypeUseMapper channelDeviceTypeUseMapper;
-    @Resource
     private PermissionMapper permissionMapper;
     @Resource
     private SiteChannelMapper siteChannelMapper;
@@ -238,29 +233,6 @@ public class ChannelServiceImpl implements ChannelService {
         return siteChannelMapper.countByChannelId(id);
     }
 
-    @Override
-    public void allocation(Integer channelId, List<Integer> deviceTypeIds) {
-        log.info("begin allocation channelId:" + channelId + ",deviceTypeIds:" + JSON.toJSONString(deviceTypeIds));
-        //先删除再插入
-        int i = channelDeviceTypeUseMapper.deleteByChannelId(channelId, UserUtil.getCurrentUser().getUsername());
-
-        if (deviceTypeIds != null && deviceTypeIds.size() > 0) {
-            List<ChannelDeviceTypeUse> list = newArrayList();
-            deviceTypeIds.forEach(deviceTypeId -> {
-                ChannelDeviceTypeUse channelDeviceTypeUse = new ChannelDeviceTypeUse();
-                channelDeviceTypeUse.setChannelId(channelId);
-                channelDeviceTypeUse.setDeviceTypeId(deviceTypeId);
-                channelDeviceTypeUse.setStatus(1);
-                channelDeviceTypeUse.setCreateBy(UserUtil.getCurrentUser().getUsername());
-                channelDeviceTypeUse.setDateCreate(LocalDateTime.now());
-                channelDeviceTypeUse.setUpdateBy(UserUtil.getCurrentUser().getUsername());
-                channelDeviceTypeUse.setDateUpdate(LocalDateTime.now());
-                list.add(channelDeviceTypeUse);
-            });
-            channelDeviceTypeUseMapper.insertList(list);
-        }
-        log.info("end allocation reslut=" + i);
-    }
 
     @Override
     public List<Channel> getUserChannelList(LoginUser loginUser) {

+ 0 - 5
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/PersonTypeChannelServiceImpl.java

@@ -34,9 +34,4 @@ public class PersonTypeChannelServiceImpl implements PersonTypeChannelService{
         return personTypeChannelMapper.updateByPrimaryKeySelective(personTypeChannel);
     }
 
-
-    @Override
-    public List<PersonTypeChannelListDto> getBindTypePerson(int channelId){
-        return  personTypeChannelMapper.getBindTypePerson(channelId);
-    }
 }

+ 0 - 34
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/PersonTypeDefServiceImpl.java

@@ -27,22 +27,6 @@ public class PersonTypeDefServiceImpl implements PersonTypeDefService{
     @Resource
     private PersonTypeChannelMapper personTypeChannelMapper;
 
-    @Override
-    public int insert(PersonTypeDefDto personTypeDefDto){
-        int count = queryByName(personTypeDefDto.getName(), 0);
-        if(0 == count) {
-            personTypeDefDto.setStatus(1);
-            personTypeDefMapper.insert(personTypeDefDto);
-            int[] dimensionIds = personTypeDefDto.getDimensionList();
-            int personTypeDefId = personTypeDefDto.getId();
-            personTypeDimensionMapper.insertAllDimension(personTypeDefId);
-            if(0 != dimensionIds.length) {
-                personTypeDimensionMapper.updateStatus(personTypeDefId, dimensionIds, 1);
-            }
-        }
-        return count;
-    }
-
     @Override
     public int insertSelective(PersonTypeDef personTypeDef){
         return personTypeDefMapper.insertSelective(personTypeDef);
@@ -95,26 +79,8 @@ public class PersonTypeDefServiceImpl implements PersonTypeDefService{
         return list1;
     }
 
-    @Override
-    public int delete(int id) {
-        int isBind = personTypeChannelMapper.isBindChannel(id);
-        if(0 == isBind) {
-            PersonTypeDefDto personTypeDefDto = new PersonTypeDefDto();
-            personTypeDefDto.setId(id);
-            personTypeDefDto.setStatus(0);
-            personTypeDefMapper.updateByPrimaryKeySelective(personTypeDefDto);
-        }
-        return isBind;
-    }
-
     @Override
     public int channelBindPersonType(int channelId, int[] insertPersonTypeId, int[] delPersonTypeIds, int[] updPersonTypeIds) {
-        if(delPersonTypeIds.length != 0) {
-            personTypeChannelMapper.updateStatus(0, channelId, delPersonTypeIds);
-        }
-        if(updPersonTypeIds.length != 0) {
-            personTypeChannelMapper.updateStatus(1, channelId, updPersonTypeIds);
-        }
         if(insertPersonTypeId.length != 0) {
             List<PersonTypeChannel> personTypeChannels = new ArrayList<PersonTypeChannel>();
             for (int i = 0; i <insertPersonTypeId.length; i++) {

+ 0 - 12
smart-city-platform/src/main/java/com/bz/smart_city/service/importfile/AsyncTaskImportService.java

@@ -278,16 +278,6 @@ public class AsyncTaskImportService {
                                    continue;
                                }
 
-                               //判断水表是否为待开户状态
-                               Integer state = payBaseCustomerandmeterrelaMapper.queryMeterState(loginUser.getCustomerId(),accounts.getId());
-                               state = state != null ? state : 0;
-                               if(state <=0){
-                                   failTime++ ;
-                                   msg +="【"+accountnumber+"】添加开户失败,该客户未验收,";
-                                   log.info("【"+accountnumber+"】添加开户失败,该客户未验收,");
-                                   c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户未验收,");
-                                   continue;
-                               }
                                Integer value = 0;
                                customer.setVatno(vatno);
 
@@ -416,8 +406,6 @@ public class AsyncTaskImportService {
                                rechargeaccountDto.setSiteId(siteId);
                                rechargeaccountDto.setCustomerId(customerId);
                                payRechargeaccountMapper.update(rechargeaccountDto);
-                               //修改水表安装信息为已开户
-                               payBaseCustomerandmeterrelaMapper.updateMeterInstallOpen(2,loginUser.getUpdateBy(),LocalDateTime.now(),device.getId());
                                successTime ++;
                            }catch (Exception e){
                                e.printStackTrace();

+ 1 - 4
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/PayBaseAccountService.java

@@ -36,10 +36,7 @@ public interface PayBaseAccountService {
 
     Pagination<PayMeter>findMeter(String queryInfo, String state, Integer pageNum, Integer pageSize);
 
-    //根据安装计划ID删除用户信息
-    //int delByPlanId(BigInteger planId);
 
     int getMaxAccountNumber(String CommunityCode);
-
-    List<SynAccountInfo> getSynAccountInfo( String createDate);
+    List<SynAccountInfo> getSynAccountInfo(String createDate);
 }

+ 0 - 9
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java

@@ -313,8 +313,6 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
         rechargeaccountDto.setCustomerId(new BigInteger(String.valueOf(loginUser.getCustomerId())));
         payRechargeaccountMapper.update(rechargeaccountDto);
 
-         //修改水表安装信息为已开户
-        payBaseCustomerandmeterrelaMapper.updateMeterInstallOpen(2,loginUser.getUpdateBy(),LocalDateTime.now(),device.getId());
         if (customerList.size() > 0) {
             int reslut = payBaseCustomerandmeterrelaMapper.insertList(customerList);
 
@@ -431,8 +429,6 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
         rechargeaccountDto.setCustomerId(new BigInteger(String.valueOf(loginUser.getCustomerId())));
         payRechargeaccountMapper.update(rechargeaccountDto);
 
-        //修改水表安装信息为已开户
-        payBaseCustomerandmeterrelaMapper.updateMeterInstallOpen(2,loginUser.getUpdateBy(),LocalDateTime.now(),device.getId());
         if (customerList.size() > 0) {
             int reslut = payBaseCustomerandmeterrelaMapper.insertList(customerList);
 
@@ -1022,8 +1018,6 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
                             rechargeaccountDto.setSiteId(new BigInteger(String.valueOf(loginUser.getSiteId())));
                             rechargeaccountDto.setCustomerId(new BigInteger(String.valueOf(loginUser.getCustomerId())));
                             payRechargeaccountMapper.update(rechargeaccountDto);
-                            //修改水表安装信息为已开户
-                            payBaseCustomerandmeterrelaMapper.updateMeterInstallOpen(2,loginUser.getUpdateBy(),LocalDateTime.now(),device.getId());
                         }
                     }
 
@@ -1107,9 +1101,6 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             //修改预存账户为销户
             result = payBaseCustomerandmeterrelaMapper.updateRechargeAccountState(2,loginUser.getId(),new Date(),loginUser.getSiteId(),loginUser.getCustomerId(),customerList.get(0).getAccountId());//开户状态:1已开户 2销户 3未开户
 
-            //修改水表安装信息为待开户
-            payBaseCustomerandmeterrelaMapper.updateMeterInstallOpen(1,loginUser.getUpdateBy(),LocalDateTime.now(),customerList.get(0).getWatermeterId());
-
             //修改客户状态为销户
             payBaseCustomerandmeterrelaMapper.updateAccountState(3,loginUser.getId(),new Date(),loginUser.getSiteId(),loginUser.getCustomerId(),customerList.get(0).getAccountId());//客户状态状态:1正常 2欠费 3销户
         }

+ 6 - 12
smart-city-platform/src/main/resources/mapper/ChannelMapper.xml

@@ -154,10 +154,10 @@
 
     <select id="getList" resultType="com.bz.smart_city.dto.ChannelDeviceCountDto">
     	SELECT
-			sc.* ,
-			IF(smt.id is null,0,1) is_water_channel
+			sc.*
+
 		FROM
-			sc_channel sc left join sc_w_meter_type smt on (sc.id = smt.channel_id)
+			sc_channel sc
 		WHERE
 			sc.STATUS = 1
 			AND sc.parent_id != 0
@@ -167,9 +167,8 @@
 
     <select id="getListByIds" resultType="com.bz.smart_city.dto.ChannelDeviceCountDto">
         select
-        distinct sc.*,
-        IF(smt.id is null,0,1) is_water_channel
-        from sc_channel sc left join sc_w_meter_type smt on (sc.id = smt.channel_id)
+        distinct sc.*
+        from sc_channel sc
         where sc.status = 1 and sc.parent_id != 0
         <if test="channelList != null and channelList.size() != 0">
             and sc.id in <foreach collection="channelList" item="item" open="(" separator="," close=")">#{item.id}</foreach>
@@ -190,18 +189,13 @@
         select channel_id from sc_site_channel where status = 1 and site_id = #{siteId}
     </select>
 
-    <select id="findList" resultMap="lazyLoadDeviceTypeId">
+    <select id="findList" resultType="com.bz.smart_city.dto.ChannelDto">
         select <include refid="Base_Column_List"/> from sc_channel
         where status = 1 and parent_id = 1
         <if test="name != null and name != ''"> AND channel_name LIKE concat('%',#{name},'%') </if>
         order by create_date desc
     </select>
 
-    <resultMap id="lazyLoadDeviceTypeId" type="com.bz.smart_city.dto.ChannelDto" extends="BaseResultMap">
-        <collection property="deviceTypeIds" ofType="java.lang.Integer" select="com.bz.smart_city.dao.ChannelDeviceTypeUseMapper.findDeviceTypeByChannelId"
-                    column="id"></collection>
-    </resultMap>
-
     <select id="findByNameUnique" resultType="int">
         select count(1) from sc_channel
         where status = 1 and channel_name = #{channelName}

+ 6 - 12
smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -365,12 +365,11 @@
     <select id="selectAccountInfo" resultType="com.bz.smart_city.entity.pay.archives.MeterListInfo">
         select
         device.metercode as "metercode",
-        sil.user_name as accountname,
-        sil.user_phone as telephone,
-        sil.id_card as idcardno
+        account.name as accountname,
+        account.mobilephone as telephone,
+        account.idcardno as idcardno
         from pay_base_account account
         inner join sc_device device on account.id = device.account_id
-        inner join sc_install_list sil on sil.device_id = device.id
         <where>
             device.metercode not in(select metercode from pay_base_customerandmeterrela where businessstate = '1')
             <if test="accountnumber != null">
@@ -392,12 +391,11 @@
         account.calculateway as "calculateway",
         account.waterproperty_id as "waterPropertyId",
         device.metercode as "metercode",
-        sil.user_name as accountname,
-        sil.user_phone as telephone,
-        sil.id_card as idcardno
+        account.name as accountname,
+        account.mobilephone as telephone,
+        account.idcardno as idcardno
         from pay_base_account account
         inner join sc_device device on account.id = device.account_id
-        inner join sc_install_list sil on sil.device_id = device.id
         <where>
             device.metercode not in(select metercode from pay_base_customerandmeterrela where businessstate = '1')
             <if test="metercode != null">
@@ -515,7 +513,6 @@
     <update id="updateMeterInstallOpen">
         update sc_device set curr_status =#{isAccepted},date_update=#{date} where id =#{id}
     </update>
-
     <select id="getOfficeId" resultType="com.bz.smart_city.entity.Organization">
         select id from sc_organization where site_id =#{siteId} and name =#{name}
     </select>
@@ -601,9 +598,6 @@
         </where>
     </select>
 
-    <select id="queryMeterState" resultType="java.lang.Integer">
-        select is_accepted as "isAccepted" from sc_install_list where account_id =#{accountId}  and customer_id =#{customerId}
-    </select>
 
     <select id="getParentOfficeId" resultType="com.bz.smart_city.entity.Organization">
         select id from sc_organization where site_id =#{siteId} and parent_id =#{id} and name =#{name}

+ 0 - 22
smart-city-platform/src/main/resources/mapper/PersonTypeChannelMapper.xml

@@ -132,28 +132,6 @@
         </set>
         WHERE id = #{personTypeChannel.id,jdbcType=INTEGER}
     </update>
-    <!--查询人员类型是否关联场景-->
-    <select id="isBindChannel" resultType="int">
-        select count(1) from sc_person_type_channel
-        where person_type_def_id = #{personTypeDefId} and status = 1
-    </select>
 
-    <!--<select id="getBindTypePerson"  resultMap="BaseResultMap">-->
-        <!--select id, channel_id, person_type_def_id, status from sc_person_type_channel where channel_id = #{channelId}-->
-    <!--</select>-->
-    <select id="getBindTypePerson"  resultType="com.bz.smart_city.dto.PersonTypeChannelListDto">
-        SELECT sptc.*,sptd.`name` as person_type_name,
-        (SELECT GROUP_CONCAT(sd.dimension_id) from sc_person_type_dimension as sd where sd.person_type_def_id = sptc.person_type_def_id and sd.`status` = 1) as dimension_ids
-        from sc_person_type_channel sptc
-        LEFT JOIN sc_person_type_def sptd ON sptd.id = sptc.person_type_def_id AND sptd.`status` = 1
-        where sptc.channel_id = #{channelId} AND sptc.`status` = 1
-    </select>
-    <update id="updateStatus">
-        update sc_person_type_channel set status = #{status} where channel_id = #{channelId} and person_type_def_id in
-        <foreach item="item" index="index" collection="personTypeIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
-    </update>
 </mapper>
 

+ 0 - 3
smart-city-platform/src/main/resources/mapper/PersonTypeDimensionMapper.xml

@@ -41,9 +41,6 @@
         </if>
     </update>
     
-    <insert id="insertAllDimension">
-        insert INTO sc_person_type_dimension(dimension_id, person_type_def_id, status) SELECT id, #{personTypeDefId}, 0 from sc_dimension
-    </insert>
 
     <!--查询人员类型生效的维度集合-->
     <select id="queryDimensionListById" resultMap="BaseResultMap">

+ 0 - 1
smart-city-platform/src/main/resources/mapper/ProgramItemMapper.xml

@@ -169,7 +169,6 @@
         dimension_value,
         CASE
         WHEN spi.dimension_id = 4 THEN (SELECT name from sc_community as sc where spi.dimension_value = sc.id)
-        WHEN spi.dimension_id = 5 THEN (select name from sc_building as sb where sb.id = spi.dimension_value)
         ELSE
         (SELECT name from sc_area as sa where sa.id = spi.dimension_value)
         END as dimension_name

+ 0 - 1
smart-city-platform/src/main/resources/mapper/ProgramMapper.xml

@@ -165,7 +165,6 @@
             GROUP_CONCAT(
                 CASE
                 WHEN spi.dimension_id = 4 THEN (select GROUP_CONCAT(a.name) from sc_community as a where spi.dimension_value = a.id)
-                WHEN spi.dimension_id = 5 THEN (select GROUP_CONCAT(b.name) from sc_building as b where spi.dimension_value = b.id)
                 WHEN spi.dimension_id = 9 THEN (select GROUP_CONCAT(c.customer_name) from sc_customer as c where spi.dimension_value = c.id)
                 WHEN spi.dimension_id = 10 THEN (select GROUP_CONCAT(o.`name`) from sc_organization as o where spi.dimension_value = o.id)
                 ELSE

+ 0 - 1
smart-city-platform/src/main/resources/mapper/SiteMapper.xml

@@ -157,7 +157,6 @@
         select
                ss.*,
                (SELECT GROUP_CONCAT(su.username SEPARATOR '、') FROM sc_site_user ssu LEFT JOIN sc_user su on(su.id = ssu.user_id and su.`status`= 1)  WHERE ssu.site_id = ss.id and ssu.`status` =1 and ssu.is_admin= 1) as username,
-                (select count(1) from sc_building sb where sb.status = 1 and sb.site_id = ss.id) as building_count,
                 (select count(1) from sc_device sd where sd.status = 1 and sd.site_id = ss.id) as device_count
         from sc_site ss
         where ss.status = 1

+ 3 - 29
smart-city-platform/src/main/resources/mapper/pay/AmountWaterUsedAmountMapper.xml

@@ -247,14 +247,14 @@
 		SELECT
 		c.id,c.office_id,
 		ifnull(lastwua.reading, IFNULL(d.new_meter_start,0)),
-		ifnull(lastwua.recorddate,ifnull(d.install_time,d.date_create)),c.metercode,
+		ifnull(lastwua.recorddate,d.date_create),c.metercode,
 		c.watermeter_id,#{month},null,null,null,NULL,1,
 		c.waterproperty_id,#{year},c.account_id,c.accountname,c.accountnumber,c.address,
-		c.watertype,null,d.electronic_no,null,null,1,NOW(),
+		c.watertype,null,d.water_meter_no,null,null,1,NOW(),
 		1,now(),'批量生成抄表计划',0,c.site_id,c.customer_id
 		FROM
 			pay_base_customerandmeterrela c
-		left join sc_install_list d on d.device_id =c.watermeter_id
+		left join sc_device d on d.id =c.watermeter_id
 		LEFT JOIN pay_amount_waterusedamount amount ON amount.watermeter_id = c.watermeter_id
 		AND amount.YEAR = #{year}
 		AND amount.MONTH = #{month}
@@ -456,32 +456,6 @@
 	group by c.customer_id, c.site_id
 	</select>
 
-	<select id ="getRepalceRecordDetail" resultType="com.bz.smart_city.dto.pay.ReplaceMeterDto">
-		SELECT
-		pc.device_id AS deviceId,
-		pc.date_create AS replaceTime,
-		pc.new_begin_wsv AS newBegin,
-		pc.old_end_wsv AS oldEnd
-		FROM
-		sc_water_meter_replace_log pc LEFT JOIN sc_device scd on pc.device_id = scd.id
-		<where>
-			<if test="stTime != null"> and pc.date_create >= #{stTime,jdbcType=TIMESTAMP}</if>
-			<if test="etTime != null"> and pc.date_create &lt;= #{etTime,jdbcType=TIMESTAMP}</if>
-			<if test="siteId != null"> and scd.site_id = #{siteId}</if>
-			<if test="customerId != null"> and scd.customer_id = #{customerId}</if>
-			<if test="list != null and list.size() != 0">
-				and pc.device_id IN
-				<foreach collection="list" item="listItem" open="(" close=")" separator=",">
-					<if test="listItem != null and listItem != ''">
-						#{listItem}
-					</if>
-				</foreach>
-			</if>
-
-
-		</where>
-
-	</select>
 
 	<select id="getLastReadrecord" resultType="com.bz.smart_city.dto.pay.AmountWaterUsedAmountDto">
 		SELECT

+ 2 - 5
smart-city-platform/src/main/resources/mapper/pay/PayChargeSurveyMapper.xml

@@ -61,9 +61,7 @@
     <select id="getMeterNumber" resultType="java.lang.Integer">
         select count(1)
         from  sc_device scd
-        left join sc_install_list scinstall on scd.id = scinstall.device_id  and scinstall.customer_id=#{customerId}
         left JOIN sc_device_type sdt on sdt.id = scd.device_type
-        left join sc_device_manufacturer sdm on sdm.id = sdt.manufacturer_id and sdm.`status`=1
         left join pay_base_account pba on pba.id = scd.account_id  and pba.site_id=#{siteId} and pba.customer_id=#{customerId}
         left join pay_base_customerandmeterrela ppr on ppr.metercode = scd.metercode and ppr.site_id=#{siteId} and ppr.customer_id=#{customerId}
         left join
@@ -75,12 +73,11 @@
         <where>
             scd.customer_id =#{customerId} and scd.account_id is not null
             <if test="startDate != null">
-                and scinstall.date_create &gt;=#{startDate}
+                and scd.date_create &gt;=#{startDate}
             </if>
             <if test="endDate != null">
-                and scinstall.date_create &lt;=#{endDate}
+                and scd.date_create &lt;=#{endDate}
             </if>
-            and(scinstall.is_accepted = 1 or scinstall.is_accepted = 2)
         </where>
     </select>