Showing
47 changed files
with
2693 additions
and
20 deletions
@@ -153,6 +153,8 @@ public class ShiroConfig { | @@ -153,6 +153,8 @@ public class ShiroConfig { | ||
153 | //测试模块排除 | 153 | //测试模块排除 |
154 | filterChainDefinitionMap.put("/test/seata/**", "anon"); | 154 | filterChainDefinitionMap.put("/test/seata/**", "anon"); |
155 | 155 | ||
156 | + filterChainDefinitionMap.put("/app/api/**", "anon"); // 公众号、微信小程序 | ||
157 | + | ||
156 | // 添加自己的过滤器并且取名为jwt | 158 | // 添加自己的过滤器并且取名为jwt |
157 | Map<String, Filter> filterMap = new HashMap<String, Filter>(1); | 159 | Map<String, Filter> filterMap = new HashMap<String, Filter>(1); |
158 | //如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】 | 160 | //如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】 |
@@ -120,7 +120,7 @@ public class BaseCommonServiceImpl implements BaseCommonService { | @@ -120,7 +120,7 @@ public class BaseCommonServiceImpl implements BaseCommonService { | ||
120 | String formatTime = formatterLong.format(createTime); | 120 | String formatTime = formatterLong.format(createTime); |
121 | 121 | ||
122 | String mergeField = logContent + "-" + userid + "-" + username + "-" + ip + "-" + formatTime; | 122 | String mergeField = logContent + "-" + userid + "-" + username + "-" + ip + "-" + formatTime; |
123 | - if (StringUtils.isNotBlank(mergeField)){ | 123 | + if (encrypFlag && StringUtils.isNotBlank(mergeField)){ |
124 | //添加完整性 | 124 | //添加完整性 |
125 | try { | 125 | try { |
126 | String hmac = EncryptionUtils.hmac(mergeField); | 126 | String hmac = EncryptionUtils.hmac(mergeField); |
@@ -63,6 +63,18 @@ | @@ -63,6 +63,18 @@ | ||
63 | <!-- <systemPath>${project.basedir}/lib/HbcaSdk.jar</systemPath>--> | 63 | <!-- <systemPath>${project.basedir}/lib/HbcaSdk.jar</systemPath>--> |
64 | <!-- </dependency>--> | 64 | <!-- </dependency>--> |
65 | 65 | ||
66 | + <!-- 小程序微信登录,微信支付--> | ||
67 | + <dependency> | ||
68 | + <groupId>com.github.binarywang</groupId> | ||
69 | + <artifactId>weixin-java-mp</artifactId> | ||
70 | + <version>4.5.0</version> | ||
71 | + </dependency> | ||
72 | + | ||
73 | + <dependency> | ||
74 | + <groupId>com.github.binarywang</groupId> | ||
75 | + <artifactId>weixin-java-pay</artifactId> | ||
76 | + <version>4.5.0</version> | ||
77 | + </dependency> | ||
66 | </dependencies> | 78 | </dependencies> |
67 | 79 | ||
68 | </project> | 80 | </project> |
1 | +package org.jeecg.modules.claims.controller; | ||
2 | + | ||
3 | +import java.util.Arrays; | ||
4 | +import java.util.List; | ||
5 | +import java.util.Map; | ||
6 | +import java.util.stream.Collectors; | ||
7 | +import java.io.IOException; | ||
8 | +import java.io.UnsupportedEncodingException; | ||
9 | +import java.net.URLDecoder; | ||
10 | +import javax.servlet.http.HttpServletRequest; | ||
11 | +import javax.servlet.http.HttpServletResponse; | ||
12 | +import org.jeecg.common.api.vo.Result; | ||
13 | +import org.jeecg.common.system.query.QueryGenerator; | ||
14 | +import org.jeecg.common.util.oConvertUtils; | ||
15 | +import org.jeecg.modules.claims.entity.InstitutionMedicalPrice; | ||
16 | +import org.jeecg.modules.claims.service.IInstitutionMedicalPriceService; | ||
17 | + | ||
18 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
19 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
20 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
21 | +import lombok.extern.slf4j.Slf4j; | ||
22 | + | ||
23 | +import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
24 | +import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
25 | +import org.jeecgframework.poi.excel.entity.ExportParams; | ||
26 | +import org.jeecgframework.poi.excel.entity.ImportParams; | ||
27 | +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
28 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
29 | +import org.springframework.beans.factory.annotation.Autowired; | ||
30 | +import org.springframework.web.bind.annotation.*; | ||
31 | +import org.springframework.web.multipart.MultipartFile; | ||
32 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
33 | +import org.springframework.web.servlet.ModelAndView; | ||
34 | +import com.alibaba.fastjson.JSON; | ||
35 | +import io.swagger.annotations.Api; | ||
36 | +import io.swagger.annotations.ApiOperation; | ||
37 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
38 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
39 | + | ||
40 | + /** | ||
41 | + * @Description: institution_medical_price | ||
42 | + * @Author: jeecg-boot | ||
43 | + * @Date: 2025-01-24 | ||
44 | + * @Version: V1.0 | ||
45 | + */ | ||
46 | +@Api(tags="institution_medical_price") | ||
47 | +@RestController | ||
48 | +@RequestMapping("/claims/institutionMedicalPrice") | ||
49 | +@Slf4j | ||
50 | +public class InstitutionMedicalPriceController extends JeecgController<InstitutionMedicalPrice, IInstitutionMedicalPriceService> { | ||
51 | + @Autowired | ||
52 | + private IInstitutionMedicalPriceService institutionMedicalPriceService; | ||
53 | + | ||
54 | + /** | ||
55 | + * 分页列表查询 | ||
56 | + * | ||
57 | + * @param institutionMedicalPrice | ||
58 | + * @param pageNo | ||
59 | + * @param pageSize | ||
60 | + * @param req | ||
61 | + * @return | ||
62 | + */ | ||
63 | + //@AutoLog(value = "institution_medical_price-分页列表查询") | ||
64 | + @ApiOperation(value="institution_medical_price-分页列表查询", notes="institution_medical_price-分页列表查询") | ||
65 | + @GetMapping(value = "/list") | ||
66 | + public Result<IPage<InstitutionMedicalPrice>> queryPageList(InstitutionMedicalPrice institutionMedicalPrice, | ||
67 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
68 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
69 | + HttpServletRequest req) { | ||
70 | + QueryWrapper<InstitutionMedicalPrice> queryWrapper = QueryGenerator.initQueryWrapper(institutionMedicalPrice, req.getParameterMap()); | ||
71 | + Page<InstitutionMedicalPrice> page = new Page<InstitutionMedicalPrice>(pageNo, pageSize); | ||
72 | + IPage<InstitutionMedicalPrice> pageList = institutionMedicalPriceService.page(page, queryWrapper); | ||
73 | + return Result.OK(pageList); | ||
74 | + } | ||
75 | + | ||
76 | + /** | ||
77 | + * 添加 | ||
78 | + * | ||
79 | + * @param institutionMedicalPrice | ||
80 | + * @return | ||
81 | + */ | ||
82 | + @AutoLog(value = "institution_medical_price-添加") | ||
83 | + @ApiOperation(value="institution_medical_price-添加", notes="institution_medical_price-添加") | ||
84 | +// @RequiresPermissions("claims:institution_medical_price:add") | ||
85 | + @PostMapping(value = "/add") | ||
86 | + public Result<String> add(@RequestBody InstitutionMedicalPrice institutionMedicalPrice) { | ||
87 | + institutionMedicalPriceService.save(institutionMedicalPrice); | ||
88 | + return Result.OK("添加成功!"); | ||
89 | + } | ||
90 | + | ||
91 | + /** | ||
92 | + * 编辑 | ||
93 | + * | ||
94 | + * @param institutionMedicalPrice | ||
95 | + * @return | ||
96 | + */ | ||
97 | + @AutoLog(value = "institution_medical_price-编辑") | ||
98 | + @ApiOperation(value="institution_medical_price-编辑", notes="institution_medical_price-编辑") | ||
99 | +// @RequiresPermissions("claims:institution_medical_price:edit") | ||
100 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
101 | + public Result<String> edit(@RequestBody InstitutionMedicalPrice institutionMedicalPrice) { | ||
102 | + institutionMedicalPriceService.updateById(institutionMedicalPrice); | ||
103 | + return Result.OK("编辑成功!"); | ||
104 | + } | ||
105 | + | ||
106 | + /** | ||
107 | + * 通过id删除 | ||
108 | + * | ||
109 | + * @param id | ||
110 | + * @return | ||
111 | + */ | ||
112 | + @AutoLog(value = "institution_medical_price-通过id删除") | ||
113 | + @ApiOperation(value="institution_medical_price-通过id删除", notes="institution_medical_price-通过id删除") | ||
114 | +// @RequiresPermissions("claims:institution_medical_price:delete") | ||
115 | + @DeleteMapping(value = "/delete") | ||
116 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | ||
117 | + institutionMedicalPriceService.removeById(id); | ||
118 | + return Result.OK("删除成功!"); | ||
119 | + } | ||
120 | + | ||
121 | + /** | ||
122 | + * 批量删除 | ||
123 | + * | ||
124 | + * @param ids | ||
125 | + * @return | ||
126 | + */ | ||
127 | + @AutoLog(value = "institution_medical_price-批量删除") | ||
128 | + @ApiOperation(value="institution_medical_price-批量删除", notes="institution_medical_price-批量删除") | ||
129 | +// @RequiresPermissions("claims:institution_medical_price:deleteBatch") | ||
130 | + @DeleteMapping(value = "/deleteBatch") | ||
131 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
132 | + this.institutionMedicalPriceService.removeByIds(Arrays.asList(ids.split(","))); | ||
133 | + return Result.OK("批量删除成功!"); | ||
134 | + } | ||
135 | + | ||
136 | + /** | ||
137 | + * 通过id查询 | ||
138 | + * | ||
139 | + * @param id | ||
140 | + * @return | ||
141 | + */ | ||
142 | + //@AutoLog(value = "institution_medical_price-通过id查询") | ||
143 | + @ApiOperation(value="institution_medical_price-通过id查询", notes="institution_medical_price-通过id查询") | ||
144 | + @GetMapping(value = "/queryById") | ||
145 | + public Result<InstitutionMedicalPrice> queryById(@RequestParam(name="id",required=true) String id) { | ||
146 | + InstitutionMedicalPrice institutionMedicalPrice = institutionMedicalPriceService.getById(id); | ||
147 | + if(institutionMedicalPrice==null) { | ||
148 | + return Result.error("未找到对应数据"); | ||
149 | + } | ||
150 | + return Result.OK(institutionMedicalPrice); | ||
151 | + } | ||
152 | + | ||
153 | + /** | ||
154 | + * 导出excel | ||
155 | + * | ||
156 | + * @param request | ||
157 | + * @param institutionMedicalPrice | ||
158 | + */ | ||
159 | +// @RequiresPermissions("claims:institution_medical_price:exportXls") | ||
160 | + @RequestMapping(value = "/exportXls") | ||
161 | + public ModelAndView exportXls(HttpServletRequest request, InstitutionMedicalPrice institutionMedicalPrice) { | ||
162 | + return super.exportXls(request, institutionMedicalPrice, InstitutionMedicalPrice.class, "institution_medical_price"); | ||
163 | + } | ||
164 | + | ||
165 | + /** | ||
166 | + * 通过excel导入数据 | ||
167 | + * | ||
168 | + * @param request | ||
169 | + * @param response | ||
170 | + * @return | ||
171 | + */ | ||
172 | +// @RequiresPermissions("claims:institution_medical_price:importExcel") | ||
173 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | ||
174 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
175 | + return super.importExcel(request, response, InstitutionMedicalPrice.class); | ||
176 | + } | ||
177 | + | ||
178 | +} |
1 | +package org.jeecg.modules.claims.controller; | ||
2 | + | ||
3 | +import java.util.Arrays; | ||
4 | +import java.util.List; | ||
5 | +import java.util.Map; | ||
6 | +import java.util.stream.Collectors; | ||
7 | +import java.io.IOException; | ||
8 | +import java.io.UnsupportedEncodingException; | ||
9 | +import java.net.URLDecoder; | ||
10 | +import javax.servlet.http.HttpServletRequest; | ||
11 | +import javax.servlet.http.HttpServletResponse; | ||
12 | + | ||
13 | +import org.apache.commons.lang3.StringUtils; | ||
14 | +import org.jeecg.common.api.vo.Result; | ||
15 | +import org.jeecg.common.system.query.QueryGenerator; | ||
16 | +import org.jeecg.common.util.oConvertUtils; | ||
17 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
18 | +import org.jeecg.modules.claims.service.IMedicalRecordsCopyPayService; | ||
19 | +import org.jeecg.modules.claims.service.IMedicalRecordsCopyService; | ||
20 | + | ||
21 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
22 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
23 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
24 | +import lombok.extern.slf4j.Slf4j; | ||
25 | + | ||
26 | +import org.jeecg.modules.weixin.service.IWeixinUserService; | ||
27 | +import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
28 | +import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
29 | +import org.jeecgframework.poi.excel.entity.ExportParams; | ||
30 | +import org.jeecgframework.poi.excel.entity.ImportParams; | ||
31 | +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
32 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
33 | +import org.springframework.beans.factory.annotation.Autowired; | ||
34 | +import org.springframework.transaction.annotation.Propagation; | ||
35 | +import org.springframework.transaction.annotation.Transactional; | ||
36 | +import org.springframework.web.bind.annotation.*; | ||
37 | +import org.springframework.web.multipart.MultipartFile; | ||
38 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
39 | +import org.springframework.web.servlet.ModelAndView; | ||
40 | +import com.alibaba.fastjson.JSON; | ||
41 | +import io.swagger.annotations.Api; | ||
42 | +import io.swagger.annotations.ApiOperation; | ||
43 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
44 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
45 | + | ||
46 | + /** | ||
47 | + * @Description: medical_records_copy | ||
48 | + * @Author: jeecg-boot | ||
49 | + * @Date: 2025-01-24 | ||
50 | + * @Version: V1.0 | ||
51 | + */ | ||
52 | +@Api(tags="medical_records_copy") | ||
53 | +@RestController | ||
54 | +@RequestMapping("/claims/medicalRecordsCopy") | ||
55 | +@Slf4j | ||
56 | +public class MedicalRecordsCopyController extends JeecgController<MedicalRecordsCopy, IMedicalRecordsCopyService> { | ||
57 | + @Autowired | ||
58 | + private IMedicalRecordsCopyService medicalRecordsCopyService; | ||
59 | + @Autowired | ||
60 | + private IWeixinUserService weixinUserService; | ||
61 | + @Autowired | ||
62 | + private IMedicalRecordsCopyPayService medicalRecordsCopyPayService; | ||
63 | + | ||
64 | + /** | ||
65 | + * 分页列表查询 | ||
66 | + * | ||
67 | + * @param medicalRecordsCopy | ||
68 | + * @param pageNo | ||
69 | + * @param pageSize | ||
70 | + * @param req | ||
71 | + * @return | ||
72 | + */ | ||
73 | + //@AutoLog(value = "medical_records_copy-分页列表查询") | ||
74 | + @ApiOperation(value="medical_records_copy-分页列表查询", notes="medical_records_copy-分页列表查询") | ||
75 | + @GetMapping(value = "/list") | ||
76 | + public Result<IPage<MedicalRecordsCopy>> queryPageList(MedicalRecordsCopy medicalRecordsCopy, | ||
77 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
78 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
79 | + HttpServletRequest req) { | ||
80 | + QueryWrapper<MedicalRecordsCopy> queryWrapper = QueryGenerator.initQueryWrapper(medicalRecordsCopy, req.getParameterMap()); | ||
81 | + Page<MedicalRecordsCopy> page = new Page<MedicalRecordsCopy>(pageNo, pageSize); | ||
82 | + IPage<MedicalRecordsCopy> pageList = medicalRecordsCopyService.page(page, queryWrapper); | ||
83 | + if (pageList.getRecords() != null && !pageList.getRecords().isEmpty()) { | ||
84 | + for (MedicalRecordsCopy record : pageList.getRecords()) { | ||
85 | + if (StringUtils.isNotBlank(record.getRegion())) { | ||
86 | + String[] split = record.getRegion().split(","); | ||
87 | + if (split.length > 2) { | ||
88 | + List<Map<String, String>> region = weixinUserService.getRegion(split[2]); | ||
89 | + record.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName")); | ||
90 | + } | ||
91 | + } | ||
92 | + } | ||
93 | + } | ||
94 | + return Result.OK(pageList); | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * 添加 | ||
99 | + * | ||
100 | + * @param medicalRecordsCopy | ||
101 | + * @return | ||
102 | + */ | ||
103 | + @AutoLog(value = "medical_records_copy-添加") | ||
104 | + @ApiOperation(value="medical_records_copy-添加", notes="medical_records_copy-添加") | ||
105 | +// @RequiresPermissions("claims:medical_records_copy:add") | ||
106 | + @PostMapping(value = "/add") | ||
107 | + public Result<String> add(@RequestBody MedicalRecordsCopy medicalRecordsCopy) { | ||
108 | + medicalRecordsCopy.setStatus("1"); | ||
109 | + medicalRecordsCopyService.save(medicalRecordsCopy); | ||
110 | + return Result.OK("添加成功!"); | ||
111 | + } | ||
112 | + | ||
113 | + /** | ||
114 | + * 编辑 | ||
115 | + * | ||
116 | + * @param medicalRecordsCopy | ||
117 | + * @return | ||
118 | + */ | ||
119 | + @AutoLog(value = "medical_records_copy-编辑") | ||
120 | + @ApiOperation(value="medical_records_copy-编辑", notes="medical_records_copy-编辑") | ||
121 | +// @RequiresPermissions("claims:medical_records_copy:edit") | ||
122 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
123 | + public Result<String> edit(@RequestBody MedicalRecordsCopy medicalRecordsCopy) { | ||
124 | + medicalRecordsCopyService.updateById(medicalRecordsCopy); | ||
125 | + return Result.OK("编辑成功!"); | ||
126 | + } | ||
127 | + | ||
128 | + /** | ||
129 | + * 通过id删除 | ||
130 | + * | ||
131 | + * @param id | ||
132 | + * @return | ||
133 | + */ | ||
134 | + @AutoLog(value = "medical_records_copy-通过id删除") | ||
135 | + @ApiOperation(value="medical_records_copy-通过id删除", notes="medical_records_copy-通过id删除") | ||
136 | +// @RequiresPermissions("claims:medical_records_copy:delete") | ||
137 | + @DeleteMapping(value = "/delete") | ||
138 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | ||
139 | + medicalRecordsCopyService.removeById(id); | ||
140 | + return Result.OK("删除成功!"); | ||
141 | + } | ||
142 | + | ||
143 | + /** | ||
144 | + * 批量删除 | ||
145 | + * | ||
146 | + * @param ids | ||
147 | + * @return | ||
148 | + */ | ||
149 | + @AutoLog(value = "medical_records_copy-批量删除") | ||
150 | + @ApiOperation(value="medical_records_copy-批量删除", notes="medical_records_copy-批量删除") | ||
151 | +// @RequiresPermissions("claims:medical_records_copy:deleteBatch") | ||
152 | + @DeleteMapping(value = "/deleteBatch") | ||
153 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
154 | + this.medicalRecordsCopyService.removeByIds(Arrays.asList(ids.split(","))); | ||
155 | + return Result.OK("批量删除成功!"); | ||
156 | + } | ||
157 | + | ||
158 | + /** | ||
159 | + * 通过id查询 | ||
160 | + * | ||
161 | + * @param id | ||
162 | + * @return | ||
163 | + */ | ||
164 | + //@AutoLog(value = "medical_records_copy-通过id查询") | ||
165 | + @ApiOperation(value="medical_records_copy-通过id查询", notes="medical_records_copy-通过id查询") | ||
166 | + @GetMapping(value = "/queryById") | ||
167 | + public Result<MedicalRecordsCopy> queryById(@RequestParam(name="id",required=true) String id) { | ||
168 | + MedicalRecordsCopy medicalRecordsCopy = medicalRecordsCopyService.getById(id); | ||
169 | + if(medicalRecordsCopy==null) { | ||
170 | + return Result.error("未找到对应数据"); | ||
171 | + } | ||
172 | + return Result.OK(medicalRecordsCopy); | ||
173 | + } | ||
174 | + | ||
175 | + /** | ||
176 | + * 导出excel | ||
177 | + * | ||
178 | + * @param request | ||
179 | + * @param medicalRecordsCopy | ||
180 | + */ | ||
181 | +// @RequiresPermissions("claims:medical_records_copy:exportXls") | ||
182 | + @RequestMapping(value = "/exportXls") | ||
183 | + public ModelAndView exportXls(HttpServletRequest request, MedicalRecordsCopy medicalRecordsCopy) { | ||
184 | + return super.exportXls(request, medicalRecordsCopy, MedicalRecordsCopy.class, "medical_records_copy"); | ||
185 | + } | ||
186 | + | ||
187 | + /** | ||
188 | + * 通过excel导入数据 | ||
189 | + * | ||
190 | + * @param request | ||
191 | + * @param response | ||
192 | + * @return | ||
193 | + */ | ||
194 | +// @RequiresPermissions("claims:medical_records_copy:importExcel") | ||
195 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | ||
196 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
197 | + return super.importExcel(request, response, MedicalRecordsCopy.class); | ||
198 | + } | ||
199 | + | ||
200 | + /** | ||
201 | + * 通过id分页查询 | ||
202 | + * 有字典翻译 | ||
203 | + * | ||
204 | + * @param id | ||
205 | + * @return | ||
206 | + */ | ||
207 | + //@AutoLog(value = "medical_records_copy-通过id分页查询") | ||
208 | + @ApiOperation(value="medical_records_copy-通过id分页查询", notes="medical_records_copy-通过id分页查询") | ||
209 | + @GetMapping(value = "/queryOne") | ||
210 | + public Result<?> queryOne(@RequestParam(name="id",required=true) String id) { | ||
211 | + QueryWrapper<MedicalRecordsCopy> queryWrapper = new QueryWrapper<>(); | ||
212 | + queryWrapper.eq("id", id); | ||
213 | + Page<MedicalRecordsCopy> page = new Page<MedicalRecordsCopy>(1, 10); | ||
214 | + IPage<MedicalRecordsCopy> pageList = medicalRecordsCopyService.page(page, queryWrapper); | ||
215 | + if (pageList.getRecords() != null && !pageList.getRecords().isEmpty()) { | ||
216 | + for (MedicalRecordsCopy record : pageList.getRecords()) { | ||
217 | + if (StringUtils.isNotBlank(record.getRegion())) { | ||
218 | + String[] split = record.getRegion().split(","); | ||
219 | + if (split.length > 2) { | ||
220 | + List<Map<String, String>> region = weixinUserService.getRegion(split[2]); | ||
221 | + record.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName")); | ||
222 | + } | ||
223 | + } | ||
224 | + } | ||
225 | + } | ||
226 | + return Result.OK(pageList); | ||
227 | + } | ||
228 | + | ||
229 | + /** | ||
230 | + * 审批 | ||
231 | + * | ||
232 | + * @param medicalRecordsCopy | ||
233 | + * @return | ||
234 | + */ | ||
235 | + @AutoLog(value = "medical_records_copy-审批") | ||
236 | + @ApiOperation(value="medical_records_copy-审批", notes="medical_records_copy-审批") | ||
237 | +// @RequiresPermissions("claims:medical_records_copy:approve") | ||
238 | + @RequestMapping(value = "/approve", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
239 | + public Result<String> approve(@RequestBody MedicalRecordsCopy medicalRecordsCopy) { | ||
240 | + MedicalRecordsCopy update = new MedicalRecordsCopy(); | ||
241 | + update.setId(medicalRecordsCopy.getId()); | ||
242 | + update.setStatus("2"); | ||
243 | + medicalRecordsCopyService.updateById(update); | ||
244 | + return Result.OK("审批成功!"); | ||
245 | + } | ||
246 | + | ||
247 | + /** | ||
248 | + * 确认 | ||
249 | + * | ||
250 | + * @param medicalRecordsCopy | ||
251 | + * @return | ||
252 | + */ | ||
253 | + @AutoLog(value = "medical_records_copy-确认") | ||
254 | + @Transactional | ||
255 | + @ApiOperation(value="medical_records_copy-确认", notes="medical_records_copy-确认") | ||
256 | +// @RequiresPermissions("claims:medical_records_copy:confirm") | ||
257 | + @RequestMapping(value = "/confirm", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
258 | + public Result<String> confirm(@RequestBody MedicalRecordsCopy medicalRecordsCopy) throws Exception { | ||
259 | + MedicalRecordsCopy update = new MedicalRecordsCopy(); | ||
260 | + update.setId(medicalRecordsCopy.getId()); | ||
261 | + update.setStatus("3"); | ||
262 | + update.setCopyingNumber(medicalRecordsCopy.getCopyingNumber()); | ||
263 | + medicalRecordsCopyService.updateById(update); | ||
264 | + // 生成账单 | ||
265 | + Boolean initPay = medicalRecordsCopyPayService.confirmUpdatePay(medicalRecordsCopy); | ||
266 | + if (initPay) { | ||
267 | + return Result.OK("确认成功!"); | ||
268 | + } else { | ||
269 | + throw new RuntimeException("确认失败!"); | ||
270 | + } | ||
271 | + } | ||
272 | + | ||
273 | +} |
1 | +package org.jeecg.modules.claims.controller; | ||
2 | + | ||
3 | +import java.util.Arrays; | ||
4 | +import java.util.List; | ||
5 | +import java.util.Map; | ||
6 | +import java.util.stream.Collectors; | ||
7 | +import java.io.IOException; | ||
8 | +import java.io.UnsupportedEncodingException; | ||
9 | +import java.net.URLDecoder; | ||
10 | +import javax.servlet.http.HttpServletRequest; | ||
11 | +import javax.servlet.http.HttpServletResponse; | ||
12 | +import org.jeecg.common.api.vo.Result; | ||
13 | +import org.jeecg.common.system.query.QueryGenerator; | ||
14 | +import org.jeecg.common.util.oConvertUtils; | ||
15 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay; | ||
16 | +import org.jeecg.modules.claims.service.IMedicalRecordsCopyPayService; | ||
17 | + | ||
18 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
19 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
20 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
21 | +import lombok.extern.slf4j.Slf4j; | ||
22 | + | ||
23 | +import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
24 | +import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
25 | +import org.jeecgframework.poi.excel.entity.ExportParams; | ||
26 | +import org.jeecgframework.poi.excel.entity.ImportParams; | ||
27 | +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
28 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
29 | +import org.springframework.beans.factory.annotation.Autowired; | ||
30 | +import org.springframework.web.bind.annotation.*; | ||
31 | +import org.springframework.web.multipart.MultipartFile; | ||
32 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
33 | +import org.springframework.web.servlet.ModelAndView; | ||
34 | +import com.alibaba.fastjson.JSON; | ||
35 | +import io.swagger.annotations.Api; | ||
36 | +import io.swagger.annotations.ApiOperation; | ||
37 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
38 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
39 | + | ||
40 | + /** | ||
41 | + * @Description: medical_records_copy_pay | ||
42 | + * @Author: jeecg-boot | ||
43 | + * @Date: 2025-01-24 | ||
44 | + * @Version: V1.0 | ||
45 | + */ | ||
46 | +@Api(tags="medical_records_copy_pay") | ||
47 | +@RestController | ||
48 | +@RequestMapping("/claims/medicalRecordsCopyPay") | ||
49 | +@Slf4j | ||
50 | +public class MedicalRecordsCopyPayController extends JeecgController<MedicalRecordsCopyPay, IMedicalRecordsCopyPayService> { | ||
51 | + @Autowired | ||
52 | + private IMedicalRecordsCopyPayService medicalRecordsCopyPayService; | ||
53 | + | ||
54 | + /** | ||
55 | + * 分页列表查询 | ||
56 | + * | ||
57 | + * @param medicalRecordsCopyPay | ||
58 | + * @param pageNo | ||
59 | + * @param pageSize | ||
60 | + * @param req | ||
61 | + * @return | ||
62 | + */ | ||
63 | + //@AutoLog(value = "medical_records_copy_pay-分页列表查询") | ||
64 | + @ApiOperation(value="medical_records_copy_pay-分页列表查询", notes="medical_records_copy_pay-分页列表查询") | ||
65 | + @GetMapping(value = "/list") | ||
66 | + public Result<IPage<MedicalRecordsCopyPay>> queryPageList(MedicalRecordsCopyPay medicalRecordsCopyPay, | ||
67 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
68 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
69 | + HttpServletRequest req) { | ||
70 | + QueryWrapper<MedicalRecordsCopyPay> queryWrapper = QueryGenerator.initQueryWrapper(medicalRecordsCopyPay, req.getParameterMap()); | ||
71 | + Page<MedicalRecordsCopyPay> page = new Page<MedicalRecordsCopyPay>(pageNo, pageSize); | ||
72 | + IPage<MedicalRecordsCopyPay> pageList = medicalRecordsCopyPayService.page(page, queryWrapper); | ||
73 | + return Result.OK(pageList); | ||
74 | + } | ||
75 | + | ||
76 | + /** | ||
77 | + * 添加 | ||
78 | + * | ||
79 | + * @param medicalRecordsCopyPay | ||
80 | + * @return | ||
81 | + */ | ||
82 | + @AutoLog(value = "medical_records_copy_pay-添加") | ||
83 | + @ApiOperation(value="medical_records_copy_pay-添加", notes="medical_records_copy_pay-添加") | ||
84 | +// @RequiresPermissions("claims:medical_records_copy_pay:add") | ||
85 | + @PostMapping(value = "/add") | ||
86 | + public Result<String> add(@RequestBody MedicalRecordsCopyPay medicalRecordsCopyPay) { | ||
87 | + medicalRecordsCopyPayService.save(medicalRecordsCopyPay); | ||
88 | + return Result.OK("添加成功!"); | ||
89 | + } | ||
90 | + | ||
91 | + /** | ||
92 | + * 编辑 | ||
93 | + * | ||
94 | + * @param medicalRecordsCopyPay | ||
95 | + * @return | ||
96 | + */ | ||
97 | + @AutoLog(value = "medical_records_copy_pay-编辑") | ||
98 | + @ApiOperation(value="medical_records_copy_pay-编辑", notes="medical_records_copy_pay-编辑") | ||
99 | +// @RequiresPermissions("claims:medical_records_copy_pay:edit") | ||
100 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
101 | + public Result<String> edit(@RequestBody MedicalRecordsCopyPay medicalRecordsCopyPay) { | ||
102 | + medicalRecordsCopyPayService.updateById(medicalRecordsCopyPay); | ||
103 | + return Result.OK("编辑成功!"); | ||
104 | + } | ||
105 | + | ||
106 | + /** | ||
107 | + * 通过id删除 | ||
108 | + * | ||
109 | + * @param id | ||
110 | + * @return | ||
111 | + */ | ||
112 | + @AutoLog(value = "medical_records_copy_pay-通过id删除") | ||
113 | + @ApiOperation(value="medical_records_copy_pay-通过id删除", notes="medical_records_copy_pay-通过id删除") | ||
114 | +// @RequiresPermissions("claims:medical_records_copy_pay:delete") | ||
115 | + @DeleteMapping(value = "/delete") | ||
116 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | ||
117 | + medicalRecordsCopyPayService.removeById(id); | ||
118 | + return Result.OK("删除成功!"); | ||
119 | + } | ||
120 | + | ||
121 | + /** | ||
122 | + * 批量删除 | ||
123 | + * | ||
124 | + * @param ids | ||
125 | + * @return | ||
126 | + */ | ||
127 | + @AutoLog(value = "medical_records_copy_pay-批量删除") | ||
128 | + @ApiOperation(value="medical_records_copy_pay-批量删除", notes="medical_records_copy_pay-批量删除") | ||
129 | +// @RequiresPermissions("claims:medical_records_copy_pay:deleteBatch") | ||
130 | + @DeleteMapping(value = "/deleteBatch") | ||
131 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
132 | + this.medicalRecordsCopyPayService.removeByIds(Arrays.asList(ids.split(","))); | ||
133 | + return Result.OK("批量删除成功!"); | ||
134 | + } | ||
135 | + | ||
136 | + /** | ||
137 | + * 通过id查询 | ||
138 | + * | ||
139 | + * @param id | ||
140 | + * @return | ||
141 | + */ | ||
142 | + //@AutoLog(value = "medical_records_copy_pay-通过id查询") | ||
143 | + @ApiOperation(value="medical_records_copy_pay-通过id查询", notes="medical_records_copy_pay-通过id查询") | ||
144 | + @GetMapping(value = "/queryById") | ||
145 | + public Result<MedicalRecordsCopyPay> queryById(@RequestParam(name="id",required=true) String id) { | ||
146 | + MedicalRecordsCopyPay medicalRecordsCopyPay = medicalRecordsCopyPayService.getById(id); | ||
147 | + if(medicalRecordsCopyPay==null) { | ||
148 | + return Result.error("未找到对应数据"); | ||
149 | + } | ||
150 | + return Result.OK(medicalRecordsCopyPay); | ||
151 | + } | ||
152 | + | ||
153 | + /** | ||
154 | + * 导出excel | ||
155 | + * | ||
156 | + * @param request | ||
157 | + * @param medicalRecordsCopyPay | ||
158 | + */ | ||
159 | +// @RequiresPermissions("claims:medical_records_copy_pay:exportXls") | ||
160 | + @RequestMapping(value = "/exportXls") | ||
161 | + public ModelAndView exportXls(HttpServletRequest request, MedicalRecordsCopyPay medicalRecordsCopyPay) { | ||
162 | + return super.exportXls(request, medicalRecordsCopyPay, MedicalRecordsCopyPay.class, "medical_records_copy_pay"); | ||
163 | + } | ||
164 | + | ||
165 | + /** | ||
166 | + * 通过excel导入数据 | ||
167 | + * | ||
168 | + * @param request | ||
169 | + * @param response | ||
170 | + * @return | ||
171 | + */ | ||
172 | +// @RequiresPermissions("claims:medical_records_copy_pay:importExcel") | ||
173 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | ||
174 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
175 | + return super.importExcel(request, response, MedicalRecordsCopyPay.class); | ||
176 | + } | ||
177 | + | ||
178 | +} |
@@ -86,6 +86,19 @@ public class InstitutionMedical implements Serializable { | @@ -86,6 +86,19 @@ public class InstitutionMedical implements Serializable { | ||
86 | @ApiModelProperty(value = "状态") | 86 | @ApiModelProperty(value = "状态") |
87 | @Dict(dicCode = "ins_status") | 87 | @Dict(dicCode = "ins_status") |
88 | private java.lang.String status; | 88 | private java.lang.String status; |
89 | + /**描述*/ | ||
90 | + @Excel(name = "描述", width = 15) | ||
91 | + @ApiModelProperty(value = "描述") | ||
92 | + private java.lang.String description; | ||
93 | + /**照片*/ | ||
94 | + @Excel(name = "照片", width = 15) | ||
95 | + @ApiModelProperty(value = "照片") | ||
96 | + private java.lang.String photo; | ||
97 | + /**等级*/ | ||
98 | + @Excel(name = "等级", width = 15, dicCode = "institution_medical_level") | ||
99 | + @Dict(dicCode = "institution_medical_level") | ||
100 | + @ApiModelProperty(value = "等级") | ||
101 | + private java.lang.String level; | ||
89 | 102 | ||
90 | /**手机号码完整性*/ | 103 | /**手机号码完整性*/ |
91 | private String phoneValid; | 104 | private String phoneValid; |
1 | +package org.jeecg.modules.claims.entity; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.io.UnsupportedEncodingException; | ||
5 | +import java.util.Date; | ||
6 | +import java.math.BigDecimal; | ||
7 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
8 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
9 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
10 | +import com.baomidou.mybatisplus.annotation.TableLogic; | ||
11 | +import lombok.Data; | ||
12 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
13 | +import org.springframework.format.annotation.DateTimeFormat; | ||
14 | +import org.jeecgframework.poi.excel.annotation.Excel; | ||
15 | +import org.jeecg.common.aspect.annotation.Dict; | ||
16 | +import io.swagger.annotations.ApiModel; | ||
17 | +import io.swagger.annotations.ApiModelProperty; | ||
18 | +import lombok.EqualsAndHashCode; | ||
19 | +import lombok.experimental.Accessors; | ||
20 | + | ||
21 | +/** | ||
22 | + * @Description: institution_medical_price | ||
23 | + * @Author: jeecg-boot | ||
24 | + * @Date: 2025-01-24 | ||
25 | + * @Version: V1.0 | ||
26 | + */ | ||
27 | +@Data | ||
28 | +@TableName("institution_medical_price") | ||
29 | +@Accessors(chain = true) | ||
30 | +@EqualsAndHashCode(callSuper = false) | ||
31 | +@ApiModel(value="institution_medical_price对象", description="institution_medical_price") | ||
32 | +public class InstitutionMedicalPrice implements Serializable { | ||
33 | + private static final long serialVersionUID = 1L; | ||
34 | + | ||
35 | + /**id*/ | ||
36 | + @TableId(type = IdType.ASSIGN_ID) | ||
37 | + @ApiModelProperty(value = "id") | ||
38 | + private java.lang.String id; | ||
39 | + /**医疗机构*/ | ||
40 | + @Excel(name = "医疗机构", width = 15, dictTable = "institution_medical", dicText = "institution_name", dicCode = "id") | ||
41 | + @Dict(dictTable = "institution_medical", dicText = "institution_name", dicCode = "id") | ||
42 | + @ApiModelProperty(value = "医疗机构") | ||
43 | + private java.lang.String institutionId; | ||
44 | + /**复印单价(分/份)*/ | ||
45 | + @Excel(name = "复印单价(分/份)", width = 15) | ||
46 | + @ApiModelProperty(value = "复印单价(分/份)") | ||
47 | + private java.lang.Integer copyPrice; | ||
48 | + /**快递价格(分)*/ | ||
49 | + @Excel(name = "快递价格(分)", width = 15) | ||
50 | + @ApiModelProperty(value = "快递价格(分)") | ||
51 | + private java.lang.Integer postPrice; | ||
52 | + /**复印张数单价(分/张)*/ | ||
53 | + @Excel(name = "复印张数单价(分/张)", width = 15) | ||
54 | + @ApiModelProperty(value = "复印张数单价(分/张)") | ||
55 | + private java.lang.Integer paperPrice; | ||
56 | + /**状态*/ | ||
57 | + @Excel(name = "状态", width = 15) | ||
58 | + @ApiModelProperty(value = "状态") | ||
59 | + private java.lang.String status; | ||
60 | + /**创建人*/ | ||
61 | + @ApiModelProperty(value = "创建人") | ||
62 | + private java.lang.String createBy; | ||
63 | + /**创建日期*/ | ||
64 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
65 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
66 | + @ApiModelProperty(value = "创建日期") | ||
67 | + private java.util.Date createTime; | ||
68 | + /**更新人*/ | ||
69 | + @ApiModelProperty(value = "更新人") | ||
70 | + private java.lang.String updateBy; | ||
71 | + /**更新日期*/ | ||
72 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
73 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
74 | + @ApiModelProperty(value = "更新日期") | ||
75 | + private java.util.Date updateTime; | ||
76 | + /**删除标记*/ | ||
77 | + @Excel(name = "删除标记", width = 15) | ||
78 | + @ApiModelProperty(value = "删除标记") | ||
79 | + @TableLogic | ||
80 | + private java.lang.String delFlag; | ||
81 | +} |
1 | +package org.jeecg.modules.claims.entity; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.io.UnsupportedEncodingException; | ||
5 | +import java.util.Date; | ||
6 | +import java.math.BigDecimal; | ||
7 | + | ||
8 | +import com.baomidou.mybatisplus.annotation.*; | ||
9 | +import lombok.Data; | ||
10 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
11 | +import org.springframework.format.annotation.DateTimeFormat; | ||
12 | +import org.jeecgframework.poi.excel.annotation.Excel; | ||
13 | +import org.jeecg.common.aspect.annotation.Dict; | ||
14 | +import io.swagger.annotations.ApiModel; | ||
15 | +import io.swagger.annotations.ApiModelProperty; | ||
16 | +import lombok.EqualsAndHashCode; | ||
17 | +import lombok.experimental.Accessors; | ||
18 | + | ||
19 | +/** | ||
20 | + * @Description: medical_records_copy | ||
21 | + * @Author: jeecg-boot | ||
22 | + * @Date: 2025-01-24 | ||
23 | + * @Version: V1.0 | ||
24 | + */ | ||
25 | +@Data | ||
26 | +@TableName("medical_records_copy") | ||
27 | +@Accessors(chain = true) | ||
28 | +@EqualsAndHashCode(callSuper = false) | ||
29 | +@ApiModel(value="medical_records_copy对象", description="medical_records_copy") | ||
30 | +public class MedicalRecordsCopy implements Serializable { | ||
31 | + private static final long serialVersionUID = 1L; | ||
32 | + | ||
33 | + /**id*/ | ||
34 | + @TableId(type = IdType.ASSIGN_ID) | ||
35 | + @ApiModelProperty(value = "id") | ||
36 | + private java.lang.String id; | ||
37 | + /**医疗机构*/ | ||
38 | + @Excel(name = "医疗机构", width = 15, dictTable = "institution_medical", dicText = "institution_name", dicCode = "id") | ||
39 | + @Dict(dictTable = "institution_medical", dicText = "institution_name", dicCode = "id") | ||
40 | + @ApiModelProperty(value = "医疗机构") | ||
41 | + private java.lang.String institutionId; | ||
42 | + /**与患者关系*/ | ||
43 | + @Excel(name = "与患者关系", width = 15, dicCode = "medical_relationship_patients") | ||
44 | + @Dict(dicCode = "medical_relationship_patients") | ||
45 | + @ApiModelProperty(value = "与患者关系") | ||
46 | + private java.lang.String relationshipPatients; | ||
47 | + /**患者姓名*/ | ||
48 | + @Excel(name = "患者姓名", width = 15) | ||
49 | + @ApiModelProperty(value = "患者姓名") | ||
50 | + private java.lang.String patientName; | ||
51 | + /**证件类型*/ | ||
52 | + @Excel(name = "证件类型", width = 15, dicCode = "medical_card_type") | ||
53 | + @Dict(dicCode = "medical_card_type") | ||
54 | + @ApiModelProperty(value = "证件类型") | ||
55 | + private java.lang.String cardType; | ||
56 | + /**身份证号*/ | ||
57 | + @Excel(name = "身份证号", width = 15) | ||
58 | + @ApiModelProperty(value = "身份证号") | ||
59 | + private java.lang.String cardNo; | ||
60 | + /**患者身份证人像照*/ | ||
61 | + @Excel(name = "患者身份证人像照", width = 15) | ||
62 | + @ApiModelProperty(value = "患者身份证人像照") | ||
63 | + private java.lang.String cardPicture; | ||
64 | + /**患者身份证国徽照*/ | ||
65 | + @Excel(name = "患者身份证国徽照", width = 15) | ||
66 | + @ApiModelProperty(value = "患者身份证国徽照") | ||
67 | + private java.lang.String cardFront; | ||
68 | + /**患者身份证手持照*/ | ||
69 | + @Excel(name = "患者身份证手持照", width = 15) | ||
70 | + @ApiModelProperty(value = "患者身份证手持照") | ||
71 | + private java.lang.String cardHolding; | ||
72 | + /**代办身份证人像照*/ | ||
73 | + @Excel(name = "代办身份证人像照", width = 15) | ||
74 | + @ApiModelProperty(value = "代办身份证人像照") | ||
75 | + private java.lang.String agentCardPicture; | ||
76 | + /**代办身份证国徽照*/ | ||
77 | + @Excel(name = "代办身份证国徽照", width = 15) | ||
78 | + @ApiModelProperty(value = "代办身份证国徽照") | ||
79 | + private java.lang.String agentCardFront; | ||
80 | + /**代办身份证手持照*/ | ||
81 | + @Excel(name = "代办身份证手持照", width = 15) | ||
82 | + @ApiModelProperty(value = "代办身份证手持照") | ||
83 | + private java.lang.String agentCardHolding; | ||
84 | + /**代办人联系方式*/ | ||
85 | + @Excel(name = "代办人联系方式", width = 15) | ||
86 | + @ApiModelProperty(value = "代办人联系方式") | ||
87 | + private java.lang.String agentPhone; | ||
88 | + /**住院号*/ | ||
89 | + @Excel(name = "住院号", width = 15) | ||
90 | + @ApiModelProperty(value = "住院号") | ||
91 | + private java.lang.String hospitalNo; | ||
92 | + /**科室*/ | ||
93 | + @Excel(name = "科室", width = 15) | ||
94 | + @ApiModelProperty(value = "科室") | ||
95 | + private java.lang.String department; | ||
96 | + /**复印用途*/ | ||
97 | + @Excel(name = "复印用途", width = 15, dicCode = "medical_copying_purposes") | ||
98 | + @Dict(dicCode = "medical_copying_purposes") | ||
99 | + @ApiModelProperty(value = "复印用途") | ||
100 | + private java.lang.String copyingPurposes; | ||
101 | + /**份数*/ | ||
102 | + @Excel(name = "份数", width = 15) | ||
103 | + @ApiModelProperty(value = "份数") | ||
104 | + private java.lang.String copyingNumber; | ||
105 | + /**总张数*/ | ||
106 | + @Excel(name = "总张数", width = 15) | ||
107 | + @ApiModelProperty(value = "总张数") | ||
108 | + private java.lang.String sheetsNumber; | ||
109 | + /**订单状态*/ | ||
110 | + @Excel(name = "订单状态", width = 15, dicCode = "medical_order_status") | ||
111 | + @Dict(dicCode = "medical_order_status") | ||
112 | + @ApiModelProperty(value = "订单状态") | ||
113 | + private java.lang.String status; | ||
114 | + /**收件人*/ | ||
115 | + @Excel(name = "收件人", width = 15) | ||
116 | + @ApiModelProperty(value = "收件人") | ||
117 | + private java.lang.String addressee; | ||
118 | + /**联系电话*/ | ||
119 | + @Excel(name = "联系电话", width = 15) | ||
120 | + @ApiModelProperty(value = "联系电话") | ||
121 | + private java.lang.String contactNumber; | ||
122 | + /**地区*/ | ||
123 | + @Excel(name = "地区", width = 15) | ||
124 | + @ApiModelProperty(value = "地区") | ||
125 | + private java.lang.String region; | ||
126 | + /**详细地址*/ | ||
127 | + @Excel(name = "详细地址", width = 15) | ||
128 | + @ApiModelProperty(value = "详细地址") | ||
129 | + private java.lang.String fullAddress; | ||
130 | + /**创建人*/ | ||
131 | + @ApiModelProperty(value = "创建人") | ||
132 | + private java.lang.String createBy; | ||
133 | + /**创建日期*/ | ||
134 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
135 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
136 | + @ApiModelProperty(value = "创建日期") | ||
137 | + private java.util.Date createTime; | ||
138 | + /**更新人*/ | ||
139 | + @ApiModelProperty(value = "更新人") | ||
140 | + private java.lang.String updateBy; | ||
141 | + /**更新日期*/ | ||
142 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
143 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
144 | + @ApiModelProperty(value = "更新日期") | ||
145 | + private java.util.Date updateTime; | ||
146 | + /**删除标记*/ | ||
147 | + @Excel(name = "删除标记", width = 15) | ||
148 | + @ApiModelProperty(value = "删除标记") | ||
149 | + @TableLogic | ||
150 | + private java.lang.String delFlag; | ||
151 | + | ||
152 | + /**医疗机构*/ | ||
153 | + @TableField(exist = false) | ||
154 | + @ApiModelProperty(value = "医疗机构") | ||
155 | + private java.lang.String institutionName; | ||
156 | + /**总复印费(分)*/ | ||
157 | + @TableField(exist = false) | ||
158 | + @ApiModelProperty(value = "总复印费(分)") | ||
159 | + private BigDecimal copyPrice; | ||
160 | + /**总快递费(分)*/ | ||
161 | + @TableField(exist = false) | ||
162 | + @ApiModelProperty(value = "总快递费(分)") | ||
163 | + private BigDecimal postPrice; | ||
164 | + /**总费用(分)*/ | ||
165 | + @TableField(exist = false) | ||
166 | + @ApiModelProperty(value = "总费用(分)") | ||
167 | + private BigDecimal totalPrice; | ||
168 | + /**预付费用(分)*/ | ||
169 | + @TableField(exist = false) | ||
170 | + @ApiModelProperty(value = "预付费用(分)") | ||
171 | + private BigDecimal prepaidPrice; | ||
172 | + /**补缴费用(分)*/ | ||
173 | + @TableField(exist = false) | ||
174 | + @ApiModelProperty(value = "补缴费用(分)") | ||
175 | + private BigDecimal additionalPayPrice; | ||
176 | + | ||
177 | +} |
1 | +package org.jeecg.modules.claims.entity; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.io.UnsupportedEncodingException; | ||
5 | +import java.util.Date; | ||
6 | +import java.math.BigDecimal; | ||
7 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
8 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
9 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
10 | +import com.baomidou.mybatisplus.annotation.TableLogic; | ||
11 | +import lombok.Data; | ||
12 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
13 | +import org.springframework.format.annotation.DateTimeFormat; | ||
14 | +import org.jeecgframework.poi.excel.annotation.Excel; | ||
15 | +import org.jeecg.common.aspect.annotation.Dict; | ||
16 | +import io.swagger.annotations.ApiModel; | ||
17 | +import io.swagger.annotations.ApiModelProperty; | ||
18 | +import lombok.EqualsAndHashCode; | ||
19 | +import lombok.experimental.Accessors; | ||
20 | + | ||
21 | +/** | ||
22 | + * @Description: medical_records_copy_pay | ||
23 | + * @Author: jeecg-boot | ||
24 | + * @Date: 2025-01-24 | ||
25 | + * @Version: V1.0 | ||
26 | + */ | ||
27 | +@Data | ||
28 | +@TableName("medical_records_copy_pay") | ||
29 | +@Accessors(chain = true) | ||
30 | +@EqualsAndHashCode(callSuper = false) | ||
31 | +@ApiModel(value="medical_records_copy_pay对象", description="medical_records_copy_pay") | ||
32 | +public class MedicalRecordsCopyPay implements Serializable { | ||
33 | + private static final long serialVersionUID = 1L; | ||
34 | + | ||
35 | + /**id*/ | ||
36 | + @TableId(type = IdType.ASSIGN_ID) | ||
37 | + @ApiModelProperty(value = "id") | ||
38 | + private java.lang.String id; | ||
39 | + /**订单id*/ | ||
40 | + @Excel(name = "订单id", width = 15, dictTable = "medical_records_copy", dicText = "id", dicCode = "id") | ||
41 | + @Dict(dictTable = "medical_records_copy", dicText = "id", dicCode = "id") | ||
42 | + @ApiModelProperty(value = "订单id") | ||
43 | + private java.lang.String orderId; | ||
44 | + /**预付复印费(分)*/ | ||
45 | + @Excel(name = "预付复印费(分)", width = 15) | ||
46 | + @ApiModelProperty(value = "预付复印费(分)") | ||
47 | + private java.lang.Integer copyPayPrice; | ||
48 | + /**预付快递费(分)*/ | ||
49 | + @Excel(name = "预付快递费(分)", width = 15) | ||
50 | + @ApiModelProperty(value = "预付快递费(分)") | ||
51 | + private java.lang.Integer postPayPrice; | ||
52 | + /**预付费用(分)*/ | ||
53 | + @Excel(name = "预付费用(分)", width = 15) | ||
54 | + @ApiModelProperty(value = "预付费用(分)") | ||
55 | + private java.lang.Integer prepaidPrice; | ||
56 | + /**总复印费(分)*/ | ||
57 | + @Excel(name = "总复印费(分)", width = 15) | ||
58 | + @ApiModelProperty(value = "总复印费(分)") | ||
59 | + private java.lang.Integer copyPrice; | ||
60 | + /**总快递费(分)*/ | ||
61 | + @Excel(name = "总快递费(分)", width = 15) | ||
62 | + @ApiModelProperty(value = "总快递费(分)") | ||
63 | + private java.lang.Integer postPrice; | ||
64 | + /**总费用(分)*/ | ||
65 | + @Excel(name = "总费用(分)", width = 15) | ||
66 | + @ApiModelProperty(value = "总费用(分)") | ||
67 | + private java.lang.Integer totalPrice; | ||
68 | + /**补缴费用(分)*/ | ||
69 | + @Excel(name = "补缴费用(分)", width = 15) | ||
70 | + @ApiModelProperty(value = "补缴费用(分)") | ||
71 | + private java.lang.Integer additionalPayPrice; | ||
72 | + /**订单状态*/ | ||
73 | + @Excel(name = "订单状态", width = 15) | ||
74 | + @ApiModelProperty(value = "订单状态") | ||
75 | + private java.lang.String status; | ||
76 | + /**创建人*/ | ||
77 | + @ApiModelProperty(value = "创建人") | ||
78 | + private java.lang.String createBy; | ||
79 | + /**创建日期*/ | ||
80 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
81 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
82 | + @ApiModelProperty(value = "创建日期") | ||
83 | + private java.util.Date createTime; | ||
84 | + /**更新人*/ | ||
85 | + @ApiModelProperty(value = "更新人") | ||
86 | + private java.lang.String updateBy; | ||
87 | + /**更新日期*/ | ||
88 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
89 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
90 | + @ApiModelProperty(value = "更新日期") | ||
91 | + private java.util.Date updateTime; | ||
92 | + /**删除标记*/ | ||
93 | + @Excel(name = "删除标记", width = 15) | ||
94 | + @ApiModelProperty(value = "删除标记") | ||
95 | + @TableLogic | ||
96 | + private java.lang.String delFlag; | ||
97 | +} |
1 | +package org.jeecg.modules.claims.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | +import org.jeecg.modules.claims.entity.InstitutionMedicalPrice; | ||
7 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | + | ||
9 | +/** | ||
10 | + * @Description: institution_medical_price | ||
11 | + * @Author: jeecg-boot | ||
12 | + * @Date: 2025-01-24 | ||
13 | + * @Version: V1.0 | ||
14 | + */ | ||
15 | +public interface InstitutionMedicalPriceMapper extends BaseMapper<InstitutionMedicalPrice> { | ||
16 | + | ||
17 | +} |
1 | +package org.jeecg.modules.claims.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
7 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | + | ||
9 | +/** | ||
10 | + * @Description: medical_records_copy | ||
11 | + * @Author: jeecg-boot | ||
12 | + * @Date: 2025-01-24 | ||
13 | + * @Version: V1.0 | ||
14 | + */ | ||
15 | +public interface MedicalRecordsCopyMapper extends BaseMapper<MedicalRecordsCopy> { | ||
16 | + | ||
17 | +} |
1 | +package org.jeecg.modules.claims.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay; | ||
7 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | + | ||
9 | +/** | ||
10 | + * @Description: medical_records_copy_pay | ||
11 | + * @Author: jeecg-boot | ||
12 | + * @Date: 2025-01-24 | ||
13 | + * @Version: V1.0 | ||
14 | + */ | ||
15 | +public interface MedicalRecordsCopyPayMapper extends BaseMapper<MedicalRecordsCopyPay> { | ||
16 | + | ||
17 | +} |
1 | +package org.jeecg.modules.claims.service; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
4 | +import org.jeecg.modules.claims.entity.InstitutionMedicalPrice; | ||
5 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
6 | + | ||
7 | +/** | ||
8 | + * @Description: institution_medical_price | ||
9 | + * @Author: jeecg-boot | ||
10 | + * @Date: 2025-01-24 | ||
11 | + * @Version: V1.0 | ||
12 | + */ | ||
13 | +public interface IInstitutionMedicalPriceService extends IService<InstitutionMedicalPrice> { | ||
14 | + | ||
15 | + InstitutionMedicalPrice getPrice(String institutionId); | ||
16 | +} |
1 | +package org.jeecg.modules.claims.service; | ||
2 | + | ||
3 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
4 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay; | ||
5 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
6 | + | ||
7 | +/** | ||
8 | + * @Description: medical_records_copy_pay | ||
9 | + * @Author: jeecg-boot | ||
10 | + * @Date: 2025-01-24 | ||
11 | + * @Version: V1.0 | ||
12 | + */ | ||
13 | +public interface IMedicalRecordsCopyPayService extends IService<MedicalRecordsCopyPay> { | ||
14 | + | ||
15 | + Boolean submitInitPay(MedicalRecordsCopy medicalRecordsCopy); | ||
16 | + | ||
17 | + Boolean confirmUpdatePay(MedicalRecordsCopy medicalRecordsCopy); | ||
18 | + | ||
19 | + void getPayInfo(MedicalRecordsCopy medicalRecordsCopy); | ||
20 | +} |
1 | +package org.jeecg.modules.claims.service; | ||
2 | + | ||
3 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
4 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | + | ||
6 | +/** | ||
7 | + * @Description: medical_records_copy | ||
8 | + * @Author: jeecg-boot | ||
9 | + * @Date: 2025-01-24 | ||
10 | + * @Version: V1.0 | ||
11 | + */ | ||
12 | +public interface IMedicalRecordsCopyService extends IService<MedicalRecordsCopy> { | ||
13 | + | ||
14 | +} |
@@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | ||
5 | import org.jeecg.modules.claims.entity.HisVisinfoList; | 5 | import org.jeecg.modules.claims.entity.HisVisinfoList; |
6 | import org.jeecg.modules.claims.mapper.HisVisinfoListMapper; | 6 | import org.jeecg.modules.claims.mapper.HisVisinfoListMapper; |
7 | import org.jeecg.modules.claims.service.IHisVisinfoListService; | 7 | import org.jeecg.modules.claims.service.IHisVisinfoListService; |
8 | +import org.springframework.beans.factory.annotation.Value; | ||
8 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
9 | 10 | ||
10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -20,6 +21,9 @@ import java.util.*; | @@ -20,6 +21,9 @@ import java.util.*; | ||
20 | */ | 21 | */ |
21 | @Service | 22 | @Service |
22 | public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper, HisVisinfoList> implements IHisVisinfoListService { | 23 | public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper, HisVisinfoList> implements IHisVisinfoListService { |
24 | + | ||
25 | + @Value("${jeecg.encrypFlag}") | ||
26 | + private Boolean encrypFlag; | ||
23 | //理赔金额求和 | 27 | //理赔金额求和 |
24 | @Override | 28 | @Override |
25 | public Double sumCalAmnt() { | 29 | public Double sumCalAmnt() { |
@@ -85,7 +89,7 @@ public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper, | @@ -85,7 +89,7 @@ public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper, | ||
85 | public void changeFieldQuery(HisVisinfoList hisVisinfoList) { | 89 | public void changeFieldQuery(HisVisinfoList hisVisinfoList) { |
86 | //解密证件号,验证完成性 | 90 | //解密证件号,验证完成性 |
87 | String userCodeCipher = hisVisinfoList.getUserCode(); | 91 | String userCodeCipher = hisVisinfoList.getUserCode(); |
88 | - if (StringUtils.isNotEmpty(userCodeCipher)) { | 92 | + if (encrypFlag && StringUtils.isNotEmpty(userCodeCipher)) { |
89 | try { | 93 | try { |
90 | //解密 | 94 | //解密 |
91 | String userCode = EncryptionUtils.symmetricDecryptData(userCodeCipher); | 95 | String userCode = EncryptionUtils.symmetricDecryptData(userCodeCipher); |
@@ -108,7 +112,7 @@ public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper, | @@ -108,7 +112,7 @@ public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper, | ||
108 | public void changeFieldEncryp(HisVisinfoList hisVisinfoList) { | 112 | public void changeFieldEncryp(HisVisinfoList hisVisinfoList) { |
109 | //加密证件号 | 113 | //加密证件号 |
110 | String userCode = hisVisinfoList.getUserCode(); | 114 | String userCode = hisVisinfoList.getUserCode(); |
111 | - if (StringUtils.isNotEmpty(userCode)){ | 115 | + if (encrypFlag && StringUtils.isNotEmpty(userCode)){ |
112 | //加密(一次加密) | 116 | //加密(一次加密) |
113 | try { | 117 | try { |
114 | String s = EncryptionUtils.encryptionData(userCode); | 118 | String s = EncryptionUtils.encryptionData(userCode); |
@@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | ||
5 | import org.jeecg.modules.claims.entity.InsApiLog; | 5 | import org.jeecg.modules.claims.entity.InsApiLog; |
6 | import org.jeecg.modules.claims.mapper.InsApiLogMapper; | 6 | import org.jeecg.modules.claims.mapper.InsApiLogMapper; |
7 | import org.jeecg.modules.claims.service.IInsApiLogService; | 7 | import org.jeecg.modules.claims.service.IInsApiLogService; |
8 | +import org.springframework.beans.factory.annotation.Value; | ||
8 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
9 | 10 | ||
10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -18,6 +19,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | @@ -18,6 +19,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
18 | @Service | 19 | @Service |
19 | public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog> implements IInsApiLogService { | 20 | public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog> implements IInsApiLogService { |
20 | 21 | ||
22 | + | ||
23 | + @Value("${jeecg.encrypFlag}") | ||
24 | + private Boolean encrypFlag; | ||
25 | + | ||
21 | //日志没有修改的,都是新建的,故只需覆写保存方法 | 26 | //日志没有修改的,都是新建的,故只需覆写保存方法 |
22 | //覆写保存方法 | 27 | //覆写保存方法 |
23 | @Override | 28 | @Override |
@@ -34,7 +39,7 @@ public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog | @@ -34,7 +39,7 @@ public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog | ||
34 | public void changeFieldQuery(InsApiLog insApiLog) { | 39 | public void changeFieldQuery(InsApiLog insApiLog) { |
35 | //解密返回参数,验证完成性 | 40 | //解密返回参数,验证完成性 |
36 | String returnParams = insApiLog.getReturnParams(); | 41 | String returnParams = insApiLog.getReturnParams(); |
37 | - if (StringUtils.isNotEmpty(returnParams)) { | 42 | + if (encrypFlag && StringUtils.isNotEmpty(returnParams)) { |
38 | try { | 43 | try { |
39 | // //解密 | 44 | // //解密 |
40 | // String userCode = EncryptionUtils.symmetricDecryptData(returnParams); | 45 | // String userCode = EncryptionUtils.symmetricDecryptData(returnParams); |
@@ -57,7 +62,7 @@ public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog | @@ -57,7 +62,7 @@ public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog | ||
57 | public void changeFieldEncryp(InsApiLog insApiLog) { | 62 | public void changeFieldEncryp(InsApiLog insApiLog) { |
58 | //加密证件号 | 63 | //加密证件号 |
59 | String returnParams = insApiLog.getReturnParams(); | 64 | String returnParams = insApiLog.getReturnParams(); |
60 | - if (StringUtils.isNotEmpty(returnParams)){ | 65 | + if (encrypFlag && StringUtils.isNotEmpty(returnParams)){ |
61 | // //加密(一次加密) | 66 | // //加密(一次加密) |
62 | // try { | 67 | // try { |
63 | // String s = EncryptionUtils.encryptionData(returnParams); | 68 | // String s = EncryptionUtils.encryptionData(returnParams); |
@@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | ||
5 | import org.jeecg.modules.claims.entity.InsInsurePerson; | 5 | import org.jeecg.modules.claims.entity.InsInsurePerson; |
6 | import org.jeecg.modules.claims.mapper.InsInsurePersonMapper; | 6 | import org.jeecg.modules.claims.mapper.InsInsurePersonMapper; |
7 | import org.jeecg.modules.claims.service.IInsInsurePersonService; | 7 | import org.jeecg.modules.claims.service.IInsInsurePersonService; |
8 | +import org.springframework.beans.factory.annotation.Value; | ||
8 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
9 | 10 | ||
10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -18,12 +19,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | @@ -18,12 +19,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
18 | @Service | 19 | @Service |
19 | public class InsInsurePersonServiceImpl extends ServiceImpl<InsInsurePersonMapper, InsInsurePerson> implements IInsInsurePersonService { | 20 | public class InsInsurePersonServiceImpl extends ServiceImpl<InsInsurePersonMapper, InsInsurePerson> implements IInsInsurePersonService { |
20 | 21 | ||
22 | + @Value("${jeecg.encrypFlag}") | ||
23 | + private Boolean encrypFlag; | ||
24 | + | ||
21 | //字段解密 | 25 | //字段解密 |
22 | @Override | 26 | @Override |
23 | public void changeFieldQuery(InsInsurePerson insInsurePerson) { | 27 | public void changeFieldQuery(InsInsurePerson insInsurePerson) { |
24 | //解密证件号,验证完成性 | 28 | //解密证件号,验证完成性 |
25 | String userCodeCipher = insInsurePerson.getUserCode(); | 29 | String userCodeCipher = insInsurePerson.getUserCode(); |
26 | - if (StringUtils.isNotEmpty(userCodeCipher)) { | 30 | + if (encrypFlag && StringUtils.isNotEmpty(userCodeCipher)) { |
27 | try { | 31 | try { |
28 | //解密 | 32 | //解密 |
29 | String userCode = EncryptionUtils.symmetricDecryptData(userCodeCipher); | 33 | String userCode = EncryptionUtils.symmetricDecryptData(userCodeCipher); |
@@ -45,7 +49,7 @@ public class InsInsurePersonServiceImpl extends ServiceImpl<InsInsurePersonMappe | @@ -45,7 +49,7 @@ public class InsInsurePersonServiceImpl extends ServiceImpl<InsInsurePersonMappe | ||
45 | public void changeFieldEncryp(InsInsurePerson insInsurePerson) { | 49 | public void changeFieldEncryp(InsInsurePerson insInsurePerson) { |
46 | //加密证件号 | 50 | //加密证件号 |
47 | String userCode = insInsurePerson.getUserCode(); | 51 | String userCode = insInsurePerson.getUserCode(); |
48 | - if (StringUtils.isNotEmpty(userCode)){ | 52 | + if (encrypFlag && StringUtils.isNotEmpty(userCode)){ |
49 | //加密(一次加密) | 53 | //加密(一次加密) |
50 | try { | 54 | try { |
51 | String s = EncryptionUtils.encryptionData(userCode); | 55 | String s = EncryptionUtils.encryptionData(userCode); |
@@ -16,6 +16,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | @@ -16,6 +16,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | ||
16 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; | 16 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; |
17 | import org.jeecg.modules.system.service.ISysUserService; | 17 | import org.jeecg.modules.system.service.ISysUserService; |
18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
19 | +import org.springframework.beans.factory.annotation.Value; | ||
19 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
20 | 21 | ||
21 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 22 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -33,6 +34,9 @@ import java.util.List; | @@ -33,6 +34,9 @@ import java.util.List; | ||
33 | @Service | 34 | @Service |
34 | public class InstitutionInsurancePersonServiceImpl extends ServiceImpl<InstitutionInsurancePersonMapper, InstitutionInsurancePerson> implements IInstitutionInsurancePersonService { | 35 | public class InstitutionInsurancePersonServiceImpl extends ServiceImpl<InstitutionInsurancePersonMapper, InstitutionInsurancePerson> implements IInstitutionInsurancePersonService { |
35 | 36 | ||
37 | + | ||
38 | + @Value("${jeecg.encrypFlag}") | ||
39 | + private Boolean encrypFlag; | ||
36 | @Autowired | 40 | @Autowired |
37 | private ISysUserService sysUserService; | 41 | private ISysUserService sysUserService; |
38 | 42 | ||
@@ -197,7 +201,7 @@ public class InstitutionInsurancePersonServiceImpl extends ServiceImpl<Instituti | @@ -197,7 +201,7 @@ public class InstitutionInsurancePersonServiceImpl extends ServiceImpl<Instituti | ||
197 | public void changeFieldQuery(InstitutionInsurancePerson institutionInsurancePerson) { | 201 | public void changeFieldQuery(InstitutionInsurancePerson institutionInsurancePerson) { |
198 | //解密手机号,验证完成性 | 202 | //解密手机号,验证完成性 |
199 | String phoneCipher = institutionInsurancePerson.getPhone(); | 203 | String phoneCipher = institutionInsurancePerson.getPhone(); |
200 | - if (StringUtils.isNotEmpty(phoneCipher)) { | 204 | + if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) { |
201 | try { | 205 | try { |
202 | //解密 | 206 | //解密 |
203 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); | 207 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); |
@@ -18,6 +18,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | @@ -18,6 +18,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | ||
18 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; | 18 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; |
19 | import org.jeecg.modules.system.service.ISysUserService; | 19 | import org.jeecg.modules.system.service.ISysUserService; |
20 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
21 | +import org.springframework.beans.factory.annotation.Value; | ||
21 | import org.springframework.stereotype.Service; | 22 | import org.springframework.stereotype.Service; |
22 | 23 | ||
23 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 24 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -36,6 +37,9 @@ import java.util.List; | @@ -36,6 +37,9 @@ import java.util.List; | ||
36 | public class InstitutionInsuranceServiceImpl extends ServiceImpl<InstitutionInsuranceMapper, InstitutionInsurance> implements IInstitutionInsuranceService { | 37 | public class InstitutionInsuranceServiceImpl extends ServiceImpl<InstitutionInsuranceMapper, InstitutionInsurance> implements IInstitutionInsuranceService { |
37 | 38 | ||
38 | 39 | ||
40 | + @Value("${jeecg.encrypFlag}") | ||
41 | + private Boolean encrypFlag; | ||
42 | + | ||
39 | @Autowired | 43 | @Autowired |
40 | private ISysUserService sysUserService; | 44 | private ISysUserService sysUserService; |
41 | 45 | ||
@@ -216,7 +220,7 @@ public class InstitutionInsuranceServiceImpl extends ServiceImpl<InstitutionInsu | @@ -216,7 +220,7 @@ public class InstitutionInsuranceServiceImpl extends ServiceImpl<InstitutionInsu | ||
216 | public void changeFieldQuery(InstitutionInsurance institutionInsurance) { | 220 | public void changeFieldQuery(InstitutionInsurance institutionInsurance) { |
217 | //解密手机号,验证完成性 | 221 | //解密手机号,验证完成性 |
218 | String phoneCipher = institutionInsurance.getPhone(); | 222 | String phoneCipher = institutionInsurance.getPhone(); |
219 | - if (StringUtils.isNotEmpty(phoneCipher)) { | 223 | + if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) { |
220 | try { | 224 | try { |
221 | //解密 | 225 | //解密 |
222 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); | 226 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); |
@@ -16,6 +16,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | @@ -16,6 +16,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | ||
16 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; | 16 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; |
17 | import org.jeecg.modules.system.service.ISysUserService; | 17 | import org.jeecg.modules.system.service.ISysUserService; |
18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
19 | +import org.springframework.beans.factory.annotation.Value; | ||
19 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
20 | 21 | ||
21 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 22 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -33,6 +34,9 @@ import java.util.List; | @@ -33,6 +34,9 @@ import java.util.List; | ||
33 | @Service | 34 | @Service |
34 | public class InstitutionMedicalPersonServiceImpl extends ServiceImpl<InstitutionMedicalPersonMapper, InstitutionMedicalPerson> implements IInstitutionMedicalPersonService { | 35 | public class InstitutionMedicalPersonServiceImpl extends ServiceImpl<InstitutionMedicalPersonMapper, InstitutionMedicalPerson> implements IInstitutionMedicalPersonService { |
35 | 36 | ||
37 | + | ||
38 | + @Value("${jeecg.encrypFlag}") | ||
39 | + private Boolean encrypFlag; | ||
36 | @Autowired | 40 | @Autowired |
37 | private ISysUserService sysUserService; | 41 | private ISysUserService sysUserService; |
38 | 42 | ||
@@ -202,7 +206,7 @@ public class InstitutionMedicalPersonServiceImpl extends ServiceImpl<Institution | @@ -202,7 +206,7 @@ public class InstitutionMedicalPersonServiceImpl extends ServiceImpl<Institution | ||
202 | public void changeFieldQuery(InstitutionMedicalPerson institutionMedicalPerson) { | 206 | public void changeFieldQuery(InstitutionMedicalPerson institutionMedicalPerson) { |
203 | //解密手机号,验证完成性 | 207 | //解密手机号,验证完成性 |
204 | String phoneCipher = institutionMedicalPerson.getPhone(); | 208 | String phoneCipher = institutionMedicalPerson.getPhone(); |
205 | - if (StringUtils.isNotEmpty(phoneCipher)) { | 209 | + if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) { |
206 | try { | 210 | try { |
207 | //解密 | 211 | //解密 |
208 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); | 212 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); |
1 | +package org.jeecg.modules.claims.service.impl; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
4 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
5 | +import org.jeecg.common.system.vo.DictModel; | ||
6 | +import org.jeecg.modules.claims.entity.InstitutionMedicalPrice; | ||
7 | +import org.jeecg.modules.claims.mapper.InstitutionMedicalPriceMapper; | ||
8 | +import org.jeecg.modules.claims.service.IInstitutionMedicalPriceService; | ||
9 | +import org.jeecg.modules.system.service.ISysDictService; | ||
10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
11 | +import org.springframework.stereotype.Service; | ||
12 | + | ||
13 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
14 | + | ||
15 | +import java.math.BigDecimal; | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +/** | ||
19 | + * @Description: institution_medical_price | ||
20 | + * @Author: jeecg-boot | ||
21 | + * @Date: 2025-01-24 | ||
22 | + * @Version: V1.0 | ||
23 | + */ | ||
24 | +@Service | ||
25 | +public class InstitutionMedicalPriceServiceImpl extends ServiceImpl<InstitutionMedicalPriceMapper, InstitutionMedicalPrice> implements IInstitutionMedicalPriceService { | ||
26 | + @Autowired | ||
27 | + private ISysDictService sysDictService; | ||
28 | + | ||
29 | + @Override | ||
30 | + public InstitutionMedicalPrice getPrice(String institutionId) { QueryWrapper<InstitutionMedicalPrice> queryWrapper = new QueryWrapper<>(); | ||
31 | + queryWrapper.eq("institution_id", institutionId); | ||
32 | + List<InstitutionMedicalPrice> list = list(queryWrapper); | ||
33 | + Integer medicalCopy; | ||
34 | + Integer medicalPost; | ||
35 | + Integer medicalPaper; | ||
36 | + if (list.isEmpty()) { | ||
37 | + List<DictModel> medicalPostFee = sysDictService.getDictItems("medical_post_fee"); | ||
38 | + List<DictModel> medicalCopyFee = sysDictService.getDictItems("medical_copy_fee"); | ||
39 | + medicalCopy = Integer.parseInt(medicalCopyFee.get(0).getValue()); | ||
40 | + medicalPost = Integer.parseInt(medicalPostFee.get(0).getValue()); | ||
41 | + medicalPaper = null; | ||
42 | + } else { | ||
43 | + InstitutionMedicalPrice institutionMedicalPrice = list.get(0); | ||
44 | + medicalCopy = institutionMedicalPrice.getCopyPrice(); | ||
45 | + medicalPost = institutionMedicalPrice.getPostPrice(); | ||
46 | + medicalPaper = institutionMedicalPrice.getPaperPrice(); | ||
47 | + } | ||
48 | + InstitutionMedicalPrice result = new InstitutionMedicalPrice(); | ||
49 | + result.setCopyPrice(medicalCopy); | ||
50 | + result.setPostPrice(medicalPost); | ||
51 | + result.setPaperPrice(medicalPaper); | ||
52 | + return result; | ||
53 | + } | ||
54 | +} |
@@ -18,6 +18,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | @@ -18,6 +18,7 @@ import org.jeecg.modules.system.entity.SysUserRole; | ||
18 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; | 18 | import org.jeecg.modules.system.mapper.SysUserRoleMapper; |
19 | import org.jeecg.modules.system.service.ISysUserService; | 19 | import org.jeecg.modules.system.service.ISysUserService; |
20 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
21 | +import org.springframework.beans.factory.annotation.Value; | ||
21 | import org.springframework.stereotype.Service; | 22 | import org.springframework.stereotype.Service; |
22 | 23 | ||
23 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 24 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -36,6 +37,9 @@ import java.util.List; | @@ -36,6 +37,9 @@ import java.util.List; | ||
36 | public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedicalMapper, InstitutionMedical> implements IInstitutionMedicalService { | 37 | public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedicalMapper, InstitutionMedical> implements IInstitutionMedicalService { |
37 | 38 | ||
38 | 39 | ||
40 | + @Value("${jeecg.encrypFlag}") | ||
41 | + private Boolean encrypFlag; | ||
42 | + | ||
39 | @Autowired | 43 | @Autowired |
40 | private ISysUserService sysUserService; | 44 | private ISysUserService sysUserService; |
41 | 45 | ||
@@ -209,7 +213,7 @@ public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedica | @@ -209,7 +213,7 @@ public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedica | ||
209 | public void changeFieldQuery(InstitutionMedical institutionMedical) { | 213 | public void changeFieldQuery(InstitutionMedical institutionMedical) { |
210 | //解密手机号,验证完成性 | 214 | //解密手机号,验证完成性 |
211 | String phoneCipher = institutionMedical.getPhone(); | 215 | String phoneCipher = institutionMedical.getPhone(); |
212 | - if (StringUtils.isNotEmpty(phoneCipher)) { | 216 | + if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) { |
213 | try { | 217 | try { |
214 | //解密 | 218 | //解密 |
215 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); | 219 | String phone = EncryptionUtils.symmetricDecryptData(phoneCipher); |
@@ -231,7 +235,7 @@ public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedica | @@ -231,7 +235,7 @@ public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedica | ||
231 | public void changeFieldEncryp(InstitutionMedical institutionMedical) { | 235 | public void changeFieldEncryp(InstitutionMedical institutionMedical) { |
232 | //加密手机号 | 236 | //加密手机号 |
233 | String phone = institutionMedical.getPhone(); | 237 | String phone = institutionMedical.getPhone(); |
234 | - if (StringUtils.isNotEmpty(phone)){ | 238 | + if (encrypFlag && StringUtils.isNotEmpty(phone)){ |
235 | //加密(一次加密) | 239 | //加密(一次加密) |
236 | try { | 240 | try { |
237 | String s = EncryptionUtils.encryptionData(phone); | 241 | String s = EncryptionUtils.encryptionData(phone); |
1 | +package org.jeecg.modules.claims.service.impl; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | +import org.jeecg.modules.claims.entity.InstitutionMedicalPrice; | ||
5 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
6 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay; | ||
7 | +import org.jeecg.modules.claims.mapper.MedicalRecordsCopyPayMapper; | ||
8 | +import org.jeecg.modules.claims.service.IInstitutionMedicalPriceService; | ||
9 | +import org.jeecg.modules.claims.service.IMedicalRecordsCopyPayService; | ||
10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
11 | +import org.springframework.stereotype.Service; | ||
12 | + | ||
13 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
14 | + | ||
15 | +import java.math.BigDecimal; | ||
16 | +import java.math.RoundingMode; | ||
17 | + | ||
18 | +/** | ||
19 | + * @Description: medical_records_copy_pay | ||
20 | + * @Author: jeecg-boot | ||
21 | + * @Date: 2025-01-24 | ||
22 | + * @Version: V1.0 | ||
23 | + */ | ||
24 | +@Service | ||
25 | +public class MedicalRecordsCopyPayServiceImpl extends ServiceImpl<MedicalRecordsCopyPayMapper, MedicalRecordsCopyPay> implements IMedicalRecordsCopyPayService { | ||
26 | + @Autowired | ||
27 | + private IInstitutionMedicalPriceService institutionMedicalPriceService; | ||
28 | + | ||
29 | + // app提交申请时确认预支付金额,生成账单 | ||
30 | + @Override | ||
31 | + public Boolean submitInitPay(MedicalRecordsCopy medicalRecordsCopy) { | ||
32 | + String orderId = medicalRecordsCopy.getId(); | ||
33 | + QueryWrapper<MedicalRecordsCopyPay> queryWrapper = new QueryWrapper<>(); | ||
34 | + queryWrapper.eq("order_id", orderId); | ||
35 | + MedicalRecordsCopyPay recordsCopyPay = getOne(queryWrapper); | ||
36 | + if (recordsCopyPay == null) { | ||
37 | + // 获取复印张数单价及快递价格 | ||
38 | + InstitutionMedicalPrice price = institutionMedicalPriceService.getPrice(medicalRecordsCopy.getInstitutionId()); | ||
39 | + Integer copyPricePre = price.getCopyPrice(); | ||
40 | + Integer copyPrice = copyPricePre * Integer.parseInt(medicalRecordsCopy.getCopyingNumber()); | ||
41 | + Integer postPrice = price.getPostPrice(); | ||
42 | + MedicalRecordsCopyPay save = new MedicalRecordsCopyPay(); | ||
43 | + save.setOrderId(orderId); | ||
44 | + save.setCopyPayPrice(copyPrice); | ||
45 | + save.setPostPayPrice(postPrice); | ||
46 | + save.setPrepaidPrice(copyPrice + postPrice); | ||
47 | + // todo 已支付、待支付 | ||
48 | + save.setStatus("2"); | ||
49 | + return save(save); | ||
50 | + } | ||
51 | + return false; | ||
52 | + } | ||
53 | + | ||
54 | + // web 确认申请时计算应付总金额,更新账单应补金额 | ||
55 | + @Override | ||
56 | + public Boolean confirmUpdatePay(MedicalRecordsCopy medicalRecordsCopy) { | ||
57 | + String orderId = medicalRecordsCopy.getId(); | ||
58 | + QueryWrapper<MedicalRecordsCopyPay> queryWrapper = new QueryWrapper<>(); | ||
59 | + queryWrapper.eq("order_id", orderId); | ||
60 | + MedicalRecordsCopyPay recordsCopyPay = getOne(queryWrapper); | ||
61 | + if (recordsCopyPay != null) { | ||
62 | + // 获取复印张数单价及快递价格 | ||
63 | + InstitutionMedicalPrice price = institutionMedicalPriceService.getPrice(medicalRecordsCopy.getInstitutionId()); | ||
64 | + Integer paperPrice = price.getPaperPrice(); | ||
65 | + if (paperPrice == null) { | ||
66 | + return false; | ||
67 | + } | ||
68 | + Integer copyPrice = paperPrice * Integer.parseInt(medicalRecordsCopy.getSheetsNumber()); | ||
69 | + Integer postPrice = price.getPostPrice(); | ||
70 | + Integer prepaidPrice = recordsCopyPay.getPrepaidPrice(); | ||
71 | + MedicalRecordsCopyPay update = new MedicalRecordsCopyPay(); | ||
72 | + update.setId(recordsCopyPay.getId()); | ||
73 | + update.setCopyPrice(copyPrice); | ||
74 | + update.setPostPrice(postPrice); | ||
75 | + update.setTotalPrice(copyPrice + postPrice); | ||
76 | + update.setAdditionalPayPrice(copyPrice + postPrice - prepaidPrice); | ||
77 | + if (copyPrice + postPrice - prepaidPrice == 0) { | ||
78 | + // 已补缴 | ||
79 | + update.setStatus("4"); | ||
80 | + } else { | ||
81 | + // 待补缴 | ||
82 | + update.setStatus("3"); | ||
83 | + } | ||
84 | + return updateById(update); | ||
85 | + } | ||
86 | + return false; | ||
87 | + } | ||
88 | + | ||
89 | + @Override | ||
90 | + public void getPayInfo(MedicalRecordsCopy medicalRecordsCopy) { | ||
91 | + QueryWrapper<MedicalRecordsCopyPay> payQueryWrapper = new QueryWrapper<>(); | ||
92 | + payQueryWrapper.eq("order_id", medicalRecordsCopy.getId()); | ||
93 | + MedicalRecordsCopyPay payInfo = getOne(payQueryWrapper); | ||
94 | + Integer copyPrice = payInfo.getCopyPrice(); | ||
95 | + Integer postPrice = payInfo.getPostPrice(); | ||
96 | + Integer totalPrice = payInfo.getTotalPrice(); | ||
97 | + Integer prepaidPrice = payInfo.getPrepaidPrice(); | ||
98 | + Integer additionalPayPrice = payInfo.getAdditionalPayPrice(); | ||
99 | + medicalRecordsCopy.setCopyPrice(new BigDecimal(copyPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
100 | + medicalRecordsCopy.setPostPrice(new BigDecimal(postPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
101 | + medicalRecordsCopy.setTotalPrice(new BigDecimal(totalPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
102 | + medicalRecordsCopy.setPrepaidPrice(new BigDecimal(prepaidPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
103 | + if (additionalPayPrice <= 0) { | ||
104 | + medicalRecordsCopy.setAdditionalPayPrice(new BigDecimal(0)); | ||
105 | + } else { | ||
106 | + medicalRecordsCopy.setAdditionalPayPrice(new BigDecimal(additionalPayPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
107 | + } | ||
108 | + } | ||
109 | +} |
1 | +package org.jeecg.modules.claims.service.impl; | ||
2 | + | ||
3 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
4 | +import org.jeecg.modules.claims.mapper.MedicalRecordsCopyMapper; | ||
5 | +import org.jeecg.modules.claims.service.IMedicalRecordsCopyService; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
9 | + | ||
10 | +/** | ||
11 | + * @Description: medical_records_copy | ||
12 | + * @Author: jeecg-boot | ||
13 | + * @Date: 2025-01-24 | ||
14 | + * @Version: V1.0 | ||
15 | + */ | ||
16 | +@Service | ||
17 | +public class MedicalRecordsCopyServiceImpl extends ServiceImpl<MedicalRecordsCopyMapper, MedicalRecordsCopy> implements IMedicalRecordsCopyService { | ||
18 | + | ||
19 | +} |
@@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils; | ||
5 | import org.jeecg.modules.gov.entity.HisMedicalInsuranceList; | 5 | import org.jeecg.modules.gov.entity.HisMedicalInsuranceList; |
6 | import org.jeecg.modules.gov.mapper.HisMedicalInsuranceListMapper; | 6 | import org.jeecg.modules.gov.mapper.HisMedicalInsuranceListMapper; |
7 | import org.jeecg.modules.gov.service.IHisMedicalInsuranceListService; | 7 | import org.jeecg.modules.gov.service.IHisMedicalInsuranceListService; |
8 | +import org.springframework.beans.factory.annotation.Value; | ||
8 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
9 | 10 | ||
10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -21,6 +22,8 @@ import java.util.*; | @@ -21,6 +22,8 @@ import java.util.*; | ||
21 | @Service | 22 | @Service |
22 | public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalInsuranceListMapper, HisMedicalInsuranceList> implements IHisMedicalInsuranceListService { | 23 | public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalInsuranceListMapper, HisMedicalInsuranceList> implements IHisMedicalInsuranceListService { |
23 | 24 | ||
25 | + @Value("${jeecg.encrypFlag}") | ||
26 | + private Boolean encrypFlag; | ||
24 | //用于首页计算医保统筹基金支出总额 | 27 | //用于首页计算医保统筹基金支出总额 |
25 | @Override | 28 | @Override |
26 | public double sumPoolFundAmount() { | 29 | public double sumPoolFundAmount() { |
@@ -94,7 +97,7 @@ public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalIn | @@ -94,7 +97,7 @@ public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalIn | ||
94 | 97 | ||
95 | //患者姓名 | 98 | //患者姓名 |
96 | String name = hisMedicalInsuranceList.getName(); | 99 | String name = hisMedicalInsuranceList.getName(); |
97 | - if (StringUtils.isNotEmpty(name)) { | 100 | + if (encrypFlag && StringUtils.isNotEmpty(name)) { |
98 | try { | 101 | try { |
99 | //解密 | 102 | //解密 |
100 | String nameCode = EncryptionUtils.symmetricDecryptData(name); | 103 | String nameCode = EncryptionUtils.symmetricDecryptData(name); |
@@ -113,7 +116,7 @@ public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalIn | @@ -113,7 +116,7 @@ public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalIn | ||
113 | 116 | ||
114 | //出院诊断 | 117 | //出院诊断 |
115 | String dischargeDisease = hisMedicalInsuranceList.getDischargeDisease(); | 118 | String dischargeDisease = hisMedicalInsuranceList.getDischargeDisease(); |
116 | - if (StringUtils.isNotEmpty(dischargeDisease)) { | 119 | + if (encrypFlag && StringUtils.isNotEmpty(dischargeDisease)) { |
117 | try { | 120 | try { |
118 | //解密 | 121 | //解密 |
119 | String dischargeDiseaseCode = EncryptionUtils.symmetricDecryptData(dischargeDisease); | 122 | String dischargeDiseaseCode = EncryptionUtils.symmetricDecryptData(dischargeDisease); |
1 | +package org.jeecg.modules.h5Api.controller; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
4 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
5 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
7 | +import io.swagger.annotations.Api; | ||
8 | +import io.swagger.annotations.ApiOperation; | ||
9 | +import lombok.extern.slf4j.Slf4j; | ||
10 | +import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken; | ||
11 | +import me.chanjar.weixin.common.error.WxErrorException; | ||
12 | +import me.chanjar.weixin.mp.api.WxMpService; | ||
13 | +import me.chanjar.weixin.mp.bean.result.WxMpUser; | ||
14 | +import org.apache.commons.lang3.StringUtils; | ||
15 | +import org.apache.shiro.SecurityUtils; | ||
16 | +import org.jeecg.common.api.vo.Result; | ||
17 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
18 | +import org.jeecg.common.system.query.QueryGenerator; | ||
19 | +import org.jeecg.common.system.vo.DictModel; | ||
20 | +import org.jeecg.common.system.vo.LoginUser; | ||
21 | +import org.jeecg.modules.claims.entity.*; | ||
22 | +import org.jeecg.modules.claims.service.*; | ||
23 | +import org.jeecg.modules.system.entity.SysDict; | ||
24 | +import org.jeecg.modules.system.entity.SysUser; | ||
25 | +import org.jeecg.modules.system.service.ISysDictService; | ||
26 | +import org.jeecg.modules.system.service.ISysUserService; | ||
27 | +import org.jeecg.modules.weixin.entity.WeixinUser; | ||
28 | +import org.jeecg.modules.weixin.service.IWeixinUserService; | ||
29 | +import org.jeecg.modules.weixin.util.WXUtils; | ||
30 | +import org.springframework.beans.BeanUtils; | ||
31 | +import org.springframework.beans.factory.annotation.Autowired; | ||
32 | +import org.springframework.beans.factory.annotation.Value; | ||
33 | +import org.springframework.transaction.annotation.Transactional; | ||
34 | +import org.springframework.web.bind.annotation.*; | ||
35 | +import org.springframework.web.servlet.ModelAndView; | ||
36 | + | ||
37 | +import javax.servlet.http.HttpServletRequest; | ||
38 | +import javax.servlet.http.HttpServletResponse; | ||
39 | +import java.io.IOException; | ||
40 | +import java.math.BigDecimal; | ||
41 | +import java.math.RoundingMode; | ||
42 | +import java.util.*; | ||
43 | + | ||
44 | +/** | ||
45 | + * @Description: app | ||
46 | + * @Author: jeecg-boot | ||
47 | + * @Date: 2025-01-23 | ||
48 | + * @Version: V1.0 | ||
49 | + */ | ||
50 | +@Api(tags="weixin_user") | ||
51 | +@RestController | ||
52 | +@RequestMapping("/app/api") | ||
53 | +@Slf4j | ||
54 | +public class AppController { | ||
55 | + | ||
56 | + @Autowired | ||
57 | + protected WxMpService wxMpService; | ||
58 | + @Autowired | ||
59 | + private IWeixinUserService weixinUserService; | ||
60 | + @Autowired | ||
61 | + private IInstitutionMedicalService institutionMedicalService; | ||
62 | + @Autowired | ||
63 | + private IInstitutionMedicalPriceService institutionMedicalPriceService; | ||
64 | + @Autowired | ||
65 | + private IMedicalRecordsCopyService medicalRecordsCopyService; | ||
66 | + @Autowired | ||
67 | + private IMedicalRecordsCopyPayService medicalRecordsCopyPayService; | ||
68 | + @Autowired | ||
69 | + private IHisVisinfoListService hisVisinfoListService; | ||
70 | + @Autowired | ||
71 | + private IInstitutionInsuranceService institutionInsuranceService; | ||
72 | + @Autowired | ||
73 | + private IInstitutionMedicalPersonService institutionMedicalPersonService; | ||
74 | + @Autowired | ||
75 | + private ISysUserService sysUserService; | ||
76 | + @Value("${wx.pay.appId}") | ||
77 | + private String appId; | ||
78 | + @Value("${wx.pay.notifyUrl}") | ||
79 | + private String notifyUrl; | ||
80 | + @Value("${wx.configs.appSecret}") | ||
81 | + private String appSecret; | ||
82 | + | ||
83 | + | ||
84 | + @RequestMapping(value = "/getWxCode", method = RequestMethod.POST) | ||
85 | + public String getWxCode(HttpServletResponse response, HttpServletRequest request) { | ||
86 | + String diningId = request.getParameter("diningId"); | ||
87 | + | ||
88 | + // 第一步:用户同意授权,获取code | ||
89 | + StringBuilder path = new StringBuilder(); | ||
90 | + //微信公众号appid | ||
91 | + path.append("https://open.weixin.qq.com/connect/oauth2/authorize?appid=").append(appId); | ||
92 | + //重定向的地址 | ||
93 | + path.append("&redirect_uri=").append(notifyUrl).append("/api/login").append("/getWxgzhUser"); | ||
94 | + if(diningId != null){ | ||
95 | + path.append("?diningId=").append(diningId); | ||
96 | + } | ||
97 | + path.append("&response_type=code"); | ||
98 | + /* | ||
99 | + *以snsapi_base为scope发起的网页授权,是用来获取进入页面的用户的openid的,并且是静默授权并自动跳转到回调页的。用户感知的就是直接进入了回调页(往往是业务页面) | ||
100 | + *以snsapi_userinfo为scope发起的网页授权,是用来获取用户的基本信息的。但这种授权需要用户手动同意,并且由于用户同意过,所以无须关注,就可在授权后获取该用户的基本信息。 | ||
101 | + */ | ||
102 | + path.append("&scope=").append("snsapi_userinfo"); | ||
103 | + path.append("&state=STATE"); | ||
104 | + path.append("&connect_redirect=1#wechat_redirect"); | ||
105 | + log.info("*****************"+path); | ||
106 | + try { | ||
107 | + response.sendRedirect(path.toString()); | ||
108 | + } catch (IOException e) { | ||
109 | + log.error("获取微信code失败: " + e.getMessage()); | ||
110 | + } | ||
111 | + //必须重定向,否则不能成功 | ||
112 | + return "redirect:" + path.toString(); | ||
113 | + } | ||
114 | + | ||
115 | + private String getOpenId(String code){ | ||
116 | + System.err.println("****************67"+code); | ||
117 | + WxOAuth2AccessToken accessToken; | ||
118 | + try { | ||
119 | + accessToken = wxMpService.getOAuth2Service().getAccessToken(code); | ||
120 | + | ||
121 | + WXUtils.putCache("OPENID",accessToken.getOpenId()); | ||
122 | + WxMpUser wxMpUser = wxMpService.getUserService().userInfo(accessToken.getOpenId()); | ||
123 | + | ||
124 | + WeixinUser weixinUser = new WeixinUser(); | ||
125 | + weixinUser.setOpenId(accessToken.getOpenId()); | ||
126 | + System.err.println(accessToken.getOpenId()); | ||
127 | + QueryWrapper<WeixinUser> queryWrapper = new QueryWrapper<>(); | ||
128 | + queryWrapper.eq("open_id",accessToken.getOpenId()); | ||
129 | + List<WeixinUser> weixinUserList = weixinUserService.list(queryWrapper); | ||
130 | + if(weixinUserList == null || weixinUserList.size() == 0){ | ||
131 | + if(wxMpUser != null){ | ||
132 | + weixinUser.setWeixinName(wxMpUser.getNickname()); | ||
133 | + weixinUser.setWeixinLogo(wxMpUser.getHeadImgUrl()); | ||
134 | + weixinUser.setDelFlag("0"); | ||
135 | + } | ||
136 | + weixinUserService.save(weixinUser); | ||
137 | + } | ||
138 | + System.err.println(weixinUser); | ||
139 | + | ||
140 | + return accessToken.getOpenId(); | ||
141 | + } catch (WxErrorException e) { | ||
142 | + e.printStackTrace(); | ||
143 | + log.error(e.getError().toString()); | ||
144 | + } | ||
145 | + | ||
146 | + return ""; | ||
147 | + } | ||
148 | + | ||
149 | + @RequestMapping("/getWxgzhUser") | ||
150 | + public ModelAndView getWxgzhApi(HttpServletRequest request) { | ||
151 | + String code = request.getParameter("code"); | ||
152 | + String openId = getOpenId(code); | ||
153 | + System.err.println("*************103***************"+openId); | ||
154 | + | ||
155 | +// String diningId = request.getParameter("diningId"); | ||
156 | +// if(diningId != null){ | ||
157 | +// return new ModelAndView("redirect:"+"https://canteenh5.yunalot.com/#/advice?diningId="+diningId+"&openId="+openId); | ||
158 | +// } | ||
159 | + | ||
160 | + return new ModelAndView("redirect:"+"https://canteenh5.yunalot.com/#/?openId="+openId); | ||
161 | + } | ||
162 | + | ||
163 | + | ||
164 | + /** | ||
165 | + * 医院列表分页列表查询 | ||
166 | + * | ||
167 | + * @param institutionMedical | ||
168 | + * @param pageNo | ||
169 | + * @param pageSize | ||
170 | + * @param req | ||
171 | + * @return | ||
172 | + */ | ||
173 | + //@AutoLog(value = "institution_medical-分页列表查询") | ||
174 | + @ApiOperation(value="institution_medical-分页列表查询", notes="institution_medical-分页列表查询") | ||
175 | + @GetMapping(value = "/institutionMedical/list") | ||
176 | + public Result<IPage<InstitutionMedical>> institutionMedicalList(InstitutionMedical institutionMedical, | ||
177 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
178 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
179 | + HttpServletRequest req) { | ||
180 | + QueryWrapper<InstitutionMedical> queryWrapper = QueryGenerator.initQueryWrapper(institutionMedical, req.getParameterMap()); | ||
181 | + | ||
182 | +// //获取当前用户 | ||
183 | +// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); | ||
184 | +// | ||
185 | +// //判断登录人员是否为医疗机构人员(前端通过权限配置,屏蔽保险机构人员访问该页面,故无需判断是否为保险公司人员) | ||
186 | +// String institutionId = sysUserService.getById(sysUser.getId()).getInstitutionId(); | ||
187 | +// //若institutionId为空,则为其他人员 | ||
188 | +// if (StringUtils.isNotEmpty(institutionId)){ | ||
189 | +// InstitutionMedical insurance = institutionMedicalService.getById(institutionId); | ||
190 | +// //若机构表中有该id,则为保险机构人员 | ||
191 | +// if (insurance != null){ | ||
192 | +// queryWrapper.eq("id",institutionId); | ||
193 | +// } | ||
194 | +// } | ||
195 | + | ||
196 | + Page<InstitutionMedical> page = new Page<>(pageNo, pageSize); | ||
197 | + IPage<InstitutionMedical> pageList = institutionMedicalService.page(page, queryWrapper); | ||
198 | + | ||
199 | + if(pageList == null) { | ||
200 | + return Result.error("未找到对应数据"); | ||
201 | + } | ||
202 | + List<InstitutionMedical> records = pageList.getRecords(); | ||
203 | + //解密显示 | ||
204 | + for (InstitutionMedical medical:records){ | ||
205 | + institutionMedicalService.changeFieldQuery(medical); | ||
206 | + } | ||
207 | + | ||
208 | + return Result.OK(pageList); | ||
209 | + } | ||
210 | + | ||
211 | + /** | ||
212 | + * 获取province | ||
213 | + * | ||
214 | + * @return | ||
215 | + */ | ||
216 | + @RequestMapping(value = "/getProvince", method = RequestMethod.GET) | ||
217 | + public Result<?> getProvince() { | ||
218 | + List<Map<String, String>> province = weixinUserService.getProvince(); | ||
219 | + List<Map<String, String>> city = weixinUserService.getCity("110000"); | ||
220 | + List<Map<String, String>> area = weixinUserService.getArea("110100"); | ||
221 | + return Result.OK(Arrays.asList(province, city, area)); | ||
222 | + } | ||
223 | + | ||
224 | + /** | ||
225 | + * 获取city | ||
226 | + * | ||
227 | + * @param | ||
228 | + * @return | ||
229 | + */ | ||
230 | + @RequestMapping(value = "/getCity", method = RequestMethod.GET) | ||
231 | + public Result<?> getCity(@RequestParam(name="provinceCode",required=false) String provinceCode) { | ||
232 | + List<Map<String, String>> city = weixinUserService.getCity(provinceCode); | ||
233 | + return Result.OK(city); | ||
234 | + } | ||
235 | + | ||
236 | + /** | ||
237 | + * 获取area | ||
238 | + * | ||
239 | + * @return | ||
240 | + */ | ||
241 | + @RequestMapping(value = "/getArea", method = RequestMethod.GET) | ||
242 | + public Result<?> getArea(@RequestParam(name="cityCode",required=false) String cityCode) { | ||
243 | + List<Map<String, String>> area = weixinUserService.getArea(cityCode); | ||
244 | + return Result.OK(area); | ||
245 | + } | ||
246 | + | ||
247 | + /** | ||
248 | + * 获取price | ||
249 | + * | ||
250 | + * @return | ||
251 | + */ | ||
252 | + @RequestMapping(value = "/getPrice", method = RequestMethod.GET) | ||
253 | + public Result<?> getPrice(@RequestParam(name="institutionId",required=false) String institutionId) { | ||
254 | + InstitutionMedicalPrice institutionMedicalPrice = institutionMedicalPriceService.getPrice(institutionId); | ||
255 | + JSONObject result = new JSONObject(); | ||
256 | + result.put("copyPrice", new BigDecimal(institutionMedicalPrice.getCopyPrice()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
257 | + result.put("postPrice", new BigDecimal(institutionMedicalPrice.getPostPrice()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
258 | + result.put("paperPrice", new BigDecimal(institutionMedicalPrice.getPaperPrice()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); | ||
259 | + return Result.OK(result); | ||
260 | + } | ||
261 | + | ||
262 | + /** | ||
263 | + * 预支付 | ||
264 | + * | ||
265 | + * @param medicalRecordsCopy | ||
266 | + * @return | ||
267 | + */ | ||
268 | + @AutoLog(value = "weixin_user-支付") | ||
269 | + @Transactional | ||
270 | + @ApiOperation(value="weixin_user-支付", notes="weixin_user-支付") | ||
271 | +// @RequiresPermissions("claims:medical_records_copy:add") | ||
272 | + @PostMapping(value = "/weixin/prepay") | ||
273 | + public Result<String> prepay(@RequestBody MedicalRecordsCopy medicalRecordsCopy) { | ||
274 | + Boolean prepay = weixinUserService.prepay(medicalRecordsCopy); | ||
275 | + medicalRecordsCopy.setStatus("0"); | ||
276 | + if (prepay) { | ||
277 | + medicalRecordsCopyPayService.submitInitPay(medicalRecordsCopy); | ||
278 | + medicalRecordsCopy.setStatus("1"); | ||
279 | + medicalRecordsCopyService.save(medicalRecordsCopy); | ||
280 | + return Result.OK("支付成功!"); | ||
281 | + } else { | ||
282 | + medicalRecordsCopyService.save(medicalRecordsCopy); | ||
283 | + return Result.error("支付失败!"); | ||
284 | + } | ||
285 | + } | ||
286 | + /** | ||
287 | + * 我的申请分页列表查询 | ||
288 | + * | ||
289 | + * @param medicalRecordsCopy | ||
290 | + * @param pageNo | ||
291 | + * @param pageSize | ||
292 | + * @param req | ||
293 | + * @return | ||
294 | + */ | ||
295 | + //@AutoLog(value = "medical_records_copy-分页列表查询") | ||
296 | + @ApiOperation(value="medical_records_copy-分页列表查询", notes="medical_records_copy-分页列表查询") | ||
297 | + @GetMapping(value = "/recordsCopy/list") | ||
298 | + public Result<IPage<MedicalRecordsCopy>> recordsCopyList(MedicalRecordsCopy medicalRecordsCopy, | ||
299 | + @RequestParam(name="openid", required = false) String openid, | ||
300 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
301 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
302 | + HttpServletRequest req) { | ||
303 | + QueryWrapper<MedicalRecordsCopy> queryWrapper = QueryGenerator.initQueryWrapper(medicalRecordsCopy, req.getParameterMap()); | ||
304 | + try { | ||
305 | + SysUser user = weixinUserService.getUserByOpenid(openid); | ||
306 | + queryWrapper.eq("create_by", user.getUsername()); | ||
307 | + } catch (Exception e) { | ||
308 | + return Result.error("身份信息有误!"); | ||
309 | + } | ||
310 | + Page<MedicalRecordsCopy> page = new Page<MedicalRecordsCopy>(pageNo, pageSize); | ||
311 | + IPage<MedicalRecordsCopy> pageList = medicalRecordsCopyService.page(page, queryWrapper); | ||
312 | + if (pageList.getRecords() != null && !pageList.getRecords().isEmpty()) { | ||
313 | + for (MedicalRecordsCopy record : pageList.getRecords()) { | ||
314 | + if (StringUtils.isNotBlank(record.getRegion())) { | ||
315 | + String[] split = record.getRegion().split(","); | ||
316 | + if (split.length > 2) { | ||
317 | + List<Map<String, String>> region = weixinUserService.getRegion(split[2]); | ||
318 | + record.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName")); | ||
319 | + } | ||
320 | + } | ||
321 | + try { | ||
322 | + medicalRecordsCopyPayService.getPayInfo(record); | ||
323 | + } catch (Exception e) { | ||
324 | + System.err.println(e.getMessage()); | ||
325 | + } | ||
326 | + } | ||
327 | + } | ||
328 | + return Result.OK(pageList); | ||
329 | + } | ||
330 | + /** | ||
331 | + * 我的申请详情 | ||
332 | + * | ||
333 | + * @param id | ||
334 | + * @return | ||
335 | + */ | ||
336 | + //@AutoLog(value = "medical_records_copy-详情") | ||
337 | + @ApiOperation(value="medical_records_copy-详情", notes="medical_records_copy-详情") | ||
338 | + @GetMapping(value = "/recordsCopy/queryById") | ||
339 | + public Result<MedicalRecordsCopy> recordsCopyQueryById(@RequestParam(name="id",required=true) String id) { | ||
340 | + MedicalRecordsCopy medicalRecordsCopy = medicalRecordsCopyService.getById(id); | ||
341 | + if(medicalRecordsCopy==null) { | ||
342 | + return Result.error("未找到对应数据"); | ||
343 | + } | ||
344 | + if (StringUtils.isNotBlank(medicalRecordsCopy.getRegion())) { | ||
345 | + String[] split = medicalRecordsCopy.getRegion().split(","); | ||
346 | + if (split.length > 2) { | ||
347 | + List<Map<String, String>> region = weixinUserService.getRegion(split[2]); | ||
348 | + medicalRecordsCopy.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName")); | ||
349 | + } | ||
350 | + } | ||
351 | + if (StringUtils.isNotBlank(medicalRecordsCopy.getInstitutionId())) { | ||
352 | + InstitutionMedical institutionMedical = institutionMedicalService.getById(medicalRecordsCopy.getInstitutionId()); | ||
353 | + if (institutionMedical != null) { | ||
354 | + medicalRecordsCopy.setInstitutionName(institutionMedical.getInstitutionName()); | ||
355 | + } | ||
356 | + } | ||
357 | + try { | ||
358 | + medicalRecordsCopyPayService.getPayInfo(medicalRecordsCopy); | ||
359 | + } catch (Exception e) { | ||
360 | + System.err.println(e.getMessage()); | ||
361 | + } | ||
362 | + return Result.OK(medicalRecordsCopy); | ||
363 | + } | ||
364 | + | ||
365 | + /** | ||
366 | + * 验证就诊流水号 | ||
367 | + * | ||
368 | + * @param medicalNum | ||
369 | + * @return | ||
370 | + */ | ||
371 | + //@AutoLog(value = "ins_claims_settle-验证就诊流水号") | ||
372 | + @ApiOperation(value="ins_claims_settle-验证就诊流水号", notes="ins_claims_settle-验证就诊流水号") | ||
373 | + @GetMapping(value = "/claimsSettle/validMedicalNum") | ||
374 | + public Result<?> validMedicalNum(@RequestParam(name="medicalNum",required=true) String medicalNum) { | ||
375 | + QueryWrapper<HisVisinfoList> queryWrapper = new QueryWrapper<>(); | ||
376 | + queryWrapper.eq("medical_num", medicalNum); | ||
377 | + List<HisVisinfoList> hisVisinfoList = hisVisinfoListService.list(queryWrapper); | ||
378 | + if (hisVisinfoList == null || hisVisinfoList.isEmpty()) { | ||
379 | + return Result.error("未找到就诊记录!"); | ||
380 | + } | ||
381 | + return Result.OK(hisVisinfoList.get(0)); | ||
382 | + } | ||
383 | + /** | ||
384 | + * 查询保险机构 | ||
385 | + * | ||
386 | + * @return | ||
387 | + */ | ||
388 | + //@AutoLog(value = "ins_claims_settle-查询保险机构") | ||
389 | + @ApiOperation(value="ins_claims_settle-查询保险机构", notes="ins_claims_settle-查询保险机构") | ||
390 | + @GetMapping(value = "/claimsSettle/getInsurance") | ||
391 | + public Result<?> getInsurance() { | ||
392 | + List<InstitutionInsurance> institutionInsuranceList = institutionInsuranceService.list(new QueryWrapper<>()); | ||
393 | + if (institutionInsuranceList == null || institutionInsuranceList.isEmpty()) { | ||
394 | + return Result.error("未找到就诊记录!"); | ||
395 | + } | ||
396 | + List<JSONObject> result = new ArrayList<>(); | ||
397 | + for (InstitutionInsurance i : institutionInsuranceList) { | ||
398 | + JSONObject jsonObject = new JSONObject(); | ||
399 | + jsonObject.put("id", i.getId()); | ||
400 | + jsonObject.put("name", i.getInstitutionName()); | ||
401 | + result.add(jsonObject); | ||
402 | + } | ||
403 | + return Result.OK(Collections.singletonList(result)); | ||
404 | + } | ||
405 | + /** | ||
406 | + * 查询理赔结算申请 | ||
407 | + * | ||
408 | + * @param hisVisinfoList | ||
409 | + * @param pageNo | ||
410 | + * @param pageSize | ||
411 | + * @param req | ||
412 | + * @return | ||
413 | + */ | ||
414 | + //@AutoLog(value = "ins_claims_settle-查询理赔结算申请") | ||
415 | + @ApiOperation(value="ins_claims_settle-查询理赔结算申请", notes="ins_claims_settle-查询理赔结算申请") | ||
416 | + @GetMapping(value = "/claimsSettle/list") | ||
417 | + public Result<IPage<HisVisinfoList>> claimsSettleList(HisVisinfoList hisVisinfoList, | ||
418 | + @RequestParam(name="openid", required = false) String openid, | ||
419 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
420 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
421 | + HttpServletRequest req) { | ||
422 | + QueryWrapper<HisVisinfoList> queryWrapper = QueryGenerator.initQueryWrapper(hisVisinfoList, req.getParameterMap()); | ||
423 | + //获取当前用户 | ||
424 | + try { | ||
425 | + SysUser user = weixinUserService.getUserByOpenid(openid); | ||
426 | + | ||
427 | + //判断登录人员是否为医院人员(前端通过权限配置,屏蔽保险机构人员访问该页面,故无需判断是否为保险公司人员) | ||
428 | + QueryWrapper<InstitutionMedicalPerson> mpQuery = new QueryWrapper<>(); | ||
429 | + mpQuery.eq("user_id",user.getId()); | ||
430 | + List<InstitutionMedicalPerson> mpList = institutionMedicalPersonService.list(mpQuery); | ||
431 | + //筛选登录用户所属医院的信息 | ||
432 | + if (!mpList.isEmpty()) { | ||
433 | + queryWrapper.eq("hospital_id",mpList.get(0).getInstitutionId()); | ||
434 | + } | ||
435 | + } catch (Exception e) { | ||
436 | + return Result.error("身份信息有误!"); | ||
437 | + } | ||
438 | + | ||
439 | + | ||
440 | + //排序 | ||
441 | + queryWrapper.orderByDesc("life_insure") | ||
442 | + .orderByDesc("leave_date") | ||
443 | + .orderByDesc("medical_type") | ||
444 | + .orderByDesc("treat_dept_name"); | ||
445 | + | ||
446 | + | ||
447 | + Page<HisVisinfoList> page = new Page<HisVisinfoList>(pageNo, pageSize); | ||
448 | + IPage<HisVisinfoList> pageList = hisVisinfoListService.page(page, queryWrapper); | ||
449 | + | ||
450 | + if(pageList == null) { | ||
451 | + return Result.error("未找到对应数据"); | ||
452 | + } | ||
453 | + List<HisVisinfoList> records = pageList.getRecords(); | ||
454 | + //解密显示 | ||
455 | + for (HisVisinfoList hisVisinfo:records){ | ||
456 | + hisVisinfoListService.changeFieldQuery(hisVisinfo); | ||
457 | + } | ||
458 | + | ||
459 | + return Result.OK(pageList); | ||
460 | + } | ||
461 | + /** | ||
462 | + * 查询理赔结算申请详情 | ||
463 | + * | ||
464 | + * @param id | ||
465 | + * @return | ||
466 | + */ | ||
467 | + //@AutoLog(value = "ins_claims_settle-查询理赔结算申请详情") | ||
468 | + @ApiOperation(value="ins_claims_settle-查询理赔结算申请详情", notes="ins_claims_settle-查询理赔结算申请详情") | ||
469 | + @GetMapping(value = "/claimsSettle/queryById") | ||
470 | + public Result<HisVisinfoList> claimsSettleQueryById(@RequestParam(name="id",required=true) String id) { | ||
471 | + HisVisinfoList hisVisinfoList = hisVisinfoListService.getById(id); | ||
472 | + if(hisVisinfoList==null) { | ||
473 | + return Result.error("未找到对应数据"); | ||
474 | + } | ||
475 | + //解密 | ||
476 | + hisVisinfoListService.changeFieldQuery(hisVisinfoList); | ||
477 | + return Result.OK(hisVisinfoList); | ||
478 | + } | ||
479 | + /** | ||
480 | + * 提交理赔结算申请 | ||
481 | + * | ||
482 | + * @return | ||
483 | + */ | ||
484 | + //@AutoLog(value = "ins_claims_settle-提交理赔结算申请") | ||
485 | + @ApiOperation(value="ins_claims_settle-提交理赔结算申请", notes="ins_claims_settle-提交理赔结算申请") | ||
486 | + @GetMapping(value = "/claimsSettle/submit") | ||
487 | + public Result<?> submitClaimsSettle(HisVisinfoList hisVisinfoList, | ||
488 | + @RequestParam(name="openid", required = false) String openid) { | ||
489 | + QueryWrapper<HisVisinfoList> queryWrapper = new QueryWrapper<>(); | ||
490 | + queryWrapper.eq("medical_num", hisVisinfoList.getMedicalNum()); | ||
491 | + List<HisVisinfoList> dbDatas = hisVisinfoListService.list(queryWrapper); | ||
492 | + HisVisinfoList dbData = dbDatas.get(0); | ||
493 | + HisVisinfoList update = new HisVisinfoList(); | ||
494 | + BeanUtils.copyProperties(dbData, update); | ||
495 | + | ||
496 | + update.setNameCode(hisVisinfoList.getNameCode()); | ||
497 | + update.setCredentialType(hisVisinfoList.getCredentialType()); | ||
498 | + update.setUserCode(hisVisinfoList.getUserCode()); | ||
499 | + update.setInsuranceId(hisVisinfoList.getInsuranceId()); | ||
500 | + update.setHospitalId(hisVisinfoList.getHospitalId()); | ||
501 | + update.setHospitalCode(hisVisinfoList.getHospitalCode()); | ||
502 | + update.setHospitalName(hisVisinfoList.getHospitalName()); | ||
503 | + | ||
504 | + // todo 初始状态 | ||
505 | + update.setInsSettleStatus("1"); | ||
506 | + hisVisinfoListService.updateById(update); | ||
507 | + return Result.OK(update); | ||
508 | + } | ||
509 | +} |
1 | +package org.jeecg.modules.h5Api.controller; | ||
2 | + | ||
3 | +import io.swagger.annotations.Api; | ||
4 | +import io.swagger.annotations.ApiImplicitParam; | ||
5 | +import io.swagger.annotations.ApiOperation; | ||
6 | +import io.swagger.annotations.Authorization; | ||
7 | +import lombok.extern.slf4j.Slf4j; | ||
8 | +import org.jeecg.common.api.vo.Result; | ||
9 | +import org.jeecg.common.constant.CommonConstant; | ||
10 | +import org.jeecg.common.util.CommonUtils; | ||
11 | +import org.jeecg.common.util.oConvertUtils; | ||
12 | +import org.jeecg.modules.h5Api.entity.H5Result; | ||
13 | +import org.jeecg.modules.h5Api.entity.ReturnCode; | ||
14 | +import org.springframework.beans.factory.annotation.Value; | ||
15 | +import org.springframework.util.AntPathMatcher; | ||
16 | +import org.springframework.util.FileCopyUtils; | ||
17 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
18 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
19 | +import org.springframework.web.bind.annotation.RestController; | ||
20 | +import org.springframework.web.multipart.MultipartFile; | ||
21 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
22 | +import org.springframework.web.servlet.HandlerMapping; | ||
23 | + | ||
24 | +import javax.servlet.http.HttpServletRequest; | ||
25 | +import javax.servlet.http.HttpServletResponse; | ||
26 | +import java.io.*; | ||
27 | + | ||
28 | +@Slf4j | ||
29 | +@Api(tags = "upload" ,description = "上传图片") | ||
30 | +@RestController | ||
31 | +@RequestMapping(value = "/app/api/img") | ||
32 | +public class UploadImgController { | ||
33 | + | ||
34 | + @Value(value = "${jeecg.path.upload}") | ||
35 | + private String uploadPath; | ||
36 | + /** | ||
37 | + * 本地:local minio:minio 阿里:alioss | ||
38 | + */ | ||
39 | + @Value(value="${jeecg.uploadType}") | ||
40 | + private String uploadType; | ||
41 | + | ||
42 | + @ApiOperation(value = "上传图片", notes = "上传图片", httpMethod = "POST") | ||
43 | + @ApiImplicitParam(paramType="header", name="authorization", value = "authorization", required = true,dataType = "string") | ||
44 | + @Authorization("authorization") | ||
45 | + @RequestMapping(value = "/upload",method = RequestMethod.POST) | ||
46 | + public String upload(HttpServletRequest request, HttpServletResponse response){ | ||
47 | + String savePath = ""; | ||
48 | + String bizPath = request.getParameter("biz"); | ||
49 | + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | ||
50 | + MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象 | ||
51 | + assert file != null; | ||
52 | + if (oConvertUtils.isEmpty(bizPath)) { | ||
53 | + if (CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)) { | ||
54 | + //未指定目录,则用阿里云默认目录 upload | ||
55 | + bizPath = "upload"; | ||
56 | + } else { | ||
57 | + bizPath = ""; | ||
58 | + } | ||
59 | + } | ||
60 | + if (CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { | ||
61 | + savePath = this.uploadLocal(file,bizPath); | ||
62 | + } else { | ||
63 | + savePath = CommonUtils.upload(file, bizPath, uploadType); | ||
64 | + } | ||
65 | + return savePath; | ||
66 | + } | ||
67 | + | ||
68 | + private String uploadLocal(MultipartFile mf,String bizPath){ | ||
69 | + try { | ||
70 | + String ctxPath = uploadPath; | ||
71 | + String fileName = null; | ||
72 | + File file = new File(ctxPath + File.separator + bizPath + File.separator ); | ||
73 | + if (!file.exists()) { | ||
74 | + file.mkdirs();// 创建文件根目录 | ||
75 | + } | ||
76 | + String orgName = mf.getOriginalFilename();// 获取文件名 | ||
77 | + orgName = CommonUtils.getFileName(orgName); | ||
78 | + if(orgName.indexOf(".")!=-1){ | ||
79 | + fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); | ||
80 | + }else{ | ||
81 | + fileName = orgName+ "_" + System.currentTimeMillis(); | ||
82 | + } | ||
83 | + String savePath = file.getPath() + File.separator + fileName; | ||
84 | + File savefile = new File(savePath); | ||
85 | + FileCopyUtils.copy(mf.getBytes(), savefile); | ||
86 | + String dbpath = null; | ||
87 | + if(oConvertUtils.isNotEmpty(bizPath)){ | ||
88 | + dbpath = bizPath + File.separator + fileName; | ||
89 | + }else{ | ||
90 | + dbpath = fileName; | ||
91 | + } | ||
92 | + if (dbpath.contains("\\")) { | ||
93 | + dbpath = dbpath.replace("\\", "/"); | ||
94 | + } | ||
95 | + return dbpath; | ||
96 | + } catch (IOException e) { | ||
97 | + log.error(e.getMessage(), e); | ||
98 | + } | ||
99 | + return ""; | ||
100 | + } | ||
101 | + | ||
102 | + @ApiOperation(value = "预览图片", notes = "预览图片", httpMethod = "POST") | ||
103 | + @ApiImplicitParam(paramType="header", name="authorization", value = "authorization", required = true,dataType = "string") | ||
104 | + @Authorization("authorization") | ||
105 | + @RequestMapping(value = "/static/**",method = RequestMethod.GET) | ||
106 | + public void view(HttpServletRequest request, HttpServletResponse response) { | ||
107 | + // ISO-8859-1 ==> UTF-8 进行编码转换 | ||
108 | + String imgPath = extractPathFromPattern(request); | ||
109 | + if(oConvertUtils.isEmpty(imgPath) || imgPath=="null"){ | ||
110 | + return; | ||
111 | + } | ||
112 | + // 其余处理略 | ||
113 | + InputStream inputStream = null; | ||
114 | + OutputStream outputStream = null; | ||
115 | + try { | ||
116 | + imgPath = imgPath.replace("..", ""); | ||
117 | + if (imgPath.endsWith(",")) { | ||
118 | + imgPath = imgPath.substring(0, imgPath.length() - 1); | ||
119 | + } | ||
120 | + String filePath = uploadPath + File.separator + imgPath; | ||
121 | + File file = new File(filePath); | ||
122 | + if(!file.exists()){ | ||
123 | + response.setStatus(404); | ||
124 | + throw new RuntimeException("文件不存在.."); | ||
125 | + } | ||
126 | + response.setContentType("application/force-download");// 设置强制下载不打开 | ||
127 | + response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1")); | ||
128 | + inputStream = new BufferedInputStream(new FileInputStream(filePath)); | ||
129 | + outputStream = response.getOutputStream(); | ||
130 | + byte[] buf = new byte[1024]; | ||
131 | + int len; | ||
132 | + while ((len = inputStream.read(buf)) > 0) { | ||
133 | + outputStream.write(buf, 0, len); | ||
134 | + } | ||
135 | + response.flushBuffer(); | ||
136 | + } catch (IOException e) { | ||
137 | + log.error("预览文件失败" + e.getMessage()); | ||
138 | + response.setStatus(404); | ||
139 | + e.printStackTrace(); | ||
140 | + } finally { | ||
141 | + if (inputStream != null) { | ||
142 | + try { | ||
143 | + inputStream.close(); | ||
144 | + } catch (IOException e) { | ||
145 | + log.error(e.getMessage(), e); | ||
146 | + } | ||
147 | + } | ||
148 | + if (outputStream != null) { | ||
149 | + try { | ||
150 | + outputStream.close(); | ||
151 | + } catch (IOException e) { | ||
152 | + log.error(e.getMessage(), e); | ||
153 | + } | ||
154 | + } | ||
155 | + } | ||
156 | + | ||
157 | + } | ||
158 | + | ||
159 | + /** | ||
160 | + * 把指定URL后的字符串全部截断当成参数 | ||
161 | + * 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题 | ||
162 | + * @param request | ||
163 | + * @return | ||
164 | + */ | ||
165 | + private static String extractPathFromPattern(final HttpServletRequest request) { | ||
166 | + String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE); | ||
167 | + String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); | ||
168 | + return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path); | ||
169 | + } | ||
170 | +} |
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/h5Api/entity/H5Result.java
0 → 100644
1 | +package org.jeecg.modules.h5Api.entity; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModel; | ||
4 | +import io.swagger.annotations.ApiModelProperty; | ||
5 | +import lombok.Data; | ||
6 | +import org.jeecg.common.constant.CommonConstant; | ||
7 | +import org.springframework.stereotype.Controller; | ||
8 | + | ||
9 | +import java.io.Serializable; | ||
10 | + | ||
11 | + | ||
12 | +@Data | ||
13 | +@ApiModel(value="h5接口返回对象", description="h5接口返回对象") | ||
14 | +@Controller | ||
15 | +public class H5Result<T> implements Serializable { | ||
16 | + | ||
17 | + /** | ||
18 | + * | ||
19 | + */ | ||
20 | + private static final long serialVersionUID = 1L; | ||
21 | + | ||
22 | + @ApiModelProperty("返回码(returnCode)") | ||
23 | + private ReturnCode returnCode; | ||
24 | + | ||
25 | + // 返回数据 | ||
26 | + @ApiModelProperty("返回的具体数据") | ||
27 | + private T resultData; | ||
28 | + | ||
29 | + public H5Result() { | ||
30 | + | ||
31 | + } | ||
32 | + | ||
33 | + public H5Result(T resultData) { | ||
34 | + this.resultData = resultData; | ||
35 | + } | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + public static<T> H5Result<T> OK() { | ||
40 | + H5Result<T> h5 = new H5Result<T>(); | ||
41 | + ReturnCode<T> r = new ReturnCode<T>(); | ||
42 | + r.setType("S"); | ||
43 | + r.setCode(CommonConstant.SC_OK_200.toString()); | ||
44 | + r.setMessage("成功"); | ||
45 | + h5.setReturnCode(r); | ||
46 | + return h5; | ||
47 | + } | ||
48 | + | ||
49 | + public static<T> H5Result<T> OK(T data) { | ||
50 | + H5Result<T> h5 = new H5Result<T>(); | ||
51 | + ReturnCode<T> r = new ReturnCode<T>(); | ||
52 | + r.setType("S"); | ||
53 | + r.setCode(CommonConstant.SC_OK_200.toString()); | ||
54 | + h5.setResultData(data); | ||
55 | + h5.setReturnCode(r); | ||
56 | + return h5; | ||
57 | + } | ||
58 | + | ||
59 | + public static<T> H5Result<T> OK(String msg, T data) { | ||
60 | + H5Result<T> h5 = new H5Result<T>(); | ||
61 | + ReturnCode<T> r = new ReturnCode<T>(); | ||
62 | + r.setType("S"); | ||
63 | + r.setCode(CommonConstant.SC_OK_200.toString()); | ||
64 | + r.setMessage(msg); | ||
65 | + h5.setResultData(data); | ||
66 | + h5.setReturnCode(r); | ||
67 | + return h5; | ||
68 | + } | ||
69 | + | ||
70 | + public static H5Result<Object> error(String msg) { | ||
71 | + return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg); | ||
72 | + } | ||
73 | + | ||
74 | + public static H5Result<Object> error(int code, String msg) { | ||
75 | + H5Result<Object> h5 = new H5Result<Object>(); | ||
76 | + ReturnCode<Object> r = new ReturnCode<Object>(); | ||
77 | + r.setCode(String.valueOf(code)); | ||
78 | + r.setMessage(msg); | ||
79 | + r.setType("E"); | ||
80 | + h5.setReturnCode(r); | ||
81 | + return h5; | ||
82 | + } | ||
83 | + | ||
84 | + public H5Result<T> error500(String message) { | ||
85 | + H5Result<T> h5 = new H5Result<T>(); | ||
86 | + ReturnCode<T> r = new ReturnCode<T>(); | ||
87 | + r.setType("E"); | ||
88 | + r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500.toString()); | ||
89 | + r.setMessage(message); | ||
90 | + h5.setReturnCode(r); | ||
91 | + return h5; | ||
92 | + } | ||
93 | + | ||
94 | +} |
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/h5Api/entity/ReturnCode.java
0 → 100644
1 | +package org.jeecg.modules.h5Api.entity; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModel; | ||
4 | +import io.swagger.annotations.ApiModelProperty; | ||
5 | +import lombok.Data; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | + | ||
9 | + | ||
10 | +@Data | ||
11 | +@ApiModel(value="h5接口返回ReturnCode", description="h5接口返回ReturnCode") | ||
12 | +public class ReturnCode<T> implements Serializable { | ||
13 | + | ||
14 | + /** | ||
15 | + * | ||
16 | + */ | ||
17 | + private static final long serialVersionUID = 1L; | ||
18 | + | ||
19 | + @ApiModelProperty("状态码") | ||
20 | + private String code; | ||
21 | + // 返回码,S:成功,E:失败 | ||
22 | + @ApiModelProperty("返回码,S:成功,E:失败") | ||
23 | + private String type; | ||
24 | + | ||
25 | + // 返回消息,成功为“success”,失败为具体失败信息 | ||
26 | + @ApiModelProperty("错误信息") | ||
27 | + private String message; | ||
28 | + | ||
29 | + | ||
30 | + public ReturnCode() { | ||
31 | + | ||
32 | + } | ||
33 | + | ||
34 | + | ||
35 | + public ReturnCode(String code, String type, String message) { | ||
36 | + this.code = code; | ||
37 | + this.type = type; | ||
38 | + this.message = message; | ||
39 | + } | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | +} |
@@ -26,6 +26,7 @@ import org.jeecg.modules.system.model.TreeModel; | @@ -26,6 +26,7 @@ import org.jeecg.modules.system.model.TreeModel; | ||
26 | import org.jeecg.modules.system.service.*; | 26 | import org.jeecg.modules.system.service.*; |
27 | import org.jeecg.modules.system.util.PermissionDataUtil; | 27 | import org.jeecg.modules.system.util.PermissionDataUtil; |
28 | import org.springframework.beans.factory.annotation.Autowired; | 28 | import org.springframework.beans.factory.annotation.Autowired; |
29 | +import org.springframework.beans.factory.annotation.Value; | ||
29 | import org.springframework.web.bind.annotation.*; | 30 | import org.springframework.web.bind.annotation.*; |
30 | 31 | ||
31 | import javax.servlet.http.HttpServletRequest; | 32 | import javax.servlet.http.HttpServletRequest; |
@@ -44,7 +45,8 @@ import java.util.stream.Collectors; | @@ -44,7 +45,8 @@ import java.util.stream.Collectors; | ||
44 | @RestController | 45 | @RestController |
45 | @RequestMapping("/sys/permission") | 46 | @RequestMapping("/sys/permission") |
46 | public class SysPermissionController { | 47 | public class SysPermissionController { |
47 | - | 48 | + @Value("${jeecg.encrypFlag}") |
49 | + private Boolean encrypFlag; | ||
48 | @Autowired | 50 | @Autowired |
49 | private ISysPermissionService sysPermissionService; | 51 | private ISysPermissionService sysPermissionService; |
50 | 52 | ||
@@ -564,7 +566,7 @@ public class SysPermissionController { | @@ -564,7 +566,7 @@ public class SysPermissionController { | ||
564 | this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds); | 566 | this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds); |
565 | 567 | ||
566 | //权限加密 | 568 | //权限加密 |
567 | - if (StringUtils.isNotEmpty(roleId) && StringUtils.isNotEmpty(permissionIds)){ | 569 | + if (encrypFlag && StringUtils.isNotEmpty(roleId) && StringUtils.isNotEmpty(permissionIds)){ |
568 | //将本次的字符串重新加密存起来 | 570 | //将本次的字符串重新加密存起来 |
569 | SysRole sysRole = sysRoleService.getById(roleId); | 571 | SysRole sysRole = sysRoleService.getById(roleId); |
570 | String hmac = EncryptionUtils.hmac(permissionIds); | 572 | String hmac = EncryptionUtils.hmac(permissionIds); |
@@ -20,6 +20,7 @@ import org.jeecg.modules.system.service.ISysRoleService; | @@ -20,6 +20,7 @@ import org.jeecg.modules.system.service.ISysRoleService; | ||
20 | import org.jeecgframework.poi.excel.ExcelImportUtil; | 20 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
21 | import org.jeecgframework.poi.excel.entity.ImportParams; | 21 | import org.jeecgframework.poi.excel.entity.ImportParams; |
22 | import org.springframework.beans.factory.annotation.Autowired; | 22 | import org.springframework.beans.factory.annotation.Autowired; |
23 | +import org.springframework.beans.factory.annotation.Value; | ||
23 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
24 | import org.springframework.transaction.annotation.Transactional; | 25 | import org.springframework.transaction.annotation.Transactional; |
25 | import org.springframework.web.multipart.MultipartFile; | 26 | import org.springframework.web.multipart.MultipartFile; |
@@ -39,6 +40,8 @@ import java.util.List; | @@ -39,6 +40,8 @@ import java.util.List; | ||
39 | */ | 40 | */ |
40 | @Service | 41 | @Service |
41 | public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService { | 42 | public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService { |
43 | + @Value("${jeecg.encrypFlag}") | ||
44 | + private Boolean encrypFlag; | ||
42 | @Autowired | 45 | @Autowired |
43 | SysRoleMapper sysRoleMapper; | 46 | SysRoleMapper sysRoleMapper; |
44 | @Autowired | 47 | @Autowired |
@@ -106,7 +109,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl | @@ -106,7 +109,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl | ||
106 | QueryWrapper<SysRolePermission> queryWrapper = new QueryWrapper<>(); | 109 | QueryWrapper<SysRolePermission> queryWrapper = new QueryWrapper<>(); |
107 | queryWrapper.eq("role_id",sysRole.getId()); | 110 | queryWrapper.eq("role_id",sysRole.getId()); |
108 | List<SysRolePermission> list = sysRolePermissionService.list(queryWrapper); | 111 | List<SysRolePermission> list = sysRolePermissionService.list(queryWrapper); |
109 | - if (!list.isEmpty()){ | 112 | + if (encrypFlag && !list.isEmpty()){ |
110 | String ids = ""; | 113 | String ids = ""; |
111 | //将所有的权限id拼接成字符串 | 114 | //将所有的权限id拼接成字符串 |
112 | for (SysRolePermission srp:list){ | 115 | for (SysRolePermission srp:list){ |
@@ -1273,7 +1273,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl | @@ -1273,7 +1273,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl | ||
1273 | public void changeFieldQuery(SysUser sysUser) { | 1273 | public void changeFieldQuery(SysUser sysUser) { |
1274 | //解密证件号,验证完整性 | 1274 | //解密证件号,验证完整性 |
1275 | String phoneCipher = sysUser.getPhone(); | 1275 | String phoneCipher = sysUser.getPhone(); |
1276 | - if (StringUtils.isNotEmpty(phoneCipher)) { | 1276 | + if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) { |
1277 | try { | 1277 | try { |
1278 | //绑定用户登录名,不适合加密 | 1278 | //绑定用户登录名,不适合加密 |
1279 | //解密 | 1279 | //解密 |
@@ -1297,7 +1297,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl | @@ -1297,7 +1297,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl | ||
1297 | public void changeFieldEncryp(SysUser sysUser) { | 1297 | public void changeFieldEncryp(SysUser sysUser) { |
1298 | //加密手机号 | 1298 | //加密手机号 |
1299 | String phone = sysUser.getPhone(); | 1299 | String phone = sysUser.getPhone(); |
1300 | - if (StringUtils.isNotEmpty(phone)){ | 1300 | + if (encrypFlag && StringUtils.isNotEmpty(phone)){ |
1301 | //绑定用户登录名,不适合加密 | 1301 | //绑定用户登录名,不适合加密 |
1302 | // //加密(一次加密) | 1302 | // //加密(一次加密) |
1303 | // try { | 1303 | // try { |
@@ -1321,7 +1321,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl | @@ -1321,7 +1321,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl | ||
1321 | @Override | 1321 | @Override |
1322 | public String roleIdeHmac(String roleIds) { | 1322 | public String roleIdeHmac(String roleIds) { |
1323 | String roleIdsValid = null; | 1323 | String roleIdsValid = null; |
1324 | - if (StringUtils.isNotEmpty(roleIds)){ | 1324 | + if (encrypFlag && StringUtils.isNotEmpty(roleIds)){ |
1325 | try { | 1325 | try { |
1326 | roleIdsValid = EncryptionUtils.hmac(roleIds); | 1326 | roleIdsValid = EncryptionUtils.hmac(roleIds); |
1327 | return roleIdsValid; | 1327 | return roleIdsValid; |
1 | +package org.jeecg.modules.weixin.controller; | ||
2 | + | ||
3 | +import me.chanjar.weixin.mp.config.WxMpConfigStorage; | ||
4 | +import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl; | ||
5 | +import me.chanjar.weixin.mp.api.WxMpService; | ||
6 | +import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; | ||
7 | +import org.jeecg.modules.weixin.entity.WxMpProperties; | ||
8 | +import org.springframework.context.annotation.Bean; | ||
9 | +import org.springframework.context.annotation.Configuration; | ||
10 | +import org.springframework.beans.factory.annotation.Value; | ||
11 | +import org.springframework.boot.context.properties.ConfigurationProperties; | ||
12 | +import javax.annotation.PostConstruct; | ||
13 | +import java.util.HashMap; | ||
14 | +import java.util.List; | ||
15 | +import java.util.Map; | ||
16 | +import java.util.logging.Handler; | ||
17 | +import java.util.stream.Collectors; | ||
18 | + | ||
19 | +@Configuration | ||
20 | +public class WeChatConfig { | ||
21 | + @Value("${wx.configs.appId}") | ||
22 | + private String appId; | ||
23 | + @Value("${wx.configs.appSecret}") | ||
24 | + private String appSecret; | ||
25 | + @Value("${wx.configs.token}") | ||
26 | + private String token; | ||
27 | + @Value("${wx.configs.aesKey}") | ||
28 | + private String aesKey; | ||
29 | + | ||
30 | + @Bean | ||
31 | + public WxMpService wxMpService() { | ||
32 | + WxMpService wxService = new WxMpServiceImpl(); | ||
33 | + WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl(); | ||
34 | + configStorage.setAppId(appId); | ||
35 | + configStorage.setSecret(appSecret); | ||
36 | + configStorage.setToken(token); | ||
37 | + configStorage.setAesKey(aesKey); | ||
38 | + Map<String, WxMpConfigStorage> map = new HashMap<>(); | ||
39 | + map.put(appId, configStorage); | ||
40 | + wxService.setMultiConfigStorages(map); | ||
41 | + return wxService; | ||
42 | + } | ||
43 | +} |
1 | +package org.jeecg.modules.weixin.controller; | ||
2 | + | ||
3 | +import java.util.Arrays; | ||
4 | +import java.util.List; | ||
5 | +import java.util.Map; | ||
6 | +import javax.servlet.http.HttpServletRequest; | ||
7 | +import javax.servlet.http.HttpServletResponse; | ||
8 | + | ||
9 | +import org.jeecg.common.api.vo.Result; | ||
10 | +import org.jeecg.common.system.query.QueryGenerator; | ||
11 | +import org.jeecg.modules.weixin.entity.WeixinUser; | ||
12 | +import org.jeecg.modules.weixin.service.IWeixinUserService; | ||
13 | + | ||
14 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
15 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
16 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
17 | +import lombok.extern.slf4j.Slf4j; | ||
18 | + | ||
19 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
20 | +import org.springframework.beans.factory.annotation.Autowired; | ||
21 | +import org.springframework.web.bind.annotation.*; | ||
22 | +import org.springframework.web.servlet.ModelAndView; | ||
23 | +import io.swagger.annotations.Api; | ||
24 | +import io.swagger.annotations.ApiOperation; | ||
25 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
26 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
27 | + | ||
28 | +import me.chanjar.weixin.mp.api.WxMpService; | ||
29 | + /** | ||
30 | + * @Description: weixin_user | ||
31 | + * @Author: jeecg-boot | ||
32 | + * @Date: 2025-01-23 | ||
33 | + * @Version: V1.0 | ||
34 | + */ | ||
35 | +@Api(tags="weixin_user") | ||
36 | +@RestController | ||
37 | +@RequestMapping("/weixin/weixinUser") | ||
38 | +@Slf4j | ||
39 | +public class WeixinUserController extends JeecgController<WeixinUser, IWeixinUserService> { | ||
40 | + @Autowired | ||
41 | + protected WxMpService wxMpService; | ||
42 | + @Autowired | ||
43 | + private IWeixinUserService weixinUserService; | ||
44 | + | ||
45 | + /** | ||
46 | + * 分页列表查询 | ||
47 | + * | ||
48 | + * @param weixinUser | ||
49 | + * @param pageNo | ||
50 | + * @param pageSize | ||
51 | + * @param req | ||
52 | + * @return | ||
53 | + */ | ||
54 | + //@AutoLog(value = "weixin_user-分页列表查询") | ||
55 | + @ApiOperation(value="weixin_user-分页列表查询", notes="weixin_user-分页列表查询") | ||
56 | + @GetMapping(value = "/list") | ||
57 | + public Result<IPage<WeixinUser>> queryPageList(WeixinUser weixinUser, | ||
58 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
59 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
60 | + HttpServletRequest req) { | ||
61 | + QueryWrapper<WeixinUser> queryWrapper = QueryGenerator.initQueryWrapper(weixinUser, req.getParameterMap()); | ||
62 | + Page<WeixinUser> page = new Page<WeixinUser>(pageNo, pageSize); | ||
63 | + IPage<WeixinUser> pageList = weixinUserService.page(page, queryWrapper); | ||
64 | + return Result.OK(pageList); | ||
65 | + } | ||
66 | + | ||
67 | + /** | ||
68 | + * 添加 | ||
69 | + * | ||
70 | + * @param weixinUser | ||
71 | + * @return | ||
72 | + */ | ||
73 | + @AutoLog(value = "weixin_user-添加") | ||
74 | + @ApiOperation(value="weixin_user-添加", notes="weixin_user-添加") | ||
75 | +// @RequiresPermissions("weixin:weixin_user:add") | ||
76 | + @PostMapping(value = "/add") | ||
77 | + public Result<String> add(@RequestBody WeixinUser weixinUser) { | ||
78 | + weixinUserService.save(weixinUser); | ||
79 | + return Result.OK("添加成功!"); | ||
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 编辑 | ||
84 | + * | ||
85 | + * @param weixinUser | ||
86 | + * @return | ||
87 | + */ | ||
88 | + @AutoLog(value = "weixin_user-编辑") | ||
89 | + @ApiOperation(value="weixin_user-编辑", notes="weixin_user-编辑") | ||
90 | +// @RequiresPermissions("weixin:weixin_user:edit") | ||
91 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
92 | + public Result<String> edit(@RequestBody WeixinUser weixinUser) { | ||
93 | + weixinUserService.updateById(weixinUser); | ||
94 | + return Result.OK("编辑成功!"); | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * 通过id删除 | ||
99 | + * | ||
100 | + * @param id | ||
101 | + * @return | ||
102 | + */ | ||
103 | + @AutoLog(value = "weixin_user-通过id删除") | ||
104 | + @ApiOperation(value="weixin_user-通过id删除", notes="weixin_user-通过id删除") | ||
105 | +// @RequiresPermissions("weixin:weixin_user:delete") | ||
106 | + @DeleteMapping(value = "/delete") | ||
107 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | ||
108 | + weixinUserService.removeById(id); | ||
109 | + return Result.OK("删除成功!"); | ||
110 | + } | ||
111 | + | ||
112 | + /** | ||
113 | + * 批量删除 | ||
114 | + * | ||
115 | + * @param ids | ||
116 | + * @return | ||
117 | + */ | ||
118 | + @AutoLog(value = "weixin_user-批量删除") | ||
119 | + @ApiOperation(value="weixin_user-批量删除", notes="weixin_user-批量删除") | ||
120 | +// @RequiresPermissions("weixin:weixin_user:deleteBatch") | ||
121 | + @DeleteMapping(value = "/deleteBatch") | ||
122 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
123 | + this.weixinUserService.removeByIds(Arrays.asList(ids.split(","))); | ||
124 | + return Result.OK("批量删除成功!"); | ||
125 | + } | ||
126 | + | ||
127 | + /** | ||
128 | + * 通过id查询 | ||
129 | + * | ||
130 | + * @param id | ||
131 | + * @return | ||
132 | + */ | ||
133 | + //@AutoLog(value = "weixin_user-通过id查询") | ||
134 | + @ApiOperation(value="weixin_user-通过id查询", notes="weixin_user-通过id查询") | ||
135 | + @GetMapping(value = "/queryById") | ||
136 | + public Result<WeixinUser> queryById(@RequestParam(name="id",required=true) String id) { | ||
137 | + WeixinUser weixinUser = weixinUserService.getById(id); | ||
138 | + if(weixinUser==null) { | ||
139 | + return Result.error("未找到对应数据"); | ||
140 | + } | ||
141 | + return Result.OK(weixinUser); | ||
142 | + } | ||
143 | + | ||
144 | + /** | ||
145 | + * 导出excel | ||
146 | + * | ||
147 | + * @param request | ||
148 | + * @param weixinUser | ||
149 | + */ | ||
150 | +// @RequiresPermissions("weixin:weixin_user:exportXls") | ||
151 | + @RequestMapping(value = "/exportXls") | ||
152 | + public ModelAndView exportXls(HttpServletRequest request, WeixinUser weixinUser) { | ||
153 | + return super.exportXls(request, weixinUser, WeixinUser.class, "weixin_user"); | ||
154 | + } | ||
155 | + | ||
156 | + /** | ||
157 | + * 通过excel导入数据 | ||
158 | + * | ||
159 | + * @param request | ||
160 | + * @param response | ||
161 | + * @return | ||
162 | + */ | ||
163 | +// @RequiresPermissions("weixin:weixin_user:importExcel") | ||
164 | + @RequestMapping(value = "/importExcel", method = RequestMethod.GET) | ||
165 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
166 | + return super.importExcel(request, response, WeixinUser.class); | ||
167 | + } | ||
168 | + | ||
169 | + } |
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/weixin/entity/WeixinUser.java
0 → 100644
1 | +package org.jeecg.modules.weixin.entity; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.io.UnsupportedEncodingException; | ||
5 | +import java.util.Date; | ||
6 | +import java.math.BigDecimal; | ||
7 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
8 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
9 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
10 | +import com.baomidou.mybatisplus.annotation.TableLogic; | ||
11 | +import lombok.Data; | ||
12 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
13 | +import org.springframework.format.annotation.DateTimeFormat; | ||
14 | +import org.jeecgframework.poi.excel.annotation.Excel; | ||
15 | +import org.jeecg.common.aspect.annotation.Dict; | ||
16 | +import io.swagger.annotations.ApiModel; | ||
17 | +import io.swagger.annotations.ApiModelProperty; | ||
18 | +import lombok.EqualsAndHashCode; | ||
19 | +import lombok.experimental.Accessors; | ||
20 | + | ||
21 | +/** | ||
22 | + * @Description: weixin_user | ||
23 | + * @Author: jeecg-boot | ||
24 | + * @Date: 2025-01-23 | ||
25 | + * @Version: V1.0 | ||
26 | + */ | ||
27 | +@Data | ||
28 | +@TableName("weixin_user") | ||
29 | +@Accessors(chain = true) | ||
30 | +@EqualsAndHashCode(callSuper = false) | ||
31 | +@ApiModel(value="weixin_user对象", description="weixin_user") | ||
32 | +public class WeixinUser implements Serializable { | ||
33 | + private static final long serialVersionUID = 1L; | ||
34 | + | ||
35 | + /**主键*/ | ||
36 | + @TableId(type = IdType.ASSIGN_ID) | ||
37 | + @ApiModelProperty(value = "主键") | ||
38 | + private java.lang.String id; | ||
39 | + /**微信ID*/ | ||
40 | + @Excel(name = "微信ID", width = 15) | ||
41 | + @ApiModelProperty(value = "微信ID") | ||
42 | + private java.lang.String openId; | ||
43 | + /**微信昵称*/ | ||
44 | + @Excel(name = "微信昵称", width = 15) | ||
45 | + @ApiModelProperty(value = "微信昵称") | ||
46 | + private java.lang.String weixinName; | ||
47 | + /**微信号*/ | ||
48 | + @Excel(name = "微信号", width = 15) | ||
49 | + @ApiModelProperty(value = "微信号") | ||
50 | + private java.lang.String weixinNum; | ||
51 | + /**微信头像*/ | ||
52 | + @Excel(name = "微信头像", width = 15) | ||
53 | + @ApiModelProperty(value = "微信头像") | ||
54 | + private java.lang.String weixinLogo; | ||
55 | + /**创建者*/ | ||
56 | + @ApiModelProperty(value = "创建者") | ||
57 | + private java.lang.String createBy; | ||
58 | + /**创建时间*/ | ||
59 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
60 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
61 | + @ApiModelProperty(value = "创建时间") | ||
62 | + private java.util.Date createTime; | ||
63 | + /**更新者*/ | ||
64 | + @ApiModelProperty(value = "更新者") | ||
65 | + private java.lang.String updateBy; | ||
66 | + /**更新时间*/ | ||
67 | + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | ||
68 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
69 | + @ApiModelProperty(value = "更新时间") | ||
70 | + private java.util.Date updateTime; | ||
71 | + /**删除标记*/ | ||
72 | + @Excel(name = "删除标记", width = 15) | ||
73 | + @ApiModelProperty(value = "删除标记") | ||
74 | + @TableLogic | ||
75 | + private java.lang.String delFlag; | ||
76 | + /**系统用户ID*/ | ||
77 | + @Excel(name = "系统用户ID", width = 15, dictTable = "sys_user", dicText = "username", dicCode = "id") | ||
78 | + @Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") | ||
79 | + @ApiModelProperty(value = "系统用户ID") | ||
80 | + private java.lang.String sysUserId; | ||
81 | +} |
1 | +package org.jeecg.modules.weixin.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | +import java.util.Map; | ||
5 | + | ||
6 | +import org.apache.ibatis.annotations.Param; | ||
7 | +import org.jeecg.modules.weixin.entity.WeixinUser; | ||
8 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
9 | + | ||
10 | +/** | ||
11 | + * @Description: weixin_user | ||
12 | + * @Author: jeecg-boot | ||
13 | + * @Date: 2025-01-23 | ||
14 | + * @Version: V1.0 | ||
15 | + */ | ||
16 | +public interface WeixinUserMapper extends BaseMapper<WeixinUser> { | ||
17 | + List<Map<String, String>> getProvince(); | ||
18 | + List<Map<String, String>> getCity(@Param("provinceCode") String provinceCode); | ||
19 | + List<Map<String, String>> getArea(@Param("cityCode") String cityCode); | ||
20 | + List<Map<String, String>> getRegion(@Param("areaCode") String areaCode); | ||
21 | +} |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="org.jeecg.modules.weixin.mapper.WeixinUserMapper"> | ||
4 | + | ||
5 | + <select id="getProvince" resultType="java.util.Map"> | ||
6 | + select distinct province_code id, province_name name | ||
7 | + from area | ||
8 | + </select> | ||
9 | + <select id="getCity" parameterType="java.lang.String" resultType="java.util.Map"> | ||
10 | + select distinct city_code id, city_name name | ||
11 | + from area | ||
12 | + where province_code = #{provinceCode} | ||
13 | + </select> | ||
14 | + <select id="getArea" parameterType="java.lang.String" resultType="java.util.Map"> | ||
15 | + select area_code id, area_name name | ||
16 | + from area | ||
17 | + where city_code = #{cityCode} | ||
18 | + </select> | ||
19 | + <select id="getRegion" parameterType="java.lang.String" resultType="java.util.Map"> | ||
20 | + select province_code provinceCode, province_name provinceName, city_code cityCode, city_name cityName, area_code areaCode, area_name areaName | ||
21 | + from area | ||
22 | + where area_code = #{areaCode} | ||
23 | + </select> | ||
24 | +</mapper> |
1 | +package org.jeecg.modules.weixin.service; | ||
2 | + | ||
3 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
4 | +import org.jeecg.modules.system.entity.SysUser; | ||
5 | +import org.jeecg.modules.weixin.entity.WeixinUser; | ||
6 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
7 | + | ||
8 | +import java.util.List; | ||
9 | +import java.util.Map; | ||
10 | + | ||
11 | +/** | ||
12 | + * @Description: weixin_user | ||
13 | + * @Author: jeecg-boot | ||
14 | + * @Date: 2025-01-23 | ||
15 | + * @Version: V1.0 | ||
16 | + */ | ||
17 | +public interface IWeixinUserService extends IService<WeixinUser> { | ||
18 | + List<Map<String, String>> getProvince(); | ||
19 | + | ||
20 | + List<Map<String, String>> getCity(String provinceCode); | ||
21 | + | ||
22 | + List<Map<String, String>> getArea(String cityCode); | ||
23 | + | ||
24 | + List<Map<String, String>> getRegion(String areaCode); | ||
25 | + | ||
26 | + SysUser getUserByOpenid(String openid); | ||
27 | + | ||
28 | + Boolean prepay(MedicalRecordsCopy medicalRecordsCopy); | ||
29 | +} |
1 | +package org.jeecg.modules.weixin.service.impl; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | +import org.jeecg.modules.claims.entity.MedicalRecordsCopy; | ||
5 | +import org.jeecg.modules.system.entity.SysUser; | ||
6 | +import org.jeecg.modules.system.service.ISysUserService; | ||
7 | +import org.jeecg.modules.weixin.entity.WeixinUser; | ||
8 | +import org.jeecg.modules.weixin.mapper.WeixinUserMapper; | ||
9 | +import org.jeecg.modules.weixin.service.IWeixinUserService; | ||
10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
11 | +import org.springframework.stereotype.Service; | ||
12 | + | ||
13 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
14 | + | ||
15 | +import java.util.List; | ||
16 | +import java.util.Map; | ||
17 | + | ||
18 | +/** | ||
19 | + * @Description: weixin_user | ||
20 | + * @Author: jeecg-boot | ||
21 | + * @Date: 2025-01-23 | ||
22 | + * @Version: V1.0 | ||
23 | + */ | ||
24 | +@Service | ||
25 | +public class WeixinUserServiceImpl extends ServiceImpl<WeixinUserMapper, WeixinUser> implements IWeixinUserService { | ||
26 | + @Autowired | ||
27 | + private ISysUserService sysUserService; | ||
28 | + | ||
29 | + @Override | ||
30 | + public List<Map<String, String>> getProvince() { | ||
31 | + return baseMapper.getProvince(); | ||
32 | + } | ||
33 | + | ||
34 | + @Override | ||
35 | + public List<Map<String, String>> getCity(String provinceCode) { | ||
36 | + return baseMapper.getCity(provinceCode); | ||
37 | + } | ||
38 | + | ||
39 | + @Override | ||
40 | + public List<Map<String, String>> getArea(String cityCode) { | ||
41 | + return baseMapper.getArea(cityCode); | ||
42 | + } | ||
43 | + | ||
44 | + @Override | ||
45 | + public List<Map<String, String>> getRegion(String areaCode) { | ||
46 | + return baseMapper.getRegion(areaCode); | ||
47 | + } | ||
48 | + | ||
49 | + @Override | ||
50 | + public SysUser getUserByOpenid(String openid) { | ||
51 | + QueryWrapper<WeixinUser> queryWrapper = new QueryWrapper<>(); | ||
52 | + queryWrapper.eq("open_id", openid); | ||
53 | + WeixinUser one = getOne(queryWrapper); | ||
54 | + SysUser sysUser = sysUserService.getById(one.getSysUserId()); | ||
55 | + return sysUser; | ||
56 | + } | ||
57 | + | ||
58 | + @Override | ||
59 | + public Boolean prepay(MedicalRecordsCopy medicalRecordsCopy) { | ||
60 | + // todo 微信支付 | ||
61 | + return true; | ||
62 | + } | ||
63 | +} |
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/weixin/util/WXUtils.java
0 → 100644
1 | +package org.jeecg.modules.weixin.util; | ||
2 | + | ||
3 | +import org.apache.shiro.SecurityUtils; | ||
4 | +import org.apache.shiro.session.InvalidSessionException; | ||
5 | +import org.apache.shiro.session.Session; | ||
6 | +import org.apache.shiro.subject.Subject; | ||
7 | + | ||
8 | +public class WXUtils { | ||
9 | + | ||
10 | + public static Session getSession(){ | ||
11 | + try{ | ||
12 | + Subject subject = SecurityUtils.getSubject(); | ||
13 | + Session session = subject.getSession(false); | ||
14 | + if (session == null){ | ||
15 | + session = subject.getSession(); | ||
16 | + } | ||
17 | + if (session != null){ | ||
18 | + return session; | ||
19 | + } | ||
20 | +// subject.logout(); | ||
21 | + }catch (InvalidSessionException e){ | ||
22 | + | ||
23 | + } | ||
24 | + return null; | ||
25 | + } | ||
26 | + | ||
27 | + public static Object getCache(String key) { | ||
28 | + return getCache(key, null); | ||
29 | + } | ||
30 | + | ||
31 | + public static Object getCache(String key, Object defaultValue) { | ||
32 | + Object obj = getSession().getAttribute(key); | ||
33 | + return obj==null?defaultValue:obj; | ||
34 | + } | ||
35 | + | ||
36 | + public static void putCache(String key, Object value) { | ||
37 | + getSession().setAttribute(key, value); | ||
38 | + } | ||
39 | + | ||
40 | + public static void removeCache(String key) { | ||
41 | + getSession().removeAttribute(key); | ||
42 | + } | ||
43 | + | ||
44 | + public static String getOpenId () { | ||
45 | + Object obj = getCache("OPENID"); | ||
46 | + String openId = obj != null ? String.valueOf(obj) : null; | ||
47 | + return openId; | ||
48 | + } | ||
49 | +} | ||
50 | + |
@@ -294,3 +294,22 @@ third-app: | @@ -294,3 +294,22 @@ third-app: | ||
294 | # appSecret | 294 | # appSecret |
295 | client-secret: ?? | 295 | client-secret: ?? |
296 | agent-id: ?? | 296 | agent-id: ?? |
297 | +#微信 | ||
298 | +wx: | ||
299 | + configs: | ||
300 | + #公众号 APP_ID | ||
301 | + appId: wx | ||
302 | + #公众号 APP_SECRET | ||
303 | + appSecret: '' | ||
304 | + #公众号 TOKEN | ||
305 | + token: '' | ||
306 | + #公众号 AES_KEY | ||
307 | + aesKey: '' | ||
308 | + pay: | ||
309 | + appId: wx #微信公众号或者小程序的appid | ||
310 | + mchId: '' #微信支付商户号 | ||
311 | + mchKey: '' #微信支付商户密钥 | ||
312 | + # subAppId: #服务商模式下的子商户公众账号ID | ||
313 | + # subMchId: #服务商模式下的子商户号 | ||
314 | + keyPath: /root/apiclient_cert.p12 # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头) | ||
315 | + notifyUrl: http://localhost:8080/insurance |
-
Please register or login to post a comment