Pārlūkot izejas kodu

添加商铺验证,是否锁住功能

loovi 1 gadu atpakaļ
vecāks
revīzija
93f6b59157

+ 5 - 6
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterprise.java

@@ -41,7 +41,6 @@ public class TbEnterprise extends Model<TbEnterprise> implements Serializable {
 
 
 
-
 	// ---------- 表中字段 ----------
 	/**
 	 *  
@@ -191,13 +190,13 @@ public class TbEnterprise extends Model<TbEnterprise> implements Serializable {
 	/**
 	 * 删除状态(0=禁用,1=启用) 
 	 */
-	private Integer deleteStatus;	
-
-
+	private Integer deleteStatus;
 
 
-
-	
+	/**
+	 * 是否锁定
+	 */
+	private Integer isLock;
 
 
 }

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

@@ -1,8 +1,15 @@
 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.common.core.utils.DateUtils;
 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.*;
@@ -25,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
 @RequestMapping("/TbEnterprise/")
 public class TbEnterpriseController {
 
+
 	/** 底层 Service 对象 */
 	@Autowired
 	TbEnterpriseService tbEnterpriseService;
@@ -123,10 +131,43 @@ public class TbEnterpriseController {
 		}
 		return AjaxJson.getError();
 	}
-	
 
-	
-	
-	
+	/**
+	*商户审核
+	*
+	* @author loovi
+	* @date
+	*/
+	@RequestMapping("audit")
+	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_EDIT)
+	public AjaxJson audit(TbEnterprise t){
 
+		Long loginId = StpUtil.getLoginIdAsLong();
+		TbEnterprise tbEnterprise = tbEnterpriseService.getById(t.getId());
+		if(Objects.isNull(tbEnterprise)){
+			return AjaxJson.getSuccess("该商户不存在");
+		}
+		BeanUtils.copyProperties(t,tbEnterprise);
+		tbEnterprise.setUpdateBy(String.valueOf(loginId));
+		tbEnterpriseService.update(t);
+		return AjaxJson.getSuccess();
+	}
+	/**
+	*是否锁住商户
+	*
+	* @author loovi
+	* @date
+	*/
+	@RequestMapping("isLock")
+	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_EDIT)
+	public AjaxJson isLock(Long id, Integer isLock) {
+		Long loginId = StpUtil.getLoginIdAsLong();
+		TbEnterprise tbEnterprise = tbEnterpriseService.getById(id);
+		if (Objects.isNull(tbEnterprise)) {
+			return AjaxJson.getSuccess("该商户不存在");
+		}
+		int line = SP.publicMapper.updateColumnById(TbEnterprise.TABLE_NAME, "is_lock", isLock, id);
+		tbEnterprise.setUpdateBy(String.valueOf(loginId));
+		return AjaxJson.getByLine(line);
+	}
 }