Browse Source

Merge remote-tracking branch 'origin/master'

jonbo 1 year ago
parent
commit
68032baec5
30 changed files with 1642 additions and 436 deletions
  1. 6 1
      collect-fees/collect-fees-service/pom.xml
  2. 1 1
      collect-fees/collect-fees-service/src/main/java/com/tofly/common/core/entity/ResultRespone.java
  3. 2 2
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/codemgt/controller/BmMrBookController.java
  4. 20 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/Ftp/FtpConfig.java
  5. 64 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/Ftp/FtpService.java
  6. 267 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/dbhelper/LogHelper.java
  7. 29 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/enums/LogOperateEnum.java
  8. 2 1
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/enums/TableIdEnum.java
  9. 43 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/util/NumberUtils.java
  10. 1 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/financialmgt/controller/BmPriceController.java
  11. 1 1
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/financialmgt/controller_easy/SfRecEasyController.java
  12. 12 12
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterprofilemgt/entity/DaMeter.java
  13. 0 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/controller/.gitkeep
  14. 173 168
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/controller/BwMeterReadPlanController.java
  15. 1 1
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/controller_easy/BwMeterReadPlanEsayController.java
  16. 8 8
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/entity/BwMeterReadPlan.java
  17. 27 32
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/mapper/BwMeterReadPlanMapper.java
  18. 121 33
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/controller/WxTsNoticeController.java
  19. 1 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/WxCustomerHisService.java
  20. 0 1
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/WxTsNoticeService.java
  21. 7 1
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/impl/WxCustomerHisServiceImpl.java
  22. 0 94
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/impl/WxTsNoticeServiceImpl.java
  23. 61 2
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatofficalacctmgt/controller/WxGhsqController.java
  24. 352 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatwebsite/controller/BindCustomerController.java
  25. 380 0
      collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatwebsite/controller_easy/BindCustomerEasyController.java
  26. 6 1
      collect-fees/collect-fees-service/src/main/resources/application.yml
  27. 6 1
      collect-fees/collect-fees-service/src/main/resources/bootstrap.yml
  28. 0 46
      collect-fees/collect-fees-service/src/main/resources/mapper/meterprofilemgt/BwReplaceMeterMapper.xml
  29. 49 30
      collect-fees/collect-fees-service/src/main/resources/mapper/meterreadingmgt/BwMeterReadPlanMapper.xml
  30. 2 0
      hnls-admin/hnls-admin-service/src/main/java/com/tofly/base/controller/UserController.java

+ 6 - 1
collect-fees/collect-fees-service/pom.xml

@@ -94,7 +94,12 @@
             <artifactId>ojdbc6</artifactId>
             <version>${oracle.version}</version>
         </dependency>
-
+        <!--使用Apache Commons Net库来创建FTP业务接口并上传图片文件 -->
+        <dependency>
+            <groupId>commons-net</groupId>
+            <artifactId>commons-net</artifactId>
+            <version>3.6</version>
+        </dependency>
         <dependency>
             <groupId>com.tofly</groupId>
             <artifactId>common-log</artifactId>

+ 1 - 1
collect-fees/collect-fees-service/src/main/java/com/tofly/common/core/entity/ResultRespone.java

@@ -109,7 +109,7 @@ public class ResultRespone<T> implements Serializable {
      * @param listData
      * @return
      */
-    private static ArrayList getConvertList(ArrayList listData) {
+    public static ArrayList getConvertList(ArrayList listData) {
         if (listData != null && listData.size() > 0) {
             Object obj = (Object) listData.get(0);
             if (!(obj instanceof HashMap)) {

+ 2 - 2
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/codemgt/controller/BmMrBookController.java

@@ -147,9 +147,9 @@ public class BmMrBookController {
             isFlag = bmMrBookService.updateById(bmMrBook);
         }
         if (isFlag) {
-            return ResultRespone.success();
+            return ResultRespone.success(true, "更新成功!");
         } else {
-            return ResultRespone.failed("更新失败!");
+            return ResultRespone.failed(false, "更新失败!");
         }
     }
 

+ 20 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/Ftp/FtpConfig.java

@@ -0,0 +1,20 @@
+package com.tofly.fees.common.Ftp;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+@Component
+@Getter
+@Setter
+public class FtpConfig {
+    @Value("${ftp.server}")
+    private String server;
+    @Value("${ftp.port}")
+    private int port;
+    @Value("${ftp.userName}")
+    private String userName;
+    @Value("${ftp.password}")
+    private String password;
+    // 省略getter和setter
+}

+ 64 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/Ftp/FtpService.java

@@ -0,0 +1,64 @@
+package com.tofly.fees.common.Ftp;
+
+import org.apache.commons.net.ftp.FTP;
+import org.apache.commons.net.ftp.FTPClient;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+@Component
+public class FtpService {
+    private static final String FTP_SERVER = "192.168.2.233";
+    private static final int FTP_PORT = 21;
+    private static final String FTP_USERNAME = "ftpuser";
+    private static final String FTP_PASSWORD = "ftpuser";
+    public void uploadFile(MultipartFile file, String remoteFilePath) throws IOException {
+        FTPClient ftpClient = new FTPClient();
+        String localFilePath = "/opt/ftp/fptpath/" + file.getOriginalFilename();
+        try {
+            ftpClient.connect(FTP_SERVER, FTP_PORT);
+            ftpClient.login(FTP_USERNAME, FTP_PASSWORD);
+            ftpClient.enterLocalPassiveMode();
+            ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
+            File convertedFile = convertMultiPartToFile(file);
+            FileInputStream inputStream = new FileInputStream(convertedFile);
+            ftpClient.storeFile(remoteFilePath, inputStream);
+          //  ftpClient.storeFile(remoteFilePath, new FileInputStream(localFilePath));
+            inputStream.close();
+            convertedFile.delete();
+        } finally {
+            if (ftpClient.isConnected()) {
+                ftpClient.logout();
+                ftpClient.disconnect();
+            }
+        }
+    }
+    public File downloadFile(String remoteFilePath, String localFilePath) throws IOException {
+        FTPClient ftpClient = new FTPClient();
+        try {
+            ftpClient.connect(FTP_SERVER, FTP_PORT);
+            ftpClient.login(FTP_USERNAME, FTP_PASSWORD);
+            ftpClient.enterLocalPassiveMode();
+            ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
+            File downloadedFile = new File(localFilePath);
+            FileOutputStream outputStream = new FileOutputStream(downloadedFile);
+            ftpClient.retrieveFile(remoteFilePath, outputStream);
+            outputStream.close();
+            return downloadedFile;
+        } finally {
+            if (ftpClient.isConnected()) {
+                ftpClient.logout();
+                ftpClient.disconnect();
+            }
+        }
+    }
+    private File convertMultiPartToFile(MultipartFile file) throws IOException {
+        File convertedFile = new File(file.getOriginalFilename());
+        FileOutputStream fileOutputStream = new FileOutputStream(convertedFile);
+        fileOutputStream.write(file.getBytes());
+        fileOutputStream.close();
+        return convertedFile;
+    }
+}

+ 267 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/dbhelper/LogHelper.java

@@ -0,0 +1,267 @@
+package com.tofly.fees.common.dbhelper;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.tofly.common.core.entity.ResultRespone;
+import com.tofly.fees.common.enums.LogOperateEnum;
+import com.tofly.fees.common.enums.SysEnum;
+import com.tofly.fees.common.model.CollectionData;
+import com.tofly.fees.common.util.DateUtils;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang.StringUtils;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+
+/**
+ * 公共日志处理类
+ *
+ * @author shudong
+ */
+public class LogHelper {
+
+    /**
+     * 获取修改类型的日志SQL语句【针对传入的2个对象比较,返回的SQL可能为空使用前进行判断】
+     *
+     * @param tOld     原对象,不能为null
+     * @param tNew     新对象,不能为null
+     * @param strCause 变更原因,不能为空否则直接返回null
+     * @param <T>      实体类
+     * @return SQL语句
+     */
+    public static <T> String getModifySQL(T tOld, T tNew, String strCause) {
+        String strResult = "";
+        try {
+            if (tOld == null || tNew == null || !StringUtils.isBlank(strCause)) {
+                return null;
+            }
+            StringBuilder sbResult = new StringBuilder();
+            JSONArray jsonArray = new JSONArray();
+            Field[] fields = tOld.getClass().getDeclaredFields();
+            Field[] newFields = tNew.getClass().getDeclaredFields();
+            for (Field oldField : fields) {
+                //设置允许通过反射访问私有变量
+                oldField.setAccessible(true);
+                //获取字段的值
+                Object oldValue = oldField.get(tOld);
+                if (oldValue != null && oldField.getName().equals("serialVersionUID")) {
+                    continue;
+                }
+                for (Field newField : newFields) {
+                    //设置允许通过反射访问私有变量
+                    newField.setAccessible(true);
+                    //判断属性名一样时,字段值是否相同
+                    if (oldField.getName().equals(newField.getName())) {
+                        Object newValue = newField.get(tNew);
+                        if (newValue != null && !oldValue.equals(newValue)) {
+                            //不相同证明有更改
+                            setModifInfo(tNew, oldValue, sbResult, jsonArray, newField);
+                        }
+                        break;
+                    }
+                }
+            }
+
+            //修改详情
+            String strNotes = sbResult.toString();
+            //判断对象是否有修改,如果不为空则返回存储的SQL
+            if (!StringUtils.isBlank(strNotes)) {
+                //去掉最后的分号
+                strNotes = strNotes.substring(0, strNotes.length() - 1);
+                //数据库表名
+                String strDbTableName = ((TableName) getTableNameAnnotation(tOld)).value();
+                //返回存储的日志SQL
+                strResult = saveLogSQL(strCause, strNotes, jsonArray.toJSONString(), LogOperateEnum.Modif, strDbTableName);
+            }
+        } catch (Exception ex) {
+            strResult = "";
+        }
+        return strResult;
+    }
+
+    /**
+     * 获取修改类型的日志SQL语句【针对单个对象加where条件入的方式,返回的SQL可能为空使用前进行判断】
+     *
+     * @param tNew     修改的实体对象
+     * @param strWhere 查询当前修改的对象的唯一sql条件;条件必须符合查询出来的数据是唯一,否则直接返回null
+     * @param strCause 变更原因,不能为空否则直接返回null
+     * @param <T>      实体类
+     * @return SQL语句
+     */
+    public static <T> String getModifySQL(T tNew, String strWhere, String strCause) {
+        String strResult = "";
+        try {
+            if (tNew == null || !StringUtils.isBlank(strWhere) || !StringUtils.isBlank(strCause)) {
+                return null;
+            }
+            //数据库表名
+            String strDbTableName = ((TableName) getTableNameAnnotation(tNew)).value();
+            //获取当前对象的数据库存储数据
+            HashMap hashMap = getModel(strDbTableName, strWhere);
+            if (hashMap == null) {
+                return null;
+            }
+            StringBuilder sbResult = new StringBuilder();
+            JSONArray jsonArray = new JSONArray();
+            Field[] newFields = tNew.getClass().getDeclaredFields();
+            for (Field newField : newFields) {
+                //设置允许通过反射访问私有变量
+                newField.setAccessible(true);
+
+                //判断值是否有修改
+                Object newValue = newField.get(tNew);
+                if (newValue != null && newField.getName().equals("serialVersionUID")) {
+                    continue;
+                }
+                if (newValue != null) {
+                    Object oldValue = hashMap.get(newField.getName());
+                    setModifInfo(tNew, oldValue, sbResult, jsonArray, newField);
+                }
+            }
+
+            //修改详情
+            String strNotes = sbResult.toString();
+            //判断对象是否有修改,如果不为空则返回存储的SQL
+            if (!StringUtils.isBlank(strNotes)) {
+                //去掉最后的分号
+                strNotes = strNotes.substring(0, strNotes.length() - 1);
+
+                //返回存储的日志SQL
+                strResult = saveLogSQL(strCause, strNotes, jsonArray.toJSONString(), LogOperateEnum.Modif, strDbTableName);
+            }
+        } catch (Exception ex) {
+            strResult = "";
+        }
+        return strResult;
+    }
+
+    /**
+     * 设置修改信息
+     *
+     * @param tNew      实体对象
+     * @param oldValue  修改前的值
+     * @param sbResult  存储的StringBuilder对象
+     * @param jsonArray 存储的JsonArray对象
+     * @param newField  实体类Field对象
+     * @param <T>       泛型实体
+     * @throws IllegalAccessException
+     */
+    private static <T> void setModifInfo(T tNew, Object oldValue, StringBuilder sbResult, JSONArray jsonArray, Field newField) throws IllegalAccessException {
+        Object newValue = newField.get(tNew);
+        String fieldText = getApiModelPropertyValue(tNew, newField.getName());
+        String fieldValue = newField.getName();
+        if (oldValue == null) {
+            oldValue = "";
+        } else {
+            if (oldValue instanceof Date) {
+                oldValue = DateUtils.formatDate((Date) oldValue);
+            }
+        }
+        if (newValue == null) {
+            newValue = "";
+        } else {
+            if (newValue instanceof Date) {
+                newValue = DateUtils.formatDate((Date) newValue);
+            }
+        }
+        sbResult.append(MessageFormat.format("「{0}({1})」由{2}修改为{3};"
+                , fieldText, fieldValue, oldValue, newValue));
+
+        //修改详情添加到json对象中
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("fieldText", fieldText);
+        jsonObject.put("fieldValue", fieldValue);
+        jsonObject.put("oldValue", oldValue);
+        jsonObject.put("newValue", newValue);
+        jsonArray.add(jsonObject);
+    }
+
+
+    /**
+     * 获取指定泛型实体类的ApiModelProperty值
+     *
+     * @param t         泛型实体类
+     * @param fieldName 字段名
+     * @param <T>       泛型
+     * @return 实体类的ApiModelProperty值
+     */
+    private static <T> String getApiModelPropertyValue(T t, String fieldName) {
+        String strValue = "";
+        Field[] fields = t.getClass().getDeclaredFields();
+        for (Field field : fields) {
+            for (Annotation annotation : field.getAnnotations()) {
+                if (annotation instanceof ApiModelProperty) {
+                    if (field.getName().equals(fieldName)) {
+                        strValue = ((ApiModelProperty) annotation).value();
+                        break;
+                    }
+                }
+            }
+        }
+        return strValue;
+    }
+
+
+    /**
+     * 获取泛型实体类对应的TableName注解对象
+     *
+     * @param t   泛型实体类
+     * @param <T> 泛型
+     * @return 实体类对应的TableName注解对象
+     */
+    private static <T> Annotation getTableNameAnnotation(T t) {
+        Annotation[] annotations = t.getClass().getDeclaredAnnotations();
+        for (Annotation annotation : annotations) {
+            if (annotation instanceof TableName) {
+                return annotation;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 保存日志SQL
+     *
+     * @param strCause       变更原因
+     * @param strNotes       修改详情
+     * @param strJsonNotes   修改详情的json字符
+     * @param logOperateEnum 枚举修改类型
+     * @param strTableName   数据库表名
+     * @return 日志存储SQL
+     */
+    private static String saveLogSQL(String strCause, String strNotes, String strJsonNotes, LogOperateEnum logOperateEnum, String strTableName) {
+        String userName = "test";//SecurityUtils.getUserName();
+        String realName = "测试";//SecurityUtils.getUser().getRealName();
+
+        StringBuilder sbSQL = new StringBuilder();
+        sbSQL.append("insert into tf_ywys_sys_commlog(id,btype,btable,changecause,notes,json_notes,optype,usercode,username,optime)");
+        sbSQL.append(MessageFormat.format("select sys_guid(),name,btable,''{0}'',''{1}'',''{2}'',''{3}'',''{4}'',''{5}'',sysdate from tf_ywys_bm_logtype where btable=''{6}''"
+                , strCause, strNotes, strJsonNotes, logOperateEnum.toString(), userName, realName, strTableName));
+        return sbSQL.toString();
+    }
+
+    /**
+     * 通过数据库表名,where唯一条件查询数据库实体model,如果where查询出多条则返回null
+     *
+     * @param strTableName 数据库表名
+     * @param strWhere     查询的where条件
+     * @return HashMap对象
+     * @throws Exception
+     */
+    private static HashMap getModel(String strTableName, String strWhere) throws Exception {
+        String strSql = MessageFormat.format("select * from {0} where {1}", strTableName, strWhere);
+        DbHelper dbHelper = DbHelper.getDbHelper();
+        Object object = dbHelper.getList(strSql, SysEnum.MyBatis.getName());
+        ArrayList arrayList = (ArrayList) ((CollectionData) object).getRecords();
+        if (arrayList.size() != 1) {
+            //查询的数据有多条,where条件不对,必须为一条数据
+            return null;
+        }
+        return (HashMap) ResultRespone.getConvertList(arrayList).get(0);
+    }
+}

+ 29 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/enums/LogOperateEnum.java

@@ -0,0 +1,29 @@
+package com.tofly.fees.common.enums;
+
+/**
+ * 日志操作枚举
+ *
+ * @author shudong
+ */
+public enum LogOperateEnum {
+    /**
+     * 添加
+     */
+    Add,
+    /**
+     * 修改
+     */
+    Modif,
+    /**
+     * 删除
+     */
+    delete,
+    /**
+     * 查询
+     */
+    Search,
+    /**
+     * 事件
+     */
+    Event
+}

+ 2 - 1
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/enums/TableIdEnum.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.EnumValue;
 
 /**
  * 数据表的主键ID枚举
+ * @author shudong
  */
 public enum TableIdEnum {
 
@@ -22,5 +23,5 @@ public enum TableIdEnum {
     /**
      * 其他自定义字符,非guid、自增、MaxID方式,当做普通字段存值
      */
-    Other;
+    Other
 }

+ 43 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/common/util/NumberUtils.java

@@ -0,0 +1,43 @@
+package com.tofly.fees.common.util;
+
+import java.text.NumberFormat;
+
+/**
+ * 数字转换处理类
+ *
+ * @author shudong
+ */
+public class NumberUtils {
+
+    private final static NumberFormat numberFormat = NumberFormat.getInstance();
+
+    /**
+     * Object类型转字符串
+     *
+     * @param obj 对象
+     * @return 字符串
+     */
+    public static String toString(Object obj) {
+        return numberFormat.format(obj);
+    }
+
+    /**
+     * double数字转字符串(如4.0,转换后为”4“,而不是”4.0“)
+     *
+     * @param dNum 数字
+     * @return 字符串
+     */
+    public static String toString(double dNum) {
+        return numberFormat.format(dNum);
+    }
+
+    /**
+     * long数字转字符串
+     *
+     * @param dNum 数字
+     * @return 字符串
+     */
+    public static String toString(long dNum) {
+        return numberFormat.format(dNum);
+    } 
+}

+ 1 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/financialmgt/controller/BmPriceController.java

@@ -12,6 +12,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 

+ 1 - 1
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/financialmgt/controller_easy/SfRecEasyController.java

@@ -76,7 +76,7 @@ public class SfRecEasyController extends BaseController {
          if(mp.get("V_SFCG").equals("0")) {
              return ResultRespone.success(new CollectionData(arr, arr.size()));
          }else {
-             return ResultRespone.failed(new CollectionData(null,0));
+             return ResultRespone.success(new CollectionData(null,0));
          }
     }
 

+ 12 - 12
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterprofilemgt/entity/DaMeter.java

@@ -55,12 +55,12 @@ public class DaMeter extends Model<DaMeter> {
     /**
      * 水表类别(bm_METER_TYPE)
      */
-    @ApiModelProperty(value = "水表类别(bm_METER_TYPE)")
+    @ApiModelProperty(value = "水表类别")
     private String meterType;
     /**
      * 水表生产厂家(bm_METER_FACTORY)
      */
-    @ApiModelProperty(value = "水表生产厂家(bm_METER_FACTORY)")
+    @ApiModelProperty(value = "水表生产厂家")
     private String meterFactory;
     /**
      * 水表出厂日期
@@ -72,12 +72,12 @@ public class DaMeter extends Model<DaMeter> {
     /**
      * 水表型号(bm_METER_MODEL)
      */
-    @ApiModelProperty(value = "水表型号(bm_METER_MODEL)")
+    @ApiModelProperty(value = "水表型号")
     private String meterModel;
     /**
      * 水表口径(sys_child_code,pcid='12')
      */
-    @ApiModelProperty(value = "水表口径(sys_child_code,pcid='12')")
+    @ApiModelProperty(value = "水表口径")
     private String meterCaliber;
     /**
      * 水表编号
@@ -87,17 +87,17 @@ public class DaMeter extends Model<DaMeter> {
     /**
      * 水表量程(sys_child_code,pcid='13')
      */
-    @ApiModelProperty(value = "水表量程(sys_child_code,pcid='13')")
+    @ApiModelProperty(value = "水表量程")
     private String meterRange;
     /**
      * 表计位置(sys_child_code,pcid='15')
      */
-    @ApiModelProperty(value = "表计位置(sys_child_code,pcid='15')")
+    @ApiModelProperty(value = "表计位置")
     private String meterPosition;
     /**
      * 精度等级(sys_child_code,pcid='14')
      */
-    @ApiModelProperty(value = "精度等级(sys_child_code,pcid='14')")
+    @ApiModelProperty(value = "精度等级")
     private String meterAccuracyClass;
     /**
      * 抄表频率
@@ -172,7 +172,7 @@ public class DaMeter extends Model<DaMeter> {
     /**
      * 垃圾费收取方式:0按户收取,1 按用量收取
      */
-    @ApiModelProperty(value = "垃圾费收取方式:0按户收取,1 按用量收取")
+    @ApiModelProperty(value = "垃圾费收取方式")
     private String garbageFeeMode;
     /**
      * 垃圾费单价
@@ -187,12 +187,12 @@ public class DaMeter extends Model<DaMeter> {
     /**
      * 计费状态(1正常,2停用)
      */
-    @ApiModelProperty(value = "计费状态(1正常,2停用)")
+    @ApiModelProperty(value = "计费状态")
     private String meterState;
     /**
      * 开卡标志(bm_kkzt)
      */
-    @ApiModelProperty(value = "开卡标志(bm_kkzt)")
+    @ApiModelProperty(value = "开卡标志")
     private String icState;
     /**
      * 开卡日期
@@ -285,7 +285,7 @@ public class DaMeter extends Model<DaMeter> {
     /**
      * 所属阀门(sys_child_code,pcid='23')
      */
-    @ApiModelProperty(value = "所属阀门(sys_child_code,pcid='23')")
+    @ApiModelProperty(value = "所属阀门")
     private String meterValve;
     /**
      * 操作人员编码
@@ -312,7 +312,7 @@ public class DaMeter extends Model<DaMeter> {
     /**
      * 两高一剩标志:0 否,1
      */
-    @ApiModelProperty(value = "两高一剩标志:0 否,1 是")
+    @ApiModelProperty(value = "两高一剩标志")
     private String lgysFlag;
     /**
      * 安装人员

+ 0 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/controller/.gitkeep


+ 173 - 168
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/controller/BwMeterReadPlanController.java

@@ -4,27 +4,38 @@
  */
 package com.tofly.fees.meterreadingmgt.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.tofly.common.core.entity.ResultRespone;
+import com.tofly.common.core.util.Convert;
 import com.tofly.common.log.annotation.ToFlyAppLog;
 import com.tofly.fees.common.BaseController;
+import com.tofly.fees.common.annotate.requestPostSingle.RequestPostSingleParam;
 import com.tofly.fees.common.dbhelper.DbHelper;
-import com.tofly.fees.common.model.CollectionData;
+import com.tofly.fees.common.dbhelper.LogHelper;
+import com.tofly.fees.common.dbhelper.PageSortHelper;
+import com.tofly.fees.common.dbhelper.ProduceSql;
+import com.tofly.fees.common.util.NumberUtils;
+import com.tofly.fees.meterprofilemgt.entity.DaMeter;
+import com.tofly.fees.meterprofilemgt.service.DaMeterService;
 import com.tofly.fees.meterreadingmgt.entity.BwMeterReadPlan;
 import com.tofly.fees.meterreadingmgt.mapper.BwMeterReadPlanMapper;
 import com.tofly.fees.meterreadingmgt.service.IBwMeterReadPlanService;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.Valid;
 import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import static com.tofly.fees.common.ControllerConstants.*;
+import java.util.Date;
+import java.util.Map;
 
 /**
  * 抄表计划_抄表录入
@@ -34,188 +45,182 @@ import static com.tofly.fees.common.ControllerConstants.*;
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("/bwmeterreadplan")
-@Api(tags = "抄表计划_抄表录入接口")
+@RequestMapping("/api/bwmeterreadplan")
+@Api(tags = "抄表管理-抄表录入接口")
 public class BwMeterReadPlanController extends BaseController {
 
     private final IBwMeterReadPlanService bwMeterReadPlanService;
+    private final BwMeterReadPlanMapper bwMeterReadPlanMapper;
 
-
-    @Autowired
-    BwMeterReadPlanMapper bwMeterReadPlanMapper;
-
-
-    @GetMapping("/page")
-    @ApiOperation(value = "分页查询")
-    public ResultRespone selBwMeterReadPlanPage(@ApiParam(value = PAGE_SIZE_DESCRIPTION, required = true)
-                                                @RequestParam(value = PAGE_SIZE_PARA_NAME) int pageSize,
-                                                @ApiParam(value = PAGE_NUMBER_DESCRIPTION, required = true)
-                                                @RequestParam(value = PAGE_NUMBER_PARA_NAME) int page,
-                                                @ApiParam(value = "抄表人员(模糊查询)")
-                                                @RequestParam String customerName,
-                                                @ApiParam(value = "抄表状态 (1:已抄表 0未抄表)")
-                                                @RequestParam String mrFlag,
-                                                @ApiParam(value = "所属抄表册[0未分配抄表册用户]")
-                                                @RequestParam String mrBook,
-                                                @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = "XXX")
-                                                @RequestParam(required = false) String sortProperty,
-                                                @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES)
-                                                @RequestParam(required = false) String sortOrder) {
-
-
-        //设置页码
-        Page<HashMap<String, Object>> pg = new Page<HashMap<String, Object>>(page, pageSize);
-        //自定义SQL语句
-        IPage<List<HashMap<String, Object>>> newPage = bwMeterReadPlanMapper.selMeterReadList(pg, customerName, mrFlag, mrBook);
-        //组装返回对象
-        CollectionData<List<HashMap<String, Object>>> m = new CollectionData<>(newPage.getRecords().stream().collect(
-                Collectors.toList()
-        ), newPage.getTotal());
-        //参数返回
-        return ResultRespone.success(m);
-    }
-
+    private final DaMeterService daMeterService;
 
     /**
-     * 通过id查询抄表计划_抄表录入
-     *
-     * @param customerNo id
-     * @return ResultRespone
+     * 抄表录入查询列表数据
      */
-    @GetMapping("/{customerNo}")
-    @ApiOperation(value = "通过ID查询")
+    @PostMapping("/page")
+    @ApiOperation(value = "分页查询")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "customerNo", value = "ID", required = true, dataType = "BigDecimal")
+            @ApiImplicitParam(name = "companyBranch", value = "公司", dataType = "String"),
+            @ApiImplicitParam(name = "mrArea", value = "片区", dataType = "String"),
+            @ApiImplicitParam(name = "mrBook", value = "抄表本", dataType = "String"),
+            @ApiImplicitParam(name = "mrOCode", value = "抄表员", dataType = "String"),
+            @ApiImplicitParam(name = "mrMode", value = "抄表方式", dataType = "String"),
+            @ApiImplicitParam(name = "mrFlag", value = "抄表状态", dataType = "String"),
+            @ApiImplicitParam(name = "calFlag", value = "算费状态", dataType = "String"),
+            @ApiImplicitParam(name = "searchText", value = "模糊查询(用户编号、姓名)", dataType = "String")
     })
-    public ResultRespone getById(@PathVariable("customerNo") BigDecimal customerNo) {
-        return ResultRespone.success(bwMeterReadPlanService.getById(customerNo));
-    }
-
-    /**
-     * 新增抄表计划_抄表录入
-     *
-     * @param bwMeterReadPlan 抄表计划_抄表录入
-     * @return ResultRespone
-     */
-    @ToFlyAppLog(title = "新增抄表计划_抄表录入")
-    @ApiOperation(value = "新增抄表计划_抄表录入")
-    @PostMapping
-    public ResultRespone save(@Valid @RequestBody BwMeterReadPlan bwMeterReadPlan) {
-        return ResultRespone.success(bwMeterReadPlanService.save(bwMeterReadPlan));
+    public ResultRespone getMeterReadList(Page page, String companyBranch, String mrArea
+            , String mrBook, String mrOCode, String mrMode, String mrFlag, String calFlag, String searchText) {
+        PageSortHelper.setPageSort(page, new String[]{"mrModeName", "mrTypeName"});
+        IPage<Map<String, Object>> pageList = bwMeterReadPlanMapper.getMeterReadList(page, companyBranch, mrArea
+                , mrBook, mrOCode, mrMode, mrFlag, calFlag, searchText);
+        return ResultRespone.success(pageList);
     }
 
     /**
      * 修改抄表计划_抄表录入
      *
-     * @param bwMeterReadPlan 抄表计划_抄表录入
+     * @param data 抄表录入对象
      * @return ResultRespone
      */
-    @ToFlyAppLog(title = "修改抄表计划_抄表录入")
-    @ApiOperation(value = "修改抄表计划_抄表录入")
-    @PutMapping
-    public ResultRespone updateById(@RequestBody BwMeterReadPlan bwMeterReadPlan) {
-        return ResultRespone.success(bwMeterReadPlanService.updateById(bwMeterReadPlan));
-    }
-
-    /**
-     * 通过id删除抄表计划_抄表录入
-     *
-     * @param customerNo id
-     * @return ResultRespone
-     */
-    @ToFlyAppLog(title = "通过id删除抄表计划_抄表录入")
-    @ApiOperation(value = "通过ID删除抄表计划_抄表录入")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "customerNo", value = "ID", required = true, dataType = "BigDecimal")
-    })
-    @DeleteMapping("/{customerNo}")
-    public ResultRespone removeById(@PathVariable BigDecimal customerNo) {
-        return ResultRespone.success(bwMeterReadPlanService.removeById(customerNo));
-    }
-
-    /**
-     * 通过id批量删除抄表计划_抄表录入
-     *
-     * @param ids id
-     * @return ResultRespone
-     */
-    @ToFlyAppLog(title = "通过id批量删除抄表计划_抄表录入")
-    @ApiOperation(value = "通过ID批量删除抄表计划_抄表录入")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "ids", value = "批量删除,多个id以逗号隔开", required = true, dataType = "String")
-    })
-    @DeleteMapping("/deleteByIds")
-    public ResultRespone removeById(String ids) {
-        return ResultRespone.success(bwMeterReadPlanService.removeByIds(Arrays.asList(ids.split(","))));
-    }
-
-
-    /*
-     *DBHelper修改用户
-     */
-    @ToFlyAppLog(title = "根据用户编号修改用户名称")
-    @ApiOperation(value = "根据用户编号修改用户名称")
-    @PostMapping("/saveName")
-    public ResultRespone saveName(@ApiParam(value = "用户姓名", required = true)
-                                  @RequestParam String name,
-                                  @ApiParam(value = "用户编号", required = true)
-                                  @RequestParam String no) throws Exception {
-
-        DbHelper db = DbHelper.getDbHelper();
-        int row = db.executeCmd("update tf_ywys_da_customer set customer_name='" + name + "' where customer_no='" + no + "'");
-        String msg = "修改成功";
-        if (!(row > 0)) {
-            msg = "修改失败";
+    @ToFlyAppLog(title = "保存抄表录入")
+    @ApiOperation(value = "保存抄表录入")
+    @PostMapping("/save")
+    public ResultRespone updateById(@RequestPostSingleParam("data") JSONObject data) throws Exception {
+
+        //region 初始赋值
+
+        //抄表类型
+        int v_cblx = Convert.toInt(data.get("cblx"));
+        //水表量程
+        double v_sblc = Convert.toDouble(data.get("sblc"));
+        String czrybm = Convert.toStr(data.get("czrybm"));
+        String czryxm = Convert.toStr(data.get("czryxm"));
+
+        BwMeterReadPlan bwMeterReadPlan = new BwMeterReadPlan();
+        bwMeterReadPlan.setMrType(Convert.toBigDecimal(v_cblx));
+        bwMeterReadPlan.setThisReading(Convert.toBigDecimal(data.get("bcds")));
+        bwMeterReadPlan.setLastReading(Convert.toBigDecimal(data.get("scds")));
+        bwMeterReadPlan.setJjl(Convert.toBigDecimal(data.get("jjl")));
+        bwMeterReadPlan.setOldMeterEreading(Convert.toBigDecimal(data.get("jbzd")));
+        bwMeterReadPlan.setNewMeterBreading(Convert.toBigDecimal(data.get("xbqd")));
+        bwMeterReadPlan.setRemark(Convert.toStr(data.get("bz")));
+        bwMeterReadPlan.setMeterCardId(data.get("cbkid").toString());
+        bwMeterReadPlan.setQuantity(Convert.toBigDecimal(data.get("sjsl")));
+        bwMeterReadPlan.setMrMode(data.get("cbfs").toString());
+        //endregion
+
+        //region 验证
+        int sjsl = 0;
+        if (v_cblx == 0) {
+            //正常
+            sjsl = Convert.toInt(bwMeterReadPlan.getThisReading()
+                    .subtract(bwMeterReadPlan.getLastReading())
+                    .add(bwMeterReadPlan.getJjl()));
+        } else if (v_cblx == -1) {
+            //表倒走
+            sjsl = Math.abs(Convert.toInt(
+                    bwMeterReadPlan.getLastReading().subtract(bwMeterReadPlan.getThisReading())))
+                    + Convert.toInt(bwMeterReadPlan.getJjl());
+        } else if (v_cblx == -2) {
+            //表满度
+            double sbmdValue = Math.pow(10, v_sblc) - 1;
+            sjsl = Math.abs(Convert.toInt(sbmdValue)
+                    - Convert.toInt(bwMeterReadPlan.getLastReading())
+                    + Convert.toInt(bwMeterReadPlan.getThisReading()))
+                    + Convert.toInt(bwMeterReadPlan.getJjl());
+        } else if (v_cblx == -3) {
+            //洗换表
+            sjsl = Convert.toInt(bwMeterReadPlan.getOldMeterEreading()
+                    .subtract(bwMeterReadPlan.getLastReading()))
+                    + Convert.toInt(bwMeterReadPlan.getThisReading()
+                    .subtract(bwMeterReadPlan.getNewMeterBreading()));
         }
-        return ResultRespone.success(true, msg);
-    }
 
-    /*
-     *DBHelper修改用户
-     */
-    @ToFlyAppLog(title = "测试接口")
-    @ApiOperation(value = "测试接口")
-    @PostMapping("/saveName2")
-    public ResultRespone saveName2(@ApiParam(value = "用户姓名", required = true)
-                                   @RequestParam String name,
-                                   @ApiParam(value = "用户编号", required = true)
-                                   @RequestParam String no) throws Exception {
-
-        DbHelper db = DbHelper.getDbHelper();
-        int row = db.executeCmd("update tf_ywys_da_customer set customer_name='" + name + "' where customer_no='" + no + "'");
-        String msg = "修改成功";
-        if (!(row > 0)) {
-            msg = "修改失败";
+        if (bwMeterReadPlan.getMeterCardId().equals("")) {
+            return ResultRespone.failed(false, "用户编号不能为空!");
         }
-        return ResultRespone.success(true, msg);
-    }
-
-    /*
-     *DBHlper删除用户
-     */
-    @ToFlyAppLog(title = "根据用户编号删除用户")
-    @ApiOperation(value = "根据用户编号删除用户")
-    @DeleteMapping("/delCustomerByNo")
-    public ResultRespone deleteByNo(
-            @ApiParam(value = "用户编号", required = true)
-            @RequestParam String no) throws Exception {
+        if (Convert.toInt(bwMeterReadPlan.getQuantity()) != sjsl) {
+            return ResultRespone.failed(false, "实际水量与计算不符!");
+        }
+        //endregion
 
+        //region 保存
         DbHelper db = DbHelper.getDbHelper();
 
-        db.clearTransactionSql();
-        db.addTransactionSql("delete from tf_ywys_da_meter where customer_no='" + no + "'");
-        db.addTransactionSql("delete from Tf_Ywys_Da_Customer where customer_no='" + no + "'");
-        //业务处理
-        //lstSql.add("delete from tf_ywys_da_meter where customer_no='" + no + "'");
-       // lstSql.add("delete from Tf_Ywys_Da_Customer where customer_no='" + no + "'");
+        Date nowDate = new Date();
+        bwMeterReadPlan.setMrDate(nowDate);
+        bwMeterReadPlan.setInputOcode(czrybm);
+        bwMeterReadPlan.setInputOname(czryxm);
+        bwMeterReadPlan.setInputDate(nowDate);
+        bwMeterReadPlan.setMrFlag("1");
+        bwMeterReadPlan.setMrDataSource("0");
+        bwMeterReadPlan.setMrTimes(new BigDecimal(1));
+
+        //审核信息,默认审核通过,暂无审核抄表
+        bwMeterReadPlan.setAuditFlag("1");
+        bwMeterReadPlan.setAuditOcode(czrybm);
+        bwMeterReadPlan.setAuditOname(czryxm);
+        bwMeterReadPlan.setAuditDate(nowDate);
+        bwMeterReadPlan.setAuditSuggestion("自动审核");
+
+        //更新抄表计划表
+        db.addTransactionSql(ProduceSql.getUpdateSql(bwMeterReadPlan
+                , "meter_card_id='" + bwMeterReadPlan.getMeterCardId() + "'"));
+
+        String meterCardId = bwMeterReadPlan.getMeterCardId();
+        if (v_cblx == -2) {
+            //region 表满度
+            DaMeter daMeter = daMeterService.getById(meterCardId);
+            if (Convert.toDouble(daMeter.getMeterRange()) != v_sblc) {
+                //更新水表量程
+                DaMeter daMeterNew = new DaMeter();
+                daMeterNew.setMeterRange(NumberUtils.toString(v_sblc));
+                daMeterNew.setOperatorCode(czrybm);
+                daMeterNew.setOperatorName(czryxm);
+                daMeterNew.setOperatorDatetime(nowDate);
+                db.addTransactionSql(ProduceSql.getUpdateSql(daMeterNew, "METER_CARD_ID='" + meterCardId + "'"));
+
+                //添加修改日志记录(水表满度,修改量程)
+                String strLog = LogHelper.getModifySQL(daMeterNew, "METER_CARD_ID='" + meterCardId + "'", "抄表录入[水表满度,修改量程]");
+                if (!StringUtils.isBlank(strLog)) {
+                    db.addTransactionSql(strLog);
+                }
+            }
+            //endregion
+        } else if (v_cblx == -3) {
+            //添加修改日志记录(洗换表)
+            String strLog = LogHelper.getModifySQL(bwMeterReadPlan, "METER_CARD_ID='" + meterCardId + "'", "抄表录入-洗换表");
+            if (!StringUtils.isBlank(strLog)) {
+                db.addTransactionSql(strLog);
+            }
+        }
 
-        String msg = "删除用户成功";
-        if (!(db.executeTransaction())) {
-            msg = "删除用户失败";
+        if (Convert.toBool(data.get("xgds"))) {
+            //上次读数修改前的值,数据库查询
+            BwMeterReadPlan bwMeterReadPlanOld = bwMeterReadPlanService.getById(meterCardId);
+            BwMeterReadPlan bwMeterReadPlanNew = new BwMeterReadPlan();
+
+            //克隆新对象
+            BeanUtils.copyProperties(bwMeterReadPlanOld, bwMeterReadPlanNew);
+            bwMeterReadPlanNew.setLastReading(bwMeterReadPlan.getLastReading());
+
+            //判断是否真实被修改
+            if (!bwMeterReadPlanOld.getLastReading().equals(bwMeterReadPlanNew.getLastReading())) {
+                //添加修改日志记录
+                String strLog = LogHelper.getModifySQL(bwMeterReadPlanOld, bwMeterReadPlanNew, "抄表录入-修改底数");
+                if (!StringUtils.isBlank(strLog)) {
+                    db.addTransactionSql(strLog);
+                }
+            }
+        }
+        //事物提交数据
+        boolean isFlag = db.executeTransaction();
+        if (isFlag) {
+            return ResultRespone.success(true, "保存成功!");
+        } else {
+            return ResultRespone.failed(false, "更新失败!");
         }
-        return ResultRespone.success(true, msg);
+        //endregion
     }
-
-
-
 }

+ 1 - 1
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/controller_easy/BwMeterReadPlanEsayController.java

@@ -23,7 +23,7 @@ import java.util.Arrays;
 @RestController
 @AllArgsConstructor
 @RequestMapping("/bwmeterreadplan")
-@Api(tags = "抄表计划_抄表录入接口")
+@Api(tags = "抄表计划-抄表录入接口")
 public class BwMeterReadPlanEsayController {
 
 

+ 8 - 8
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/entity/BwMeterReadPlan.java

@@ -40,7 +40,6 @@ public class BwMeterReadPlan extends Model<BwMeterReadPlan> {
     /**
      * 客户编号
      */
-    @TableId(value = "CUSTOMER_NO", type = IdType.INPUT)
     @ApiModelProperty(value = "客户编号", required = true)
     private String customerNo;
     /**
@@ -52,7 +51,8 @@ public class BwMeterReadPlan extends Model<BwMeterReadPlan> {
     /**
      * 抄表卡ID:TF_YWYS_DA_METER.METER_CARD_ID=TF_YWYS_BW_METER_READ_PLAN.METER_CARD_ID
      */
-    @ApiModelProperty(value = "抄表卡ID:TF_YWYS_DA_METER.METER_CARD_ID=TF_YWYS_BW_METER_READ_PLAN.METER_CARD_ID")
+    @TableId(value = "CUSTOMER_NO", type = IdType.INPUT)
+    @ApiModelProperty(value = "抄表卡ID")
     private String meterCardId;
     /**
      * 所属公司
@@ -137,12 +137,12 @@ public class BwMeterReadPlan extends Model<BwMeterReadPlan> {
     /**
      * 审核标志(0:未审核;1:审核通过;2:审核不通过)
      */
-    @ApiModelProperty(value = "审核标志(0:未审核;1:审核通过;2:审核不通过)")
+    @ApiModelProperty(value = "审核标志")
     private String auditFlag;
     /**
      * 计算标志:0未算费,1已算费
      */
-    @ApiModelProperty(value = "计算标志:0未算费,1已算费")
+    @ApiModelProperty(value = "计算标志")
     private String calFlag;
     /**
      * 抄表次数
@@ -162,17 +162,17 @@ public class BwMeterReadPlan extends Model<BwMeterReadPlan> {
     /**
      * 抄表类型:BM_MR_TYPE
      */
-    @ApiModelProperty(value = "抄表类型:BM_MR_TYPE")
+    @ApiModelProperty(value = "抄表类型")
     private BigDecimal mrType;
     /**
      * 抄表方式:bm_MR_MODE
      */
-    @ApiModelProperty(value = "抄表方式:bm_MR_MODE")
+    @ApiModelProperty(value = "抄表方式")
     private String mrMode;
     /**
      * 计费状态(1正常,2停用)
      */
-    @ApiModelProperty(value = "计费状态(1正常,2停用)")
+    @ApiModelProperty(value = "计费状态")
     private String calState;
     /**
      * $column.comments
@@ -197,7 +197,7 @@ public class BwMeterReadPlan extends Model<BwMeterReadPlan> {
     /**
      * 抄表数据来源(0手工抄表,1抄表机抄表,2移动APP抄表,3远传抄表,4批量导入抄表,5换表抄,  6 一体机抄表)
      */
-    @ApiModelProperty(value = "抄表数据来源(0手工抄表,1抄表机抄表,2移动APP抄表,3远传抄表,4批量导入抄表,5换表抄,  6 一体机抄表)")
+    @ApiModelProperty(value = "抄表数据来源")
     private String mrDataSource;
     /**
      * 经度

+ 27 - 32
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/meterreadingmgt/mapper/BwMeterReadPlanMapper.java

@@ -5,18 +5,12 @@
 package com.tofly.fees.meterreadingmgt.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.tofly.fees.meterreadingmgt.entity.BwMeterReadPlan;
-import com.tofly.fees.meterreadingmgt.model.BwMeterReadPlanModel;
-import com.tofly.fees.userprofilemgt.entity.DaCustomerSelect;
-import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.MapKey;
 import org.springframework.stereotype.Repository;
 
-import java.math.BigDecimal;
-
-import java.util.HashMap;
-import java.util.List;
+import java.util.Map;
 
 /**
  * 抄表计划_抄表录入
@@ -30,44 +24,45 @@ public interface BwMeterReadPlanMapper extends BaseMapper<BwMeterReadPlan> {
     /**
      * 查询MyBatis数据
      */
-    Page<List<HashMap<String, Object>>> selMeterReadList(Page<HashMap<String,Object>> page, String name,String mrFlag,String mrBook);
+    @MapKey("meter_card_id")
+    Page<Map<String, Object>> getMeterReadList(Page page, String companyBranch, String mrArea
+            , String mrBook, String mrOCode, String mrMode, String mrFlag, String calFlag, String searchText);
 
     int delByNo(String no);
 
-      /**
-         * @MethodName cancelMrBook
-         * @Description   撤销分配
-         * @Author xb
-         * @Date 13:46 2023-06-12
-         */
+    /**
+     * @MethodName cancelMrBook
+     * @Description 撤销分配
+     * @Author xb
+     * @Date 13:46 2023-06-12
+     */
     int cancelMeterReadPlan(String customerNos);
 
 
     /**
      * @MethodName cancelMrBook
-     * @Description   撤销分配
+     * @Description 撤销分配
      * @Author xb
      * @Date 13:46 2023-06-12
      */
     int cancelDaCustomerReadPlan(String customerNos);
 
 
-     /**
-        * @MethodName toMeterReadPlan
-        * @Description    分配
-        * @Author xb
-        * @Date 16:36 2023-06-12
-        */ 
-    int toMeterReadPlan(String customerNos,Integer mrBook);
+    /**
+     * @MethodName toMeterReadPlan
+     * @Description 分配
+     * @Author xb
+     * @Date 16:36 2023-06-12
+     */
+    int toMeterReadPlan(String customerNos, Integer mrBook);
+
+    /**
+     * @MethodName toDaCustomerReadPlan
+     * @Description 分配
+     * @Author xb
+     * @Date 16:37 2023-06-12
+     */
+    int toDaCustomerReadPlan(String customerNos, Integer mrBook);
 
-   /**
-      * @MethodName toDaCustomerReadPlan
-      * @Description 分配
-      * @Author xb
-      * @Date 16:37 2023-06-12
-      */ 
-    int toDaCustomerReadPlan(String customerNos,Integer mrBook);
-    
-    
 
 }

+ 121 - 33
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/controller/WxTsNoticeController.java

@@ -11,9 +11,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.tofly.common.core.entity.ResultRespone;
 import com.tofly.common.log.annotation.ToFlyAppLog;
+import com.tofly.fees.common.util.GuidGenerator;
+import com.tofly.fees.common.wechat.UserListJsonResult;
+import com.tofly.fees.common.wechat.WxPayConfig;
+import com.tofly.fees.common.wechat.Wxapi;
 import com.tofly.fees.userprofilemgt.entity.DaCustomerSelect;
+import com.tofly.fees.wechatbasicmgt.entity.WxMessage;
+import com.tofly.fees.wechatbasicmgt.entity.WxToken;
 import com.tofly.fees.wechatbasicmgt.entity.WxTsNotice;
 import com.tofly.fees.wechatbasicmgt.mapper.WxTsNoticeMapper;
+import com.tofly.fees.wechatbasicmgt.service.WxMessageService;
+import com.tofly.fees.wechatbasicmgt.service.WxTokenService;
 import com.tofly.fees.wechatbasicmgt.service.WxTsNoticeService;
 import lombok.AllArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,8 +32,8 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import org.springframework.web.bind.annotation.ModelAttribute;
 
-import java.util.Arrays;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * 微信推送停水通知
@@ -36,120 +44,200 @@ import java.util.Map;
 @RestController
 @AllArgsConstructor
 @RequestMapping("/api/wechatbasicmgt/wxtsnotice")
-@Api(tags="微信管理-微信推送停水通知接口")
+@Api(tags = "微信管理-微信推送停水通知接口")
 public class WxTsNoticeController {
 
-    private final  WxTsNoticeService wxTsNoticeService;
+    private final WxTsNoticeService wxTsNoticeService;
 
     private final WxTsNoticeMapper wxTsNoticeMapper;
+
+
+    private final WxTokenService wxTokenService;
+
+    private final WxMessageService wxMessageService;
+
+
     /**
-    * 分页查询  微信推送停水通知接口
-    * @param page 分页对象
-    * @param
-    * @return
-    */
-    @GetMapping("/page" )
+     * 分页查询  微信推送停水通知接口
+     *
+     * @param page 分页对象
+     * @param
+     * @return
+     */
+    @GetMapping("/page")
     @ApiOperation(value = "分页查询")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "current", value = "当前页码", required = true, dataType = "int"),
             @ApiImplicitParam(name = "size", value = "每页显示数据条数", required = true, dataType = "int"),
-            @ApiImplicitParam(name = "pages", value = "共几页,输出参数",  dataType = "int"),
+            @ApiImplicitParam(name = "pages", value = "共几页,输出参数", dataType = "int"),
             @ApiImplicitParam(name = "maxLimit", value = "每页最大显示数据", dataType = "int"),
-            @ApiImplicitParam(name = "orders[0].asc", value = "排序,bool类型",  dataType = "String"),
-            @ApiImplicitParam(name = "orders[0].column", value = "排序,字段名",  dataType = "String"),
+            @ApiImplicitParam(name = "orders[0].asc", value = "排序,bool类型", dataType = "String"),
+            @ApiImplicitParam(name = "orders[0].column", value = "排序,字段名", dataType = "String"),
             @ApiImplicitParam(name = "state", value = "是否发送,0,1", dataType = "String"),
             @ApiImplicitParam(name = "editDateStart", value = "开始日期", dataType = "String"),
             @ApiImplicitParam(name = "editDateEnd", value = "结束日期", dataType = "String"),
-            @ApiImplicitParam(name = "searchText", value = "模糊查询(编辑人员、标题、停水区域)",dataType = "String")
+            @ApiImplicitParam(name = "searchText", value = "模糊查询(编辑人员、标题、停水区域)", dataType = "String")
     })
-    public ResultRespone getWxTsNoticePage(Page page, String searchText,String state,String editDateStart,String editDateEnd) {
-        IPage<WxTsNotice> WxTsPage=wxTsNoticeMapper.selectWxTsNoticePage(page,searchText,state,editDateStart,editDateEnd);
-      return ResultRespone.success(WxTsPage);
+    public ResultRespone getWxTsNoticePage(Page page, String searchText, String state, String editDateStart, String editDateEnd) {
+        IPage<WxTsNotice> WxTsPage = wxTsNoticeMapper.selectWxTsNoticePage(page, searchText, state, editDateStart, editDateEnd);
+        return ResultRespone.success(WxTsPage);
     }
 
 
     /**
      * 通过id查询微信推送停水通知
+     *
      * @param id id
      * @return ResultRespone
      */
-    @GetMapping("/{id}" )
+    @GetMapping("/{id}")
     @ApiOperation(value = "通过ID查询")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "BigDecimal")
     })
-    public ResultRespone getById(@PathVariable("id" ) Integer id) {
-      return ResultRespone.success(wxTsNoticeService.getById(id));
+    public ResultRespone getById(@PathVariable("id") Integer id) {
+        return ResultRespone.success(wxTsNoticeService.getById(id));
     }
 
     /**
      * 新增微信推送停水通知
+     *
      * @param wxTsNotice 微信推送停水通知
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="新增微信推送停水通知" )
+    @ToFlyAppLog(title = "新增微信推送停水通知")
     @ApiOperation(value = "新增微信推送停水通知")
     @PostMapping
     public ResultRespone save(@RequestBody WxTsNotice wxTsNotice) {
         //查询当前ID
-       int id=  wxTsNoticeMapper.SelectChargeMaxCode();
-        wxTsNotice.setId(id+1);
+        int id = wxTsNoticeMapper.SelectChargeMaxCode();
+        wxTsNotice.setId(id + 1);
         wxTsNotice.setState("0");//推送状态
         wxTsNotice.setAuditFlag("0");//未审核
-      return ResultRespone.success(wxTsNoticeService.save(wxTsNotice));
+        return ResultRespone.success(wxTsNoticeService.save(wxTsNotice));
     }
+
     /**
      * 发送微信推送停水通知
+     *
      * @param wxTsNotice 微信推送停水通知
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="发送微信推送停水通知" )
+    @ToFlyAppLog(title = "发送微信推送停水通知")
     @ApiOperation(value = "发送微信推送停水通知")
     @PostMapping("/send")
     public ResultRespone send(@RequestBody WxTsNotice wxTsNotice) {
+       WxPayConfig wxPayConfig=new WxPayConfig();
+
+//region 获取accessToken和expiresdate,openid
+        WxToken wxToken = wxTokenService.getById(wxPayConfig.getAPPID());
+        String accessToken = wxToken.getAccessToken();
+        Date expiresDate = wxToken.getExpiresdate();
+
 
+        int resultcount = 10000;
+        String nextopenid = "";
+        List<String> listpenid = new ArrayList<>();
+        //int j = 2;
+        while (resultcount >= 10000) {
+            Date date = new Date();
+            // 判断access_token是否在有效期内,无效重新获取
+            if (date.compareTo(expiresDate) >= 0 || accessToken == "") {
 
+                Map<String, String> map = Wxapi.GetAccessToken();
+                accessToken = map.get("accessToken");
+                if (accessToken != "") {
+                    long currentTime = System.currentTimeMillis();
+                    currentTime += 120 * 60 * 1000;
+                    expiresDate = new Date(currentTime);
+                    wxToken.setAccessToken(accessToken);
+                    wxToken.setExpiresdate(expiresDate);
+                    wxTokenService.updateById(wxToken);
+                } else {
+                    break;
+                }
+
+            }
+            UserListJsonResult userlist = Wxapi.GetUserList(accessToken, nextopenid);
+            if (userlist != null && userlist.data != null) {
+                listpenid.addAll(userlist.data.openid);
+                resultcount = userlist.count;
+                nextopenid = userlist.next_openid;
+
+            } else {
+                break;
+            }
+
+        }
+//endregion
+
+        List<WxMessage> ListMessage = new ArrayList<>();
+
+        for (int i = 0; i < listpenid.size(); i++) {
+//            for (int i = 0; i < 5; i++) {
+            WxMessage wxMessage = new WxMessage();
+            wxMessage.setId(GuidGenerator.getGuid());
+            wxMessage.setMsgType("06");
+            wxMessage.setOpenid(listpenid.get(i));
+//                wxMessage.setOpenid("openid_test");
+            wxMessage.setFirst(wxTsNotice.getTitle());
+            wxMessage.setKeyword1(wxTsNotice.getStopType());
+            wxMessage.setKeyword2(wxTsNotice.getStopTime());
+            wxMessage.setKeyword3(wxTsNotice.getStopArea());
+            wxMessage.setRemark(wxTsNotice.getRemark());
+            wxMessage.setAddDate(wxTsNotice.getEditDate());
+            wxMessage.setAddOcode(wxTsNotice.getEditCode());
+            wxMessage.setSendState("0");
+            wxMessage.setIsLock("0");
+
+            ListMessage.add(wxMessage);
+
+        }
+        return ResultRespone.success(wxMessageService.saveBatch(ListMessage));
 
-        return ResultRespone.success(wxTsNoticeService.sendWx(wxTsNotice));
     }
+
     /**
      * 修改微信推送停水通知
+     *
      * @param wxTsNotice 微信推送停水通知
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="修改微信推送停水通知" )
+    @ToFlyAppLog(title = "修改微信推送停水通知")
     @ApiOperation(value = "修改微信推送停水通知")
     @PutMapping
     public ResultRespone updateById(@RequestBody WxTsNotice wxTsNotice) {
-      return ResultRespone.success(wxTsNoticeService.updateById(wxTsNotice));
+        return ResultRespone.success(wxTsNoticeService.updateById(wxTsNotice));
     }
 
     /**
      * 通过id删除微信推送停水通知
+     *
      * @param id id
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="通过id删除微信推送停水通知" )
+    @ToFlyAppLog(title = "通过id删除微信推送停水通知")
     @ApiOperation(value = "通过ID删除微信推送停水通知")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "BigDecimal")
     })
-    @DeleteMapping("/{id}" )
+    @DeleteMapping("/{id}")
     public ResultRespone removeById(@PathVariable Integer id) {
-      return ResultRespone.success(wxTsNoticeService.removeById(id));
+        return ResultRespone.success(wxTsNoticeService.removeById(id));
     }
 
     /**
      * 通过id批量删除微信推送停水通知
+     *
      * @param ids id
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="通过id批量删除微信推送停水通知" )
+    @ToFlyAppLog(title = "通过id批量删除微信推送停水通知")
     @ApiOperation(value = "通过ID批量删除微信推送停水通知")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "ids", value = "批量删除,多个id以逗号隔开", required = true, dataType = "String")
     })
-    @DeleteMapping("/deleteByIds" )
+    @DeleteMapping("/deleteByIds")
     public ResultRespone removeByIds(String ids) {
         return ResultRespone.success(wxTsNoticeService.removeByIds(Arrays.asList(ids.split(","))));
     }

+ 1 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/WxCustomerHisService.java

@@ -14,5 +14,6 @@ import com.tofly.fees.wechatbasicmgt.entity.WxCustomerHis;
  * @date Mon Jun 05 00:00:00 CST 2023
  */
 public interface WxCustomerHisService extends IService<WxCustomerHis> {
+    int SelectChargeMaxCode();
 
 }

+ 0 - 1
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/WxTsNoticeService.java

@@ -15,5 +15,4 @@ import com.tofly.fees.wechatbasicmgt.entity.WxTsNotice;
  */
 public interface WxTsNoticeService extends IService<WxTsNotice> {
 
-   boolean sendWx(WxTsNotice wxTsNotice);
 }

+ 7 - 1
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/impl/WxCustomerHisServiceImpl.java

@@ -7,6 +7,7 @@ package com.tofly.fees.wechatbasicmgt.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.tofly.fees.wechatbasicmgt.entity.WxCustomerHis;
 import com.tofly.fees.wechatbasicmgt.service.WxCustomerHisService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.tofly.fees.wechatbasicmgt.mapper.WxCustomerHisMapper;
 
@@ -18,5 +19,10 @@ import com.tofly.fees.wechatbasicmgt.mapper.WxCustomerHisMapper;
  */
 @Service("wxCustomerHisService")
 public class WxCustomerHisServiceImpl extends ServiceImpl<WxCustomerHisMapper, WxCustomerHis> implements WxCustomerHisService {
-
+    @Autowired
+    private WxCustomerHisMapper wxCustomerHisMapper;
+    @Override
+    public int SelectChargeMaxCode() {
+       return wxCustomerHisMapper.SelectChargeMaxCode();
+    }
 }

+ 0 - 94
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatbasicmgt/service/impl/WxTsNoticeServiceImpl.java

@@ -33,99 +33,5 @@ import java.util.*;
  */
 @Service("wxTsNoticeService")
 public class WxTsNoticeServiceImpl extends ServiceImpl<WxTsNoticeMapper, WxTsNotice> implements WxTsNoticeService {
-    @Autowired
-    WxTokenService wxTokenService;
 
-    @Autowired
-    WxMessageService wxMessageService;
-
-
-    WxPayConfig wxPayConfig = new WxPayConfig();
-
-    private SimpleDateFormat sdfFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
-
-
-    @Override
-    public boolean sendWx(WxTsNotice wxTsNotice) {
-        try {
-//region 获取accessToken和expiresdate
-            WxToken wxToken = wxTokenService.getById(wxPayConfig.getAPPID());
-            String accessToken = wxToken.getAccessToken();
-            Date expiresDate = wxToken.getExpiresdate();
-//            Date expiresDate = null;
-
-//            expiresDate = sdfFormat.parse(strExpiresDate);
-
-
-            int resultcount = 10000;
-            String nextopenid = "";
-            List<String> listpenid = new ArrayList<>();
-            //int j = 2;
-            while (resultcount >= 10000) {
-                Date date = new Date();
-                // 判断access_token是否在有效期内,无效重新获取
-                if (date.compareTo(expiresDate) >= 0 || accessToken == "") {
-
-                    Map<String, String> map = Wxapi.GetAccessToken();
-                    accessToken = map.get("accessToken");
-                    if (accessToken != "") {
-                        long currentTime = System.currentTimeMillis();
-                        currentTime += 120 * 60 * 1000;
-                        expiresDate = new Date(currentTime);
-                        wxToken.setAccessToken(accessToken);
-                        wxToken.setExpiresdate(expiresDate);
-                        wxTokenService.updateById(wxToken);
-                    }
-                    else
-                    {break;}
-
-                }
-                UserListJsonResult userlist = Wxapi.GetUserList(accessToken, nextopenid);
-                if (userlist != null && userlist.data != null) {
-                    listpenid.addAll(userlist.data.openid);
-                    resultcount = userlist.count;
-                    nextopenid = userlist.next_openid;
-
-                } else {
-                    break;
-                }
-
-            }
-
-            List<WxMessage> ListMessage = new ArrayList<>();
-
-            for (int i = 0; i < listpenid.size(); i++) {
-//            for (int i = 0; i < 5; i++) {
-                WxMessage wxMessage = new WxMessage();
-                wxMessage.setId(GuidGenerator.getGuid());
-                wxMessage.setMsgType("06");
-                wxMessage.setOpenid(listpenid.get(i));
-//                wxMessage.setOpenid("openid_test");
-                wxMessage.setFirst(wxTsNotice.getTitle());
-                wxMessage.setKeyword1(wxTsNotice.getStopType());
-                wxMessage.setKeyword2(wxTsNotice.getStopTime());
-                wxMessage.setKeyword3(wxTsNotice.getStopArea());
-                wxMessage.setRemark(wxTsNotice.getRemark());
-                wxMessage.setAddDate(wxTsNotice.getEditDate());
-                wxMessage.setAddOcode(wxTsNotice.getEditCode());
-                wxMessage.setSendState("0");
-                wxMessage.setIsLock("0");
-
-                ListMessage.add(wxMessage);
-
-            }
-            if (wxMessageService.saveBatch(ListMessage)) {
-                return true;
-            } else {
-                return false;
-            }
-
-//endregion
-        } catch (Exception e) {
-
-            throw new RuntimeException(e);
-
-        }
-
-    }
 }

+ 61 - 2
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatofficalacctmgt/controller/WxGhsqController.java

@@ -8,11 +8,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.tofly.common.core.entity.ResultRespone;
 import com.tofly.common.log.annotation.ToFlyAppLog;
+import com.tofly.fees.common.Ftp.FtpConfig;
+import com.tofly.fees.common.Ftp.FtpService;
 import com.tofly.fees.wechatofficalacctmgt.entity.WxGhsq;
 import com.tofly.fees.wechatofficalacctmgt.service.WxGhsqService;
 import lombok.AllArgsConstructor;
 import org.apache.commons.net.ftp.FTP;
 import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPReply;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -25,6 +29,9 @@ import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 /**
  * 微信-更名过户申请
@@ -33,13 +40,26 @@ import java.util.Arrays;
  * @date Thu Jul 06 00:00:00 CST 2023
  */
 @RestController
-@AllArgsConstructor
+/*@AllArgsConstructor*/
 @RequestMapping("/api/wechatofficalacctmgt/wxghsq")
 @Api(tags="微信-更名过户申请接口")
 public class WxGhsqController {
 
-    private final  WxGhsqService wxGhsqService;
 
+
+   // private final  WxGhsqService wxGhsqService;
+@Autowired
+private  WxGhsqService wxGhsqService;
+
+
+    @Value("${ftp.server}")
+    private String server;
+    @Value("${ftp.port}")
+    private int port;
+    @Value("${ftp.userName}")
+    private String userName;
+    @Value("${ftp.password}")
+    private String password;
     /**
     * 分页查询
     * @param page 分页对象
@@ -54,6 +74,45 @@ public class WxGhsqController {
 
 
 
+    @PostMapping("/upload")
+    @ApiOperation(value = "附件上传")
+    public ResultRespone uploadFile(@RequestParam("file") MultipartFile file) {
+        FTPClient ftpClient = new FTPClient();
+        try {
+            ftpClient.setControlEncoding("UTF-8");
+            // 设置FTP服务器的连接信息
+            FtpConfig ftp=new FtpConfig();
+           // ftp.getPort();
+            ftpClient.connect("192.168.2.233", 21);
+            ftpClient.login("ftpuser", "ftpuser");
+
+            // 检查连接是否成功
+            int replyCode = ftpClient.getReplyCode();
+            if (!FTPReply.isPositiveCompletion(replyCode)) {
+                return ResultRespone.failed("FTP连接失败");
+            }
+
+            // 设置文件上传的路径
+            String remoteFilePath = "/ftppath";
+           String fileName = file.getOriginalFilename();
+            String remoteFileName = remoteFilePath + "/" + fileName;
+            // 上传文件到FTP服务器
+            InputStream inputStream = file.getInputStream();
+            ftpClient.storeFile(remoteFileName, inputStream);
+            inputStream.close();
+            // 关闭FTP连接
+            ftpClient.logout();
+            ftpClient.disconnect();
+            return ResultRespone.success("上传成功");
+        } catch (IOException e) {
+            e.printStackTrace();
+            return ResultRespone.failed("上传失败");
+        }
+
+    }
+
+
+
     /**
      * 通过id查询微信-更名过户申请
      * @param id id

+ 352 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatwebsite/controller/BindCustomerController.java

@@ -0,0 +1,352 @@
+package com.tofly.fees.wechatwebsite.controller;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.tofly.common.core.entity.ResultRespone;
+import com.tofly.fees.common.Excel.ExcleFileUtil;
+import com.tofly.fees.common.util.GuidGenerator;
+import com.tofly.fees.feesmgt.service.SfCusAccService;
+import com.tofly.fees.meterprofilemgt.entity.DaMeter;
+import com.tofly.fees.meterprofilemgt.service.DaMeterService;
+import com.tofly.fees.reportmgt.entity.SfRecSelect;
+import com.tofly.fees.userprofilemgt.entity.DaCustomer;
+import com.tofly.fees.userprofilemgt.service.DaCustomerService;
+import com.tofly.fees.wechatbasicmgt.entity.WxBusinessCode;
+import com.tofly.fees.wechatbasicmgt.entity.WxCustomer;
+import com.tofly.fees.wechatbasicmgt.entity.WxCustomerHis;
+import com.tofly.fees.wechatbasicmgt.service.WxCustomerHisService;
+import com.tofly.fees.wechatbasicmgt.service.WxCustomerService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/api/wechatwebsite/BindCustomer")
+@Api(tags="微网厅-用户绑定接口")
+public class BindCustomerController {
+
+    private final DaCustomerService daCustomerService;
+    private final WxCustomerService wxCustomerService;
+    private final WxCustomerHisService wxCustomerHisService;
+    private final DaMeterService daMeterService;
+
+
+
+    @GetMapping("/selectCustomer" )
+    @ApiOperation(value = "查询用户")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "openid", value = "微信openid", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "customerName", value = "客户姓名", required = true, dataType = "String")
+    })
+    public ResultRespone  selectCustomer(HttpServletResponse response, @RequestParam("openid") String openid, @RequestParam("customerNo") String customerNo, @RequestParam("customerName") String customerName) throws IOException {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("客户编号不能为空!");
+            return resultModel;
+        }
+        if (StringUtils.isBlank(customerName)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("客户名称不能为空!");
+            return resultModel;
+        }
+        //endregion
+
+        QueryWrapper<DaCustomer> queryWrapper = new QueryWrapper<DaCustomer>();
+
+        queryWrapper.eq("customer_no",customerNo).notIn("customer_state", '3','4');
+        List<DaCustomer> daCustomerList = daCustomerService.list(queryWrapper);
+        if (daCustomerList.size()==0) {
+            resultModel.setCode(1);
+            resultModel.setMessage("客户名称不存在!");
+            return resultModel;
+        }
+        queryWrapper.clear();
+        queryWrapper.eq("customer_no",customerNo).notIn("customer_state",'3','4').like("customer_name",customerName);
+        daCustomerList = daCustomerService.list(queryWrapper);
+        if (daCustomerList.size()==0 || daCustomerList.size()>1) {
+            resultModel.setCode(1);
+            resultModel.setMessage("客户名称不匹配,请重新输入!");
+            return resultModel;
+        }
+        QueryWrapper<WxCustomer> queryWrapperWx = new QueryWrapper<WxCustomer>();
+        queryWrapperWx.eq("customer_no",customerNo).eq("openid",openid);
+        List<WxCustomer> wxCustomerList = wxCustomerService.list(queryWrapperWx);
+        if ( wxCustomerList.size()>0)
+        {
+
+            if ( !StringUtils.isBlank(wxCustomerList.get(0).getBindFlag()) && wxCustomerList.get(0).getBindFlag()=="1")
+            {
+                resultModel.setCode(3);
+                resultModel.setMessage("该收费号已绑定微信!");
+                return resultModel;
+            }
+        }
+        queryWrapperWx.clear();
+        queryWrapperWx.eq("openid",openid).eq("bind_flag","1");
+        wxCustomerList = wxCustomerService.list(queryWrapperWx);
+
+        if ( wxCustomerList.size()>10)
+        {
+            resultModel.setCode(5);
+            resultModel.setMessage("此微信已绑定满10个收费号!");
+            return resultModel;
+        }
+        queryWrapperWx.clear();
+        queryWrapperWx.eq("customer_no",customerNo).eq("bind_flag","1");
+        wxCustomerList = wxCustomerService.list(queryWrapperWx);
+
+        if ( wxCustomerList.size()>10)
+        {
+            resultModel.setCode(5);
+            resultModel.setMessage("此收费号已绑定满10个微信号!");
+            return resultModel;
+        }
+
+        QueryWrapper<DaMeter> queryWrapperDaMeter = new QueryWrapper<DaMeter>();
+        queryWrapperDaMeter.eq("customer_no",customerNo).in("meter_type",'1');
+        List<DaMeter> daMeterList = daMeterService.list(queryWrapperDaMeter);
+
+        if ( daMeterList.size()>0)
+        {
+            resultModel.setCode(6);
+            resultModel.setMessage("IC卡用户不能绑定,请持卡到营业点缴费!!");
+            return resultModel;
+        }
+
+        //region 业务处理
+        queryWrapper.clear();
+        queryWrapper.eq("customer_no",customerNo);
+        daCustomerList = daCustomerService.list(queryWrapper);
+        resultModel.setResult(daCustomerList.get(0));
+        resultModel.setMessage("成功!");
+        //endregion
+        return resultModel;
+    }
+
+    @PostMapping ("/addCustomer" )
+    @ApiOperation(value = "添加用户")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "openid", value = "微信openid", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String")
+    })
+    public ResultRespone  addCustomer(@RequestParam("openid") String openid, @RequestParam("customerNo") String customerNo) throws IOException {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("客户编号不能为空!");
+            return resultModel;
+        }
+        if (StringUtils.isBlank(openid)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("微信openid不能为空!");
+            return resultModel;
+        }
+        //endregion
+
+        QueryWrapper<DaCustomer> queryWrapper = new QueryWrapper<DaCustomer>();
+
+        queryWrapper.eq("customer_no",customerNo).notIn("customer_state",'3','4');
+        List<DaCustomer> daCustomerList = daCustomerService.list(queryWrapper);
+        if (daCustomerList.size()==0) {
+            resultModel.setCode(1);
+            resultModel.setMessage("客户名称不存在!");
+            return resultModel;
+        }
+
+        QueryWrapper<WxCustomer> queryWrapperWx = new QueryWrapper<WxCustomer>();
+        queryWrapperWx.eq("customer_no",customerNo).eq("openid",openid);
+        List<WxCustomer> wxCustomerList = wxCustomerService.list(queryWrapperWx);
+        if(wxCustomerList.size()>0) {
+            if (!StringUtils.isBlank(wxCustomerList.get(0).getBindFlag()) && wxCustomerList.get(0).getBindFlag() == "1") {
+                resultModel.setCode(3);
+                resultModel.setMessage("该收费号已绑定微信!");
+                return resultModel;
+            }
+       }
+
+        //region 业务处理
+        queryWrapper.clear();
+        queryWrapper.eq("customer_no",customerNo);
+        daCustomerList = daCustomerService.list(queryWrapper);
+        WxCustomer wxCustomer=new WxCustomer();
+        if ( wxCustomerList.size()>0 )
+        {
+
+            wxCustomer=wxCustomerList.get(0);
+            wxCustomer.setBindFlag("1");
+            wxCustomer.setName(daCustomerList.get(0).getCustomerName());
+            wxCustomer.setAddress(daCustomerList.get(0).getCustomerAddress());
+            wxCustomer.setPhone(daCustomerList.get(0).getCustomerPhone());
+            wxCustomer.setBindDate(new Date());
+             if (wxCustomerService.update(wxCustomer,queryWrapperWx)) {
+                resultModel.setCode(0);
+                resultModel.setMessage("绑定成功!");
+            }
+            else
+            {
+                resultModel.setCode(-1);
+                resultModel.setMessage("绑定失败!");
+            }
+        }
+        else
+        {
+            wxCustomer.setCustomerNo(customerNo);
+            wxCustomer.setOpenid(openid);
+            wxCustomer.setBindFlag("1");
+            wxCustomer.setName(daCustomerList.get(0).getCustomerName());
+            wxCustomer.setAddress(daCustomerList.get(0).getCustomerAddress());
+            wxCustomer.setPhone(daCustomerList.get(0).getCustomerPhone());
+            wxCustomer.setBindDate(new Date());
+            if (wxCustomerService.save(wxCustomer)) {
+                resultModel.setCode(0);
+                resultModel.setMessage("绑定成功!");
+            }
+            else
+            {
+                resultModel.setCode(-1);
+                resultModel.setMessage("绑定失败!");
+            }
+        }
+
+        //endregion
+        return resultModel;
+    }
+
+    @PostMapping ("/removeCustomer" )
+    @ApiOperation(value = "刪除用户")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "openid", value = "微信openid", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String")
+    })
+    public ResultRespone  deleteCustomer(@RequestParam("openid") String openid, @RequestParam("customerNo") String customerNo) throws IOException {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("客户编号不能为空!");
+            return resultModel;
+        }
+        if (StringUtils.isBlank(openid)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("微信openid不能为空!");
+            return resultModel;
+        }
+        //endregion
+
+
+        QueryWrapper<WxCustomer> queryWrapperWx = new QueryWrapper<WxCustomer>();
+        queryWrapperWx.eq("customer_no",customerNo).eq("openid",openid);
+        List<WxCustomer> wxCustomerList = wxCustomerService.list(queryWrapperWx);
+        WxCustomer wxCustomer =new WxCustomer();
+        WxCustomerHis wxCustomerHis=new WxCustomerHis();
+        if(wxCustomerList.size()>0) {
+            wxCustomer=wxCustomerList.get(0);
+            int id=  wxCustomerHisService.SelectChargeMaxCode();
+            wxCustomerHis.setId(id+1);
+            wxCustomerHis.setCustomerNo(wxCustomer.getCustomerNo());
+            wxCustomerHis.setName(wxCustomer.getName());
+            wxCustomerHis.setAddress(wxCustomer.getAddress());
+            wxCustomerHis.setPhone(wxCustomer.getPhone());
+            wxCustomerHis.setBindFlag(wxCustomer.getBindFlag());
+            wxCustomerHis.setOpenid(wxCustomer.getOpenid());
+            wxCustomerHis.setBindDate(wxCustomer.getBindDate());
+            wxCustomerHis.setBindRemark(wxCustomer.getBindRemark());
+            wxCustomerHis.setBindWxname(wxCustomer.getBindWxname());
+            wxCustomerHis.setBindSex(wxCustomer.getBindSex());
+            wxCustomerHis.setUnbindDate(new Date());
+            wxCustomerHis.setUnbindName("本人");
+            wxCustomerHis.setUnbindRemark("自愿");
+            boolean saveWxCustomerHis = wxCustomerHisService.save(wxCustomerHis);
+            wxCustomer.setBindFlag("0");
+            wxCustomer.setUnbindDate(new Date());
+            wxCustomer.setUnbindName("本人");
+            wxCustomer.setUnbindRemark("自愿");
+            boolean updatewxCustomer = wxCustomerService.update(wxCustomer, queryWrapperWx);
+            if (saveWxCustomerHis && updatewxCustomer)
+            {
+                resultModel.setCode(0);
+                resultModel.setMessage("解绑成功!");
+            }
+            else
+            {resultModel.setCode(-1);
+                resultModel.setMessage("解绑失败!");}
+
+        }
+        else
+        {resultModel.setCode(-1);
+            resultModel.setMessage("解绑失败!");}
+
+        //region 业务处理
+
+
+        //endregion
+        return resultModel;
+    }
+
+    @GetMapping("/getBindCustomer" )
+    @ApiOperation(value = "获取绑定用户")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "openid", value = "微信openid", required = true, dataType = "String")
+    })
+    public ResultRespone  getBindCustomer( @RequestParam("openid") String openid) {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(openid)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("传入微信编号不能为空!");
+            return resultModel;
+        }
+
+        //endregion
+
+        QueryWrapper<WxCustomer> queryWrapperWx = new QueryWrapper<WxCustomer>();
+        queryWrapperWx.eq("openid",openid).eq("bind_flag","1").orderByAsc("customer_no");
+        List<WxCustomer> wxCustomerList = wxCustomerService.list(queryWrapperWx);
+        if ( wxCustomerList.size()==0)
+        {
+                resultModel.setCode(1);
+                resultModel.setMessage("请绑定用户!");
+                return resultModel;
+        }
+
+
+        //region 业务处理
+
+        resultModel.setResult(wxCustomerList);
+        resultModel.setMessage("成功!");
+        //endregion
+        return resultModel;
+    }
+
+
+}

+ 380 - 0
collect-fees/collect-fees-service/src/main/java/com/tofly/fees/wechatwebsite/controller_easy/BindCustomerEasyController.java

@@ -0,0 +1,380 @@
+package com.tofly.fees.wechatwebsite.controller_easy;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.tofly.common.core.entity.ResultRespone;
+import com.tofly.fees.common.dbhelper.DbHelper;
+import com.tofly.fees.common.enums.SysEnum;
+import com.tofly.fees.common.model.CollectionData;
+import com.tofly.fees.meterprofilemgt.entity.DaMeter;
+import com.tofly.fees.meterprofilemgt.service.DaMeterService;
+import com.tofly.fees.userprofilemgt.entity.DaCustomer;
+import com.tofly.fees.userprofilemgt.service.DaCustomerService;
+import com.tofly.fees.wechatbasicmgt.entity.WxCustomer;
+import com.tofly.fees.wechatbasicmgt.entity.WxCustomerHis;
+import com.tofly.fees.wechatbasicmgt.service.WxCustomerHisService;
+import com.tofly.fees.wechatbasicmgt.service.WxCustomerService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/api/wechatwebsite/BindCustomer")
+@Api(tags="微网厅-用户绑定接口")
+public class BindCustomerEasyController {
+
+
+    @GetMapping("/getCustomerInFo" )
+    @ApiOperation(value = "[Easy]获取用户欠费和余额信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String")
+    })
+    public ResultRespone  getCustomerInFo( @RequestParam("customerNo") String customerNo) throws Exception {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("用户编号不能为空!");
+            return resultModel;
+        }
+
+        //endregion
+
+
+
+        //region 业务处理
+        DbHelper db = DbHelper.getDbHelper();
+        List<HashMap<String,Object>> arrayList=new ArrayList<>();
+        //参数
+        Map<String,Object> params = new HashMap<>();
+        params.put("V_CUSTOMERNO",customerNo);
+        params.put("V_CUR",arrayList) ;
+        params.put("V_SFCG","0") ;
+
+        //这里要注意参数前面的map固定写法不然读取不了数据
+        Map mp = db.procurdeCmd("{call PROC_Agentfee_customerinfo(" +
+                "#{V_CUSTOMERNO,mode=IN,jdbcType=VARCHAR}," +
+                "#{V_CUR,mode=OUT,jdbcType=CURSOR},"+
+                "#{V_SFCG,mode=OUT,jdbcType=VARCHAR}"+
+                ")}",params, SysEnum.MyBatis.getName());
+
+        //存储过程返回的参数
+        ArrayList<Object> arr=(ArrayList<Object>)mp.get("V_CUR");
+        if (mp.get("V_SFCG").equals("1")) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(未知原因)!");
+            return resultModel;
+        }else if (mp.get("V_SFCG").equals("2")) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(用户不存在)");
+            return resultModel;
+        }else if (mp.get("V_SFCG").equals("3")) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(扎账时间不能缴费,请明天再试,谢谢)!");
+            return resultModel;
+        }else if (mp.get("V_SFCG").equals("4")) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("上次缴费下发未完成,不能继续缴费,请稍后再试,谢谢!");
+            return resultModel;
+        }else if (mp.get("V_SFCG").equals("5")) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("上次充值未上表,不能继续缴费,请上表后再试,谢谢!");
+            return resultModel;
+        }else if (mp.get("V_SFCG").equals("-999")) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(逻辑错误)!");
+            return resultModel;
+        }
+        else{
+            resultModel.setResult(arr.get(0));
+            resultModel.setMessage("成功!");
+
+            return resultModel;
+        }
+        //endregion
+    }
+
+    @GetMapping("/getCustomerBasicInFo" )
+    @ApiOperation(value = "[Easy]获取用户基础信息(总预存,扣减,余额,欠费等)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String")
+    })
+    public ResultRespone  getCustomerBasicInFo( @RequestParam("customerNo") String customerNo) throws Exception {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("用户编号不能为空!");
+            return resultModel;
+        }
+
+        //endregion
+
+
+
+        //region 业务处理
+        DbHelper db = DbHelper.getDbHelper();
+        List<HashMap<String,Object>> arrayList=new ArrayList<>();
+        //参数
+        Map<String,Object> params = new HashMap<>();
+        params.put("V_CUSTOMERNO",customerNo);
+        params.put("V_CUR",arrayList) ;
+        params.put("V_SFCG","0") ;
+
+        //这里要注意参数前面的map固定写法不然读取不了数据
+        Map mp = db.procurdeCmd("{call PROC_AGENTFEE_CXCUSTOMERINFO(" +
+                "#{V_CUSTOMERNO,mode=IN,jdbcType=VARCHAR}," +
+                "#{V_CUR,mode=OUT,jdbcType=CURSOR},"+
+                "#{V_SFCG,mode=OUT,jdbcType=VARCHAR}"+
+                ")}",params, SysEnum.MyBatis.getName());
+
+        //存储过程返回的参数
+        ArrayList<Object> arr=(ArrayList<Object>)mp.get("V_CUR");
+        if (mp.get("V_SFCG").equals("1")) {
+            resultModel.setResult(arr.get(0));
+            resultModel.setMessage("成功!");
+            return resultModel;
+
+        }
+        else{
+
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败!");
+            return resultModel;
+        }
+        //endregion
+    }
+
+    @GetMapping("/getCustomerReadMeterInFo" )
+    @ApiOperation(value = "[Easy]获取用户抄表明细")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String")
+    })
+    public ResultRespone  getCustomerReadMeterInFo( @RequestParam("customerNo") String customerNo) throws Exception {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("用户编号不能为空!");
+            return resultModel;
+        }
+
+        //endregion
+
+
+
+        //region 业务处理
+        DbHelper db = DbHelper.getDbHelper();
+        List<HashMap<String,Object>> arrayList=new ArrayList<>();
+        //参数
+        Map<String,Object> params = new HashMap<>();
+        params.put("V_CUSTOMERNO",customerNo);
+        params.put("V_CUR",arrayList) ;
+        params.put("V_SFCG","0") ;
+
+        //这里要注意参数前面的map固定写法不然读取不了数据
+        Map mp = db.procurdeCmd("{call PROC_AGENTFEE_CXCBINFO(" +
+                "#{V_CUSTOMERNO,mode=IN,jdbcType=VARCHAR}," +
+                "#{V_CUR,mode=OUT,jdbcType=CURSOR},"+
+                "#{V_SFCG,mode=OUT,jdbcType=VARCHAR}"+
+                ")}",params, SysEnum.MyBatis.getName());
+
+        //存储过程返回的参数
+        ArrayList<Object> arr=(ArrayList<Object>)mp.get("V_CUR");
+        if (mp.get("V_SFCG").equals("1")) {
+
+            resultModel.setResult(arr);
+            resultModel.setMessage("成功!");
+            return resultModel;
+        }
+        else{
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(未知原因)!");
+            return resultModel;
+        }
+        //endregion
+    }
+
+
+    @GetMapping("/getCustomerQfInFo" )
+    @ApiOperation(value = "[Easy]获取用户欠费明细")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String")
+    })
+    public ResultRespone  getCustomerQfInFo( @RequestParam("customerNo") String customerNo) throws Exception {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("用户编号不能为空!");
+            return resultModel;
+        }
+
+        //endregion
+
+
+
+        //region 业务处理
+        DbHelper db = DbHelper.getDbHelper();
+        List<HashMap<String,Object>> arrayList=new ArrayList<>();
+        //参数
+        Map<String,Object> params = new HashMap<>();
+        params.put("V_CUSTOMERNO",customerNo);
+        params.put("V_CUR",arrayList) ;
+        params.put("V_SFCG","0") ;
+
+        //这里要注意参数前面的map固定写法不然读取不了数据
+        Map mp = db.procurdeCmd("{call PROC_AGENTFEE_CXQFINFO(" +
+                "#{V_CUSTOMERNO,mode=IN,jdbcType=VARCHAR}," +
+                "#{V_CUR,mode=OUT,jdbcType=CURSOR},"+
+                "#{V_SFCG,mode=OUT,jdbcType=VARCHAR}"+
+                ")}",params, SysEnum.MyBatis.getName());
+
+        //存储过程返回的参数
+        ArrayList<Object> arr=(ArrayList<Object>)mp.get("V_CUR");
+        if (mp.get("V_SFCG").equals("1")) {
+
+            resultModel.setResult(arr);
+            resultModel.setMessage("成功!");
+            return resultModel;
+        }
+        else{
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(未知原因)!");
+            return resultModel;
+        }
+        //endregion
+    }
+
+    @GetMapping("/getCustomerChargeInFo" )
+    @ApiOperation(value = "[Easy]获取用户交易明细")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "customerNo", value = "客户编号", required = true, dataType = "String")
+    })
+    public ResultRespone  getCustomerChargeInFo( @RequestParam("customerNo") String customerNo) throws Exception {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(customerNo)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("用户编号不能为空!");
+            return resultModel;
+        }
+
+        //endregion
+
+
+
+        //region 业务处理
+        DbHelper db = DbHelper.getDbHelper();
+        List<HashMap<String,Object>> arrayList=new ArrayList<>();
+        //参数
+        Map<String,Object> params = new HashMap<>();
+        params.put("V_CUSTOMERNO",customerNo);
+        params.put("V_CUR",arrayList) ;
+        params.put("V_SFCG","0") ;
+
+        //这里要注意参数前面的map固定写法不然读取不了数据
+        Map mp = db.procurdeCmd("{call PROC_AGENTFEE_CXSFINFO(" +
+                "#{V_CUSTOMERNO,mode=IN,jdbcType=VARCHAR}," +
+                "#{V_CUR,mode=OUT,jdbcType=CURSOR},"+
+                "#{V_SFCG,mode=OUT,jdbcType=VARCHAR}"+
+                ")}",params, SysEnum.MyBatis.getName());
+
+        //存储过程返回的参数
+        ArrayList<Object> arr=(ArrayList<Object>)mp.get("V_CUR");
+        if (mp.get("V_SFCG").equals("1")) {
+
+            resultModel.setResult(arr);
+            resultModel.setMessage("成功!");
+            return resultModel;
+        }
+        else{
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(未知原因)!");
+            return resultModel;
+        }
+        //endregion
+    }
+
+    @GetMapping("/getBindCustomerAndQf" )
+    @ApiOperation(value = "[Easy]获取绑定用户和欠费信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "openid", value = "微信id", required = true, dataType = "String")
+    })
+    public ResultRespone  getBindCustomerAndQf( @RequestParam("openid") String openid) throws Exception {
+
+        ResultRespone<Object> resultModel = new ResultRespone<>();
+        resultModel.setCode(0);
+
+        //region 参数验证
+        //验证
+        if (StringUtils.isBlank(openid)) {
+            resultModel.setCode(-1);
+            resultModel.setMessage("微信id不能为空!");
+            return resultModel;
+        }
+
+        //endregion
+
+
+
+        //region 业务处理
+        DbHelper db = DbHelper.getDbHelper();
+        List<HashMap<String,Object>> arrayList=new ArrayList<>();
+        //参数
+        Map<String,Object> params = new HashMap<>();
+        params.put("V_OPENID",openid);
+        params.put("V_CUR",arrayList) ;
+        params.put("V_SFCG","0") ;
+
+        //这里要注意参数前面的map固定写法不然读取不了数据
+        Map mp = db.procurdeCmd("{call PROC_AGENTFEE_CXBINDCUSTOMERQF(" +
+                "#{V_OPENID,mode=IN,jdbcType=VARCHAR}," +
+                "#{V_CUR,mode=OUT,jdbcType=CURSOR},"+
+                "#{V_SFCG,mode=OUT,jdbcType=VARCHAR}"+
+                ")}",params, SysEnum.MyBatis.getName());
+
+        //存储过程返回的参数
+        ArrayList<Object> arr=(ArrayList<Object>)mp.get("V_CUR");
+        if (mp.get("V_SFCG").equals("1")) {
+
+            resultModel.setResult(arr);
+            resultModel.setMessage("成功!");
+            return resultModel;
+        }
+        else{
+            resultModel.setCode(-1);
+            resultModel.setMessage("查询失败(未知原因)!");
+            return resultModel;
+        }
+        //endregion
+    }
+}

+ 6 - 1
collect-fees/collect-fees-service/src/main/resources/application.yml

@@ -53,7 +53,12 @@ user:
   logo: /base/logo/
   account : /sys/widgets/UserManagement
   logFile : /base/logFile
-
+ftp:
+  enable: true
+  server: 192.168.2.233
+  port: 21
+  userName: ftpuser
+  password: ftpuser
 api:
   doc:
     title: 营收系统相关业务接口    #API文档标题

+ 6 - 1
collect-fees/collect-fees-service/src/main/resources/bootstrap.yml

@@ -1,4 +1,9 @@
 spring:
+#  http:
+#    encoding:
+#      charset: utf-8
+#      enabled: true
+#      force: true
   cloud:
     config:
       enabled: false
@@ -36,4 +41,4 @@ logging:
     com.alibaba.nacos.client.config.impl: WARN
 # DEV配置 为这个服务配置服务清单,可以是一个或N个
 tofly-base.ribbon.listOfServers: http://localhost:10102
-tofly-auth.ribbon.listOfServers: http://localhost:10101
+tofly-auth.ribbon.listOfServers: http://localhost:10101

+ 0 - 46
collect-fees/collect-fees-service/src/main/resources/mapper/meterprofilemgt/BwReplaceMeterMapper.xml

@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.tofly.fees.meterprofilemgt.mapper.BwReplaceMeterMapper">
-    <resultMap id="bwReplaceMeterMap" type="com.tofly.fees.meterprofilemgt.entity.BwReplaceMeter">
-        <id property="id" column="ID"/>
-        <result property="customerNo" column="CUSTOMER_NO"/>
-        <result property="customerNoOld" column="CUSTOMER_NO_OLD"/>
-        <result property="customerName" column="CUSTOMER_NAME"/>
-        <result property="customerAddress" column="CUSTOMER_ADDRESS"/>
-        <result property="customerPhone" column="CUSTOMER_PHONE"/>
-        <result property="meterCardNo" column="METER_CARD_NO"/>
-        <result property="meterCardId" column="METER_CARD_ID"/>
-        <result property="oldMeterType" column="OLD_METER_TYPE"/>
-        <result property="oldMeterFactory" column="OLD_METER_FACTORY"/>
-        <result property="oldMeterModel" column="OLD_METER_MODEL"/>
-        <result property="oldMeterFactoryDatetime" column="OLD_METER_FACTORY_DATETIME"/>
-        <result property="oldMeterCaliber" column="OLD_METER_CALIBER"/>
-        <result property="oldMeterRange" column="OLD_METER_RANGE"/>
-        <result property="oldMeterNo" column="OLD_METER_NO"/>
-        <result property="oldMeterCardId" column="OLD_METER_CARD_ID"/>
-        <result property="oldMeterLastReading" column="OLD_METER_LAST_READING"/>
-        <result property="oldMeterNowReading" column="OLD_METER_NOW_READING"/>
-        <result property="oldIcMargin" column="OLD_IC_MARGIN"/>
-        <result property="oldMeterDosage" column="OLD_METER_DOSAGE"/>
-        <result property="newMeterType" column="NEW_METER_TYPE"/>
-        <result property="newMeterFactory" column="NEW_METER_FACTORY"/>
-        <result property="newMeterModel" column="NEW_METER_MODEL"/>
-        <result property="newMeterFactoryDatetime" column="NEW_METER_FACTORY_DATETIME"/>
-        <result property="newMeterCaliber" column="NEW_METER_CALIBER"/>
-        <result property="newMeterRange" column="NEW_METER_RANGE"/>
-        <result property="newMeterNo" column="NEW_METER_NO"/>
-        <result property="newMeterCardId" column="NEW_METER_CARD_ID"/>
-        <result property="newMeterLastReading" column="NEW_METER_LAST_READING"/>
-        <result property="newMeterNowReading" column="NEW_METER_NOW_READING"/>
-        <result property="auditorOname" column="AUDITOR_ONAME"/>
-        <result property="replaceMeterOname" column="REPLACE_METER_ONAME"/>
-        <result property="replaceMeterDate" column="REPLACE_METER_DATE"/>
-        <result property="inputOcode" column="INPUT_OCODE"/>
-        <result property="inputName" column="INPUT_NAME"/>
-        <result property="inputDate" column="INPUT_DATE"/>
-        <result property="remark" column="REMARK"/>
-    </resultMap>
-
-
-</mapper>

+ 49 - 30
collect-fees/collect-fees-service/src/main/resources/mapper/meterreadingmgt/BwMeterReadPlanMapper.xml

@@ -2,39 +2,50 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
 <mapper namespace="com.tofly.fees.meterreadingmgt.mapper.BwMeterReadPlanMapper">
-
-
-    <!--  <select id="selMeterReadList" resultType="com.tofly.fees.meterreadingmgt.model.BwMeterReadPlanModel"  parameterType="java.lang.String">-->
-    <select id="selMeterReadList" resultType="java.util.HashMap" parameterType="java.lang.String">
-        select a.customer_no as "customerNo",b.customer_name as "customerName",b.customer_address
-        "customerAddress",b.customer_mobile "customerMobile",a.last_reading "lastReading",a.this_reading
-        "thisReading",a.jjl,a.mr_type "mrType",a.mr_mode "mrMode",a.mr_flag "mrFlag",a.cal_state
-        "calState",c.meter_range "meterRange",
-        a.mr_order_no as mrOrderNo
-        from TF_YWYS_BW_METER_READ_PLAN a
-        left join Tf_Ywys_Da_Customer b ON a.customer_no=b.customer_no
+    <!--抄表录入列表数据-->
+    <select id="getMeterReadList" resultType="java.util.Map">
+        select a.customer_no,a.meter_card_id,b.customer_name,b.customer_address,b.customer_mobile,a.year_month
+        ,a.last_reading,a.this_reading,a.jjl,quantity,a.mr_mode,d.name as "mrModeName",a.mr_flag,a.cal_flag
+        ,a.mr_type,e.name as
+        "mrTypeName",c.meter_no,c.meter_range,a.remark,old_meter_ereading,new_meter_breading,a.mr_order_no
+        from tf_ywys_bw_meter_read_plan a
+        left join tf_ywys_da_customer b on a.customer_no=b.customer_no
         left join tf_ywys_da_meter c on a.meter_card_id=c.meter_card_id
-        WHERE 1=1
+        left join tf_ywys_bm_mr_mode d on a.mr_mode=d.code
+        left join tf_ywys_bm_mr_type e on a.mr_type=e.code
+        where a.cal_state='1'
 
-        <if test="name != null and name != ''">
-            AND b.customer_name like concat(concat('%',#{name}),'%')
+        <!--所属公司-->
+        <if test="companyBranch!=null and companyBranch!=''">
+            and a.company_branch=#{companyBranch}
         </if>
-
+        <!--所属片区-->
+        <if test="mrArea!=null and mrArea!=''">
+            and a.mr_area=#{mrArea}
+        </if>
+        <!--所属表册-->
+        <if test="mrBook!=null and mrBook!=''">
+            and a.mr_book=#{mrBook}
+        </if>
+        <!--抄表人员-->
+        <if test="mrOCode!=null and mrOCode!=''">
+            and a.mr_ocode=#{mrOCode}
+        </if>
+        <!--抄表方式-->
+        <if test="mrMode != null and mrMode != ''">
+            AND a.mr_mode=#{mrMode}
+        </if>
+        <!--抄表状态-->
         <if test="mrFlag != null and mrFlag != ''">
             AND a.mr_Flag=#{mrFlag}
         </if>
-
-        <if test="mrBook != null and mrBook != ''">
-            <choose>
-                <when test="mrBook == 0">
-                    AND nvl(a.mr_Book,0)=0
-                </when>
-                <otherwise>
-                    AND a.mr_Book=#{mrBook}
-                </otherwise>
-            </choose>
+        <!--算费状态-->
+        <if test="calFlag != null and calFlag != ''">
+            AND a.cal_flag=#{calFlag}
+        </if>
+        <if test="searchText != null and searchText != ''">
+            AND (a.customer_no like '%${searchText}%' or b.customer_name like '%${searchText}%')
         </if>
-
     </select>
     <delete id="delByNo">
         delete
@@ -46,19 +57,27 @@
     </delete>
 
     <update id="cancelMeterReadPlan">
-        update TF_YWYS_BW_METER_READ_PLAN set mr_book = null where customer_no in (${customerNos})
+        update TF_YWYS_BW_METER_READ_PLAN
+        set mr_book = null
+        where customer_no in (${customerNos})
     </update>
 
     <update id="cancelDaCustomerReadPlan">
-        update tf_ywys_da_customer set mr_book = null where customer_no in (${customerNos})
+        update tf_ywys_da_customer
+        set mr_book = null
+        where customer_no in (${customerNos})
     </update>
 
     <update id="toMeterReadPlan">
-        update TF_YWYS_BW_METER_READ_PLAN set mr_book = #{mrBook} where customer_no in (${customerNos})
+        update TF_YWYS_BW_METER_READ_PLAN
+        set mr_book = #{mrBook}
+        where customer_no in (${customerNos})
     </update>
 
     <update id="toDaCustomerReadPlan">
-        update tf_ywys_da_customer set mr_book =  #{mrBook} where customer_no in (${customerNos})
+        update tf_ywys_da_customer
+        set mr_book = #{mrBook}
+        where customer_no in (${customerNos})
     </update>
 
     <resultMap id="bwMeterReadPlanMap" type="com.tofly.fees.meterreadingmgt.entity.BwMeterReadPlan">

+ 2 - 0
hnls-admin/hnls-admin-service/src/main/java/com/tofly/base/controller/UserController.java

@@ -67,6 +67,8 @@ import java.util.stream.Collectors;
 @Slf4j
 public class UserController {
 
+    @Value("${user.logo}")
+    private String avatarPath1;
     @Value("${user.avatar}")
     private String avatarPath;
     @Value("${xrty.ftp.excelmb}")