| | |
| | | import com.itextpdf.text.Paragraph; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.DictHosp; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.domain.TjOrder; |
| | | import com.ltkj.hosp.domain.TjOrderYcxm; |
| | | import com.ltkj.framework.config.UserHoder; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.mapper.TjCustomerMapper; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.vodomain.ShenGaoTiZhongVo; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | // @PostMapping("/wx/bindPhoneV2") |
| | | // public AjaxResult bindPhoneV2(@RequestBody String json) { |
| | | // cn.hutool.json.JSONObject entries = JSONUtil.parseObj(json); |
| | | // String phone = entries.getStr("phone"); |
| | | // Wxuser wxuser = UserHoder.getWxuser(); |
| | | // LambdaQueryWrapper<Wxuser> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(Wxuser::getOpenid, wxuser.getOpenid()); |
| | | // Wxuser one = wxuserService.getOne(wq); |
| | | // System.out.println("绑定 ->"+wxuser.getOpenid()+",json = "+json); |
| | | // if (one != null){ |
| | | // one.setPhone(phone); |
| | | // wxuserService.updateById(one); |
| | | // return AjaxResult.success(); |
| | | // } |
| | | // return AjaxResult.error(); |
| | | // } |
| | | |
| | | public static void removeNullFields(JSONObject jsonObject) { |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | strings.add("orderId"); |
| | |
| | | wq.eq(TjCustomer::getCusPhone, tjCustomer.getCusPhone()); |
| | | wq.eq(TjCustomer::getCusName, tjCustomer.getCusName()); |
| | | final TjCustomer one = customerService.getOne(wq); |
| | | one.setConnect(""); |
| | | one.setConnect(null); |
| | | final boolean b = customerService.updateById(one); |
| | | if (b) { |
| | | return AjaxResult.success(); |
| | |
| | | // } |
| | | // } |
| | | |
| | | LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjCustomer::getCusIdcard, cusIdcard); |
| | | TjCustomer customer = customerService.getOne(wq); |
| | | |
| | | TjCustomer customer = customerService.getTjCustomerByCusIdCard(cusIdcard); |
| | | |
| | | String key = sysConfigService.selectConfigByKey("sfkqdyhis"); |
| | | |
| | | if (customer != null) { |
| | | customer.setConnect(tjCustomer.getConnect()); |
| | | customer.setCusPhone(tjCustomer.getCusPhone()); |
| | | customer.setCusMarryStatus(tjCustomer.getCusMarryStatus()); |
| | | customerService.updateById(customer); |
| | | return AjaxResult.success(customer); |
| | | } |
| | |
| | | LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); |
| | | qw.eq(TjCustomer::getCusPhone, phone); |
| | | List<TjCustomer> tjCustomer1 = customerService.list(qw); |
| | | if (tjCustomer1 != null && tjCustomer1.size() > 0) { |
| | | if (tjCustomer1 != null && !tjCustomer1.isEmpty()) { |
| | | List<String> num = new ArrayList<>(); |
| | | for (TjCustomer tjCustomer : tjCustomer1) { |
| | | num.add(tjCustomer.getCusIdcard()); |
| | |
| | | LambdaQueryWrapper<TjCustomer> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjCustomer::getCusPhone, cusPhone); |
| | | List<TjCustomer> list1 = customerService.list(wq1); |
| | | if (list1.size() != 0) { |
| | | if (null != list1 && !list1.isEmpty()) { |
| | | for (TjCustomer tjCustomer : list1) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | QueryWrapper<TjOrder> wq2 = new QueryWrapper<>(); |
| | |
| | | wq2.isNotNull("finish_time"); |
| | | wq2.orderByDesc("finish_time"); |
| | | List<TjOrder> list = orderService.list(wq2); |
| | | if (null != list && list.size() > 0) { |
| | | if (null != list && !list.isEmpty()) { |
| | | TjOrder tjOrder = orderService.list(wq2).get(0); |
| | | map.put("report", tjOrder); |
| | | map.put("customer", tjCustomer); |
| | |
| | | package com.ltkj.web.controller.app; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | Wxuser wxuser = UserHoder.getWxuser(); |
| | | LambdaQueryWrapper<Wxuser> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(Wxuser::getOpenid, wxuser.getOpenid()); |
| | | // System.out.println("获取 ->"+wxuser.getOpenid()); |
| | | Wxuser one = wxuserService.getOne(wq); |
| | | return AjaxResult.success(one); |
| | | } |
| | |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/wx/bindPhoneV2") |
| | | public AjaxResult bindPhoneV2(@RequestBody String json) { |
| | | cn.hutool.json.JSONObject entries = JSONUtil.parseObj(json); |
| | | String phone = entries.getStr("phone"); |
| | | Wxuser wxuser = UserHoder.getWxuser(); |
| | | LambdaQueryWrapper<Wxuser> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(Wxuser::getOpenid, wxuser.getOpenid()); |
| | | Wxuser one = wxuserService.getOne(wq); |
| | | // System.out.println("绑定 ->"+wxuser.getOpenid()+",json = "+json); |
| | | if (one != null){ |
| | | one.setPhone(phone); |
| | | wxuserService.updateById(one); |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | |
| | | LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); |
| | | qw.eq(TjCustomer::getCusPhone, phone); |
| | | List<TjCustomer> tjCustomer1 = customerService.list(qw); |
| | | if (tjCustomer1 != null && tjCustomer1.size()>0) { |
| | | if (tjCustomer1 != null && !tjCustomer1.isEmpty()) { |
| | | for (TjCustomer tjCustomer : tjCustomer1) { |
| | | tjCustomer.setConnect(openId); |
| | | customerService.updateById(tjCustomer); |
| | |
| | | @PostMapping(value = "/cusIdcard") |
| | | @ApiOperation(value = "根据身份证号获取用户信息") |
| | | // @Log(title = "客户身份信息", businessType = BusinessType.EXPORT) |
| | | @RepeatSubmit |
| | | public AjaxResult getInfoByIdCard(@RequestParam @ApiParam(value = "客户身份证号") String cusIdcard) { |
| | | if (!"".equals(cusIdcard) && cusIdcard != null) { |
| | | |
| | |
| | | tjReservationService.updateById(tjReservation); |
| | | return AjaxResult.error("对不起您的预约已超时请重新预约"); |
| | | } |
| | | LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); |
| | | qw.eq(TjCustomer::getCusIdcard, cusIdcard); |
| | | TjCustomer tjCustomer1 = tjCustomerService.getOne(qw); |
| | | TjCustomer tjCustomer1 = tjCustomerService.getTjCustomerByCusIdCard(cusIdcard); |
| | | if (tjCustomer1 != null) { |
| | | // if (null != tjReservation.getCompanyId()) tjCustomer1.setDictCompId(Long.valueOf(tjReservation.getCompanyId())); |
| | | // if (null != tjReservation.getCompany()) tjCustomer1.setCompName(tjReservation.getCompany()); |
| | |
| | | } else if(null != s && s.equalsIgnoreCase("Y")) { |
| | | tjCustomer = isRequestCommonHisApi(tjCustomer); |
| | | } |
| | | tjCustomerService.save(tjCustomer); |
| | | // TjCustomer tjCustomerByCusIdCard = tjCustomerService.getTjCustomerByCusIdCard(cusIdcard); |
| | | // if(null != tjCustomerByCusIdCard) |
| | | tjCustomerService.save(tjCustomer); |
| | | tjCustomer.setTeamNo(tjReservation.getTeamNo()); |
| | | tjCustomer.setCompId(tjReservation.getCompanyId()); |
| | | tjCustomer.setReservationId(tjReservation.getId()); |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="deleted" column="deleted"/> |
| | | <result property="phone" column="phone"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectWxuserVo"> |
| | |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="phone != null">phone,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="nickname != null">#{nickname},</if> |
| | |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | <if test="deleted != null">#{deleted},</if> |
| | | <if test="phone != null">#{phone},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="deleted != null">deleted = #{deleted},</if> |
| | | <if test="phone != null">phone = #{phone},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | | </mapper> |