Bladeren bron

多公司选择

liangpeile 1 jaar geleden
bovenliggende
commit
13453b847a

+ 2 - 0
medical_history-vue/src/views/admin/AdminDoctorUserList.vue

@@ -217,6 +217,7 @@ export default {
       money: '',
       notes: '',
       userId: '',
+
       userPhone: '',
       visiblezz: false,
       visiblezzMoney: false,
@@ -446,6 +447,7 @@ export default {
     },
 
     initDictConfig() {
+
     },
     getSuperFieldList() {
       let fieldList = []

+ 171 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/controller/AdminCompSelectController.java

@@ -0,0 +1,171 @@
+package org.jeecg.modules.adminuser.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.adminuser.entity.AdminCompSelect;
+import org.jeecg.modules.adminuser.service.IAdminCompSelectService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 用户子表-公司
+ * @Author: jeecg-boot
+ * @Date:   2023-08-14
+ * @Version: V1.0
+ */
+@Api(tags="用户子表-公司")
+@RestController
+@RequestMapping("/admincompselect/adminCompSelect")
+@Slf4j
+public class AdminCompSelectController extends JeecgController<AdminCompSelect, IAdminCompSelectService> {
+	@Autowired
+	private IAdminCompSelectService adminCompSelectService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param adminCompSelect
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "用户子表-公司-分页列表查询")
+	@ApiOperation(value="用户子表-公司-分页列表查询", notes="用户子表-公司-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<AdminCompSelect>> queryPageList(AdminCompSelect adminCompSelect,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<AdminCompSelect> queryWrapper = QueryGenerator.initQueryWrapper(adminCompSelect, req.getParameterMap());
+		Page<AdminCompSelect> page = new Page<AdminCompSelect>(pageNo, pageSize);
+		IPage<AdminCompSelect> pageList = adminCompSelectService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param adminCompSelect
+	 * @return
+	 */
+	@AutoLog(value = "用户子表-公司-添加")
+	@ApiOperation(value="用户子表-公司-添加", notes="用户子表-公司-添加")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody AdminCompSelect adminCompSelect) {
+		adminCompSelectService.save(adminCompSelect);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param adminCompSelect
+	 * @return
+	 */
+	@AutoLog(value = "用户子表-公司-编辑")
+	@ApiOperation(value="用户子表-公司-编辑", notes="用户子表-公司-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody AdminCompSelect adminCompSelect) {
+		adminCompSelectService.updateById(adminCompSelect);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "用户子表-公司-通过id删除")
+	@ApiOperation(value="用户子表-公司-通过id删除", notes="用户子表-公司-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		adminCompSelectService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "用户子表-公司-批量删除")
+	@ApiOperation(value="用户子表-公司-批量删除", notes="用户子表-公司-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.adminCompSelectService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "用户子表-公司-通过id查询")
+	@ApiOperation(value="用户子表-公司-通过id查询", notes="用户子表-公司-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<AdminCompSelect> queryById(@RequestParam(name="id",required=true) String id) {
+		AdminCompSelect adminCompSelect = adminCompSelectService.getById(id);
+		if(adminCompSelect==null) {
+			return Result.error("未找到对应数据",null);
+		}
+		return Result.OK(adminCompSelect);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param adminCompSelect
+    */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, AdminCompSelect adminCompSelect) {
+        return super.exportXls(request, adminCompSelect, AdminCompSelect.class, "用户子表-公司");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, AdminCompSelect.class);
+    }
+
+}

+ 65 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/entity/AdminCompSelect.java

@@ -0,0 +1,65 @@
+package org.jeecg.modules.adminuser.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 用户子表-公司
+ * @Author: jeecg-boot
+ * @Date:   2023-08-14
+ * @Version: V1.0
+ */
+@Data
+@TableName("admin_comp_select")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="admin_comp_select对象", description="用户子表-公司")
+public class AdminCompSelect implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建日期*/
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**公司名称*/
+	@Excel(name = "公司名称", width = 15)
+    @ApiModelProperty(value = "公司名称")
+    private String compName;
+    /**手机号*/
+    @Excel(name = "手机号", width = 15)
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+	/**外键*/
+	@Excel(name = "外键", width = 15)
+    @ApiModelProperty(value = "外键")
+    private String orderId;
+}

+ 17 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/mapper/AdminCompSelectMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.adminuser.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.adminuser.entity.AdminCompSelect;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 用户子表-公司
+ * @Author: jeecg-boot
+ * @Date:   2023-08-14
+ * @Version: V1.0
+ */
+public interface AdminCompSelectMapper extends BaseMapper<AdminCompSelect> {
+
+}

+ 5 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/mapper/xml/AdminCompSelectMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.adminuser.mapper.AdminCompSelectMapper">
+
+</mapper>

+ 14 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/service/IAdminCompSelectService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.adminuser.service;
+
+import org.jeecg.modules.adminuser.entity.AdminCompSelect;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 用户子表-公司
+ * @Author: jeecg-boot
+ * @Date:   2023-08-14
+ * @Version: V1.0
+ */
+public interface IAdminCompSelectService extends IService<AdminCompSelect> {
+
+}

+ 19 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/service/impl/AdminCompSelectServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.adminuser.service.impl;
+
+import org.jeecg.modules.adminuser.entity.AdminCompSelect;
+import org.jeecg.modules.adminuser.mapper.AdminCompSelectMapper;
+import org.jeecg.modules.adminuser.service.IAdminCompSelectService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 用户子表-公司
+ * @Author: jeecg-boot
+ * @Date:   2023-08-14
+ * @Version: V1.0
+ */
+@Service
+public class AdminCompSelectServiceImpl extends ServiceImpl<AdminCompSelectMapper, AdminCompSelect> implements IAdminCompSelectService {
+
+}

+ 86 - 32
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/service/impl/AdminUserServiceImpl.java

@@ -13,11 +13,13 @@ import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.PasswordUtil;
 import org.jeecg.common.util.RedisUtil;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.adminuser.entity.AdminCompSelect;
 import org.jeecg.modules.adminuser.entity.AdminTransferAccounts;
 import org.jeecg.modules.adminuser.entity.AdminUser;
 import org.jeecg.modules.adminuser.entity.AdminUserVO;
 import org.jeecg.modules.adminuser.mapper.AdminTransferAccountsMapper;
 import org.jeecg.modules.adminuser.mapper.AdminUserMapper;
+import org.jeecg.modules.adminuser.service.IAdminCompSelectService;
 import org.jeecg.modules.adminuser.service.IAdminUserService;
 import org.jeecg.modules.base.service.BaseCommonService;
 import org.jeecg.modules.pay.example.config.Config;
@@ -48,10 +50,7 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Random;
+import java.util.*;
 
 import static org.jeecg.modules.pay.sdk.utils.DESUtil.tripleDesEncrypt;
 
@@ -89,6 +88,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
     private AdminTransferAccountsMapper adminTransferAccountsMapper;
     @Autowired
     private IAdminUserService adminUserService;
+    @Autowired
+    private IAdminCompSelectService adminCompSelectService;
 
 
     @Override
@@ -98,18 +99,11 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
 
     @Override
     public Result saveUser(AdminUser adminUser) {
+
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         adminUser.setCompName(user.getRealname());
         String phone = adminUser.getPhone();
         String compName = adminUser.getCompName();
-        QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
-        adminUserQueryWrapper.eq("phone", phone);
-        adminUserQueryWrapper.eq("comp_name", compName);
-        List<AdminUser> list = this.list(adminUserQueryWrapper);
-        if (null != list && list.size() > 0) {
-            return Result.error("手机号已经存在,请勿重复添加");
-        }
-
         adminUser.setDoctorAndSpecialist("1");
         String salt = oConvertUtils.randomGen(8);
         adminUser.setSalt(salt);
@@ -122,25 +116,83 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         adminUser.setWisMhu("允许");
         adminUser.setCompleteInformation(1);
         adminUser.setIsTrue("1");
+        adminUser.setSysOrgCode(user.getOrgCode());
         adminUser.setYzh(user.getYzh());
         adminUser.setWisWjdc("允许");
         String passwordEncode = PasswordUtil.encrypt(adminUser.getPhone(), adminUser.getPassword(), salt);
         adminUser.setPassword(passwordEncode);
-        this.save(adminUser);
+
+
+        QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
+        adminUserQueryWrapper.eq("phone", phone);
+        AdminUser adminUsers = adminUserService.getOne(adminUserQueryWrapper);
+
+        if (null != adminUsers) {
+
+            AdminCompSelect adminCompSelect = new AdminCompSelect();
+            adminCompSelect.setOrderId(adminUsers.getId());
+            adminCompSelect.setPhone(phone);
+            adminCompSelect.setCompName(compName);
+            adminCompSelect.setSysOrgCode(adminUser.getSysOrgCode());
+
+
+            QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
+            adminCompSelectQueryWrapper.eq("phone", phone);
+            adminCompSelectQueryWrapper.eq("comp_name", compName);
+            adminCompSelectQueryWrapper.eq("sys_org_code", adminUser.getSysOrgCode());
+            List<AdminCompSelect> list = adminCompSelectService.list(adminCompSelectQueryWrapper);
+
+            if (null != list && list.size() > 0) {
+                return Result.error("该手机号已存在该公司,请更换手机号进行注册");
+            } else {
+                adminCompSelectService.save(adminCompSelect);
+            }
+        } else {
+            adminUser.setId(UUID.randomUUID().toString().replace("-", ""));
+
+            AdminCompSelect adminCompSelect = new AdminCompSelect();
+            adminCompSelect.setOrderId(adminUser.getId());
+            adminCompSelect.setPhone(phone);
+            adminCompSelect.setCompName(compName);
+            adminCompSelect.setSysOrgCode(adminUser.getSysOrgCode());
+
+            QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
+            adminCompSelectQueryWrapper.eq("phone", phone);
+            adminCompSelectQueryWrapper.eq("comp_name", compName);
+            adminCompSelectQueryWrapper.eq("sys_org_code", adminUser.getSysOrgCode());
+            List<AdminCompSelect> list = adminCompSelectService.list(adminCompSelectQueryWrapper);
+
+            if (null != list && list.size() > 0) {
+                return Result.error("该手机号已存在该公司,请更换手机号进行注册");
+            } else {
+                adminCompSelectService.save(adminCompSelect);
+            }
+
+
+            this.save(adminUser);
+
+        }
+
         return Result.OK("操作成功");
+
     }
 
     @Override
     public Result<?> giveMoney(AdminUser adminUser1) {
         String id = adminUser1.getId();
         AdminUser adminUser = this.getById(id);
+        String yzh = adminUser.getYzh();
+        if ("0".equals(yzh)) {
+            return Result.error("请确认云账户转账权限是否开启");
+        }
+
         CreateBankpayOrderRequest request = new CreateBankpayOrderRequest();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
         Date date = new Date();
         String format = sdf.format(date);
         Random random = new Random();
         int randomNumber = random.nextInt(900000) + 100000;
-        request.setOrderId("BL"+format+randomNumber);
+        request.setOrderId("BL" + format + randomNumber);
         request.setDealerId(dealer_id);
         request.setBrokerId(broker_id);
         request.setRealName(adminUser.getName());
@@ -161,16 +213,16 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
             response = clientPay.createBankpayOrder(YzhRequest.build(requestId, request));
             if (response.isSuccess()) {// 请求成功
                 CreateBankpayOrderResponse data = response.getData();
-                baseCommonService.addLog("请求成功转账的唯一标识request-id: " + requestId+"", CommonConstant.LOG_TYPE_2, 2);
-                return Result.ok("请求成功:转账金额"+request.getPay());
+                baseCommonService.addLog("请求成功转账的唯一标识request-id: " + requestId + "", CommonConstant.LOG_TYPE_2, 2);
+                return Result.ok("请求成功:转账金额" + request.getPay());
             } else {
                 System.out.println("HTTP Status Code:" + response.getHttpCode());
                 System.out.println("发生异常:" + response.getCode() + "-" + response.getMessage());
-                baseCommonService.addLog("发生异常转账的唯一标识request-id: " + requestId+ response.getCode() + "-" + response.getMessage(), CommonConstant.LOG_TYPE_2, 2);
-                return Result.error( response.getCode() + "-" + response.getMessage());
+                baseCommonService.addLog("发生异常转账的唯一标识request-id: " + requestId + response.getCode() + "-" + response.getMessage(), CommonConstant.LOG_TYPE_2, 2);
+                return Result.error(response.getCode() + "-" + response.getMessage());
             }
         } catch (Exception e) {
-            return Result.error( "请求失败");
+            return Result.error("请求失败");
         }
     }
 
@@ -253,7 +305,6 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
 //            //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
 //            QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
 //            queryWrapper.eq("phone", userPhone);
-//            queryWrapper.eq("is_true", "1");
 //            AdminUser storeMember1 = this.getOne(queryWrapper);
 //            if (storeMember1 == null) {
 //                baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
@@ -314,14 +365,20 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
             //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = this.getOne(queryWrapper);
             if (storeMember1 == null) {
                 baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
                 return Result.error("token校验该用户不存在");
             }
-            //银行卡四要素认证(上传验证码)
-           return this.bankCardFourAuthConfirm(adminUserVO,storeMember1);
+            String yzh = storeMember1.getYzh();
+            if ("1".equals(yzh)) {
+                //银行卡四要素认证(上传验证码)
+                return this.bankCardFourAuthConfirm(adminUserVO, storeMember1);
+            } else {
+                this.saveAdminUserVO(adminUserVO, storeMember1);
+                return Result.ok("操作成功");
+            }
+
         } catch (Exception e) {
             return Result.error("请求失败");
         }
@@ -343,7 +400,6 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
             //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = this.getOne(queryWrapper);
             if (storeMember1 == null) {
                 baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
@@ -378,7 +434,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         }
     }
 
-    private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO,AdminUser adminUser) {
+    private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO, AdminUser adminUser) {
         BankCardFourAuthConfirmRequest request = new BankCardFourAuthConfirmRequest();
         request.setCardNo(adminUserVO.getBackCard());
         request.setIdCard(adminUserVO.getCard());
@@ -399,7 +455,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
                 BankCardFourAuthConfirmResponse data = response.getData();
                 baseCommonService.addLog("银行卡四要素认证(上传验证码)请求的唯一标识request-id: " + requestId, CommonConstant.LOG_TYPE_2, 2);
                 System.out.println("请求成功:" + data);
-                this.saveAdminUserVO(adminUserVO,adminUser);
+                this.saveAdminUserVO(adminUserVO, adminUser);
                 return Result.ok("请求成功:" + data);
 
             } else {
@@ -413,15 +469,15 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         }
     }
 
-    public void saveAdminUserVO(AdminUserVO adminUserVO,AdminUser adminUser) {
+    public void saveAdminUserVO(AdminUserVO adminUserVO, AdminUser adminUser) {
 
         String sysOrgCode = adminUser.getSysOrgCode();
 
         QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
-        adminUserQueryWrapper.eq("phone",adminUser.getPhone());
-        adminUserQueryWrapper.eq("sys_org_code",sysOrgCode);
+        adminUserQueryWrapper.eq("phone", adminUser.getPhone());
+        adminUserQueryWrapper.eq("sys_org_code", sysOrgCode);
         AdminUser one = adminUserService.getOne(adminUserQueryWrapper);
-        if (null!=one){
+        if (null != one) {
             one.setCard(adminUserVO.getCard());
             one.setCardholderName(adminUserVO.getName());
             one.setBackCard(adminUserVO.getBackCard());
@@ -437,6 +493,4 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
     }
 
 
-
-
 }

+ 16 - 36
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/APIController.java

@@ -35,10 +35,8 @@ import org.jeecg.modules.admincasehistory.service.IAdminCaseNameService;
 import org.jeecg.modules.admincasehistory.service.IAdminMedicalHistoryService;
 import org.jeecg.modules.admincasehistory.service.IAdminPlatformService;
 import org.jeecg.modules.admincasehistory.service.IAdminUploadingNameService;
-import org.jeecg.modules.adminuser.entity.AdminPrivacy;
-import org.jeecg.modules.adminuser.entity.AdminTransferAccounts;
-import org.jeecg.modules.adminuser.entity.AdminUser;
-import org.jeecg.modules.adminuser.entity.AdminUserVO;
+import org.jeecg.modules.adminuser.entity.*;
+import org.jeecg.modules.adminuser.service.IAdminCompSelectService;
 import org.jeecg.modules.adminuser.service.IAdminPrivacyService;
 import org.jeecg.modules.adminuser.service.IAdminTransferAccountsService;
 import org.jeecg.modules.adminuser.service.IAdminUserService;
@@ -107,6 +105,8 @@ public class APIController {
     private IAdminTransferAccountsService adminTransferAccountsService;
     @Autowired
     private ISysUserService sysUserService;
+    @Autowired
+    private IAdminCompSelectService adminCompSelectService;
 
 
     @GetMapping(value = "/a")
@@ -230,7 +230,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -493,7 +492,6 @@ public class APIController {
             //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -538,7 +536,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -605,7 +602,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -651,7 +647,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -718,7 +713,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -765,7 +759,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -819,7 +812,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -870,7 +862,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -915,7 +906,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -978,7 +968,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -1024,7 +1013,6 @@ public class APIController {
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -1063,7 +1051,6 @@ public class APIController {
             //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
@@ -1113,7 +1100,7 @@ public class APIController {
     @GetMapping(value = "getCompName")
     public Result<?> getCompName(@RequestHeader("Authorization") String Authorization) {
 
-        Result<List<AdminUser>> result = new Result<>();
+        Result<List<AdminCompSelect>> result = new Result<>();
         if (Authorization.equals("")) {
             result.setMessage("token不能为空");
             return result;
@@ -1128,12 +1115,9 @@ public class APIController {
             return result;
         }
         try {
-
-            QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("phone", userPhone);
-
-            List<AdminUser> list = adminUserService.list(queryWrapper);
-
+            QueryWrapper<AdminCompSelect> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("phone",userPhone);
+            List<AdminCompSelect> list = adminCompSelectService.list(queryWrapper1);
             result.setMessage("获取用户公司信息成功");
             result.setResult(list);
             result.setCode(200);
@@ -1167,17 +1151,14 @@ public class APIController {
         }
         try {
 
-            QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("phone", userPhone);
-            List<AdminUser> list = adminUserService.list(queryWrapper);
-            for (AdminUser adminUser : list) {
-                if (adminUser.getId().equals(id)) {
-                    adminUser.setIsTrue("1");
-                } else {
-                    adminUser.setIsTrue("0");
-                }
-                adminUserService.updateById(adminUser);
-            }
+            QueryWrapper<AdminCompSelect> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("id", id);
+            AdminCompSelect adminCompSelect = adminCompSelectService.getOne(queryWrapper);
+            String orderId = adminCompSelect.getOrderId();
+            AdminUser adminUser = adminUserService.getById(orderId);
+            adminUser.setSysOrgCode(adminCompSelect.getSysOrgCode());
+            adminUser.setCompName(adminCompSelect.getCompName());
+            adminUserService.updateById(adminUser);
             result.setMessage("操作成功");
             result.setResult(null);
             result.setCode(200);
@@ -1219,7 +1200,6 @@ public class APIController {
             //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
             AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
             if (storeMember1 == null) {
                 result.setMessage("token校验该用户不存在");