张延森 3 年之前
父節點
當前提交
299ba9f9a5

+ 1
- 1
src/main/java/com/njyunzhi/pet_identity/common/BaseController.java 查看文件

@@ -46,6 +46,6 @@ public class BaseController {
46 46
     }
47 47
 
48 48
     public boolean checkRole(String srcRole, String targRole) {
49
-        return Constants.USER_ADMIN.equals(srcRole) || srcRole.equals(targRole);
49
+        return Constants.USER_ADMIN.equals(srcRole) || Constants.USER_MANAGER.equals(srcRole) || srcRole.equals(targRole);
50 50
     }
51 51
 }

+ 2
- 1
src/main/java/com/njyunzhi/pet_identity/common/Constants.java 查看文件

@@ -14,8 +14,9 @@ public class Constants {
14 14
     public final static String USER_ADMIN = "admin";
15 15
     public final static String USER_AUDITOR = "auditor";
16 16
     public final static String USER_MAKER = "maker";
17
+    public final static String USER_MANAGER = "manager";
17 18
 
18
-    // 用户角色
19
+    // 申请单类型
19 20
     public final static String APPLY_TYPE_FIRST = "first";  // 申请
20 21
     public final static String APPLY_TYPE_REISSUE = "reissue"; // 补办
21 22
     public final static String APPLY_TYPE_RENEWAL = "renewal"; // 续期

+ 2
- 2
src/main/java/com/njyunzhi/pet_identity/config/CorsConfig.java 查看文件

@@ -29,9 +29,9 @@ public class CorsConfig implements WebMvcConfigurer {
29 29
 
30 30
         //设置放行哪些原始域
31 31
         if ("prod".equals(mode)) {
32
-            registration.allowedOrigins("http://resumework.njyunzhi.com", "https://resumework.njyunzhi.com");
32
+            registration.allowedOrigins("https://pet-certificate-online.njyunzhi.com");
33 33
         } else {
34
-            registration.allowedOrigins("http://localhost:8000", "http://localhost:3000");
34
+            registration.allowedOrigins("http://localhost:8000", "http://localhost:3000", "https://pet-certificate-online.njyunzhi.com");
35 35
         }
36 36
 
37 37
         //放行哪些请求方式

+ 1
- 0
src/main/java/com/njyunzhi/pet_identity/controller/CommController.java 查看文件

@@ -12,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
12 12
 import java.io.IOException;
13 13
 import java.time.LocalDateTime;
14 14
 import java.time.format.DateTimeFormatter;
15
+import java.util.HashMap;
15 16
 import java.util.Map;
16 17
 
17 18
 @Api(tags = "通用")

+ 3
- 2
src/main/java/com/njyunzhi/pet_identity/controller/SysUserController.java 查看文件

@@ -49,11 +49,12 @@ public class SysUserController extends BaseController {
49 49
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
50 50
     public ResponseBean sysUserList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
51 51
                                     @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
52
-                                    @ApiParam("用户名") @RequestParam(value ="userName", required = false) String userName) throws Exception{
52
+                                    @ApiParam("用户名") @RequestParam(value ="userName", required = false) String userName,
53
+                                    @ApiParam("手机号") @RequestParam(value ="phone", required = false) String phone) throws Exception{
53 54
 
54 55
         IPage<SysUser> pg = new Page<>(pageNum, pageSize);
55 56
 
56
-        IPage<SysUser> result = iSysUserService.getPagedBy(pg, userName);
57
+        IPage<SysUser> result = iSysUserService.getPagedBy(pg, userName, phone);
57 58
         return ResponseBean.success(result);
58 59
     }
59 60
 

+ 29
- 1
src/main/java/com/njyunzhi/pet_identity/controller/TaApplicationController.java 查看文件

@@ -68,13 +68,41 @@ public class TaApplicationController extends BaseController {
68 68
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
69 69
     public ResponseBean taApplicationList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
70 70
                                           @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
71
-                                          @ApiParam("表单进度") @RequestParam(value ="process", defaultValue = "0") Integer process) throws Exception{
71
+                                          @ApiParam("表单进度") @RequestParam(value ="process", defaultValue = "0") Integer process,
72
+                                          @ApiParam(value = "申请开始时间", example = "2022-06-01") @RequestParam(value ="applyStart", required = false) String applyStart,
73
+                                          @ApiParam(value = "申请结束时间", example = "2022-06-30") @RequestParam(value ="applyEnd", required = false) String applyEnd,
74
+                                          @ApiParam(value = "审核开始时间", example = "2022-06-01") @RequestParam(value ="auditStart", required = false) String auditStart,
75
+                                          @ApiParam(value = "审核结束时间", example = "2022-06-30") @RequestParam(value ="auditEnd", required = false) String auditEnd,
76
+                                          @ApiParam(value = "发证开始时间", example = "2022-06-01") @RequestParam(value ="makeStart", required = false) String makeStart,
77
+                                          @ApiParam(value = "发证结束时间", example = "2022-06-30") @RequestParam(value ="makeEnd", required = false) String makeEnd,
78
+                                          @ApiParam("申请类型") @RequestParam(value ="applyType", required = false) String applyType,
79
+                                          @ApiParam("申领方式") @RequestParam(value ="applyMethod", required = false) Integer applyMethod,
80
+                                          @ApiParam("付款状态") @RequestParam(value ="payStatus", required = false) Integer payStatus,
81
+                                          @ApiParam("审核状态") @RequestParam(value ="verifyStatus", required = false) Integer verifyStatus,
82
+                                          @ApiParam("犬主") @RequestParam(value ="personName", required = false) String personName,
83
+                                          @ApiParam("手机号") @RequestParam(value ="phone", required = false) String phone,
84
+                                          @ApiParam("犬名") @RequestParam(value ="petName", required = false) String petName,
85
+                                          @ApiParam("卡号") @RequestParam(value ="originCardNo", required = false) String originCardNo) throws Exception{
72 86
 
73 87
         SysUser sysUser = currentUser();
74 88
 
75 89
         IPage<TaApplication> pg = new Page<>(pageNum, pageSize);
76 90
         QueryWrapper<TaApplication> queryWrapper = new QueryWrapper<>();
77 91
         queryWrapper.gt("status", Constants.STATUS_DELETE);
92
+        queryWrapper.eq(!StringUtils.isEmpty(applyType), "apply_type", applyType);
93
+        queryWrapper.eq(null != applyMethod, "apply_method", applyMethod);
94
+        queryWrapper.eq(null != payStatus, "pay_status", payStatus);
95
+        queryWrapper.eq(null != verifyStatus, "verify_status", verifyStatus);
96
+        queryWrapper.like(!StringUtils.isEmpty(personName), "person_name", "%" + personName + "%");
97
+        queryWrapper.like(!StringUtils.isEmpty(phone), "phone", "%" + phone + "%");
98
+        queryWrapper.like(!StringUtils.isEmpty(petName), "pet_name", "%" + petName + "%");
99
+        queryWrapper.like(!StringUtils.isEmpty(originCardNo), "origin_card_no", "%" + originCardNo + "%");
100
+        queryWrapper.ge(!StringUtils.isEmpty(applyStart), "create_date", applyStart);
101
+        queryWrapper.le(!StringUtils.isEmpty(applyEnd), "create_date", applyEnd);
102
+        queryWrapper.ge(!StringUtils.isEmpty(auditStart), "verify_date", auditStart);
103
+        queryWrapper.le(!StringUtils.isEmpty(auditEnd), "verify_date", auditEnd);
104
+        queryWrapper.ge(!StringUtils.isEmpty(makeStart), "make_date", makeStart);
105
+        queryWrapper.le(!StringUtils.isEmpty(makeEnd), "make_date", makeEnd);
78 106
 
79 107
         if (Constants.WORKFLOW_PROCESS_AUDIT == process) {
80 108
             // 过滤待审批列表

+ 4
- 1
src/main/java/com/njyunzhi/pet_identity/controller/TaNoticeController.java 查看文件

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.njyunzhi.pet_identity.common.BaseController;
7 7
 import com.njyunzhi.pet_identity.common.Constants;
8 8
 import com.njyunzhi.pet_identity.common.ResponseBean;
9
+import com.njyunzhi.pet_identity.common.StringUtils;
9 10
 import io.swagger.annotations.Api;
10 11
 import io.swagger.annotations.ApiOperation;
11 12
 import io.swagger.annotations.ApiParam;
@@ -50,10 +51,12 @@ public class TaNoticeController extends BaseController {
50 51
     @RequestMapping(value="/admin/notice",method= RequestMethod.GET)
51 52
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
52 53
     public ResponseBean taNoticeList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53
-									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
54
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
55
+                                     @ApiParam("标题") @RequestParam(value ="title", required = false) String title) throws Exception{
54 56
 
55 57
         IPage<TaNotice> pg = new Page<>(pageNum, pageSize);
56 58
         QueryWrapper<TaNotice> queryWrapper = new QueryWrapper<>();
59
+        queryWrapper.like(!StringUtils.isEmpty(title), "title", "%" + title + "%");
57 60
         queryWrapper.gt("status", Constants.STATUS_DELETE);
58 61
         queryWrapper.orderByDesc("create_date");
59 62
 

+ 6
- 1
src/main/java/com/njyunzhi/pet_identity/controller/TaPersonController.java 查看文件

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.njyunzhi.pet_identity.common.BaseController;
7 7
 import com.njyunzhi.pet_identity.common.ResponseBean;
8
+import com.njyunzhi.pet_identity.common.StringUtils;
8 9
 import io.swagger.annotations.Api;
9 10
 import io.swagger.annotations.ApiOperation;
10 11
 import io.swagger.annotations.ApiParam;
@@ -48,10 +49,14 @@ public class TaPersonController extends BaseController {
48 49
     @RequestMapping(value="/admin/person",method= RequestMethod.GET)
49 50
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
50 51
     public ResponseBean taPersonList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
51
-									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
52
+									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
53
+                                     @ApiParam("犬主") @RequestParam(value ="personName", required = false) String personName,
54
+                                     @ApiParam("手机号") @RequestParam(value ="phone", required = false) String phone) throws Exception{
52 55
 
53 56
         IPage<TaPerson> pg = new Page<>(pageNum, pageSize);
54 57
         QueryWrapper<TaPerson> queryWrapper = new QueryWrapper<>();
58
+        queryWrapper.like(!StringUtils.isEmpty(personName), "person_name", "%" + personName + "%");
59
+        queryWrapper.like(!StringUtils.isEmpty(phone), "phone", "%" + phone + "%");
55 60
         queryWrapper.isNotNull("phone");
56 61
         queryWrapper.orderByDesc("create_date");
57 62
 

+ 7
- 48
src/main/java/com/njyunzhi/pet_identity/controller/TaPetIdentityController.java 查看文件

@@ -52,10 +52,16 @@ public class TaPetIdentityController extends BaseController {
52 52
     @RequestMapping(value="/admin/card",method= RequestMethod.GET)
53 53
     @ApiOperation(value="证件列表", notes = "证件列表", httpMethod = "GET", response = ResponseBean.class)
54 54
     public ResponseBean getList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
-                               @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
55
+                                @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
56
+                                @ApiParam("卡号") @RequestParam(value ="cardNo", required = false) String cardNo,
57
+                                @ApiParam("犬主") @RequestParam(value ="personName", required = false) String personName,
58
+                                @ApiParam("手机号") @RequestParam(value ="phone", required = false) String phone) throws Exception{
56 59
 
57 60
         IPage<TaPetIdentity> pg = new Page<>(pageNum, pageSize);
58 61
         QueryWrapper<TaPetIdentity> queryWrapper = new QueryWrapper<>();
62
+        queryWrapper.like(!StringUtils.isEmpty(cardNo), "card_no", "%" + cardNo + "%");
63
+        queryWrapper.like(!StringUtils.isEmpty(personName), "person_name", "%" + personName + "%");
64
+        queryWrapper.like(!StringUtils.isEmpty(phone), "phone", "%" + phone + "%");
59 65
         queryWrapper.gt("status", Constants.STATUS_DELETE);
60 66
         queryWrapper.orderByDesc("create_date");
61 67
 
@@ -85,53 +91,6 @@ public class TaPetIdentityController extends BaseController {
85 91
         return ResponseBean.success(result);
86 92
     }
87 93
 
88
-//    /**
89
-//     * 保存对象
90
-//     * @param taPetIdentity 实体对象
91
-//     * @return
92
-//     */
93
-//    @RequestMapping(value="/taPetIdentity",method= RequestMethod.POST)
94
-//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
95
-//    public ResponseBean taPetIdentityAdd(@ApiParam("保存内容") @RequestBody TaPetIdentity taPetIdentity) throws Exception{
96
-//
97
-//        if (iTaPetIdentityService.save(taPetIdentity)){
98
-//            return ResponseBean.success(taPetIdentity);
99
-//        }else {
100
-//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
101
-//        }
102
-//    }
103
-//
104
-//    /**
105
-//     * 根据id删除对象
106
-//     * @param id  实体ID
107
-//     */
108
-//    @RequestMapping(value="/taPetIdentity/{id}", method= RequestMethod.DELETE)
109
-//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
110
-//    public ResponseBean taPetIdentityDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
111
-//        if(iTaPetIdentityService.removeById(id)){
112
-//            return ResponseBean.success("success");
113
-//        }else {
114
-//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
115
-//        }
116
-//    }
117
-//
118
-//    /**
119
-//     * 修改对象
120
-//     * @param id  实体ID
121
-//     * @param taPetIdentity 实体对象
122
-//     * @return
123
-//     */
124
-//    @RequestMapping(value="/taPetIdentity/{id}",method= RequestMethod.PUT)
125
-//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
126
-//    public ResponseBean taPetIdentityUpdate(@ApiParam("对象ID") @PathVariable Integer id,
127
-//                                        @ApiParam("更新内容") @RequestBody TaPetIdentity taPetIdentity) throws Exception{
128
-//
129
-//        if (iTaPetIdentityService.updateById(taPetIdentity)){
130
-//            return ResponseBean.success(iTaPetIdentityService.getById(id));
131
-//        }else {
132
-//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
133
-//        }
134
-//    }
135 94
 
136 95
     /**
137 96
      * 获取证件号码

+ 1
- 1
src/main/java/com/njyunzhi/pet_identity/mapper/SysUserMapper.java 查看文件

@@ -17,5 +17,5 @@ import org.apache.ibatis.annotations.Param;
17 17
 @Mapper
18 18
 public interface SysUserMapper extends BaseMapper<SysUser> {
19 19
 
20
-    IPage<SysUser> getPagedBy(IPage<SysUser> pg, @Param("userName") String userName);
20
+    IPage<SysUser> getPagedBy(IPage<SysUser> pg, @Param("userName") String userName, @Param("phone") String phone);
21 21
 }

+ 1
- 2
src/main/java/com/njyunzhi/pet_identity/service/ISysUserService.java 查看文件

@@ -2,7 +2,6 @@ package com.njyunzhi.pet_identity.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.njyunzhi.pet_identity.entity.SysUser;
5
-import com.baomidou.mybatisplus.extension.service.IService;
6 5
 
7 6
 /**
8 7
  * <p>
@@ -14,5 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
14 13
  */
15 14
 public interface ISysUserService extends IBaseService<SysUser> {
16 15
 
17
-    IPage<SysUser> getPagedBy(IPage<SysUser> pg, String userName);
16
+    IPage<SysUser> getPagedBy(IPage<SysUser> pg, String userName, String phone);
18 17
 }

+ 2
- 3
src/main/java/com/njyunzhi/pet_identity/service/impl/SysUserServiceImpl.java 查看文件

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.njyunzhi.pet_identity.entity.SysUser;
5 5
 import com.njyunzhi.pet_identity.mapper.SysUserMapper;
6 6
 import com.njyunzhi.pet_identity.service.ISysUserService;
7
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8 7
 import org.springframework.stereotype.Service;
9 8
 
10 9
 /**
@@ -19,7 +18,7 @@ import org.springframework.stereotype.Service;
19 18
 public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
20 19
 
21 20
     @Override
22
-    public IPage<SysUser> getPagedBy(IPage<SysUser> pg, String userName) {
23
-        return baseMapper.getPagedBy(pg, userName);
21
+    public IPage<SysUser> getPagedBy(IPage<SysUser> pg, String userName, String phone) {
22
+        return baseMapper.getPagedBy(pg, userName, phone);
24 23
     }
25 24
 }

+ 3
- 0
src/main/java/com/njyunzhi/pet_identity/service/impl/TaOrderServiceImpl.java 查看文件

@@ -78,6 +78,9 @@ public class TaOrderServiceImpl extends BaseServiceImpl<TaOrderMapper, TaOrder>
78 78
     @Override
79 79
     public boolean refundByApplication(TaApplication taApplication) throws Exception {
80 80
         TaOrder taOrder = baseMapper.getByApplyId(taApplication.getApplyId().toString());
81
+        if (null == taOrder) {
82
+            throw new Exception("未找到支付订单信息");
83
+        }
81 84
 
82 85
         WxPayRefundV3Request request = new WxPayRefundV3Request();
83 86
         request.setOutTradeNo(taOrder.getOrderNo()); // 原单号

+ 3
- 0
src/main/resources/mapper/SysUserMapper.xml 查看文件

@@ -22,6 +22,9 @@
22 22
           <if test="userName != null and userName != ''">
23 23
               AND t.user_name LIKE CONCAT( '%', #{userName}, '%' )
24 24
           </if>
25
+        <if test="phone != null and phone != ''">
26
+            AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
27
+        </if>
25 28
         ORDER BY
26 29
             t.create_date DESC
27 30
     </select>