dingxin 6 年之前
父節點
當前提交
72ecdc03b7
共有 20 個文件被更改,包括 238 次插入107 次删除
  1. 4
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBillInvoiceMapper.java
  2. 12
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  3. 17
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml
  4. 9
    1
      CODE/smart-community/property-api/pom.xml
  5. 9
    5
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/base/BaseController.java
  6. 6
    7
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillController.java
  7. 2
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillService.java
  8. 6
    6
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java
  9. 70
    50
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java
  10. 32
    10
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java
  11. 二進制
      CODE/smart-community/property-api/src/main/resources/缴费单模板.xls
  12. 8
    0
      VUECODE/smart-property-manage/src/api/bill.js
  13. 3
    3
      VUECODE/smart-property-manage/src/router/index.js
  14. 10
    1
      VUECODE/smart-property-manage/src/store/modules/bill.js
  15. 14
    1
      VUECODE/smart-property-manage/src/views/bill/add/index.vue
  16. 15
    2
      VUECODE/smart-property-manage/src/views/bill/edi/index.vue
  17. 2
    2
      VUECODE/smart-property-manage/src/views/bill/index.vue
  18. 1
    1
      VUECODE/smart-property-manage/src/views/bill/info/add/index.vue
  19. 1
    1
      VUECODE/smart-property-manage/src/views/bill/info/bill-edi/index.vue
  20. 17
    15
      VUECODE/smart-property-manage/src/views/bill/info/index.vue

+ 4
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBillInvoiceMapper.java 查看文件

@@ -47,4 +47,8 @@ public interface TpBillInvoiceMapper {
47 47
 	TpBillInvoice selectByIdAndUserId(@Param("id") Integer billInvoiceId,@Param("userId") Integer userId,@Param("communityId") Integer communityId);
48 48
     
49 49
     TpBillInvoice selectByOutTradeNo(@Param("outTradeNo") String outTradeNo);
50
+
51
+    List<TpBillInvoice> selectByBuildingOwnerInfoId(@Param("buildingOwnerInfoId") Integer buildingOwnerInfoId);
52
+
53
+    int updateBeach(Map<String, Object> map);
50 54
 }

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java 查看文件

@@ -68,6 +68,9 @@ public class TaUserServiceImpl implements ITaUserService {
68 68
     @Autowired
69 69
     private TaFaceMapper taFaceMapper;
70 70
 
71
+    @Autowired
72
+    private TpBillInvoiceMapper tpBillInvoiceMapper;
73
+
71 74
     @Transactional(rollbackFor = Exception.class)
72 75
     @Override
73 76
     @Deprecated
@@ -211,6 +214,15 @@ public class TaUserServiceImpl implements ITaUserService {
211 214
             buildingOwnerInfo.setUpdateDate(new Date());
212 215
             tpBuildingOwnerInfoMapper.updateByPrimaryKeySelective(buildingOwnerInfo);
213 216
 
217
+            // 开始绑定缴费单
218
+            List<TpBillInvoice> tpBillInvoices = tpBillInvoiceMapper.selectByBuildingOwnerInfoId(buildingOwnerInfo.getId());
219
+            if (CollectionUtils.isNotEmpty(tpBillInvoices)) {
220
+                Map<String, Object> map = new HashMap<>();
221
+                map.put("taUserId", user.getId());
222
+                map.put("list", tpBillInvoices);
223
+                tpBillInvoiceMapper.updateBeach(map);
224
+            }
225
+
214 226
         }
215 227
 
216 228
         // 更新

+ 17
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml 查看文件

@@ -307,4 +307,21 @@
307 307
 	where t.out_trade_no = #{outTradeNo,jdbcType=VARCHAR}
308 308
 	and t.status = 1
309 309
   </select>
310
+
311
+    <select id="selectByBuildingOwnerInfoId" parameterType="integer" resultMap="BaseResultMap" >
312
+        select
313
+        <include refid="Base_Column_List"/>
314
+        from tp_bill_invoice
315
+        where bill_statement_id = #{buildingOwnerInfoId,jdbcType=INTEGER}
316
+    </select>
317
+
318
+    <update id="updateBeach" parameterType="map" >
319
+        update tp_bill_invoice
320
+        set ta_user_id = #{map.taUserId}
321
+        where id in
322
+      <foreach collection="map.list" item="item" index="index" separator="," open="(" close=")">
323
+          #{item.id}
324
+      </foreach>
325
+    </update>
326
+
310 327
 </mapper>

+ 9
- 1
CODE/smart-community/property-api/pom.xml 查看文件

@@ -159,7 +159,15 @@
159 159
             <scope>compile</scope>
160 160
         </dependency>
161 161
 
162
-    </dependencies>
162
+		<!-- https://mvnrepository.com/artifact/com.alibaba/easyexcel -->
163
+		<dependency>
164
+			<groupId>com.alibaba</groupId>
165
+			<artifactId>easyexcel</artifactId>
166
+			<version>1.1.2-beat1</version>
167
+		</dependency>
168
+
169
+
170
+	</dependencies>
163 171
 
164 172
 	<dependencyManagement>
165 173
 		<dependencies>

+ 9
- 5
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/base/BaseController.java 查看文件

@@ -69,15 +69,19 @@ public class BaseController {
69 69
     protected void setResponseHeader(HttpServletResponse response, String fileName) {
70 70
         try {
71 71
             try {
72
-                fileName = new String(fileName.getBytes(),"ISO8859-1");
72
+                fileName = new String(fileName.getBytes(),"utf-8");
73 73
             } catch (UnsupportedEncodingException e) {
74 74
                 // TODO Auto-generated catch block
75 75
                 e.printStackTrace();
76 76
             }
77
-            response.setContentType("application/octet-stream;charset=ISO8859-1");
78
-            response.setHeader("Content-Disposition", "attachment;filename="+ fileName);
79
-            response.addHeader("Pargam", "no-cache");
80
-            response.addHeader("Cache-Control", "no-cache");
77
+//            response.setContentType("application/octet-stream;charset=ISO8859-1");
78
+//            response.setHeader("Content-Disposition", "attachment;filename="+ fileName);
79
+//            response.addHeader("Pargam", "no-cache");
80
+//            response.addHeader("Cache-Control", "no-cache");
81
+
82
+            response.setContentType("multipart/form-data");
83
+            response.setCharacterEncoding("utf-8");
84
+            response.setHeader("Content-disposition", "attachment;filename="+fileName);
81 85
         } catch (Exception ex) {
82 86
             ex.printStackTrace();
83 87
         }

+ 6
- 7
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillController.java 查看文件

@@ -143,14 +143,13 @@ public class BillController extends BaseController {
143 143
 
144 144
     @ApiOperation(value = "下载Excel模板", notes = "下载Excel模板")
145 145
     @ApiImplicitParams({
146
-            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "billExplain收费组说明"),
147
-//            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
146
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "billExplain收费组说明"),
147
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
148 148
     })
149
-    @RequestMapping(value = "/bill/downloadExcel", method = RequestMethod.POST)
150
-    public void exportExcel(HttpServletResponse response, HttpSession session, @RequestBody String parameter) {
151
-        ResponseBean responseBean = new ResponseBean();
152
-//        UserElement userElement = getUserElement(session);
153
-        HSSFWorkbook workbook = (HSSFWorkbook) iBillService.downloadExcel(parameter).getData();
149
+    @RequestMapping(value = "/bill/downloadExcel", method = RequestMethod.GET)
150
+    public void exportExcel(HttpServletResponse response, HttpSession session) {
151
+        UserElement userElement = getUserElement(session);
152
+        HSSFWorkbook workbook = (HSSFWorkbook) iBillService.downloadExcel(userElement).getData();
154 153
         this.setResponseHeader(response, "缴费单模板.xls");
155 154
         //响应到客户端
156 155
         try {

+ 2
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillService.java 查看文件

@@ -81,8 +81,8 @@ public interface IBillService extends IService<Bill> {
81 81
 
82 82
 	/**
83 83
 	 * 下载 excel 模板
84
-	 * @param parameter
84
+	 * @param userElement
85 85
 	 * @return
86 86
 	 */
87
-	ResponseBean downloadExcel(String parameter);
87
+	ResponseBean downloadExcel(UserElement userElement);
88 88
 }

+ 6
- 6
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java 查看文件

@@ -226,12 +226,12 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
226 226
         Double payPrice = jsonObject.getDouble("payPrice");
227 227
 
228 228
         // 判断是不是已经 收费完成
229
-        Bill bill = billMapper.selectById(billId);
230
-        if ("1".equals(bill.getBillStatus())) {
231
-            // 状态 收费完成, 不允许添加收费单
232
-            responseBean.addError("不能给收费已完成的收费组添加收费单!");
233
-            return responseBean;
234
-        }
229
+//        Bill bill = billMapper.selectById(billId);
230
+//        if ("1".equals(bill.getBillStatus())) {
231
+//            // 状态 收费完成, 不允许添加收费单
232
+//            responseBean.addError("不能给收费已完成的收费组添加收费单!");
233
+//            return responseBean;
234
+//        }
235 235
 
236 236
         // 楼栋资料库
237 237
         QueryWrapper<TpBuildingOwnerInfo> queryWrapper = new QueryWrapper<>();

+ 70
- 50
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java 查看文件

@@ -14,6 +14,7 @@ import com.community.huiju.exception.WisdomException;
14 14
 import com.community.huiju.model.*;
15 15
 import com.community.huiju.service.IBillInvoiceService;
16 16
 import com.community.huiju.service.IBillService;
17
+import com.community.huiju.service.IBuildingOwnerInfoService;
17 18
 import com.google.common.collect.Lists;
18 19
 import com.google.common.collect.Maps;
19 20
 import com.google.zxing.common.detector.MathUtils;
@@ -31,10 +32,7 @@ import org.springframework.stereotype.Service;
31 32
 import org.springframework.transaction.annotation.Transactional;
32 33
 import org.springframework.web.multipart.MultipartFile;
33 34
 
34
-import java.io.FileInputStream;
35
-import java.io.FileNotFoundException;
36
-import java.io.IOException;
37
-import java.io.InputStream;
35
+import java.io.*;
38 36
 import java.text.ParseException;
39 37
 import java.text.SimpleDateFormat;
40 38
 import java.util.Date;
@@ -81,6 +79,8 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
81 79
     @Autowired
82 80
     private TaUserMapper taUserMapper;
83 81
 
82
+    @Autowired
83
+    private IBuildingOwnerInfoService iBuildingOwnerInfoService;
84 84
 
85 85
     @Override
86 86
     @Transactional(rollbackFor = Exception.class)
@@ -229,10 +229,10 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
229 229
 
230 230
         bill.setPayedNum(0);
231 231
         bill.setBillStatus(billStatus);
232
-        bill.setCreateUser(userElement.getId());
233 232
         //为草稿时不创建时间
234 233
         if(!"2".equals(billStatus)) {
235 234
             bill.setCreateDate(new Date());
235
+            bill.setCreateUser(userElement.getId());
236 236
         }
237 237
         bill.setCommunityId(userElement.getCommunityId());
238 238
         Integer payTotalNum = tempBills.size() != 0 ? tempBills.size() : records != null ? records.size() : 0;
@@ -250,6 +250,10 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
250 250
         if (billId != null) {
251 251
             bill.setCreateUser(null);
252 252
             bill.setCreateDate(null);
253
+            if(!"2".equals(billStatus)) {
254
+                bill.setCreateDate(new Date());
255
+                bill.setCreateUser(userElement.getId());
256
+            }
253 257
             // 设置主键, 表示修改
254 258
             bill.setId(billId);
255 259
         }
@@ -271,8 +275,15 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
271 275
                 queryWrapper.eq("room_no", e.getRoomNo());
272 276
                 queryWrapper.eq("community_id", userElement.getCommunityId());
273 277
                 TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectOne(queryWrapper);
278
+                if (null == buildingOwnerInfo) {
279
+                    throw new WisdomException("请输入正确的用户信息! ");
280
+                }
281
+
282
+                /**
283
+                 * 如果用户不在 app 里面,没有关联, 那么就设置 taUserId
284
+                 * 等业主第一次登陆的时候, 再去自动匹配上去
285
+                 */
274 286
 
275
-                // TODO 如果用户不在 app 里面,没有关联, 怎么处理?
276 287
                 // 查询app用户id
277 288
                 QueryWrapper<TaUser> userQueryWrapper = new QueryWrapper<>();
278 289
                 userQueryWrapper.eq("community_id", userElement.getCommunityId());
@@ -280,7 +291,9 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
280 291
                 TaUser taUser = taUserMapper.selectOne(userQueryWrapper);
281 292
 
282 293
                 billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
283
-                billInvoice.setTaUserId(taUser.getId());
294
+                if (null != taUser) {
295
+                    billInvoice.setTaUserId(taUser.getId());
296
+                }
284 297
                 billInvoice.setBillInvoiceExplain(bill.getBillExplain());
285 298
                 billInvoice.setPayPrice(e.getMoney());
286 299
                 billInvoice.setBillStatus("0");
@@ -468,62 +481,69 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
468 481
     }
469 482
 
470 483
     @Override
471
-    public ResponseBean downloadExcel(String parameter) {
484
+    public ResponseBean downloadExcel(UserElement userElement) {
472 485
         ResponseBean responseBean = new ResponseBean();
473 486
 
474 487
         InputStream inputStream = null;
488
+        inputStream = this.getClass().getResourceAsStream("/缴费单模板.xls");
489
+
475 490
         HSSFWorkbook workbook = null;
476 491
         try {
477
-            inputStream = new FileInputStream("缴费单模板.xls");
478 492
             workbook = new HSSFWorkbook(inputStream);
479
-        } catch (FileNotFoundException e) {
480
-            e.printStackTrace();
481 493
         } catch (IOException e) {
482 494
             e.printStackTrace();
483 495
         }
484 496
 
485
-       
486
-        HSSFSheet sheet = workbook.createSheet("缴费单");
497
+        HSSFSheet sheet = workbook.getSheetAt(0);
487 498
         // 创建行
488
-        HSSFRow row = sheet.createRow(0);
499
+        HSSFRow row = null;
489 500
         // 创建列
490
-        HSSFCell cell = row.createCell(0);
491
-        cell.setCellValue("1.第1行到第4行为模板说明。第5行为列头。第6行为示例。第7行及以后行中的金额部分为需要您填写的区域。请不要删除任何列、说明以及示例等。");
492
-        row = sheet.createRow(1);
493
-        cell = row.createCell(0);
494
-        cell.setCellValue("2.下表中 栋/单元/楼层/房号/业主姓名为系统生成,自行增加、修改无效,只能修改金额!!!如果没有内容或缺失内容,请先登录物业系统,在 社区管理——业主/楼盘——楼盘库中添加楼盘信息,在社区管理——业主/楼盘——业主资料库中添加业主信息,完成后再重新下载账单模板。");
495
-        row = sheet.createRow(2);
496
-        cell = row.createCell(0);
497
-        cell.setCellValue("3.无需缴费的户可以直接在户所在行最左侧行号上点击右键删除行。");
498
-        row = sheet.createRow(3);
499
-        cell = row.createCell(0);
500
-        cell.setCellValue("4.需要缴费的户,在金额列中填写金额,默认单位为人民币元,请输入大于0的数字,小数点请用英文小数点,更不能使用句号。最多保留小数点后两位。若是复制粘贴的金额,请在粘贴后检查金额是否正确,系统暂时无法退费,请仔细核对账单");
501
-        row = sheet.createRow(4);
502
-        cell = row.createCell(0);
503
-        cell.setCellValue("期/区");
504
-        cell = row.createCell(1);
505
-        cell.setCellValue("栋");
506
-        cell = row.createCell(2);
507
-        cell.setCellValue("单元");
508
-        cell = row.createCell(3);
509
-        cell.setCellValue("楼层");
510
-        cell = row.createCell(4);
511
-        cell.setCellValue("房号");
512
-        cell = row.createCell(5);
513
-        cell.setCellValue("业主姓名");
514
-        cell = row.createCell(6);
515
-        cell.setCellValue("金额(元)");
516
-
517
-        String [] [] data = new String[][] {{"1区","0", "0", "0", "0", "示例忽删", "12.34", "<-示例"}};
518
-        int crrentRow = 5;
519
-        // 行数
520
-        for (int i = 0; i < data.length; i++) {
521
-            row = sheet.createRow(i + crrentRow);
522
-            for (int t = 0; t < data[i].length; t++) {
523
-                cell = row.createCell(t);
524
-                cell.setCellValue(data[i][t]);
501
+        HSSFCell cell = null;
502
+
503
+        Integer pageNum = 1;
504
+        Integer pageSize = 10;
505
+        Page<TpBuildingOwnerInfo> page = new Page(pageNum,pageSize);
506
+        // 分页查询
507
+        QueryWrapper<TpBuildingOwnerInfo> buildingOwnerInfoQueryWrapper = new QueryWrapper<>();
508
+        buildingOwnerInfoQueryWrapper.eq("community_id", userElement.getCommunityId());
509
+        IPage<TpBuildingOwnerInfo> infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
510
+        List<TpBuildingOwnerInfo> records = infoIPage.getRecords();
511
+        // 总页数
512
+        Long pages = infoIPage.getPages();
513
+        do {
514
+
515
+        } while (false);
516
+
517
+
518
+        // 行数 默认从 第 6 行开始
519
+        int currentRow = 6;
520
+        // 记录坐标
521
+        int index = 0;
522
+
523
+        do {
524
+            TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
525
+            row = sheet.createRow(currentRow);
526
+            cell = row.createCell(0);
527
+            cell.setCellValue(buildingOwnerInfo.getPhase());
528
+            cell = row.createCell(1);
529
+            cell.setCellValue(buildingOwnerInfo.getBuilding());
530
+            cell = row.createCell(2);
531
+            cell.setCellValue(buildingOwnerInfo.getUnit());
532
+            cell = row.createCell(3);
533
+            cell.setCellValue(buildingOwnerInfo.getLevel());
534
+            cell = row.createCell(4);
535
+            cell.setCellValue(buildingOwnerInfo.getRoomNo());
536
+            cell = row.createCell(5);
537
+            cell.setCellValue(buildingOwnerInfo.getOwnerName());
538
+            currentRow ++;
539
+            index ++;
540
+            if (index == records.size()) {
541
+                index = 0;
542
+                page = new Page(infoIPage.getCurrent() + 1,pageSize);
543
+                infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
544
+                records = infoIPage.getRecords();
525 545
             }
526
-        }
546
+        } while (infoIPage.getCurrent() <= pages);
527 547
 
528 548
         responseBean.addSuccess(workbook);
529 549
         return responseBean;

+ 32
- 10
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java 查看文件

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5
 import com.baomidou.mybatisplus.core.enums.SqlMethod;
6 6
 import com.baomidou.mybatisplus.core.metadata.IPage;
7
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
8 7
 import com.baomidou.mybatisplus.core.toolkit.Constants;
9 8
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
10 9
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -15,21 +14,16 @@ import com.community.commom.session.UserElement;
15 14
 import com.community.commom.utils.AccountValidatorUtil;
16 15
 import com.community.commom.utils.BeanTools;
17 16
 
18
-import com.community.huiju.dao.TaSysUserRoleMapper;
19
-import com.community.huiju.dao.TaUserMapper;
20
-import com.community.huiju.dao.UserMapper;
17
+import com.community.huiju.dao.*;
21 18
 import com.community.huiju.exception.WisdomException;
22
-import com.community.huiju.model.TaSysUserRole;
23
-import com.community.huiju.model.TaUser;
19
+import com.community.huiju.model.*;
24 20
 
25
-import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
26
-import com.community.huiju.model.TpBuildingOwnerInfo;
27
-
28
-import com.community.huiju.model.User;
21
+import com.community.huiju.service.IBillInvoiceService;
29 22
 import com.community.huiju.service.IBuildingOwnerInfoService;
30 23
 import com.community.huiju.service.ITaUserService;
31 24
 import com.google.common.collect.Lists;
32 25
 import com.google.common.collect.Maps;
26
+import org.apache.commons.collections.CollectionUtils;
33 27
 import org.apache.ibatis.binding.MapperMethod;
34 28
 import org.apache.ibatis.session.SqlSession;
35 29
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -78,6 +72,12 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
78 72
 
79 73
     @Autowired
80 74
     private ITaUserService iTaUserService;
75
+
76
+    @Autowired
77
+    private BillInvoiceMapper billInvoiceMapper;
78
+
79
+    @Autowired
80
+    private IBillInvoiceService iBillInvoiceService;
81 81
     
82 82
     public static final Logger logger = LoggerFactory.getLogger(BuildingOwnerInfoServiceImpl.class);
83 83
     
@@ -232,6 +232,9 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
232 232
 
233 233
             // 更新APP端用户的角色身份为 业主
234 234
             updateAppRole(tpBuildingOwnerInfo.getCommunityId(), appOwnerUser.getId(), Constant.OWNER_ID);
235
+
236
+            // 绑定 缴费单
237
+            bingBillInvoice(user.getId(), tpBuildingOwnerInfo.getId());
235 238
         }
236 239
 
237 240
 
@@ -321,6 +324,10 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
321 324
 
322 325
             // 更新APP端用户的角色身份为 业主
323 326
             updateAppRole(tpBuildingOwnerInfo.getCommunityId(), appOwnerUser.getId(), Constant.OWNER_ID);
327
+
328
+            // 绑定 缴费单
329
+            bingBillInvoice(user.getId(), tpBuildingOwnerInfo.getId());
330
+
324 331
         }
325 332
 
326 333
 
@@ -349,6 +356,21 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
349 356
         taSysUserRoleMapper.insert(taSysUserRole);
350 357
     }
351 358
 
359
+    /**
360
+     * 绑定 缴费单
361
+     * @param taUserId
362
+     */
363
+    private void bingBillInvoice(Integer taUserId, Integer buildingOwnerInfoId) {
364
+        // 开始绑定缴费单
365
+        QueryWrapper<BillInvoice> queryWrapper = new QueryWrapper<>();
366
+        queryWrapper.eq("building_owner_info_id", buildingOwnerInfoId);
367
+        List<BillInvoice> tpBillInvoices = billInvoiceMapper.selectList(queryWrapper);
368
+        if (CollectionUtils.isNotEmpty(tpBillInvoices)) {
369
+            tpBillInvoices.forEach(e -> e.setTaUserId(taUserId));
370
+            iBillInvoiceService.updateBatchById(tpBillInvoices);
371
+        }
372
+    }
373
+
352 374
     @Override
353 375
     public ResponseBean getBuildingOrUnitOrNumber(String parameter,Integer communityId) {
354 376
 

二進制
CODE/smart-community/property-api/src/main/resources/缴费单模板.xls 查看文件


+ 8
- 0
VUECODE/smart-property-manage/src/api/bill.js 查看文件

@@ -47,3 +47,11 @@ export function deleteBillBeach(data) {
47 47
   })
48 48
 }
49 49
 
50
+// 下载excel模板
51
+export function billDownloadExcel() {
52
+  return request({
53
+    url: '/bill/downloadExcel',
54
+    method: 'get',
55
+    responseType: 'blob'
56
+  })
57
+}

+ 3
- 3
VUECODE/smart-property-manage/src/router/index.js 查看文件

@@ -221,7 +221,7 @@ export const constantRouterMap = [
221 221
         meta: { title: '收费组管理', icon: 'table' }
222 222
       },
223 223
       {
224
-        path: '/bill/management/info/:id',
224
+        path: '/bill/management/info',
225 225
         component: () => import('@/views/bill/info/index'),
226 226
         name: 'bill-info',
227 227
         hidden: true,
@@ -235,14 +235,14 @@ export const constantRouterMap = [
235 235
         meta: { title: '新增收费组', icon: 'table' }
236 236
       },
237 237
       {
238
-        path: '/bill/management/edi/:id',
238
+        path: '/bill/management/edi',
239 239
         component: () => import('@/views/bill/edi/index'),
240 240
         name: 'bill-edi',
241 241
         hidden: true,
242 242
         meta: { title: '修改收费组', icon: 'table' }
243 243
       },
244 244
       {
245
-        path: '/bill/management/info/bill-edi/:id',
245
+        path: '/bill/management/info/bill-edi',
246 246
         component: () => import('@/views/bill/info/bill-edi/index'),
247 247
         name: 'bill-info-edi',
248 248
         hidden: true,

+ 10
- 1
VUECODE/smart-property-manage/src/store/modules/bill.js 查看文件

@@ -1,4 +1,4 @@
1
-import { fetchBillList, billUploadExcelAdd, updateBillStatus, deleteBillBeach } from '@/api/bill'
1
+import { fetchBillList, billUploadExcelAdd, updateBillStatus, deleteBillBeach, billDownloadExcel } from '@/api/bill'
2 2
 
3 3
 const transaction = {
4 4
   namespaced: true,
@@ -56,6 +56,15 @@ const transaction = {
56 56
           reject(error)
57 57
         })
58 58
       })
59
+    },
60
+    BillDownloadExcel({ commit }) { // 下载Excel模板
61
+      return new Promise((resolve, reject) => {
62
+        billDownloadExcel().then(response => {
63
+          resolve(response)
64
+        }).catch(error => {
65
+          reject(error)
66
+        })
67
+      })
59 68
     }
60 69
   }
61 70
 }

+ 14
- 1
VUECODE/smart-property-manage/src/views/bill/add/index.vue 查看文件

@@ -29,7 +29,7 @@
29 29
             <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
30 30
           </el-upload>
31 31
           如果还未制作账单,请先下载账单模板,按规则填写费用后再上传
32
-          <el-button type="primary" size="small" icon="el-icon-download" @click="submitForm('ruleForm')">下载模板</el-button>
32
+          <el-button type="primary" size="small" icon="el-icon-download" @click="downloadExcel">下载模板</el-button>
33 33
         </span>
34 34
       </div>
35 35
       <span style="color: #99a9bf; font-size: 13px;">如果想修改下表的内容,请重新下载excel模板填写金额后上传,系统会直接删除下表所有旧数据,以新的excel内容为准</span>
@@ -296,6 +296,19 @@ export default {
296 296
         str += obj.roomNo
297 297
       }
298 298
       return str
299
+    },
300
+    downloadExcel() {
301
+      this.$store.dispatch('bill/BillDownloadExcel').then(res => {
302
+        const url = window.URL.createObjectURL(new Blob([res]))
303
+        const link = document.createElement('a')
304
+        link.style.display = 'none'
305
+        link.href = url
306
+        link.setAttribute('download', '缴费单模板.xls')
307
+        document.body.appendChild(link)
308
+        link.click()
309
+      }).catch(() => {
310
+        console.log('error BillDownloadExcel')
311
+      })
299 312
     }
300 313
   }
301 314
 }

+ 15
- 2
VUECODE/smart-property-manage/src/views/bill/edi/index.vue 查看文件

@@ -29,7 +29,7 @@
29 29
             <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
30 30
           </el-upload>
31 31
           如果还未制作账单,请先下载账单模板,按规则填写费用后再上传
32
-          <el-button type="primary" size="small" icon="el-icon-download" @click="submitForm('ruleForm')">下载模板</el-button>
32
+          <el-button type="primary" size="small" icon="el-icon-download" @click="downloadExcel">下载模板</el-button>
33 33
         </span>
34 34
       </div>
35 35
       <el-table
@@ -130,7 +130,7 @@ export default {
130 130
     }
131 131
   },
132 132
   created() {
133
-    this.listQuery.billId = this.$route.params.id
133
+    this.listQuery.billId = this.$route.query.id
134 134
     this.billInvoiceGetInvoiceInvalid()
135 135
     // this.getMenuList()
136 136
   },
@@ -323,6 +323,19 @@ export default {
323 323
         str += obj.roomNo
324 324
       }
325 325
       return str
326
+    },
327
+    downloadExcel() {
328
+      this.$store.dispatch('bill/BillDownloadExcel').then(res => {
329
+        const url = window.URL.createObjectURL(new Blob([res]))
330
+        const link = document.createElement('a')
331
+        link.style.display = 'none'
332
+        link.href = url
333
+        link.setAttribute('download', '缴费单模板.xls')
334
+        document.body.appendChild(link)
335
+        link.click()
336
+      }).catch(() => {
337
+        console.log('error BillDownloadExcel')
338
+      })
326 339
     }
327 340
   }
328 341
 }

+ 2
- 2
VUECODE/smart-property-manage/src/views/bill/index.vue 查看文件

@@ -162,9 +162,9 @@ export default {
162 162
     },
163 163
     getInfo(billId, billStatus) {
164 164
       if (billStatus === '2') {
165
-        this.$router.push({ name: 'bill-edi', params: { id: billId }})
165
+        this.$router.push({ name: 'bill-edi', query: { id: billId }})
166 166
       } else {
167
-        this.$router.push({ name: 'bill-info', params: { id: billId }})
167
+        this.$router.push({ name: 'bill-info', query: { id: billId }})
168 168
       }
169 169
     },
170 170
     addBill() {

+ 1
- 1
VUECODE/smart-property-manage/src/views/bill/info/add/index.vue 查看文件

@@ -116,7 +116,7 @@ export default {
116 116
   mounted() {
117 117
     // 获取期
118 118
     this.getPhase()
119
-    this.formInline.billId = this.$route.params.id
119
+    this.formInline.billId = this.$route.query.id
120 120
     // 查询数据
121 121
     this.getTempBillInvoice()
122 122
   },

+ 1
- 1
VUECODE/smart-property-manage/src/views/bill/info/bill-edi/index.vue 查看文件

@@ -45,7 +45,7 @@ export default {
45 45
     }
46 46
   },
47 47
   mounted() {
48
-    this.ruleForm.id = this.$route.params.id
48
+    this.ruleForm.id = this.$route.query.id
49 49
     this.getBillByIdInfo()
50 50
   },
51 51
   methods: {

+ 17
- 15
VUECODE/smart-property-manage/src/views/bill/info/index.vue 查看文件

@@ -206,7 +206,7 @@ export default {
206 206
   mounted() {
207 207
     // 获取期
208 208
     this.getPhase()
209
-    this.formInline.billId = this.$route.params.id
209
+    this.formInline.billId = this.$route.query.id
210 210
     this.getBillInvoice()
211 211
   },
212 212
   methods: {
@@ -345,7 +345,7 @@ export default {
345 345
       this.getBillInvoice()
346 346
     },
347 347
     updateBill() { // 跳转修改bill标题页面 bill-info-edi
348
-      this.$router.push({ name: 'bill-info-edi', params: { id: this.formInline.billId }})
348
+      this.$router.push({ name: 'bill-info-edi', query: { id: this.formInline.billId }})
349 349
     },
350 350
     deleteBeachIds() { // 批量删除
351 351
       if (this.deleteIds.length <= 0) {
@@ -434,19 +434,21 @@ export default {
434 434
     },
435 435
     addBillInvoice() {
436 436
       // 如果是 收费已完成 的收费项, 则不允许跳进添加页面
437
-      this.$store.dispatch('GetBillByIdInfo', this.formInline.billId).then(res => {
438
-        const resCode = res.code
439
-        if (resCode === '0') {
440
-          const billStatus = res.data.billStatus
441
-          if (billStatus === '1') {
442
-            this.$message.error('不能给收费已完成的收费组添加收费单!')
443
-            return
444
-          }
445
-          this.$router.push({ name: 'bill-info-add', params: { id: this.formInline.billId }})
446
-        }
447
-      }).catch(() => {
448
-        console.log('GetBillByIdInfo error')
449
-      })
437
+      // this.$store.dispatch('GetBillByIdInfo', this.formInline.billId).then(res => {
438
+      //   const resCode = res.code
439
+      //   if (resCode === '0') {
440
+      //     const billStatus = res.data.billStatus
441
+      //     if (billStatus === '1') {
442
+      //       this.$message.error('不能给收费已完成的收费组添加收费单!')
443
+      //       return
444
+      //     }
445
+      //     this.$router.push({ name: 'bill-info-add', params: { id: this.formInline.billId }})
446
+      //   }
447
+      // }).catch(() => {
448
+      //   console.log('GetBillByIdInfo error')
449
+      // })
450
+
451
+      this.$router.push({ name: 'bill-info-add', query: { id: this.formInline.billId }})
450 452
     },
451 453
     showPayPrice(payPrice) { //  转换金额
452 454
       const price = payPrice / 100