瀏覽代碼

新增合作社模块

李书文 2 年之前
父節點
當前提交
a5e525de39

+ 158 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_cooperative/TbCooperative.java

@@ -0,0 +1,158 @@
+package com.pj.tb_cooperative;
+
+import java.io.Serializable;
+import java.util.*;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_cooperative -- 合作社
+ * @author lsw 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbCooperative.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbCooperative extends Model<TbCooperative> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_cooperative";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-cooperative";
+	public static final String PERMISSION_CODE_ADD = "tb-cooperative-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-cooperative-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-cooperative-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 名称 
+	 */
+	private String name;	
+
+	/**
+	 * 法人 
+	 */
+	private String legalPerson;	
+
+	/**
+	 * 身份证号 
+	 */
+	private String idCard;	
+
+	/**
+	 * 手机号码 
+	 */
+	private String contact;	
+
+	/**
+	 * 营业执照 
+	 */
+	private String businessLicense;	
+
+	/**
+	 * 银行名称 
+	 */
+	private String bankName;	
+
+	/**
+	 * 银行账号 
+	 */
+	private String bankAccount;	
+
+	/**
+	 * 税号 
+	 */
+	private String dutyParagraph;	
+
+	/**
+	 * 地址 
+	 */
+	private String address;	
+
+	/**
+	 * 审核状态(0=未通过,1=已通过,2=审核不通过) 
+	 */
+	private String judgeStatus;	
+
+	/**
+	 * 审核意见 
+	 */
+	private String judgeContent;	
+
+	/**
+	 * 上次审核时间 
+	 */
+	private Date judgeTime;	
+
+	/**
+	 * 注册时间 
+	 */
+	private Date registerTime;	
+
+	/**
+	 * 创建时间 
+	 */
+	private Date createTime;
+
+	/**
+	 * 创建人编号 
+	 */
+	private String createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 更新时间 
+	 */
+	private Date updateTime;
+
+	/**
+	 * 更新人编号 
+	 */
+	private String updateBy;	
+
+	/**
+	 * 更新人名称 
+	 */
+	private String updateName;	
+
+	/**
+	 * 删除状态(0=禁用,1=启用) 
+	 */
+	private Integer deleteStatus;	
+
+	/**
+	 * 0=锁住 1=启用 
+	 */
+	private String isLock;	
+
+	/**
+	 * 审核人 
+	 */
+	private String judgeBy;
+}

+ 84 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_cooperative/TbCooperativeController.java

@@ -0,0 +1,84 @@
+package com.pj.tb_cooperative;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.project4sp.SP;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * Controller: tb_cooperative -- 合作社
+ * @author lsw 
+ */
+@RestController
+@RequestMapping("/TbCooperative/")
+public class TbCooperativeController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbCooperativeService tbCooperativeService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbCooperative.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbCooperative t){
+		tbCooperativeService.add(t);
+		t = tbCooperativeService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbCooperative.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbCooperativeService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbCooperative.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbCooperative.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbCooperative.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbCooperative t){
+		tbCooperativeService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(TbCooperative.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		TbCooperative t = tbCooperativeService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(TbCooperative.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbCooperative> list = tbCooperativeService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+	/** 改 - 删除状态(0=禁用,1=启用) */  
+	@RequestMapping("updateDeleteStatus")
+	@SaCheckPermission(TbCooperative.PERMISSION_CODE_EDIT)
+	public AjaxJson updateDeleteStatus(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbCooperative.TABLE_NAME, "delete_status", value, id);
+		return AjaxJson.getByLine(line);
+	}
+}

+ 28 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_cooperative/TbCooperativeMapper.java

@@ -0,0 +1,28 @@
+package com.pj.tb_cooperative;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_cooperative -- 合作社
+ * @author lsw 
+ */
+
+@Mapper
+@Repository
+public interface TbCooperativeMapper extends BaseMapper <TbCooperative> {
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbCooperative> getList(SoMap so);
+
+
+}

+ 70 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_cooperative/TbCooperativeMapper.xml

@@ -0,0 +1,70 @@
+<?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="com.pj.tb_cooperative.TbCooperativeMapper">
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, name, legal_person, id_card, contact, business_license, bank_name, bank_account, duty_paragraph, address, judge_status, judge_content, judge_time, register_time, create_time, create_by, create_name, update_time, update_by, update_name, delete_status, is_lock, judge_by from tb_cooperative  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_cooperative.TbCooperative"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_cooperative 
+	</sql>
+
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("name") '> and name = #{name} </if>
+			<if test=' this.has("legalPerson") '> and legal_person = #{legalPerson} </if>
+			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>
+			<if test=' this.has("contact") '> and contact = #{contact} </if>
+			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>
+			<if test=' this.has("bankAccount") '> and bank_account = #{bankAccount} </if>
+			<if test=' this.has("dutyParagraph") '> and duty_paragraph = #{dutyParagraph} </if>
+			<if test=' this.has("address") '> and address = #{address} </if>
+			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>
+			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and create_name = #{createName} </if>
+			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>
+			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
+			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>
+			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
+			<if test=' this.has("isLock") '> and is_lock = #{isLock} </if>
+			<if test=' this.has("judgeBy") '> and judge_by = #{judgeBy} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> name desc </when>
+			<when test='sortType == 3'> legal_person desc </when>
+			<when test='sortType == 4'> id_card desc </when>
+			<when test='sortType == 5'> contact desc </when>
+			<when test='sortType == 6'> bank_name desc </when>
+			<when test='sortType == 7'> bank_account desc </when>
+			<when test='sortType == 8'> duty_paragraph desc </when>
+			<when test='sortType == 9'> address desc </when>
+			<when test='sortType == 10'> judge_status desc </when>
+			<when test='sortType == 11'> judge_content desc </when>
+			<when test='sortType == 12'> judge_time desc </when>
+			<when test='sortType == 13'> register_time desc </when>
+			<when test='sortType == 14'> create_time desc </when>
+			<when test='sortType == 15'> create_by desc </when>
+			<when test='sortType == 16'> create_name desc </when>
+			<when test='sortType == 17'> update_time desc </when>
+			<when test='sortType == 18'> update_by desc </when>
+			<when test='sortType == 19'> update_name desc </when>
+			<when test='sortType == 20'> delete_status desc </when>
+			<when test='sortType == 21'> is_lock desc </when>
+			<when test='sortType == 22'> judge_by desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+</mapper>

+ 57 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_cooperative/TbCooperativeService.java

@@ -0,0 +1,57 @@
+package com.pj.tb_cooperative;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.current.satoken.StpUserUtil;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Service: tb_cooperative -- 合作社
+ * @author lsw 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbCooperativeService extends ServiceImpl<TbCooperativeMapper, TbCooperative> implements IService<TbCooperative>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbCooperativeMapper tbCooperativeMapper;
+
+	/** 增 */
+	void add(TbCooperative t){
+		t.setCreateTime(new Date());
+		t.setCreateName(StpUserUtil.getPCLoginInfo().getLoginName());
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbCooperative t){
+		t.setUpdateTime(new Date());
+		t.setUpdateName(StpUserUtil.getPCLoginInfo().getLoginName());
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbCooperative getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<TbCooperative> getList(SoMap so) { 
+		return tbCooperativeMapper.getList(so);	
+	}
+	
+
+}

+ 21 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_cooperative/TbCooperativeUtil.java

@@ -0,0 +1,21 @@
+package com.pj.tb_cooperative;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 工具类:tb_cooperative -- 合作社
+ * @author lsw 
+ *
+ */
+@Component
+public class TbCooperativeUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static TbCooperativeMapper tbCooperativeMapper;
+	@Autowired
+	private void setTbCooperativeMapper(TbCooperativeMapper tbCooperativeMapper) {
+		TbCooperativeUtil.tbCooperativeMapper = tbCooperativeMapper;
+	}
+}

+ 0 - 2
sp-service/sp-admin/src/main/java/com/pj/project/tb_message/TbMessageController.java

@@ -1,12 +1,10 @@
 package com.pj.project.tb_message;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
-import com.pj.api.dto.DistrictInfoDTO;
 import com.pj.api.dto.MessageDto;
 import com.pj.project4sp.SP;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
-import org.apache.xmlbeans.impl.xb.xsdschema.Public;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;