Browse Source

商户认证

李书文 1 năm trước cách đây
mục cha
commit
c9d89b43c0

+ 3 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterface.java

@@ -68,4 +68,7 @@ public interface LevelOneServerInterface {
     /** 添加普通边民信息 */
     @RequestMapping("/TbPeople/rpc/peopleDto")
     public boolean peopleDto(@RequestBody PeopleDto peopleDto);
+
+    @RequestMapping("/AppUser/rpc/audit")
+    public boolean audit(@RequestBody EnterpriseAuditDto dto);
 }

+ 5 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterfaceFallback.java

@@ -106,6 +106,11 @@ public class LevelOneServerInterfaceFallback implements FallbackFactory<LevelOne
                 log.error("互市区普通边民信息添加错误:{},错误信息是:{}",peopleDto,throwable.getMessage());
                 return false;
             }
+
+            @Override
+            public boolean audit(EnterpriseAuditDto dto) {
+                return false;
+            }
         };
     }
 }

+ 37 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/EnterpriseAuditDto.java

@@ -0,0 +1,37 @@
+package com.pj.api.dto;
+
+/**
+ * 商家审核通过
+ */
+public class EnterpriseAuditDto {
+
+    private Long fkId;
+
+    private String auth;
+
+    private Long id;
+
+    public Long getFkId() {
+        return fkId;
+    }
+
+    public void setFkId(Long fkId) {
+        this.fkId = fkId;
+    }
+
+    public String getAuth() {
+        return auth;
+    }
+
+    public void setAuth(String auth) {
+        this.auth = auth;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+}

+ 58 - 47
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseAppController.java

@@ -1,7 +1,6 @@
 package com.pj.tb_enterprise;
 
-import com.pj.api.dto.EnterpriseDto;
-import com.pj.tb_enterprise.param.EnterpriseParam;
+import com.pj.tb_enterprise.dto.EnterpriseDto;
 import com.pj.tb_enterprise.vo.OrdersVo;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
@@ -14,6 +13,7 @@ import java.util.List;
 
 /**
  * Controller: tb_enterprise -- 商家(app接口)
+ *
  * @author lbl
  */
 @RestController
@@ -21,50 +21,61 @@ import java.util.List;
 public class TbEnterpriseAppController {
 
 
-	/** 底层 Service 对象 */
-	@Autowired
-	TbEnterpriseService tbEnterpriseService;
-
-
-	/** 查个人信息 - 根据id */
-	@RequestMapping("getById")
-	public AjaxJson getById(Long id){
-		TbEnterprise t = tbEnterpriseService.getById(id);
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 改个人信息 */
-	@RequestMapping("update")
-	public AjaxJson update(TbEnterprise t){
-		tbEnterpriseService.update(t);
-		return AjaxJson.getSuccess();
-	}
-
-	/** 商家认证 */
-	@RequestMapping("identification")
-	public AjaxJson identification(@Validated @RequestBody EnterpriseParam enterpriseParam){
-		boolean identification = tbEnterpriseService.identification(enterpriseParam);
-		if(!identification) return AjaxJson.getError("商家认证信息提交失败!!!");
-
-		return AjaxJson.getSuccess("商家认证信息已提交,管理员审核中,请耐心等待!");
-	}
-
-	/** 管理一级市场的贸易订单 */
-	@RequestMapping("manageLevelOneOrders")
-	public AjaxJson manageLevelOneOrders(@RequestParam(value = "keyword",required = false)String keyword){
-		SoMap so = SoMap.getRequestSoMap();
-		List<OrdersVo> ordersVos = tbEnterpriseService.manageLevelOneOrders(so.startPage(),keyword);
-		return AjaxJson.getSuccessData(ordersVos);
-	}
-
-	/*------            正常业务👆👆    rpc远程调用👇👇                         -----------*/
-
-
-	/** 根据ID获取一级市场商户信息 */
-	@RequestMapping("rpc/getEnterpriseById")
-	public EnterpriseDto getEnterpriseById(@RequestParam("id")Long enterpriseId){
-		EnterpriseDto enterpriseById = tbEnterpriseService.getEnterpriseById(enterpriseId);
-		return enterpriseById;
-	}
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    TbEnterpriseService tbEnterpriseService;
+
+
+    /**
+     * 查认证信息
+     */
+    @RequestMapping("getInfo")
+    public AjaxJson getInfo() {
+        return AjaxJson.getSuccessData(tbEnterpriseService.selectByCreateBy());
+    }
+
+    /**
+     * 改个人信息
+     */
+    @RequestMapping("update")
+    public AjaxJson update(TbEnterprise t) {
+        tbEnterpriseService.update(t);
+        return AjaxJson.getSuccess();
+    }
+
+    /**
+     * 商家认证
+     */
+    @PostMapping("identification")
+    public AjaxJson identification(@Validated EnterpriseDto enterpriseParam) {
+        boolean identification = tbEnterpriseService.identification(enterpriseParam);
+        if (!identification) return AjaxJson.getError("商家认证信息提交失败!!!");
+
+        return AjaxJson.getSuccess("商家认证信息已提交,管理员审核中,请耐心等待!");
+    }
+
+    /**
+     * 管理一级市场的贸易订单
+     */
+    @RequestMapping("manageLevelOneOrders")
+    public AjaxJson manageLevelOneOrders(@RequestParam(value = "keyword", required = false) String keyword) {
+        SoMap so = SoMap.getRequestSoMap();
+        List<OrdersVo> ordersVos = tbEnterpriseService.manageLevelOneOrders(so.startPage(), keyword);
+        return AjaxJson.getSuccessData(ordersVos);
+    }
+
+    /*------            正常业务👆👆    rpc远程调用👇👇                         -----------*/
+
+
+    /**
+     * 根据ID获取一级市场商户信息
+     */
+    @RequestMapping("rpc/getEnterpriseById")
+    public com.pj.api.dto.EnterpriseDto getEnterpriseById(@RequestParam("id") Long enterpriseId) {
+        com.pj.api.dto.EnterpriseDto enterpriseById = tbEnterpriseService.getEnterpriseById(enterpriseId);
+        return enterpriseById;
+    }
 
 }

+ 17 - 32
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseController.java

@@ -1,35 +1,21 @@
 package com.pj.tb_enterprise;
 
-import java.io.IOException;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-
-import cn.dev33.satoken.stp.StpUtil;
-import cn.hutool.core.date.DateUtil;
-import com.pj.api.client.admin.AdminInterface;
-import com.pj.api.consts.FeignFactory;
+import cn.dev33.satoken.annotation.SaCheckPermission;
 import com.pj.api.dto.EnterpriseDto;
-import com.pj.common.core.utils.DateUtils;
+import com.pj.project4sp.SP;
+import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
-
-import com.pj.utils.sg.*;
-import com.pj.project4sp.SP;
-
-import com.pj.current.satoken.StpUserUtil;
-import cn.dev33.satoken.annotation.SaCheckPermission;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
 
 
 /**
  * Controller: tb_enterprise -- 商家
- * @author qzy 
+ * @author qzy
  */
 @RestController
 @RequestMapping("/TbEnterprise/")
@@ -42,7 +28,7 @@ public class TbEnterpriseController {
 
 
 
-	/** 增 */  
+	/** 增 */
 	@RequestMapping("add")
 	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_ADD)
 	public AjaxJson add(TbEnterprise t){
@@ -51,24 +37,24 @@ public class TbEnterpriseController {
 		return AjaxJson.getSuccessData(t);
 	}
 
-	/** 删 */  
+	/** 删 */
 	@RequestMapping("delete")
 	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_DEL)
 	public AjaxJson delete(Long id){
 		 tbEnterpriseService.delete(id);
 		return AjaxJson.getSuccess();
 	}
-	
-	/** 删 - 根据id列表 */  
+
+	/** 删 - 根据id列表 */
 	@RequestMapping("deleteByIds")
 	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_DEL)
 	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
 		int line = SP.publicMapper.deleteByIds(TbEnterprise.TABLE_NAME, ids);
 		return AjaxJson.getByLine(line);
 	}
-	
-	/** 改 */  
+
+	/** 改 */
 	@RequestMapping("update")
 	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_EDIT)
 	public AjaxJson update(TbEnterprise t){
@@ -76,7 +62,7 @@ public class TbEnterpriseController {
 		return AjaxJson.getSuccess();
 	}
 
-	/** 查 - 根据id */  
+	/** 查 - 根据id */
 	@RequestMapping("getById")
 		@SaCheckPermission(TbEnterprise.PERMISSION_CODE)
 	public AjaxJson getById(Long id){
@@ -108,8 +94,8 @@ public class TbEnterpriseController {
 		List<TbEnterprise> list = tbEnterpriseService.getList(so);
 		return AjaxJson.getSuccessData(list);
 	}
-	
-	/** 改 - 删除状态(0=禁用,1=启用) */  
+
+	/** 改 - 删除状态(0=禁用,1=启用) */
 	@RequestMapping("updateDeleteStatus")
 	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_EDIT)
 	public AjaxJson updateDeleteStatus(Long id, Integer value){
@@ -164,8 +150,7 @@ public class TbEnterpriseController {
 		Long id=soMap.getLong("id");
 		Integer judgeStatus=soMap.getInt("judgeStatus");
 		String judgeContent=soMap.getString("judgeContent");
-		tbEnterpriseService.audit(id,judgeStatus,judgeContent);
-		return AjaxJson.getSuccess();
+		return AjaxJson.toAjax(tbEnterpriseService.audit(id,judgeStatus,judgeContent));
 	}
 	@RequestMapping("auditBatch")
 	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_JUDGE)

+ 14 - 9
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseMapper.java

@@ -6,25 +6,30 @@ import org.apache.ibatis.annotations.Mapper;
 
 import com.pj.utils.so.*;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
 /**
  * Mapper: tb_enterprise -- 商家
- * @author qzy 
+ *
+ * @author qzy
  */
 
 @Mapper
 @Repository
-public interface TbEnterpriseMapper extends BaseMapper <TbEnterprise> {
+public interface TbEnterpriseMapper extends BaseMapper<TbEnterprise> {
 
 
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     *
+     * @param so 参数集合
+     * @return 数据列表
+     */
+    List<TbEnterprise> getList(SoMap so);
 
-	/**
-	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
-	 * @param so 参数集合 
-	 * @return 数据列表 
-	 */
-	List<TbEnterprise> getList(SoMap so);
-
+    @Select("SELECT * FROM tb_enterprise WHERE create_by=#{createBy}")
+    TbEnterprise selectByCreateBy(@Param("createBy") String createBy);
 
 }

+ 257 - 258
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseService.java

@@ -1,35 +1,23 @@
 package com.pj.tb_enterprise;
 
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import com.alibaba.excel.EasyExcel;
-import com.alibaba.excel.event.AnalysisEventListener;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.client.admin.AdminInterface;
+import com.pj.api.client.level_one_server.LevelOneServerInterface;
 import com.pj.api.consts.FeignFactory;
 import com.pj.api.dto.DistrictDTO;
-import com.pj.api.dto.EnterpriseDto;
-import com.pj.common.core.exception.ServiceException;
+import com.pj.api.dto.EnterpriseAuditDto;
 import com.pj.current.dto.APPLoginUserInfo;
 import com.pj.current.satoken.StpAPPUserUtil;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.enummj.DeleteStatus;
-import com.pj.enummj.JudgeStatus;
 import com.pj.enummj.People;
-import com.pj.tb_enterprise.param.EnterpriseParam;
+import com.pj.tb_enterprise.dto.EnterpriseDto;
 import com.pj.tb_enterprise.vo.OrdersVo;
 import com.pj.tb_order.TbOrder;
 import com.pj.tb_order.TbOrderMapper;
 import com.pj.utils.sg.AjaxError;
-import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -38,12 +26,18 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.swing.filechooser.FileSystemView;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 
 /**
@@ -65,6 +59,13 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
      */
     @Autowired
     AdminInterface adminInterface;
+
+    /**
+     * 远程调用
+     */
+    @Autowired
+    private LevelOneServerInterface levelOneServerInterface;
+
     /**
      * 订单表mapper
      */
@@ -81,9 +82,8 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
      * 增
      */
     void add(TbEnterprise t) {
-        List<DistrictDTO>districtDTOS= FeignFactory.adminInterface.getDistrictList(t.getAddressIds());
-        t.setAddress(districtDTOS.stream().map(DistrictDTO::getDistrict).collect(Collectors.joining()))
-                .setCreateTime(new Date()).setCreateName(StpUserUtil.getPCLoginInfo().getLoginName());
+        List<DistrictDTO> districtDTOS = FeignFactory.adminInterface.getDistrictList(t.getAddressIds());
+        t.setAddress(districtDTOS.stream().map(DistrictDTO::getDistrict).collect(Collectors.joining())).setCreateTime(new Date()).setCreateName(StpUserUtil.getPCLoginInfo().getLoginName());
         save(t);
     }
 
@@ -98,9 +98,8 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
      * 改
      */
     void update(TbEnterprise t) {
-        List<DistrictDTO>districtDTOS= FeignFactory.adminInterface.getDistrictList(t.getAddressIds());
-        t.setAddress(districtDTOS.stream().map(DistrictDTO::getDistrict).collect(Collectors.joining()))
-                .setCreateTime(new Date()).setCreateName(StpUserUtil.getPCLoginInfo().getLoginName());
+        List<DistrictDTO> districtDTOS = FeignFactory.adminInterface.getDistrictList(t.getAddressIds());
+        t.setAddress(districtDTOS.stream().map(DistrictDTO::getDistrict).collect(Collectors.joining())).setCreateTime(new Date()).setCreateName(StpUserUtil.getPCLoginInfo().getLoginName());
         updateById(t);
 
     }
@@ -120,251 +119,250 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
     }
 
 
-	public int isLock(TbEnterpriseDto tbEnterpriseDto) {
-		// 获取当前登录用户id
-		Long loginId = StpUserUtil.getLoginIdAsLong();
-		// 根据id获取商户
-		TbEnterprise tbEnterprise = tbEnterpriseMapper.selectById(tbEnterpriseDto.getId());
-		// 如果商户不存在则抛出异常
-		if(Objects.isNull(tbEnterprise)){
-			throw new RuntimeException("该商户不存在");
-		}
-		BeanUtils.copyProperties(tbEnterpriseDto,tbEnterprise);
-		// 写入更新者id
-		tbEnterprise.setUpdateBy(String.valueOf(loginId));
-		// 更新商户锁定状态
-		int  line = tbEnterpriseMapper.updateById(tbEnterprise);
-		//获取商户锁定状态
-		int isLock = tbEnterprise.getIsLock();
-		// 如果商户被锁住则禁止app端登录
-		adminInterface.isLock(String.valueOf(tbEnterprise.getId()), People.PEOPLE_TYPE_TWO.getCode(),isLock);
-
-		return line;
-	}
+    public int isLock(TbEnterpriseDto tbEnterpriseDto) {
+        // 获取当前登录用户id
+        Long loginId = StpUserUtil.getLoginIdAsLong();
+        // 根据id获取商户
+        TbEnterprise tbEnterprise = tbEnterpriseMapper.selectById(tbEnterpriseDto.getId());
+        // 如果商户不存在则抛出异常
+        if (Objects.isNull(tbEnterprise)) {
+            throw new RuntimeException("该商户不存在");
+        }
+        BeanUtils.copyProperties(tbEnterpriseDto, tbEnterprise);
+        // 写入更新者id
+        tbEnterprise.setUpdateBy(String.valueOf(loginId));
+        // 更新商户锁定状态
+        int line = tbEnterpriseMapper.updateById(tbEnterprise);
+        //获取商户锁定状态
+        int isLock = tbEnterprise.getIsLock();
+        // 如果商户被锁住则禁止app端登录
+        adminInterface.isLock(String.valueOf(tbEnterprise.getId()), People.PEOPLE_TYPE_TWO.getCode(), isLock);
+
+        return line;
+    }
+
+    public TbEnterprise selectByCreateBy() {
+        return tbEnterpriseMapper.selectByCreateBy("" + StpAPPUserUtil.getAPPLoginInfo().getLoginId());
+    }
 
     /**
      * 商家认证
      *
-     * @param enterpriseParam
      * @return
      */
-    boolean identification(EnterpriseParam enterpriseParam) {
-
-		//手机号去重
-		String linkPhone = enterpriseParam.getLinkPhone();
-		if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getIdCard,linkPhone).eq(TbEnterprise::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0)
-			throw new RuntimeException("当前手机号已被认证!");
-		//身份证号去重
-		String contact = enterpriseParam.getCorporateIdCard();
-		if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getContact,contact).eq(TbEnterprise::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0)
-			throw new RuntimeException("当前身份证号已被认证!");
-		//判断是否重复提交
-		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
-			throw new RuntimeException("当前登录账号信息已失效!");
-		//重复提交验证处理
-		methodEnterpriseService.againApply(appLoginInfo.getFk());
-		//开始保存商家信息
-		TbEnterprise tbEnterprise = new TbEnterprise();
-		//保存基本信息
-		tbEnterprise.setName(enterpriseParam.getName());
-		tbEnterprise.setNationality("China");
-		tbEnterprise.setLegalPerson(enterpriseParam.getCorporateName());
-		tbEnterprise.setIdCard(enterpriseParam.getCorporateIdCard());
-		tbEnterprise.setContact(enterpriseParam.getLinkPhone());
-		tbEnterprise.setBusinessLicense(enterpriseParam.getBusinessLicense());
-		tbEnterprise.setBankName(enterpriseParam.getBankName());
-		tbEnterprise.setBankAccount(enterpriseParam.getBankAccount());
-		tbEnterprise.setBankNo(enterpriseParam.getBankNo());
-		tbEnterprise.setDutyParagraph(enterpriseParam.getDutyParagraph());
-		//默认待审核
-		tbEnterprise.setJudgeStatus(JudgeStatus.JUDGE_STATUS_ZERO.getCode());
-
-        //注册/认证时间
-        tbEnterprise.setRegisterTime(new Date());
-        //创建时间
-        tbEnterprise.setCreateTime(new Date());
-        //删除状态:启用
-        tbEnterprise.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
-
-        // 保存商家信息
-        int insert = tbEnterpriseMapper.insert(tbEnterprise);
-        return insert == 1;
+    boolean identification(EnterpriseDto dto) {
+        TbEnterprise enterprise = tbEnterpriseMapper.selectByCreateBy("" + StpAPPUserUtil.getAPPLoginInfo().getLoginId());
+        dto.setJudgeStatus(0);
+        String contact = enterprise != null ? enterprise.getContact() : "";
+        String idCard = enterprise != null ? enterprise.getIdCard() : "";
+        //手机号查重
+        if (!contact.equals(dto.getContact()) && tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getContact, dto.getContact()).eq(TbEnterprise::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0) {
+            throw new RuntimeException("当前手机号已被认证!");
+        }
+        //身份证号查重
+        if (!idCard.equals(dto.getIdCard()) && tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getIdCard, dto.getIdCard()).eq(TbEnterprise::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0) {
+            throw new RuntimeException("当前身份证号已被认证!");
+        }
+        if (enterprise == null) {
+            enterprise = new TbEnterprise();
+            BeanUtils.copyProperties(dto, enterprise);
+            enterprise.setCreateTime(new Date());
+            enterprise.setCreateBy("" + StpAPPUserUtil.getAPPLoginInfo().getLoginId());
+            enterprise.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
+            return save(enterprise);
+        }
+        dto.setId(enterprise.getId());
+        BeanUtils.copyProperties(dto, enterprise);
+        return updateById(enterprise);
     }
 
 
+    /**
+     * 管理一级市场的贸易订单。
+     * 列表(主要展示字段:订单号、下单时间、商品名称、图片、价格、购买的边民组、订单状态、物流信息)、
+     * 确认退货/退款;
+     * 物流状态  SoMap soMap
+     */
+    public List<OrdersVo> manageLevelOneOrders(SoMap so, String keyword) {
+
+        //获取当前登录用户
+        APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+        if (appLoginInfo == null || appLoginInfo.getLoginId() == null)
+            throw new RuntimeException("当前登陆用户信息已失效!");
+        Long fk = appLoginInfo.getFk();
+        //仅能查询自己的订单
+        so.put("buyUserId", fk);
+        so.put("deleteStatus", DeleteStatus.DELETE_STATUS_ON.getCode());
+        so.put("keyword", keyword);
+
+        List<TbOrder> tbOrders = tbOrderMapper.getList(so);
+        //执行数据封装
+        List<OrdersVo> ordersVos = methodEnterpriseService.orderListChangeVo(appLoginInfo, tbOrders);
+        return ordersVos;
+    }
+
 
-	/** 管理一级市场的贸易订单。
-	 * 列表(主要展示字段:订单号、下单时间、商品名称、图片、价格、购买的边民组、订单状态、物流信息)、
-	 * 确认退货/退款;
-	 * 物流状态  SoMap soMap
-	 */
-	public List<OrdersVo> manageLevelOneOrders(SoMap so,String keyword){
-
-		//获取当前登录用户
-		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)throw new RuntimeException("当前登陆用户信息已失效!");
-		Long fk = appLoginInfo.getFk();
-		//仅能查询自己的订单
-		so.put("buyUserId",fk);
-		so.put("deleteStatus",DeleteStatus.DELETE_STATUS_ON.getCode());
-		so.put("keyword",keyword);
-
-		List<TbOrder> tbOrders = tbOrderMapper.getList(so);
-		//执行数据封装
-		List<OrdersVo> ordersVos = methodEnterpriseService.orderListChangeVo(appLoginInfo,tbOrders);
-		return ordersVos;
-	}
-
-
-	/**
-	 * 导入
-	 * @param file excel文件
-	 * @return
-	 * @throws IOException
-	 */
-	public String importData(MultipartFile file) throws IOException {
-		System.out.println("\n开始执行文件上传....\n");
-
-		//判空
-		if(file.isEmpty()) return "文件为空,无法执行上传...";
-		//获取文件上传数据
-		HSSFWorkbook wb = new HSSFWorkbook(file.getInputStream());
-		//获取第一页sheet
-		HSSFSheet sheet = wb.getSheetAt(0);
-		//定义计数器
-		int count = 0;
-		//定义行对象
-		HSSFRow row = null;
-		//解析数据封装到集合
-		count = methodEnterpriseService.importMethod(row, sheet, count);
-		wb.close();
-		System.out.println("\n文件上传完成,共上传 " + count + "条 " + "数据...\n");
-		return "上传完成,共上传"  + count + "条"  + "数据。";
-	}
-
-	/**
-	 * 导出 excel文件
-	 * @param keyword
-	 * @return
-	 */
-	public String outportExcel(String keyword,String filepath) throws IOException {
-		System.out.println("\n开始执行文件导出....\n");
-		//导出的文件的路径
-		if(filepath == null || filepath.trim().equals("")){
-			// 获取当前用户的桌面路径
-			FileSystemView fileSystemView = FileSystemView.getFileSystemView();
-			filepath = fileSystemView.getHomeDirectory().getPath();
-		}
-		filepath = filepath + "\\商家数据表_" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ".xlsx";
-		//根据需求查询数据
-		List<TbEnterprise> selectedList = tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(StringUtils.isNoneBlank(keyword), TbEnterprise::getName, keyword));
-		if(selectedList.size() == 0)return "没有可导出的数据。";
-		//建立excel对象封装数据
-		HSSFWorkbook workbook = new HSSFWorkbook();
-		//创建excel表格右下角的sheet页名称
-		HSSFSheet sheet = workbook.createSheet("1");
-		//创建表头
-		HSSFRow row = sheet.createRow(0);
-		row.createCell(0).setCellValue("序号");
-		row.createCell(1).setCellValue("名称");
-		row.createCell(2).setCellValue("国别");
-		row.createCell(3).setCellValue("商户分类");
-		row.createCell(4).setCellValue("法人");
-		row.createCell(5).setCellValue("身份证号");
-		row.createCell(6).setCellValue("手机号码");
-		row.createCell(7).setCellValue("营业执照");
-		row.createCell(8).setCellValue("所在铺位");
-		row.createCell(9).setCellValue("所在铺位名称");
-		row.createCell(10).setCellValue("银行编号");
-		row.createCell(11).setCellValue("银行名称");
-		row.createCell(12).setCellValue("银行账号");
-		row.createCell(13).setCellValue("银行税号");
-		row.createCell(14).setCellValue("地址ID集合");
-		row.createCell(15).setCellValue("地址");
-		row.createCell(16).setCellValue("agreement");
-		row.createCell(17).setCellValue("judge_status");
-		row.createCell(18).setCellValue("judge_content");
-		row.createCell(19).setCellValue("judge_time");
-		row.createCell(20).setCellValue("注册时间");
-		row.createCell(21).setCellValue("人物编号");
-		row.createCell(22).setCellValue("创建时间");
-		row.createCell(23).setCellValue("创建人编号");
-		row.createCell(24).setCellValue("创建人名称");
-		row.createCell(25).setCellValue("更新时间");
-		row.createCell(26).setCellValue("更新人编号");
-		row.createCell(27).setCellValue("更新人名称");
-		row.createCell(28).setCellValue("删除状态");
-
-		//定义计数器
-		int count = 0;
-		//遍历集合
-		for (int i = 0; i < selectedList.size(); i++) {
-			HSSFRow sheetRow = sheet.createRow(sheet.getLastRowNum() + 1);
-			sheetRow.createCell(0).setCellValue(i + 1);
-			sheetRow.createCell(1).setCellValue((selectedList.get(i).getName() + "").equals("null")? "": selectedList.get(i).getName() + "");
-			sheetRow.createCell(2).setCellValue((selectedList.get(i).getNationality() + "").equals("null")? "": selectedList.get(i).getNationality() + "");
-			sheetRow.createCell(3).setCellValue((selectedList.get(i).getType() + "").equals("null")? "": selectedList.get(i).getType() + "");
-			sheetRow.createCell(4).setCellValue((selectedList.get(i).getLegalPerson() + "").equals("null")? "": selectedList.get(i).getLegalPerson() + "");
-			sheetRow.createCell(5).setCellValue((selectedList.get(i).getIdCard() + "").equals("null")? "": selectedList.get(i).getIdCard() + "");
-			sheetRow.createCell(6).setCellValue((selectedList.get(i).getContact() + "").equals("null")? "": selectedList.get(i).getContact() + "");
-			sheetRow.createCell(7).setCellValue((selectedList.get(i).getBusinessLicense() + "").equals("null")? "": selectedList.get(i).getBusinessLicense() + "");
-			sheetRow.createCell(8).setCellValue((selectedList.get(i).getShopId() + "" ).equals("null")? "": selectedList.get(i).getShopId() + "");
-			sheetRow.createCell(9).setCellValue((selectedList.get(i).getShopName() + "").equals("null")? "": selectedList.get(i).getShopName() + "");
-			sheetRow.createCell(10).setCellValue((selectedList.get(i).getBankNo() + "").equals("null")? "": selectedList.get(i).getBankNo() + "");
-			sheetRow.createCell(11).setCellValue((selectedList.get(i).getBankName() + "").equals("null")? "": selectedList.get(i).getBankName() + "");
-			sheetRow.createCell(12).setCellValue((selectedList.get(i).getBankAccount() + "").equals("null")? "": selectedList.get(i).getBankAccount() + "");
-			sheetRow.createCell(13).setCellValue((selectedList.get(i).getDutyParagraph() + "").equals("null")? "": selectedList.get(i).getDutyParagraph() + "");
-			sheetRow.createCell(14).setCellValue((selectedList.get(i).getAddressIds() + "").equals("null")? "": selectedList.get(i).getAddressIds() + "");
-			sheetRow.createCell(15).setCellValue((selectedList.get(i).getAddress() + "").equals("null")? "": selectedList.get(i).getAddress() + "");
-			sheetRow.createCell(16).setCellValue((selectedList.get(i).getAgreement() + "").equals("null")? "": selectedList.get(i).getAgreement() + "");
-			sheetRow.createCell(17).setCellValue((selectedList.get(i).getJudgeStatus() + "").equals("null")? "": selectedList.get(i).getJudgeStatus() + "");
-			sheetRow.createCell(18).setCellValue((selectedList.get(i).getJudgeContent() + "").equals("null")? "": selectedList.get(i).getJudgeContent() + "");
-			sheetRow.createCell(19).setCellValue((selectedList.get(i).getJudgeTime() + "").equals("null")? "": selectedList.get(i).getJudgeTime() + "");
-			sheetRow.createCell(20).setCellValue((selectedList.get(i).getRegisterTime() + "").equals("null")? "": selectedList.get(i).getRegisterTime() + "");
+    /**
+     * 导入
+     *
+     * @param file excel文件
+     * @return
+     * @throws IOException
+     */
+    public String importData(MultipartFile file) throws IOException {
+        System.out.println("\n开始执行文件上传....\n");
+
+        //判空
+        if (file.isEmpty()) return "文件为空,无法执行上传...";
+        //获取文件上传数据
+        HSSFWorkbook wb = new HSSFWorkbook(file.getInputStream());
+        //获取第一页sheet
+        HSSFSheet sheet = wb.getSheetAt(0);
+        //定义计数器
+        int count = 0;
+        //定义行对象
+        HSSFRow row = null;
+        //解析数据封装到集合
+        count = methodEnterpriseService.importMethod(row, sheet, count);
+        wb.close();
+        System.out.println("\n文件上传完成,共上传 " + count + "条 " + "数据...\n");
+        return "上传完成,共上传" + count + "条" + "数据。";
+    }
+
+    /**
+     * 导出 excel文件
+     *
+     * @param keyword
+     * @return
+     */
+    public String outportExcel(String keyword, String filepath) throws IOException {
+        System.out.println("\n开始执行文件导出....\n");
+        //导出的文件的路径
+        if (filepath == null || filepath.trim().equals("")) {
+            // 获取当前用户的桌面路径
+            FileSystemView fileSystemView = FileSystemView.getFileSystemView();
+            filepath = fileSystemView.getHomeDirectory().getPath();
+        }
+        filepath = filepath + "\\商家数据表_" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ".xlsx";
+        //根据需求查询数据
+        List<TbEnterprise> selectedList = tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(StringUtils.isNoneBlank(keyword), TbEnterprise::getName, keyword));
+        if (selectedList.size() == 0) return "没有可导出的数据。";
+        //建立excel对象封装数据
+        HSSFWorkbook workbook = new HSSFWorkbook();
+        //创建excel表格右下角的sheet页名称
+        HSSFSheet sheet = workbook.createSheet("1");
+        //创建表头
+        HSSFRow row = sheet.createRow(0);
+        row.createCell(0).setCellValue("序号");
+        row.createCell(1).setCellValue("名称");
+        row.createCell(2).setCellValue("国别");
+        row.createCell(3).setCellValue("商户分类");
+        row.createCell(4).setCellValue("法人");
+        row.createCell(5).setCellValue("身份证号");
+        row.createCell(6).setCellValue("手机号码");
+        row.createCell(7).setCellValue("营业执照");
+        row.createCell(8).setCellValue("所在铺位");
+        row.createCell(9).setCellValue("所在铺位名称");
+        row.createCell(10).setCellValue("银行编号");
+        row.createCell(11).setCellValue("银行名称");
+        row.createCell(12).setCellValue("银行账号");
+        row.createCell(13).setCellValue("银行税号");
+        row.createCell(14).setCellValue("地址ID集合");
+        row.createCell(15).setCellValue("地址");
+        row.createCell(16).setCellValue("agreement");
+        row.createCell(17).setCellValue("judge_status");
+        row.createCell(18).setCellValue("judge_content");
+        row.createCell(19).setCellValue("judge_time");
+        row.createCell(20).setCellValue("注册时间");
+        row.createCell(21).setCellValue("人物编号");
+        row.createCell(22).setCellValue("创建时间");
+        row.createCell(23).setCellValue("创建人编号");
+        row.createCell(24).setCellValue("创建人名称");
+        row.createCell(25).setCellValue("更新时间");
+        row.createCell(26).setCellValue("更新人编号");
+        row.createCell(27).setCellValue("更新人名称");
+        row.createCell(28).setCellValue("删除状态");
+
+        //定义计数器
+        int count = 0;
+        //遍历集合
+        for (int i = 0; i < selectedList.size(); i++) {
+            HSSFRow sheetRow = sheet.createRow(sheet.getLastRowNum() + 1);
+            sheetRow.createCell(0).setCellValue(i + 1);
+            sheetRow.createCell(1).setCellValue((selectedList.get(i).getName() + "").equals("null") ? "" : selectedList.get(i).getName() + "");
+            sheetRow.createCell(2).setCellValue((selectedList.get(i).getNationality() + "").equals("null") ? "" : selectedList.get(i).getNationality() + "");
+            sheetRow.createCell(3).setCellValue((selectedList.get(i).getType() + "").equals("null") ? "" : selectedList.get(i).getType() + "");
+            sheetRow.createCell(4).setCellValue((selectedList.get(i).getLegalPerson() + "").equals("null") ? "" : selectedList.get(i).getLegalPerson() + "");
+            sheetRow.createCell(5).setCellValue((selectedList.get(i).getIdCard() + "").equals("null") ? "" : selectedList.get(i).getIdCard() + "");
+            sheetRow.createCell(6).setCellValue((selectedList.get(i).getContact() + "").equals("null") ? "" : selectedList.get(i).getContact() + "");
+            sheetRow.createCell(7).setCellValue((selectedList.get(i).getBusinessLicense() + "").equals("null") ? "" : selectedList.get(i).getBusinessLicense() + "");
+            sheetRow.createCell(8).setCellValue((selectedList.get(i).getShopId() + "").equals("null") ? "" : selectedList.get(i).getShopId() + "");
+            sheetRow.createCell(9).setCellValue((selectedList.get(i).getShopName() + "").equals("null") ? "" : selectedList.get(i).getShopName() + "");
+            sheetRow.createCell(10).setCellValue((selectedList.get(i).getBankNo() + "").equals("null") ? "" : selectedList.get(i).getBankNo() + "");
+            sheetRow.createCell(11).setCellValue((selectedList.get(i).getBankName() + "").equals("null") ? "" : selectedList.get(i).getBankName() + "");
+            sheetRow.createCell(12).setCellValue((selectedList.get(i).getBankAccount() + "").equals("null") ? "" : selectedList.get(i).getBankAccount() + "");
+            sheetRow.createCell(13).setCellValue((selectedList.get(i).getDutyParagraph() + "").equals("null") ? "" : selectedList.get(i).getDutyParagraph() + "");
+            sheetRow.createCell(14).setCellValue((selectedList.get(i).getAddressIds() + "").equals("null") ? "" : selectedList.get(i).getAddressIds() + "");
+            sheetRow.createCell(15).setCellValue((selectedList.get(i).getAddress() + "").equals("null") ? "" : selectedList.get(i).getAddress() + "");
+            sheetRow.createCell(16).setCellValue((selectedList.get(i).getAgreement() + "").equals("null") ? "" : selectedList.get(i).getAgreement() + "");
+            sheetRow.createCell(17).setCellValue((selectedList.get(i).getJudgeStatus() + "").equals("null") ? "" : selectedList.get(i).getJudgeStatus() + "");
+            sheetRow.createCell(18).setCellValue((selectedList.get(i).getJudgeContent() + "").equals("null") ? "" : selectedList.get(i).getJudgeContent() + "");
+            sheetRow.createCell(19).setCellValue((selectedList.get(i).getJudgeTime() + "").equals("null") ? "" : selectedList.get(i).getJudgeTime() + "");
+            sheetRow.createCell(20).setCellValue((selectedList.get(i).getRegisterTime() + "").equals("null") ? "" : selectedList.get(i).getRegisterTime() + "");
 //			sheetRow.createCell(21).setCellValue((selectedList.get(i).getPersonId() + "").equals("null")? "": selectedList.get(i).getPersonId() + "");
-			sheetRow.createCell(22).setCellValue((selectedList.get(i).getCreateTime() + "").equals("null")? "": selectedList.get(i).getCreateTime() + "");
-			sheetRow.createCell(23).setCellValue((selectedList.get(i).getCreateBy() + "").equals("null")? "": selectedList.get(i).getCreateBy() + "");
-			sheetRow.createCell(24).setCellValue((selectedList.get(i).getCreateName() + "").equals("null")? "": selectedList.get(i).getCreateName() + "");
-			sheetRow.createCell(25).setCellValue((selectedList.get(i).getUpdateTime() + "").equals("null")? "": selectedList.get(i).getUpdateTime() + "");
-			sheetRow.createCell(26).setCellValue((selectedList.get(i).getUpdateBy() + "").equals("null")? "": selectedList.get(i).getUpdateBy() + "");
-			sheetRow.createCell(27).setCellValue((selectedList.get(i).getUpdateName() + "").equals("null")? "": selectedList.get(i).getUpdateName() + "");
-			sheetRow.createCell(28).setCellValue((selectedList.get(i).getDeleteStatus() + "").equals("null")? "": selectedList.get(i).getDeleteStatus() + "");
-			count += 1;
-		}
-		//建立输出流,输出文件
-		FileOutputStream fos = new FileOutputStream(filepath);
-
-		workbook.write(fos);
-		fos.flush();
-		//关闭输出流
-		fos.close();
-		workbook.close();
-		System.out.println("\n数据导出完成!共导出 " + count + " 条数据。");
-		return "数据导出完成!共导出 " + count + " 条数据。";
-	}
-
-	/** 远程调用方法 注册身份为互市区商家时调用*/
-	public boolean enterpriseDto(EnterpriseDto enterpriseDto){
-		TbEnterprise tbEnterprise = new TbEnterprise();
-		BeanUtils.copyProperties(enterpriseDto,tbEnterprise);
-		boolean save = this.save(tbEnterprise);
-		return save;
-	}
-
-    public void audit(Long id, Integer judgeStatus, String judgeContent) {
+            sheetRow.createCell(22).setCellValue((selectedList.get(i).getCreateTime() + "").equals("null") ? "" : selectedList.get(i).getCreateTime() + "");
+            sheetRow.createCell(23).setCellValue((selectedList.get(i).getCreateBy() + "").equals("null") ? "" : selectedList.get(i).getCreateBy() + "");
+            sheetRow.createCell(24).setCellValue((selectedList.get(i).getCreateName() + "").equals("null") ? "" : selectedList.get(i).getCreateName() + "");
+            sheetRow.createCell(25).setCellValue((selectedList.get(i).getUpdateTime() + "").equals("null") ? "" : selectedList.get(i).getUpdateTime() + "");
+            sheetRow.createCell(26).setCellValue((selectedList.get(i).getUpdateBy() + "").equals("null") ? "" : selectedList.get(i).getUpdateBy() + "");
+            sheetRow.createCell(27).setCellValue((selectedList.get(i).getUpdateName() + "").equals("null") ? "" : selectedList.get(i).getUpdateName() + "");
+            sheetRow.createCell(28).setCellValue((selectedList.get(i).getDeleteStatus() + "").equals("null") ? "" : selectedList.get(i).getDeleteStatus() + "");
+            count += 1;
+        }
+        //建立输出流,输出文件
+        FileOutputStream fos = new FileOutputStream(filepath);
+
+        workbook.write(fos);
+        fos.flush();
+        //关闭输出流
+        fos.close();
+        workbook.close();
+        System.out.println("\n数据导出完成!共导出 " + count + " 条数据。");
+        return "数据导出完成!共导出 " + count + " 条数据。";
+    }
+
+    /**
+     * 远程调用方法 注册身份为互市区商家时调用
+     */
+    public boolean enterpriseDto(com.pj.api.dto.EnterpriseDto enterpriseDto) {
+        TbEnterprise tbEnterprise = new TbEnterprise();
+        BeanUtils.copyProperties(enterpriseDto, tbEnterprise);
+        boolean save = this.save(tbEnterprise);
+        return save;
+    }
+
+    @Transactional
+    public boolean audit(Long id, Integer judgeStatus, String judgeContent) {
         TbEnterprise tbEnterprise = this.getById(id);
         if (tbEnterprise == null) {
             throw new AjaxError("商户不存在");
         }
         String name = StpUserUtil.getLoginName();
-        tbEnterprise.setJudgeStatus(judgeStatus).setJudgeContent(judgeContent).setJudgeTime(new Date())
-                .setJudgeBy(name);
+        tbEnterprise.setJudgeStatus(judgeStatus).setJudgeContent(judgeContent).setJudgeTime(new Date()).setJudgeBy(name);
         this.updateById(tbEnterprise);
+        if (judgeStatus == 1) {
+            EnterpriseAuditDto auditDto = new EnterpriseAuditDto();
+            auditDto.setAuth("1");
+            auditDto.setFkId(id);
+            auditDto.setId(Long.parseLong(tbEnterprise.getCreateBy()));
+            return levelOneServerInterface.audit(auditDto);
+        }
+        return false;
     }
 
     /**
      * 批量审核
+     *
      * @param ids
      * @param judgeStatus
      * @param judgeContent
@@ -376,18 +374,19 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
         List<TbEnterprise> list = listByIds(ids);
         String name = StpUserUtil.getLoginName();
         list.forEach(tbEnterprise -> {
-            tbEnterprise.setJudgeStatus(judgeStatus).setJudgeContent(judgeContent).setJudgeTime(new Date())
-                    .setJudgeBy(name);
+            tbEnterprise.setJudgeStatus(judgeStatus).setJudgeContent(judgeContent).setJudgeTime(new Date()).setJudgeBy(name);
         });
         this.updateBatchById(list);
     }
 
-	/** 远程调用:根据ID获取一级市场商户 */
-	EnterpriseDto getEnterpriseById(Long id) {
-		TbEnterprise enterprise = tbEnterpriseMapper.selectById(id);
-		EnterpriseDto enterpriseDto = new EnterpriseDto();
-		BeanUtils.copyProperties(enterprise,enterpriseDto);
-		return enterpriseDto;
-	}
+    /**
+     * 远程调用:根据ID获取一级市场商户
+     */
+    com.pj.api.dto.EnterpriseDto getEnterpriseById(Long id) {
+        TbEnterprise enterprise = tbEnterpriseMapper.selectById(id);
+        com.pj.api.dto.EnterpriseDto enterpriseDto = new com.pj.api.dto.EnterpriseDto();
+        BeanUtils.copyProperties(enterprise, enterpriseDto);
+        return enterpriseDto;
+    }
 
 }

+ 48 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/dto/EnterpriseDto.java

@@ -0,0 +1,48 @@
+package com.pj.tb_enterprise.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 商户认证入参
+ * @Author Mechrevo
+ * @Date 2023 08 02 10 56
+ **/
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class EnterpriseDto {
+
+    private Long id;
+
+    @NotBlank(message = "公司名称")
+    private String name;
+
+    private int judgeStatus;
+
+    @NotBlank(message = "税号")
+    private String dutyParagraph;
+
+    @NotBlank(message = "法人姓名")
+    private String legalPerson;
+
+    @NotBlank(message = "法人身份证")
+    private String idCard;
+
+    @NotBlank(message = "联系号码")
+    private String contact;
+
+    @NotBlank(message = "开户银行")
+    private String bankName;
+
+    @NotBlank(message = "银行账号")
+    private String bankAccount;
+
+    private String businessLicense;
+
+
+
+}

+ 0 - 51
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/param/EnterpriseParam.java

@@ -1,51 +0,0 @@
-package com.pj.tb_enterprise.param;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * 商户认证入参
- * @Author Mechrevo
- * @Date 2023 08 02 10 56
- **/
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class EnterpriseParam {
-
-    @NotNull(message = "登录人ID")
-    private Long loginUserId;
-
-    @NotNull(message = "公司名称")
-    private String name;
-
-    @NotNull(message = "税号")
-    private String dutyParagraph;
-
-    @NotNull(message = "法人姓名")
-    private String corporateName;
-
-    @NotNull(message = "法人身份证")
-    private String corporateIdCard;
-
-    @NotNull(message = "联系号码")
-    private String linkPhone;
-
-    @NotNull(message = "银行编号")
-    private String bankNo;
-
-    @NotNull(message = "开户银行")
-    private String bankName;
-
-    @NotNull(message = "银行账号")
-    private String bankAccount;
-
-    @NotNull(message = "营业执照")
-    private String businessLicense;
-
-
-
-}

+ 9 - 2
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserController.java

@@ -4,7 +4,9 @@ import java.util.List;
 
 import com.pj.api.dto.AppUserDto;
 
+import com.pj.api.dto.EnterpriseAuditDto;
 import com.pj.utils.so.SoMap;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -107,7 +109,12 @@ public class AppUserController {
 		AppUserDto appUser = appUserService.getUserById(id);
 		return appUser;
 	}
-
-
+	/** 商户认证 */
+	@RequestMapping("rpc/audit")
+	public boolean audit(EnterpriseAuditDto dto){
+		AppUser user=new AppUser();
+		BeanUtils.copyProperties(dto, user);
+		return appUserService.updateById(user);
+	}
 
 }

+ 1 - 2
sp-service/sp-admin/src/main/java/com/pj/project/app_user_login_log/AppUserLoginLogMapper.xml

@@ -23,8 +23,7 @@
 		<include refid="select_sql"></include>
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>
-			<if test=' this.has("usreId") '> and usre_id = #{usreId} </if>
-			<if test=' this.has("loginTime") '> and login_time = #{loginTime} </if>
+			<if test=' this.has("userName") '> and user_name like concat('%', #{userName}, '%') </if>
 			<if test=' this.has("loginIp") '> and login_ip = #{loginIp} </if>
 			<if test=' this.has("deviceMode") '> and device_mode = #{deviceMode} </if>
 			<if test=' this.has("appVersion") '> and app_version = #{appVersion} </if>