linbl před 1 rokem
rodič
revize
9a4de3d20e

+ 16 - 16
sp-service/level-one-server/src/main/java/com/pj/tb_agreement/TbAgreementMapper.xml

@@ -7,24 +7,24 @@
 
 	<!-- ================================== 查询相关 ================================== -->
 	<!-- select id, type, content from tb_agreement  -->
-	
+
 	<!-- 通用映射:自动模式 -->
 	<resultMap id="model" autoMapping="true" type="com.pj.tb_agreement.TbAgreement"></resultMap>
-	
+
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select * 
-		from tb_agreement 
+		select *
+		from tb_agreement
 	</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("type") '> and type = #{type} </if>
-			<if test=' this.has("content") '> and content = #{content} </if>
+			<if test=' this.has("type") '> and type like concat('%', #{type}, '%') </if>
+			<if test=' this.has("content") '> and content like concat('%', #{content}, '%') </if>
 		</where>
 		order by
 		<choose>
@@ -33,14 +33,14 @@
 			<otherwise> id desc </otherwise>
 		</choose>
 	</select>
-	
-	
-	
-	
-	
-	
-	
-	
-	
+
+
+
+
+
+
+
+
+
 
 </mapper>

+ 15 - 15
sp-service/level-one-server/src/main/java/com/pj/tb_banner/TbBannerMapper.xml

@@ -7,23 +7,23 @@
 
 	<!-- ================================== 查询相关 ================================== -->
 	<!-- select id, title, image, url, status, create_by, create_name, create_time, update_by, update_name, update_time, delete_status from tb_banner  -->
-	
+
 	<!-- 通用映射:自动模式 -->
 	<resultMap id="model" autoMapping="true" type="com.pj.tb_banner.TbBanner"></resultMap>
-	
+
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select * 
-		from tb_banner 
+		select *
+		from tb_banner
 	</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("title") '> and title = #{title} </if>
+			<if test=' this.has("title") '> and title like concat('%', #{title}, '%') </if>
 			<if test=' this.has("url") '> and url = #{url} </if>
 			<if test=' this.has("status") '> and status = #{status} </if>
 			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
@@ -46,14 +46,14 @@
 			<otherwise> id desc </otherwise>
 		</choose>
 	</select>
-	
-	
-	
-	
-	
-	
-	
-	
-	
+
+
+
+
+
+
+
+
+
 
 </mapper>

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

@@ -7,23 +7,23 @@
 
 	<!-- ================================== 查询相关 ================================== -->
 	<!-- select id, owner_name, nationality, type, sex, legal_person, id_card, owner_tel, business_license, shop_id, shop_name, bank_no, bank, bank_account, age, duty_paragraph, address_ids, address, detail, agreement, judge_status, judge_content, judge_time, register_time, judge_by, create_time, create_by, create_name, update_time, update_by, update_name, delete_status, is_lock, trade_area_id, trade_area_name, plat_seq_no, owner_idtype, e_d_status from tb_enterprise  -->
-	
+
 	<!-- 通用映射:自动模式 -->
 	<resultMap id="model" autoMapping="true" type="com.pj.tb_enterprise.TbEnterprise"></resultMap>
-	
+
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select * 
-		from tb_enterprise 
+		select *
+		from tb_enterprise
 	</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("ownerName") '> and owner_name = #{ownerName} </if>
+			<if test=' this.has("ownerName") '> and owner_name like concat('%',#{ownerName},'%') </if>
 			<if test=' this.has("nationality") '> and nationality = #{nationality} </if>
 			<if test=' this.has("type") '> and type = #{type} </if>
 			<if test=' this.has("sex") '> and sex = #{sex} </if>
@@ -102,14 +102,14 @@
 			<otherwise> id desc </otherwise>
 		</choose>
 	</select>
-	
-	
-	
-	
-	
-	
-	
-	
-	
+
+
+
+
+
+
+
+
+
 
 </mapper>

+ 33 - 42
sp-service/level-one-server/src/main/java/com/pj/tb_port_news/TbPortNews.java

@@ -24,15 +24,15 @@ public class TbPortNews extends Model<TbPortNews> implements Serializable {
 
 	// ---------- 模块常量 ----------
 	/**
-	 * 序列化版本id 
+	 * 序列化版本id
 	 */
-	private static final long serialVersionUID = 1L;	
+	private static final long serialVersionUID = 1L;
 	/**
-	 * 此模块对应的表名 
+	 * 此模块对应的表名
 	 */
-	public static final String TABLE_NAME = "tb_port_news";	
+	public static final String TABLE_NAME = "tb_port_news";
 	/**
-	 * 此模块对应的权限码 
+	 * 此模块对应的权限码
 	 */
 	public static final String PERMISSION_CODE = "tb-port-news";
 	public static final String PERMISSION_CODE_ADD = "tb-port-news-add";
@@ -44,44 +44,44 @@ public class TbPortNews extends Model<TbPortNews> implements Serializable {
 
 	// ---------- 表中字段 ----------
 	/**
-	 * 主键 
+	 * 主键
 	 */
 	@TableId(type = IdType.AUTO)
 	@JsonSerialize(using = ToStringSerializer.class)
-	private Long id;	
+	private Long id;
 
 	/**
-	 * 标题 
+	 * 标题
 	 */
-	private String title;	
+	private String title;
 
 	/**
-	 * 封面图片 
+	 * 封面图片
 	 */
-	private String cover;	
+	private String cover;
 
 	/**
-	 * 链接地址 
+	 * 链接地址
 	 */
-	private String url;	
+	private String url;
 
 	/**
-	 * 内容 
+	 * 内容
 	 */
-	private String content;	
+	private String content;
 
 	/**
-	 * 来源 
+	 * 来源
 	 */
-	private String source;	
+	private String source;
 
 	/**
-	 * 阅读量 
+	 * 阅读量
 	 */
-	private Integer readCount;	
+	private Integer readCount;
 
 	/**
-	 * 发布状态(0=未发布,1=发布) 
+	 * 发布状态(0=未发布,1=发布)
 	 */
 	private Integer isRelease;
 
@@ -89,51 +89,42 @@ public class TbPortNews extends Model<TbPortNews> implements Serializable {
 	 * 发布时间
 	 *
 	 */
-	@JsonFormat(pattern = "yyyy-MM-dd")
-	private Date releaseTime;	
+	private Date releaseTime;
 
 	/**
-	 * 状态(0=禁用,1=启用) 
+	 * 状态(0=禁用,1=启用)
 	 */
 	private Integer status;
 
 	/**
-	 * 创建者id 
+	 * 创建者id
 	 */
-	private String createBy;	
+	private String createBy;
 
 	/**
-	 * 创建者名称 
+	 * 创建者名称
 	 */
-	private String createName;	
+	private String createName;
 
 	/**
-	 * 创建时间 
+	 * 创建时间
 	 */
-	@JsonFormat(pattern = "yyyy-MM-dd")
-	private Date createTime;	
+	private Date createTime;
 
 	/**
-	 * 更新者id 
+	 * 更新者id
 	 */
 	private String updateBy;
 
 	/**
-	 * 更新者名称 
+	 * 更新者名称
 	 */
-	private String updateName;	
+	private String updateName;
 
 	/**
-	 * 更新时间 
+	 * 更新时间
 	 */
-	@JsonFormat(pattern = "yyyy-MM-dd")
-	private Date updateTime;	
-
-
-
-
-
-	
+	private Date updateTime;
 
 
 }

+ 17 - 22
sp-service/level-one-server/src/main/java/com/pj/tb_port_news/TbPortNewsService.java

@@ -4,18 +4,14 @@ import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 
-import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.extra.cglib.CglibUtil;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.pj.current.dto.PCLoginUserInfo;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.enummj.DeleteStatus;
 import com.pj.enummj.ReleaseStatus;
 import com.pj.tb_port_news.vo.TbPortNewsVo;
-import com.pj.utils.cache.RedisUtil;
 import com.pj.utils.so.SoMap;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -42,6 +38,12 @@ public class TbPortNewsService extends ServiceImpl<TbPortNewsMapper, TbPortNews>
      * 增
      */
     void add(TbPortNews t) {
+        PCLoginUserInfo userInfo = StpUserUtil.getPCLoginInfo();
+        t.setIsRelease(0)
+                .setStatus(0)
+                .setCreateBy(userInfo.getLoginId())
+                .setCreateName(userInfo.getLoginName())
+                .setCreateTime(new Date());
         save(t);
     }
 
@@ -56,6 +58,10 @@ public class TbPortNewsService extends ServiceImpl<TbPortNewsMapper, TbPortNews>
      * 改
      */
     void update(TbPortNews t) {
+        PCLoginUserInfo userInfo = StpUserUtil.getPCLoginInfo();
+        t.setUpdateBy(userInfo.getLoginId())
+                .setUpdateName(userInfo.getLoginName())
+                .setUpdateTime(new Date());
         updateById(t);
 
     }
@@ -82,11 +88,7 @@ public class TbPortNewsService extends ServiceImpl<TbPortNewsMapper, TbPortNews>
      */
     int updateRelease(Long id, int isRelease) {
 
-        // 获取当前登录者信息
-        String str = RedisUtil.get("pc:" + StpUtil.getLoginIdAsString());
-        JSONObject jsonObject = JSONUtil.parseObj(str);
-        String loginId = (String) jsonObject.get("loginId");
-        String loginName = (String) jsonObject.get("loginName");
+        PCLoginUserInfo userInfo = StpUserUtil.getPCLoginInfo();
         // 获取口岸咨询
         TbPortNews tbPortNews = tbPortNewsMapper.selectById(id);
         // 口岸咨询不存在抛异常
@@ -95,19 +97,12 @@ public class TbPortNewsService extends ServiceImpl<TbPortNewsMapper, TbPortNews>
         }
         // 口岸咨询被禁用抛异常
         if (tbPortNews.getStatus() == DeleteStatus.DELETE_STATUS_OFF.getCode()) {
-            throw new RuntimeException("口岸咨询已被禁用");
+            throw new RuntimeException("当前口岸咨询已被禁用,不允许发布!");
         }
-        // 设置口岸咨询发布状态
-        tbPortNews.setIsRelease(isRelease);
-        // 设置口岸咨询发布时间
-        tbPortNews.setReleaseTime(new Date());
-        // 设置口岸咨询更新者id
-        tbPortNews.setUpdateBy(loginId);
-        // 设置口岸咨询更新者名称
-        tbPortNews.setUpdateName(loginName);
-        // 更新口岸咨询
-        int line = tbPortNewsMapper.updateById(tbPortNews);
-        return line;
+        tbPortNews.setIsRelease(isRelease).setReleaseTime(new Date());
+        tbPortNews.setUpdateBy(userInfo.getLoginId()).setUpdateName(userInfo.getLoginName()).setUpdateTime(new Date());
+
+        return tbPortNewsMapper.updateById(tbPortNews);
     }
 
 

+ 7 - 16
sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShopMapper.xml

@@ -7,17 +7,17 @@
 
 	<!-- ================================== 查询相关 ================================== -->
 	<!-- select id, enterprise_id, create_by, create_name, update_name, create_time, update_by, update_time, trade_area_id, trade_area_name, address, address_ids, name, no, area, status, remark, enterprise_name, delete_status from tb_shop  -->
-	
+
 	<!-- 通用映射:自动模式 -->
 	<resultMap id="model" autoMapping="true" type="com.pj.tb_shop.TbShop"></resultMap>
-	
+
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select * 
-		from tb_shop 
+		select *
+		from tb_shop
 	</sql>
 
-	
+
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>
@@ -32,8 +32,8 @@
 			<if test=' this.has("tradeAreaName") '> and trade_area_name = #{tradeAreaName} </if>
 			<if test=' this.has("address") '> and address = #{address} </if>
 			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
-			<if test=' this.has("name") '> and name = #{name} </if>
-			<if test=' this.has("no") '> and no = #{no} </if>
+			<if test=' this.has("shopName") '> and shop_name like concat('%',#{shopName},'%') </if>
+			<if test=' this.has("shopNo") '> and shop_no = #{shopNo} </if>
 			<if test=' this.has("area") '> and area = #{area} </if>
 			<if test=' this.has("status") '> and status = #{status} </if>
 			<if test=' this.has("remark") '> and remark = #{remark} </if>
@@ -63,14 +63,5 @@
 			<otherwise> id desc </otherwise>
 		</choose>
 	</select>
-	
-	
-	
-	
-	
-	
-	
-	
-	
 
 </mapper>