Commit 5e39a8b4f1b9359258928f968ee04fbccf3ec73e
1 parent
8f22f7e0
Exists in
dev
lpg 功能模块划分
Showing
26 changed files
with
769 additions
and
371 deletions
Show diff stats
backend/lpg-user/src/main/java/com/hotent/lpg/user/controller/AjController.java
0 → 100644
... | ... | @@ -0,0 +1,66 @@ |
1 | +package com.hotent.lpg.user.controller; | |
2 | + | |
3 | +import cn.hutool.core.util.ObjectUtil; | |
4 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
5 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
7 | +import com.hotent.base.model.CommonResult; | |
8 | +import com.hotent.lpg.common.model.WAj; | |
9 | +import com.hotent.lpg.common.model.WAjxq; | |
10 | +import com.hotent.lpg.user.dto.AjDto; | |
11 | +import com.hotent.lpg.user.manager.WAjManager; | |
12 | +import com.hotent.lpg.user.manager.WAjxqManager; | |
13 | +import com.hotent.lpg.user.vo.AjDetailResponse; | |
14 | +import com.hotent.lpg.user.vo.AjxxVo; | |
15 | +import com.hotent.uc.util.ContextUtil; | |
16 | +import io.swagger.annotations.ApiOperation; | |
17 | +import org.springframework.beans.factory.annotation.Autowired; | |
18 | +import org.springframework.web.bind.annotation.GetMapping; | |
19 | +import org.springframework.web.bind.annotation.RequestMapping; | |
20 | +import org.springframework.web.bind.annotation.RequestParam; | |
21 | +import org.springframework.web.bind.annotation.RestController; | |
22 | + | |
23 | +import java.util.List; | |
24 | + | |
25 | +@RestController | |
26 | +@RequestMapping("/customer/aj/") | |
27 | +public class AjController { | |
28 | + | |
29 | + @Autowired | |
30 | + private WAjManager wAjManager; | |
31 | + @Autowired | |
32 | + private WAjxqManager wAjxqManager; | |
33 | + | |
34 | + @GetMapping("/pageList") | |
35 | + @ApiOperation("会员安检列表") | |
36 | + public CommonResult<IPage<AjxxVo>> pageList(Page page, String ajlx, String ajjl, String ajsj) { | |
37 | + AjDto ajDto = new AjDto(); | |
38 | + ajDto.setFHyyhid(ContextUtil.getCurrentUserId()); | |
39 | + ajDto.setFAjlx(ajlx); | |
40 | + ajDto.setFAjjl(ajjl); | |
41 | + ajDto.setSj(ajsj); | |
42 | + IPage<AjxxVo> responseIPage = wAjManager.pageList(page,ajDto,null); | |
43 | + return CommonResult.<IPage<AjxxVo>>ok().value(responseIPage); | |
44 | + } | |
45 | + | |
46 | + /** | |
47 | + * 根据id获取详情 | |
48 | + * | |
49 | + * @param id | |
50 | + * @return | |
51 | + * @throws Exception ModelAndView | |
52 | + */ | |
53 | + @GetMapping(value = "/getDetail") | |
54 | + public CommonResult<AjDetailResponse> getDetail(@RequestParam(required = true) String id) throws Exception { | |
55 | + AjDetailResponse response = new AjDetailResponse(); | |
56 | + WAj aj = wAjManager.getDetail(id); | |
57 | + if (ObjectUtil.isNull(aj)) { | |
58 | + return CommonResult.<AjDetailResponse>ok().value(response); | |
59 | + } | |
60 | + List<WAjxq> list = wAjxqManager.list(new LambdaQueryWrapper<WAjxq>().eq(WAjxq::getfAjid, id)); | |
61 | + response.setAj(aj); | |
62 | + response.setAjxq(list); | |
63 | + return CommonResult.<AjDetailResponse>ok().value(response); | |
64 | + } | |
65 | + | |
66 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/controller/BxbController.java
0 → 100644
... | ... | @@ -0,0 +1,119 @@ |
1 | +package com.hotent.lpg.user.controller; | |
2 | + | |
3 | + | |
4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
7 | +import com.hotent.base.controller.BaseController; | |
8 | +import com.hotent.base.model.CommonResult; | |
9 | +import com.hotent.lpg.common.model.WBxb; | |
10 | +import com.hotent.lpg.common.model.WHyxx; | |
11 | +import com.hotent.lpg.user.dto.BxRequest; | |
12 | +import com.hotent.lpg.user.vo.BxbResponse; | |
13 | +import com.hotent.lpg.user.manager.WBxbManager; | |
14 | +import com.hotent.lpg.user.manager.WHyxxManager; | |
15 | +import com.hotent.runtime.script.ScriptImpl; | |
16 | +import io.swagger.annotations.ApiOperation; | |
17 | +import io.swagger.annotations.ApiParam; | |
18 | +import lombok.extern.slf4j.Slf4j; | |
19 | +import org.springframework.web.bind.annotation.*; | |
20 | + | |
21 | +import javax.annotation.Resource; | |
22 | + | |
23 | +/** | |
24 | + * 会员端:报修管理 | |
25 | + * | |
26 | + * @author 超级管理员 | |
27 | + * @company 广州宏天软件股份有限公司 | |
28 | + * @since 2024-04-07 | |
29 | + */ | |
30 | +@Slf4j | |
31 | +@RestController | |
32 | +@RequestMapping("/customer/bx") | |
33 | +public class BxbController extends BaseController<WBxbManager, WBxb> { | |
34 | + | |
35 | + @Resource | |
36 | + private ScriptImpl scriptImpl; | |
37 | + @Resource | |
38 | + private WHyxxManager wHyxxManager; | |
39 | + | |
40 | + /** | |
41 | + * 根据id获取报修表数据详情 | |
42 | + * | |
43 | + * @param id | |
44 | + * @return | |
45 | + * @throws Exception ModelAndView | |
46 | + */ | |
47 | + @GetMapping(value = "/getDetail") | |
48 | + @ApiOperation(value = "根据id获取报修表数据详情", httpMethod = "GET", notes = "根据id获取报修表数据详情") | |
49 | + public CommonResult<WBxb> getDetail(@ApiParam(name = "id", value = "业务对象主键", required = true) @RequestParam(required = true) String id) throws Exception { | |
50 | + return CommonResult.<WBxb>ok().value(baseService.getDetail(id)); | |
51 | + } | |
52 | + | |
53 | + /** | |
54 | + * 创建工单 | |
55 | + * | |
56 | + * @param bxRequest | |
57 | + * @return | |
58 | + * @throws Exception | |
59 | + * @throws | |
60 | + */ | |
61 | + @PostMapping(value = "/save") | |
62 | + @ApiOperation(value = "创建工单", httpMethod = "POST", notes = "创建工单") | |
63 | + public CommonResult<String> save(@ApiParam(name = "bxRequest", value = "报修表对象", required = true) @RequestBody BxRequest bxRequest) throws Exception { | |
64 | + log.info("新增保修参数,bxRequest={}", bxRequest); | |
65 | + try { | |
66 | + String currentUserId = scriptImpl.getCurrentUserId(); | |
67 | + WHyxx one = wHyxxManager.getOne(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFUserid, currentUserId)); | |
68 | + if (one == null) { | |
69 | + throw new RuntimeException("会员信息不存在"); | |
70 | + } | |
71 | + bxRequest.setHyyhid(one.getFUserid()); | |
72 | + baseService.saveBx(bxRequest,"1"); | |
73 | + } catch (Exception e) { | |
74 | + return CommonResult.<String>error().message(e.getMessage()); | |
75 | + } | |
76 | + return CommonResult.<String>ok().message("操作成功"); | |
77 | + } | |
78 | + | |
79 | + /** | |
80 | + * 会员端报修分页 | |
81 | + * | |
82 | + * @param page | |
83 | + * @param wBxb | |
84 | + * @return | |
85 | + */ | |
86 | + @GetMapping(value = "/bxbPage", produces = {"application/json; charset=utf-8"}) | |
87 | + @ApiOperation(value = "会员报修列表", httpMethod = "GET", notes = "会员报修列表") | |
88 | + public CommonResult bxbPage(Page page, WBxb wBxb) { | |
89 | + log.info("保修列表参数,page={},wBxb={}", page, wBxb); | |
90 | + String currentUserId = scriptImpl.getCurrentUserId(); | |
91 | + WHyxx wHyxx = wHyxxManager.getOne(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFUserid, currentUserId)); | |
92 | + if (wHyxx == null) { | |
93 | + return CommonResult.error("会员信息不存在"); | |
94 | + } | |
95 | + wBxb.setFHyyhid(wHyxx.getFUserid()); | |
96 | + IPage<BxbResponse> resultPage = baseService.bxbPage(page, wBxb); | |
97 | + return new CommonResult(true, "", resultPage); | |
98 | + } | |
99 | + | |
100 | + /** | |
101 | + * 取消工单 | |
102 | + * | |
103 | + * @param id 工单id | |
104 | + * @return | |
105 | + * @throws Exception | |
106 | + * @throws | |
107 | + */ | |
108 | + @PostMapping(value = "/cancal") | |
109 | + @ApiOperation(value = "取消工单", httpMethod = "POST", notes = "取消工单") | |
110 | + public CommonResult<String> cancal(String id) throws Exception { | |
111 | + log.info("新增保修参数,id={}", id); | |
112 | + try { | |
113 | + baseService.cancal(id); | |
114 | + } catch (Exception e) { | |
115 | + return CommonResult.<String>error().message(e.getMessage()); | |
116 | + } | |
117 | + return CommonResult.<String>ok().message("操作成功"); | |
118 | + } | |
119 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/dao/WAjxqDao.java
0 → 100644
... | ... | @@ -0,0 +1,14 @@ |
1 | +package com.hotent.lpg.user.dao; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
4 | +import com.hotent.lpg.common.model.WAjxq; | |
5 | + | |
6 | +/** | |
7 | + * 安检详情 Mapper 接口 | |
8 | + * | |
9 | + * @company 广州宏天软件股份有限公司 | |
10 | + * @author admin | |
11 | + * @since 2024-03-20 | |
12 | + */ | |
13 | +public interface WAjxqDao extends BaseMapper<WAjxq> { | |
14 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/dao/WBxbDao.java
0 → 100644
... | ... | @@ -0,0 +1,14 @@ |
1 | +package com.hotent.lpg.user.dao; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
4 | +import com.hotent.lpg.common.model.WBxb; | |
5 | + | |
6 | +/** | |
7 | + * 报修表 Mapper 接口 | |
8 | + * | |
9 | + * @company 广州宏天软件股份有限公司 | |
10 | + * @author 超级管理员 | |
11 | + * @since 2024-04-07 | |
12 | + */ | |
13 | +public interface WBxbDao extends BaseMapper<WBxb> { | |
14 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/dto/AjDto.java
0 → 100644
backend/lpg-user/src/main/java/com/hotent/lpg/user/dto/BxRequest.java
0 → 100644
... | ... | @@ -0,0 +1,106 @@ |
1 | +package com.hotent.lpg.user.dto; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +/** | |
6 | + * 报修表请求参数 | |
7 | + */ | |
8 | +@Data | |
9 | +public class BxRequest { | |
10 | + // 会员端:新增工单参数 | |
11 | + /** | |
12 | + * 报修类型 | |
13 | + */ | |
14 | + private String bxlx; | |
15 | + /** | |
16 | + * 问题描述 | |
17 | + */ | |
18 | + private String wtms; | |
19 | + /** | |
20 | + * 问题图片 | |
21 | + */ | |
22 | + private String wttp; | |
23 | + /** | |
24 | + * 工单类型 | |
25 | + */ | |
26 | + private String gdlx; | |
27 | + /** | |
28 | + * 下单姓名 | |
29 | + */ | |
30 | + private String xdxm; | |
31 | + /** | |
32 | + * 会员用户ID | |
33 | + */ | |
34 | + private String hyyhid; | |
35 | + /** | |
36 | + * 联系方式 | |
37 | + */ | |
38 | + private String lxfs; | |
39 | + /** | |
40 | + * 联系地址省 | |
41 | + */ | |
42 | + private String lxdzsf; | |
43 | + /** | |
44 | + * 联系地址市 | |
45 | + */ | |
46 | + private String lxdzs; | |
47 | + /** | |
48 | + * 联系地址区 | |
49 | + */ | |
50 | + private String lxdzq; | |
51 | + /** | |
52 | + * 联系地址街道 | |
53 | + */ | |
54 | + private String lxdzjd; | |
55 | + /** | |
56 | + * 联系地址详细地址 | |
57 | + */ | |
58 | + private String lxdzxxdz; | |
59 | + /** | |
60 | + * 报修类型明细 | |
61 | + */ | |
62 | + private String bxlxmx; | |
63 | + /** | |
64 | + * 经度 | |
65 | + */ | |
66 | + private String jd; | |
67 | + /** | |
68 | + * 维度 | |
69 | + */ | |
70 | + private String wd; | |
71 | + | |
72 | + | |
73 | + //员工端:提交工单参数 | |
74 | + /** | |
75 | + * 维修结果 | |
76 | + */ | |
77 | + private String wxjg; | |
78 | + | |
79 | + /** | |
80 | + * 维修图片 | |
81 | + */ | |
82 | + private String wxtp; | |
83 | + | |
84 | + /** | |
85 | + * 维修备注 | |
86 | + */ | |
87 | + private String wxbz; | |
88 | + | |
89 | + /** | |
90 | + * 维修id | |
91 | + */ | |
92 | + private String id; | |
93 | + /** | |
94 | + * 身份证号 | |
95 | + */ | |
96 | + private String sfzh; | |
97 | + /** | |
98 | + * 会员类型 | |
99 | + */ | |
100 | + private String hylx; | |
101 | + /** | |
102 | + * 会员姓名 | |
103 | + */ | |
104 | + private String hyxm; | |
105 | + | |
106 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/WAjManager.java
1 | 1 | package com.hotent.lpg.user.manager; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
4 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
3 | 5 | import com.hotent.base.manager.BaseManager; |
4 | 6 | import com.hotent.lpg.common.model.WAj; |
7 | +import com.hotent.lpg.user.dto.AjDto; | |
8 | +import com.hotent.lpg.user.vo.AjxxVo; | |
5 | 9 | |
6 | 10 | public interface WAjManager extends BaseManager<WAj> { |
11 | + IPage<AjxxVo> pageList(Page page, AjDto ajDto, String filterFieldSql); | |
12 | + | |
13 | + WAj getDetail(String id); | |
14 | + | |
15 | + | |
16 | + | |
7 | 17 | } | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/WAjxqManager.java
0 → 100644
... | ... | @@ -0,0 +1,14 @@ |
1 | +package com.hotent.lpg.user.manager; | |
2 | + | |
3 | +import com.hotent.base.manager.BaseManager; | |
4 | +import com.hotent.lpg.common.model.WAjxq; | |
5 | + | |
6 | +/** | |
7 | + * 安检详情 服务类 | |
8 | + * | |
9 | + * @company 广州宏天软件股份有限公司 | |
10 | + * @author admin | |
11 | + * @since 2024-03-20 | |
12 | + */ | |
13 | +public interface WAjxqManager extends BaseManager<WAjxq> { | |
14 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/WBxbManager.java
0 → 100644
... | ... | @@ -0,0 +1,40 @@ |
1 | +package com.hotent.lpg.user.manager; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
4 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
5 | +import com.hotent.base.manager.BaseManager; | |
6 | +import com.hotent.lpg.common.model.WBxb; | |
7 | +import com.hotent.lpg.user.dto.BxRequest; | |
8 | +import com.hotent.lpg.user.vo.BxbResponse; | |
9 | + | |
10 | +/** | |
11 | + * 报修表 服务类 | |
12 | + * | |
13 | + * @company 广州宏天软件股份有限公司 | |
14 | + * @author 超级管理员 | |
15 | + * @since 2024-04-07 | |
16 | + */ | |
17 | +public interface WBxbManager extends BaseManager<WBxb> { | |
18 | + WBxb getDetail(String id); | |
19 | + /** | |
20 | + * 会员端:创建工单 | |
21 | + * @param bxRequest | |
22 | + */ | |
23 | + WBxb saveBx(BxRequest bxRequest,String type); | |
24 | + /** | |
25 | + * 报修单分页 | |
26 | + * @param page | |
27 | + * @param wBxb | |
28 | + * @return | |
29 | + */ | |
30 | + IPage<BxbResponse> bxbPage(Page page, WBxb wBxb); | |
31 | + | |
32 | + | |
33 | + /** | |
34 | + * 会员端:取消工单 | |
35 | + * @param id | |
36 | + */ | |
37 | + void cancal(String id); | |
38 | + | |
39 | + | |
40 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/WHyxxManager.java
... | ... | @@ -3,6 +3,7 @@ package com.hotent.lpg.user.manager; |
3 | 3 | import com.hotent.base.manager.BaseManager; |
4 | 4 | import com.hotent.lpg.common.model.Hytjxx; |
5 | 5 | import com.hotent.lpg.common.model.WHyxx; |
6 | +import com.hotent.lpg.user.vo.WHydzVo; | |
6 | 7 | |
7 | 8 | public interface WHyxxManager extends BaseManager<WHyxx> { |
8 | 9 | |
... | ... | @@ -17,4 +18,11 @@ public interface WHyxxManager extends BaseManager<WHyxx> { |
17 | 18 | void realNameAuth(WHyxx wHyxx); |
18 | 19 | |
19 | 20 | |
21 | + WHyxx getHyxxByHydz(WHydzVo wHydzVo); | |
22 | + | |
23 | + | |
24 | + /** | |
25 | + * 根据会员信息创建会员和账号信息 | |
26 | + */ | |
27 | + WHyxx createByHyxx(WHyxx wHyxx) throws Exception; | |
20 | 28 | } | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/impl/WAjManagerImpl.java
1 | 1 | package com.hotent.lpg.user.manager.impl; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
3 | 7 | import com.hotent.base.manager.impl.BaseManagerImpl; |
8 | +import com.hotent.base.util.StringUtil; | |
4 | 9 | import com.hotent.lpg.common.model.WAj; |
5 | 10 | import com.hotent.lpg.user.dao.WAjDao; |
11 | +import com.hotent.lpg.user.dto.AjDto; | |
6 | 12 | import com.hotent.lpg.user.manager.WAjManager; |
13 | +import com.hotent.lpg.user.vo.AjxxVo; | |
7 | 14 | import lombok.extern.slf4j.Slf4j; |
8 | 15 | import org.springframework.stereotype.Service; |
9 | 16 | import org.springframework.transaction.annotation.Transactional; |
10 | 17 | |
18 | +import java.util.ArrayList; | |
19 | + | |
11 | 20 | @Transactional(rollbackFor = Exception.class) |
12 | 21 | @Slf4j |
13 | 22 | @Service |
14 | 23 | public class WAjManagerImpl extends BaseManagerImpl<WAjDao, WAj> implements WAjManager { |
24 | + @Override | |
25 | + public IPage<AjxxVo> pageList(Page page, AjDto ajDto,String filterFieldSql) { | |
26 | + ArrayList<String> ajzt = new ArrayList<>(); | |
27 | + if ("完成安检".equals(ajDto.getFAjjl())) { | |
28 | + ajzt.add("已整改"); | |
29 | + ajzt.add("完成安检"); | |
30 | + } | |
31 | + if ("待整改".equals(ajDto.getFAjjl())) { | |
32 | + ajzt.add("待整改"); | |
33 | + } | |
34 | + if ("随瓶".equals(ajDto.getFAjlx())) { | |
35 | + ajDto.setFAjlx("随瓶安检"); | |
36 | + } | |
37 | + if ("定期".equals(ajDto.getFAjlx())) { | |
38 | + ajDto.setFAjlx("定期安检"); | |
39 | + } | |
40 | + if ("全部".equals(ajDto.getFAjjl())) { | |
41 | + ajDto.setFAjjl(null); | |
42 | + } | |
43 | + if ("全部".equals(ajDto.getFAjlx())) { | |
44 | + ajDto.setFAjlx(null); | |
45 | + } | |
46 | + LambdaQueryWrapper<WAj> eq = Wrappers.<WAj>lambdaQuery() | |
47 | + .eq(StringUtil.isNotEmpty(ajDto.getFHyyhid()),WAj::getFHyyhid, ajDto.getFHyyhid()) | |
48 | + //.eq(StringUtil.isNotEmpty(ajDto.getFAjjl()),WAj::getFAjjl, ajDto.getFAjjl()) | |
49 | + .eq(StringUtil.isNotEmpty(ajDto.getFAjlx()),WAj::getFAjlx, ajDto.getFAjlx()) | |
50 | + .like(StringUtil.isNotEmpty(ajDto.getSj()) ,WAj::getFAjsj, ajDto.getSj()) | |
51 | + .in(StringUtil.isNotEmpty(ajDto.getFAjjl()),WAj::getFAjzt, ajzt) | |
52 | + .orderByDesc(WAj::getFCjsj) | |
53 | + .apply(StringUtil.isNotEmpty(filterFieldSql), filterFieldSql); | |
54 | + Page respIPage = this.page(page, eq); | |
55 | + return respIPage; | |
56 | + } | |
57 | + | |
58 | + @Override | |
59 | + public WAj getDetail(String id) { | |
60 | + WAj wAj = this.get(id); | |
61 | + return wAj; | |
62 | + } | |
15 | 63 | } | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/impl/WAjxqManagerImpl.java
0 → 100644
... | ... | @@ -0,0 +1,18 @@ |
1 | +package com.hotent.lpg.user.manager.impl; | |
2 | + | |
3 | +import com.hotent.base.manager.impl.BaseManagerImpl; | |
4 | +import com.hotent.lpg.common.model.WAjxq; | |
5 | +import com.hotent.lpg.user.dao.WAjxqDao; | |
6 | +import com.hotent.lpg.user.manager.WAjxqManager; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +/** | |
10 | + * 安检详情 服务实现类 | |
11 | + * | |
12 | + * @author admin | |
13 | + * @company 广州宏天软件股份有限公司 | |
14 | + * @since 2024-03-20 | |
15 | + */ | |
16 | +@Service | |
17 | +public class WAjxqManagerImpl extends BaseManagerImpl<WAjxqDao, WAjxq> implements WAjxqManager { | |
18 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/impl/WBxbManagerImpl.java
0 → 100644
... | ... | @@ -0,0 +1,142 @@ |
1 | +package com.hotent.lpg.user.manager.impl; | |
2 | + | |
3 | + | |
4 | +import cn.hutool.core.bean.BeanUtil; | |
5 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
6 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
7 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
8 | +import com.hotent.base.id.IdGenerator; | |
9 | +import com.hotent.base.manager.impl.BaseManagerImpl; | |
10 | +import com.hotent.base.util.StringUtil; | |
11 | +import com.hotent.lpg.common.enums.BxztEnum; | |
12 | +import com.hotent.lpg.common.model.WBxb; | |
13 | +import com.hotent.lpg.common.model.WHyxx; | |
14 | +import com.hotent.lpg.user.dao.WBxbDao; | |
15 | +import com.hotent.lpg.user.dao.WHyxxDao; | |
16 | +import com.hotent.lpg.user.dto.BxRequest; | |
17 | +import com.hotent.lpg.user.manager.WBxbManager; | |
18 | +import com.hotent.lpg.user.manager.WHyxxManager; | |
19 | +import com.hotent.lpg.user.vo.BxbResponse; | |
20 | +import com.hotent.lpg.user.vo.WHydzVo; | |
21 | +import com.hotent.runtime.script.ScriptImpl; | |
22 | +import com.hotent.uc.api.model.IUser; | |
23 | +import lombok.extern.slf4j.Slf4j; | |
24 | +import org.springframework.stereotype.Service; | |
25 | +import org.springframework.transaction.annotation.Transactional; | |
26 | + | |
27 | +import javax.annotation.Resource; | |
28 | +import java.time.LocalDateTime; | |
29 | + | |
30 | +/** | |
31 | + * 报修表 服务实现类 | |
32 | + * | |
33 | + * @author 超级管理员 | |
34 | + * @company 广州宏天软件股份有限公司 | |
35 | + * @since 2024-04-07 | |
36 | + */ | |
37 | +@Slf4j | |
38 | +@Transactional(rollbackFor = Exception.class) | |
39 | +@Service | |
40 | +public class WBxbManagerImpl extends BaseManagerImpl<WBxbDao, WBxb> implements WBxbManager { | |
41 | + @Resource | |
42 | + private ScriptImpl script; | |
43 | + @Resource | |
44 | + private WHyxxDao wHyxxDao; | |
45 | + @Resource | |
46 | + private IdGenerator idGenerator; | |
47 | + @Resource | |
48 | + private WHyxxManager wHyxxManager; | |
49 | + | |
50 | + @Override | |
51 | + public void cancal(String id) { | |
52 | + WBxb wBxb = this.getDetail(id); | |
53 | + if (wBxb == null) { | |
54 | + throw new RuntimeException("报修工单不存在"); | |
55 | + } | |
56 | + if (BxztEnum.ycl.getInfo().equals(wBxb.getFZt())) { | |
57 | + throw new RuntimeException("报修工单已处理"); | |
58 | + } | |
59 | + if (BxztEnum.yqx.getInfo().equals(wBxb.getFZt())) { | |
60 | + throw new RuntimeException("报修工单已取消"); | |
61 | + } | |
62 | + wBxb.setFQxsj(LocalDateTime.now()); | |
63 | + wBxb.setFZt(BxztEnum.yqx.getInfo()); | |
64 | + this.updateById(wBxb); | |
65 | + } | |
66 | + | |
67 | + | |
68 | + @Override | |
69 | + public WBxb getDetail(String id) { | |
70 | + WBxb wBxb = this.get(id); | |
71 | + BxbResponse bxbResponse = new BxbResponse(); | |
72 | + BeanUtil.copyProperties(wBxb,bxbResponse); | |
73 | + return bxbResponse; | |
74 | + } | |
75 | + | |
76 | + @Override | |
77 | + public WBxb saveBx(BxRequest bxRequest, String type) { | |
78 | + IUser currentUser = script.getCurrentUser(); | |
79 | + WHyxx wHyxx = new WHyxx(); | |
80 | + if ("1".equals(type)) { | |
81 | + wHyxx = wHyxxDao.selectOne(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFUserid,currentUser.getUserId())); | |
82 | + } else if ("2".equals(type)) { | |
83 | + wHyxx = wHyxxDao.selectOne(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFUserid,bxRequest.getHyyhid())); | |
84 | + } | |
85 | + WBxb wBxb = new WBxb(); | |
86 | + wBxb.setFBxlx(bxRequest.getBxlx()); | |
87 | + wBxb.setFBxlxmx(bxRequest.getBxlxmx()); | |
88 | + wBxb.setFWtms(bxRequest.getWtms()); | |
89 | + wBxb.setFWttp(bxRequest.getWttp()); | |
90 | + wBxb.setFHyyhid(bxRequest.getHyyhid()); | |
91 | + wBxb.setFLxdzsf(bxRequest.getLxdzsf()); | |
92 | + wBxb.setFLxdzs(bxRequest.getLxdzs()); | |
93 | + wBxb.setFLxdzq(bxRequest.getLxdzq()); | |
94 | + wBxb.setFLxdzjd(bxRequest.getLxdzjd()); | |
95 | + wBxb.setFLxdzxxdz(bxRequest.getLxdzxxdz()); | |
96 | + wBxb.setFZt(BxztEnum.dcl.getInfo()); | |
97 | + wBxb.setFGdh(idGenerator.getSuid()); | |
98 | + wBxb.setFXdsj(LocalDateTime.now()); | |
99 | + wBxb.setFGdlx("报修"); | |
100 | + wBxb.setFJd(bxRequest.getJd()); | |
101 | + wBxb.setFWd(bxRequest.getWd()); | |
102 | + wBxb.setFXdrmc(currentUser.getFullname()); | |
103 | + wBxb.setFXdrid(currentUser.getUserId()); | |
104 | + if ("1".equals(type)) { | |
105 | + wBxb.setFLxr(bxRequest.getXdxm()); | |
106 | + wBxb.setFLxrdh(bxRequest.getLxfs()); | |
107 | + wBxb.setFHyxm(wHyxx.getFXm()); | |
108 | + wBxb.setFHyyhid(wHyxx.getFUserid()); | |
109 | + } else { | |
110 | + wBxb.setFLxr(wHyxx.getFXm()); | |
111 | + wBxb.setFLxrdh(bxRequest.getLxfs()); | |
112 | + wBxb.setFHyxm(wHyxx.getFXm()); | |
113 | + wBxb.setFHyyhid(wHyxx.getFUserid()); | |
114 | + | |
115 | + if (StringUtil.isEmpty(bxRequest.getHyyhid())) { | |
116 | + WHydzVo wHydzVo = new WHydzVo(); | |
117 | + wHydzVo.setFLxr(bxRequest.getHyxm()); | |
118 | + wHydzVo.setFLxrdh(bxRequest.getLxfs()); | |
119 | + wHydzVo.setFLxrsf(bxRequest.getLxdzsf()); | |
120 | + wHydzVo.setFLxrs(bxRequest.getLxdzs()); | |
121 | + wHydzVo.setFLxrq(bxRequest.getLxdzq()); | |
122 | + wHydzVo.setFLxrjd(bxRequest.getLxdzjd()); | |
123 | + wHydzVo.setFLxrxxdz(bxRequest.getLxdzxxdz()); | |
124 | + wHydzVo.setFJd(bxRequest.getJd()); | |
125 | + wHydzVo.setFWd(bxRequest.getWd()); | |
126 | + wHydzVo.setFHylx(bxRequest.getHylx()); | |
127 | + wHydzVo.setFSfzh(bxRequest.getSfzh()); | |
128 | + WHyxx hyxxByHydz = wHyxxManager.getHyxxByHydz(wHydzVo); | |
129 | + wBxb.setFHyyhid(hyxxByHydz.getFUserid()); | |
130 | + } | |
131 | + } | |
132 | + this.save(wBxb); | |
133 | + return wBxb; | |
134 | + } | |
135 | + | |
136 | + @Override | |
137 | + public IPage<BxbResponse> bxbPage(Page page, WBxb wBxb) { | |
138 | + return null; | |
139 | + } | |
140 | + | |
141 | + | |
142 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/impl/WHyxxManagerImpl.java
1 | 1 | package com.hotent.lpg.user.manager.impl; |
2 | 2 | |
3 | 3 | import cn.hutool.core.bean.BeanUtil; |
4 | +import cn.hutool.core.util.ObjectUtil; | |
4 | 5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
5 | 6 | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
6 | 7 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
8 | +import com.hotent.base.exception.BaseException; | |
7 | 9 | import com.hotent.base.manager.impl.BaseManagerImpl; |
10 | +import com.hotent.base.util.StringUtil; | |
8 | 11 | import com.hotent.base.util.time.DateFormatUtil; |
9 | 12 | import com.hotent.lpg.common.enums.QpztEnum; |
10 | 13 | import com.hotent.lpg.common.enums.RzztEnum; |
14 | +import com.hotent.lpg.common.enums.SfztEnum; | |
15 | +import com.hotent.lpg.common.enums.UserlxEnum; | |
11 | 16 | import com.hotent.lpg.common.model.*; |
12 | 17 | import com.hotent.lpg.user.dao.WCzxxDao; |
13 | 18 | import com.hotent.lpg.user.dao.WHyxxDao; |
14 | 19 | import com.hotent.lpg.user.manager.WDdManager; |
20 | +import com.hotent.lpg.user.manager.WHydzManager; | |
15 | 21 | import com.hotent.lpg.user.manager.WHyxxManager; |
16 | 22 | import com.hotent.lpg.user.manager.WHyyqjlManager; |
23 | +import com.hotent.lpg.user.vo.WHydzVo; | |
17 | 24 | import com.hotent.uc.manager.UserManager; |
25 | +import com.hotent.uc.model.User; | |
18 | 26 | import com.hotent.uc.params.user.UserVo; |
27 | +import com.hotent.uc.util.ContextUtil; | |
19 | 28 | import lombok.extern.slf4j.Slf4j; |
20 | 29 | import org.springframework.stereotype.Service; |
21 | 30 | import org.springframework.transaction.annotation.Transactional; |
... | ... | @@ -25,6 +34,7 @@ import java.time.Duration; |
25 | 34 | import java.time.LocalDateTime; |
26 | 35 | import java.util.ArrayList; |
27 | 36 | import java.util.List; |
37 | +import java.util.UUID; | |
28 | 38 | |
29 | 39 | @Transactional |
30 | 40 | @Service |
... | ... | @@ -40,6 +50,17 @@ public class WHyxxManagerImpl extends BaseManagerImpl<WHyxxDao, WHyxx> implement |
40 | 50 | private UserManager userManager; |
41 | 51 | @Resource |
42 | 52 | private WCzxxDao wCzxxDao; |
53 | + @Resource | |
54 | + private WHydzManager wHydzManager; | |
55 | + | |
56 | + /** | |
57 | + * 会员角色编码 | |
58 | + */ | |
59 | + public static final String USER_ROLE_CODE = "hyyh"; | |
60 | + /** | |
61 | + * 会员组织编码 | |
62 | + */ | |
63 | + public static final String USER_ORG_CODE = "gsmc"; | |
43 | 64 | |
44 | 65 | |
45 | 66 | @Override |
... | ... | @@ -162,4 +183,81 @@ public class WHyxxManagerImpl extends BaseManagerImpl<WHyxxDao, WHyxx> implement |
162 | 183 | wHyxx_select.setFTjsmrzsj(LocalDateTime.now()); |
163 | 184 | baseMapper.updateById(wHyxx_select); |
164 | 185 | } |
186 | + | |
187 | + @Override | |
188 | + public WHyxx getHyxxByHydz(WHydzVo wHydzVo) { | |
189 | + WHyxx hyxx = this.getOne(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFSjh, wHydzVo.getFLxrdh())); | |
190 | + try { | |
191 | + if (BeanUtil.isEmpty(hyxx)) { | |
192 | + WHyxx hyxx1 = new WHyxx(); | |
193 | + hyxx1.setFSjh(wHydzVo.getFLxrdh()); | |
194 | + hyxx1.setFHync(wHydzVo.getFLxr()); | |
195 | + hyxx1.setFXm(wHydzVo.getFLxr()); | |
196 | + hyxx1.setFSfzc(SfztEnum.n.getInfo()); | |
197 | + | |
198 | + hyxx1.setFHylx(wHydzVo.getFHylx()); | |
199 | + hyxx1.setFSfzh(wHydzVo.getFSfzh()); | |
200 | + hyxx1.setFShtysbm(wHydzVo.getFShtysbm()); | |
201 | + hyxx = createByHyxx(hyxx1); | |
202 | + } | |
203 | + List<WHydz> dz = wHydzManager.list(Wrappers.<WHydz>lambdaQuery() | |
204 | + .eq(WHydz::getFHyyhid, wHydzVo.getFHyyhid()) | |
205 | + .eq(WHydz::getFLxrsf, wHydzVo.getFLxrsf()) | |
206 | + .eq(WHydz::getFLxrjd, wHydzVo.getFLxrjd()) | |
207 | + .eq(WHydz::getFLxrq, wHydzVo.getFLxrq()) | |
208 | + .eq(WHydz::getFLxrs, wHydzVo.getFLxrs()) | |
209 | + ); | |
210 | + if (dz == null || dz.size() == 0) { | |
211 | + wHydzVo.setFHyyhid(hyxx.getFUserid()); | |
212 | + wHydzManager.save(wHydzVo); | |
213 | + } | |
214 | + } catch (Exception e) { | |
215 | + log.error(e.getMessage()); | |
216 | + } | |
217 | + return hyxx; | |
218 | + } | |
219 | + | |
220 | + @Override | |
221 | + public WHyxx createByHyxx(WHyxx wHyxx) throws Exception { | |
222 | + if (StringUtil.isEmpty(wHyxx.getFSjh())) { | |
223 | + throw new BaseException("手机号不能为空"); | |
224 | + } | |
225 | + com.hotent.uc.model.User selectUser = userManager.getOne(Wrappers.<com.hotent.uc.model.User>query().lambda().eq(com.hotent.uc.model.User::getMobile, wHyxx.getFSjh())); | |
226 | + List<WHyxx> wHyxxes = baseMapper.selectList(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFSjh, wHyxx.getFSjh())); | |
227 | + if (ObjectUtil.isNotEmpty(wHyxxes)) { | |
228 | + throw new BaseException("该手机号已注册"); | |
229 | + } | |
230 | + wHyxx.setFHync(StringUtil.isEmpty(wHyxx.getFHync()) ? wHyxx.getFSjh() : wHyxx.getFHync()); | |
231 | + wHyxx.setFXm(StringUtil.isEmpty(wHyxx.getFXm()) ? wHyxx.getFSjh() : wHyxx.getFXm()); | |
232 | + wHyxx.setFCjsj(LocalDateTime.now()); | |
233 | + wHyxx.setFCjr(ContextUtil.getCurrentUser() != null ? ContextUtil.getCurrentUser().getFullname() : wHyxx.getFXm()); | |
234 | + wHyxx.setFHybh("HY-" + UUID.randomUUID().toString().replace("-", "")); | |
235 | + wHyxx.setFMm("lpg@A1b2c3"); | |
236 | + this.save(wHyxx); | |
237 | + //添加宏天用户 | |
238 | + if (ObjectUtil.isNull(selectUser)) { | |
239 | + UserVo userVo = new UserVo(); | |
240 | + userVo.setAccount(wHyxx.getFSjh()); | |
241 | + userVo.setMobile(wHyxx.getFSjh()); | |
242 | + userVo.setFullname(wHyxx.getFXm()); | |
243 | + userVo.setPassword("lpg@A1b2c3"); | |
244 | + userVo.setStatus(1); | |
245 | + userVo.setRoleCode(USER_ROLE_CODE); | |
246 | + userVo.setUserType(UserlxEnum.hy.getInfo()); | |
247 | + User addUser = userManager.addUser(userVo); | |
248 | +// orgManager.addUsersForOrg(USER_ORG_CODE, addUser.getAccount()); | |
249 | +// this.update(null, Wrappers.lambdaUpdate(WHyxx.class).set(WHyxx::getFUserid, addUser.getId()).set(WHyxx::getFHtzzcode, USER_ORG_CODE).eq(WHyxx::getId, wHyxx.getId())); | |
250 | + this.update(null, Wrappers.lambdaUpdate(WHyxx.class).set(WHyxx::getFUserid, addUser.getId()).eq(WHyxx::getId, wHyxx.getId())); | |
251 | + wHyxx.setFUserid(addUser.getId()); | |
252 | + } else { | |
253 | +// orgManager.addUsersForOrg(USER_ORG_CODE, selectUser.getAccount()); | |
254 | +// this.update(null, Wrappers.lambdaUpdate(WHyxx.class).set(WHyxx::getFUserid, selectUser.getId()).set(WHyxx::getFHtzzcode, USER_ORG_CODE).eq(WHyxx::getId, wHyxx.getId())); | |
255 | + this.update(null, Wrappers.lambdaUpdate(WHyxx.class).set(WHyxx::getFUserid, selectUser.getId()).eq(WHyxx::getId, wHyxx.getId())); | |
256 | + wHyxx.setFUserid(selectUser.getId()); | |
257 | + } | |
258 | + | |
259 | + wHyxx.setFHtzzcode(USER_ORG_CODE); | |
260 | + return wHyxx; | |
261 | + } | |
262 | + | |
165 | 263 | } | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/vo/AjDetailResponse.java
0 → 100644
... | ... | @@ -0,0 +1,16 @@ |
1 | +package com.hotent.lpg.user.vo; | |
2 | + | |
3 | +import com.hotent.lpg.common.model.WAj; | |
4 | +import com.hotent.lpg.common.model.WAjxq; | |
5 | +import lombok.Data; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +@Data | |
10 | +public class AjDetailResponse { | |
11 | + | |
12 | + private WAj aj; | |
13 | + | |
14 | + private List<WAjxq> ajxq; | |
15 | + | |
16 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/vo/AjxxVo.java
0 → 100644
backend/lpg-user/src/main/java/com/hotent/lpg/user/vo/BxbResponse.java
0 → 100644
... | ... | @@ -0,0 +1,21 @@ |
1 | +package com.hotent.lpg.user.vo; | |
2 | + | |
3 | +import com.hotent.lpg.common.model.WBxb; | |
4 | +import lombok.Data; | |
5 | + | |
6 | +@Data | |
7 | +public class BxbResponse extends WBxb { | |
8 | + /** | |
9 | + * 地址全称 | |
10 | + */ | |
11 | + private String ddqc; | |
12 | + | |
13 | + public String getDdqc() { | |
14 | + return this.getFLxdzsf() + this.getFLxdzs() + this.getFLxdzq() + this.getFLxdzjd() + this.getFLxdzxxdz(); | |
15 | + } | |
16 | + | |
17 | + public void setDdqc(String ddqc) { | |
18 | + this.ddqc = ddqc; | |
19 | + } | |
20 | + | |
21 | +} | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/vo/WHydzVo.java
0 → 100644
... | ... | @@ -0,0 +1,15 @@ |
1 | +package com.hotent.lpg.user.vo; | |
2 | + | |
3 | +import com.hotent.lpg.common.model.WHydz; | |
4 | +import io.swagger.annotations.ApiModelProperty; | |
5 | +import lombok.Data; | |
6 | + | |
7 | +@Data | |
8 | +public class WHydzVo extends WHydz { | |
9 | + @ApiModelProperty(value = "会员类型") | |
10 | + private String fHylx; | |
11 | + @ApiModelProperty(value = "身份证号") | |
12 | + private String fSfzh; | |
13 | + @ApiModelProperty(value = "社会统一识别码") | |
14 | + private String fShtysbm; | |
15 | +} | ... | ... |
backend/lpg/src/main/java/com/hotent/lpg/controller/hy/AjController.java
... | ... | @@ -1,72 +0,0 @@ |
1 | -package com.hotent.lpg.controller.hy; | |
2 | - | |
3 | -import cn.hutool.core.util.ObjectUtil; | |
4 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
5 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
6 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
7 | -import com.hotent.base.model.CommonResult; | |
8 | -import com.hotent.base.util.StringUtil; | |
9 | -import com.hotent.lpg.manager.WAjManager; | |
10 | -import com.hotent.lpg.manager.WAjxqManager; | |
11 | -import com.hotent.lpg.model.WAj; | |
12 | -import com.hotent.lpg.model.WAjxq; | |
13 | -import com.hotent.lpg.model.dto.AjDto; | |
14 | -import com.hotent.lpg.model.response.AjDetailResponse; | |
15 | -import com.hotent.lpg.model.vo.AjxxVo; | |
16 | -import com.hotent.uc.util.ContextUtil; | |
17 | -import io.swagger.annotations.ApiOperation; | |
18 | -import org.springframework.beans.factory.annotation.Autowired; | |
19 | -import org.springframework.format.annotation.DateTimeFormat; | |
20 | -import org.springframework.web.bind.annotation.GetMapping; | |
21 | -import org.springframework.web.bind.annotation.RequestMapping; | |
22 | -import org.springframework.web.bind.annotation.RequestParam; | |
23 | -import org.springframework.web.bind.annotation.RestController; | |
24 | - | |
25 | -import java.time.LocalDateTime; | |
26 | -import java.time.format.DateTimeFormatter; | |
27 | -import java.util.Date; | |
28 | -import java.util.List; | |
29 | - | |
30 | -@RestController | |
31 | -@RequestMapping("/customer/aj/") | |
32 | -public class AjController { | |
33 | - | |
34 | - @Autowired | |
35 | - private WAjManager wAjManager; | |
36 | - @Autowired | |
37 | - private WAjxqManager wAjxqManager; | |
38 | - | |
39 | - @GetMapping("/pageList") | |
40 | - @ApiOperation("会员安检列表") | |
41 | - public CommonResult<IPage<AjxxVo>> pageList(Page page, String ajlx, String ajjl, String ajsj) { | |
42 | - | |
43 | - AjDto ajDto = new AjDto(); | |
44 | - ajDto.setFHyyhid(ContextUtil.getCurrentUserId()); | |
45 | - ajDto.setFAjlx(ajlx); | |
46 | - ajDto.setFAjjl(ajjl); | |
47 | - ajDto.setSj(ajsj); | |
48 | - IPage<AjxxVo> responseIPage = wAjManager.pageList(page,ajDto,null); | |
49 | - return CommonResult.<IPage<AjxxVo>>ok().value(responseIPage); | |
50 | - } | |
51 | - | |
52 | - /** | |
53 | - * 根据id获取详情 | |
54 | - * | |
55 | - * @param id | |
56 | - * @return | |
57 | - * @throws Exception ModelAndView | |
58 | - */ | |
59 | - @GetMapping(value = "/getDetail") | |
60 | - public CommonResult<AjDetailResponse> getDetail(@RequestParam(required = true) String id) throws Exception { | |
61 | - AjDetailResponse response = new AjDetailResponse(); | |
62 | - WAj aj = wAjManager.getDetail(id); | |
63 | - if (ObjectUtil.isNull(aj)) { | |
64 | - return CommonResult.<AjDetailResponse>ok().value(response); | |
65 | - } | |
66 | - List<WAjxq> list = wAjxqManager.list(new LambdaQueryWrapper<WAjxq>().eq(WAjxq::getfAjid, id)); | |
67 | - response.setAj(aj); | |
68 | - response.setAjxq(list); | |
69 | - return CommonResult.<AjDetailResponse>ok().value(response); | |
70 | - } | |
71 | - | |
72 | -} |
backend/lpg/src/main/java/com/hotent/lpg/controller/hy/BxbController.java
... | ... | @@ -1,119 +0,0 @@ |
1 | -package com.hotent.lpg.controller.hy; | |
2 | - | |
3 | - | |
4 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
5 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
7 | -import com.hotent.base.controller.BaseController; | |
8 | -import com.hotent.base.model.CommonResult; | |
9 | -import com.hotent.lpg.manager.WBxbManager; | |
10 | -import com.hotent.lpg.manager.WHyxxManager; | |
11 | -import com.hotent.lpg.model.WBxb; | |
12 | -import com.hotent.lpg.model.WHyxx; | |
13 | -import com.hotent.lpg.model.request.BxRequest; | |
14 | -import com.hotent.lpg.model.response.BxbResponse; | |
15 | -import com.hotent.runtime.script.ScriptImpl; | |
16 | -import io.swagger.annotations.ApiOperation; | |
17 | -import io.swagger.annotations.ApiParam; | |
18 | -import lombok.extern.slf4j.Slf4j; | |
19 | -import org.springframework.web.bind.annotation.*; | |
20 | - | |
21 | -import javax.annotation.Resource; | |
22 | - | |
23 | -/** | |
24 | - * 会员端:报修管理 | |
25 | - * | |
26 | - * @author 超级管理员 | |
27 | - * @company 广州宏天软件股份有限公司 | |
28 | - * @since 2024-04-07 | |
29 | - */ | |
30 | -@Slf4j | |
31 | -@RestController | |
32 | -@RequestMapping("/customer/bx") | |
33 | -public class BxbController extends BaseController<WBxbManager, WBxb> { | |
34 | - | |
35 | - @Resource | |
36 | - private ScriptImpl scriptImpl; | |
37 | - @Resource | |
38 | - private WHyxxManager wHyxxManager; | |
39 | - | |
40 | - /** | |
41 | - * 根据id获取报修表数据详情 | |
42 | - * | |
43 | - * @param id | |
44 | - * @return | |
45 | - * @throws Exception ModelAndView | |
46 | - */ | |
47 | - @GetMapping(value = "/getDetail") | |
48 | - @ApiOperation(value = "根据id获取报修表数据详情", httpMethod = "GET", notes = "根据id获取报修表数据详情") | |
49 | - public CommonResult<WBxb> getDetail(@ApiParam(name = "id", value = "业务对象主键", required = true) @RequestParam(required = true) String id) throws Exception { | |
50 | - return CommonResult.<WBxb>ok().value(baseService.getDetail(id)); | |
51 | - } | |
52 | - | |
53 | - /** | |
54 | - * 创建工单 | |
55 | - * | |
56 | - * @param bxRequest | |
57 | - * @return | |
58 | - * @throws Exception | |
59 | - * @throws | |
60 | - */ | |
61 | - @PostMapping(value = "/save") | |
62 | - @ApiOperation(value = "创建工单", httpMethod = "POST", notes = "创建工单") | |
63 | - public CommonResult<String> save(@ApiParam(name = "bxRequest", value = "报修表对象", required = true) @RequestBody BxRequest bxRequest) throws Exception { | |
64 | - log.info("新增保修参数,bxRequest={}", bxRequest); | |
65 | - try { | |
66 | - String currentUserId = scriptImpl.getCurrentUserId(); | |
67 | - WHyxx one = wHyxxManager.getOne(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFUserid, currentUserId)); | |
68 | - if (one == null) { | |
69 | - throw new RuntimeException("会员信息不存在"); | |
70 | - } | |
71 | - bxRequest.setHyyhid(one.getFUserid()); | |
72 | - baseService.saveBx(bxRequest,"1"); | |
73 | - } catch (Exception e) { | |
74 | - return CommonResult.<String>error().message(e.getMessage()); | |
75 | - } | |
76 | - return CommonResult.<String>ok().message("操作成功"); | |
77 | - } | |
78 | - | |
79 | - /** | |
80 | - * 会员端报修分页 | |
81 | - * | |
82 | - * @param page | |
83 | - * @param wBxb | |
84 | - * @return | |
85 | - */ | |
86 | - @GetMapping(value = "/bxbPage", produces = {"application/json; charset=utf-8"}) | |
87 | - @ApiOperation(value = "会员报修列表", httpMethod = "GET", notes = "会员报修列表") | |
88 | - public CommonResult bxbPage(Page page, WBxb wBxb) { | |
89 | - log.info("保修列表参数,page={},wBxb={}", page, wBxb); | |
90 | - String currentUserId = scriptImpl.getCurrentUserId(); | |
91 | - WHyxx wHyxx = wHyxxManager.getOne(Wrappers.<WHyxx>lambdaQuery().eq(WHyxx::getFUserid, currentUserId)); | |
92 | - if (wHyxx == null) { | |
93 | - return CommonResult.error("会员信息不存在"); | |
94 | - } | |
95 | - wBxb.setFHyyhid(wHyxx.getFUserid()); | |
96 | - IPage<BxbResponse> resultPage = baseService.bxbPage(page, wBxb); | |
97 | - return new CommonResult(true, "", resultPage); | |
98 | - } | |
99 | - | |
100 | - /** | |
101 | - * 取消工单 | |
102 | - * | |
103 | - * @param id 工单id | |
104 | - * @return | |
105 | - * @throws Exception | |
106 | - * @throws | |
107 | - */ | |
108 | - @PostMapping(value = "/cancal") | |
109 | - @ApiOperation(value = "取消工单", httpMethod = "POST", notes = "取消工单") | |
110 | - public CommonResult<String> cancal(String id) throws Exception { | |
111 | - log.info("新增保修参数,id={}", id); | |
112 | - try { | |
113 | - baseService.cancal(id); | |
114 | - } catch (Exception e) { | |
115 | - return CommonResult.<String>error().message(e.getMessage()); | |
116 | - } | |
117 | - return CommonResult.<String>ok().message("操作成功"); | |
118 | - } | |
119 | -} |
backend/lpg/src/main/java/com/hotent/lpg/model/dto/AjDto.java
backend/lpg/src/main/java/com/hotent/lpg/model/request/BxRequest.java
... | ... | @@ -1,106 +0,0 @@ |
1 | -package com.hotent.lpg.model.request; | |
2 | - | |
3 | -import lombok.Data; | |
4 | - | |
5 | -/** | |
6 | - * 报修表请求参数 | |
7 | - */ | |
8 | -@Data | |
9 | -public class BxRequest { | |
10 | - // 会员端:新增工单参数 | |
11 | - /** | |
12 | - * 报修类型 | |
13 | - */ | |
14 | - private String bxlx; | |
15 | - /** | |
16 | - * 问题描述 | |
17 | - */ | |
18 | - private String wtms; | |
19 | - /** | |
20 | - * 问题图片 | |
21 | - */ | |
22 | - private String wttp; | |
23 | - /** | |
24 | - * 工单类型 | |
25 | - */ | |
26 | - private String gdlx; | |
27 | - /** | |
28 | - * 下单姓名 | |
29 | - */ | |
30 | - private String xdxm; | |
31 | - /** | |
32 | - * 会员用户ID | |
33 | - */ | |
34 | - private String hyyhid; | |
35 | - /** | |
36 | - * 联系方式 | |
37 | - */ | |
38 | - private String lxfs; | |
39 | - /** | |
40 | - * 联系地址省 | |
41 | - */ | |
42 | - private String lxdzsf; | |
43 | - /** | |
44 | - * 联系地址市 | |
45 | - */ | |
46 | - private String lxdzs; | |
47 | - /** | |
48 | - * 联系地址区 | |
49 | - */ | |
50 | - private String lxdzq; | |
51 | - /** | |
52 | - * 联系地址街道 | |
53 | - */ | |
54 | - private String lxdzjd; | |
55 | - /** | |
56 | - * 联系地址详细地址 | |
57 | - */ | |
58 | - private String lxdzxxdz; | |
59 | - /** | |
60 | - * 报修类型明细 | |
61 | - */ | |
62 | - private String bxlxmx; | |
63 | - /** | |
64 | - * 经度 | |
65 | - */ | |
66 | - private String jd; | |
67 | - /** | |
68 | - * 维度 | |
69 | - */ | |
70 | - private String wd; | |
71 | - | |
72 | - | |
73 | - //员工端:提交工单参数 | |
74 | - /** | |
75 | - * 维修结果 | |
76 | - */ | |
77 | - private String wxjg; | |
78 | - | |
79 | - /** | |
80 | - * 维修图片 | |
81 | - */ | |
82 | - private String wxtp; | |
83 | - | |
84 | - /** | |
85 | - * 维修备注 | |
86 | - */ | |
87 | - private String wxbz; | |
88 | - | |
89 | - /** | |
90 | - * 维修id | |
91 | - */ | |
92 | - private String id; | |
93 | - /** | |
94 | - * 身份证号 | |
95 | - */ | |
96 | - private String sfzh; | |
97 | - /** | |
98 | - * 会员类型 | |
99 | - */ | |
100 | - private String hylx; | |
101 | - /** | |
102 | - * 会员姓名 | |
103 | - */ | |
104 | - private String hyxm; | |
105 | - | |
106 | -} |
backend/lpg/src/main/java/com/hotent/lpg/model/response/AjDetailResponse.java
... | ... | @@ -1,16 +0,0 @@ |
1 | -package com.hotent.lpg.model.response; | |
2 | - | |
3 | -import com.hotent.lpg.model.WAj; | |
4 | -import com.hotent.lpg.model.WAjxq; | |
5 | -import lombok.Data; | |
6 | - | |
7 | -import java.util.List; | |
8 | - | |
9 | -@Data | |
10 | -public class AjDetailResponse { | |
11 | - | |
12 | - private WAj aj; | |
13 | - | |
14 | - private List<WAjxq> ajxq; | |
15 | - | |
16 | -} |
backend/lpg/src/main/java/com/hotent/lpg/model/response/BxbResponse.java
... | ... | @@ -1,21 +0,0 @@ |
1 | -package com.hotent.lpg.model.response; | |
2 | - | |
3 | -import com.hotent.lpg.model.WBxb; | |
4 | -import lombok.Data; | |
5 | - | |
6 | -@Data | |
7 | -public class BxbResponse extends WBxb { | |
8 | - /** | |
9 | - * 地址全称 | |
10 | - */ | |
11 | - private String ddqc; | |
12 | - | |
13 | - public String getDdqc() { | |
14 | - return this.getFLxdzsf() + this.getFLxdzs() + this.getFLxdzq() + this.getFLxdzjd() + this.getFLxdzxxdz(); | |
15 | - } | |
16 | - | |
17 | - public void setDdqc(String ddqc) { | |
18 | - this.ddqc = ddqc; | |
19 | - } | |
20 | - | |
21 | -} |
backend/lpg/src/main/java/com/hotent/lpg/model/vo/AjxxVo.java
backend/lpg/src/main/java/com/hotent/lpg/model/vo/WHydzVo.java
... | ... | @@ -1,17 +0,0 @@ |
1 | -package com.hotent.lpg.model.vo; | |
2 | - | |
3 | -import com.baomidou.mybatisplus.annotation.TableField; | |
4 | -import com.fasterxml.jackson.annotation.JsonProperty; | |
5 | -import com.hotent.lpg.model.WHydz; | |
6 | -import io.swagger.annotations.ApiModelProperty; | |
7 | -import lombok.Data; | |
8 | - | |
9 | -@Data | |
10 | -public class WHydzVo extends WHydz { | |
11 | - @ApiModelProperty(value = "会员类型") | |
12 | - private String fHylx; | |
13 | - @ApiModelProperty(value = "身份证号") | |
14 | - private String fSfzh; | |
15 | - @ApiModelProperty(value = "社会统一识别码") | |
16 | - private String fShtysbm; | |
17 | -} |