Просмотр исходного кода

一级市场新增-进口申报单

linbl 1 год назад
Родитель
Сommit
b930d16d19

+ 125 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_iport_order/TbIportOrder.java

@@ -0,0 +1,125 @@
+package com.pj.tb_iport_order;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_iport_order -- 进口申报单
+ * @author lbl
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbIportOrder.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbIportOrder extends Model<TbIportOrder> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id
+	 */
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 此模块对应的表名
+	 */
+	public static final String TABLE_NAME = "tb_iport_order";
+	/**
+	 * 此模块对应的权限码
+	 */
+	public static final String PERMISSION_CODE = "tb-iport-order";
+	public static final String PERMISSION_CODE_ADD = "tb-iport-order-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-iport-order-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-iport-order-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;
+
+	/**
+	 * 身份证号
+	 */
+	private String idno;
+
+	/**
+	 * 边民备案编号(可选)
+	 */
+	private String borderPutrecNo;
+
+	/**
+	 * 边民姓名不能为空
+	 */
+	private String borderName;
+
+	/**
+	 * 结算单号
+	 */
+	private String settleBillNo;
+
+	/**
+	 * 进出口预申报单号
+	 */
+	private String preIeportNo;
+
+	/**
+	 * 购买申报确认状态:Y->确认购买申报,N->不购买申报
+	 */
+	private String buyConfirmStatus;
+
+	/**
+	 * 支付状态:01->未支付,02->已支付
+	 */
+	private Integer payStatus;
+
+	/**
+	 * 创建人编号
+	 */
+	private Long createBy;
+
+	/**
+	 * 创建人名称
+	 */
+	private String createName;
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+	/**
+	 * 更新人编号
+	 */
+	private Long updateBy;
+
+	/**
+	 * 更新人名称
+	 */
+	private String updateName;
+
+	/**
+	 * 更新时间
+	 */
+	private Date updateTime;
+
+	/**
+	 * 删除状态(0=禁用,1=启用)
+	 */
+	private Integer deleteStatus;
+
+
+
+
+
+
+}

+ 51 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_iport_order/TbIportOrderAppController.java

@@ -0,0 +1,51 @@
+package com.pj.tb_iport_order;
+
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * Controller: tb_iport_order -- 进口申报单
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/app/TbIportOrder/")
+public class TbIportOrderAppController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbIportOrderService tbIportOrderService;
+
+
+	/** 改 */
+	@RequestMapping("update")
+	public AjaxJson update(TbIportOrder t){
+		tbIportOrderService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbIportOrder t = tbIportOrderService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getList")
+	public AjaxJson getList() {
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbIportOrder> list = tbIportOrderService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+
+}

+ 87 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_iport_order/TbIportOrderController.java

@@ -0,0 +1,87 @@
+package com.pj.tb_iport_order;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+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;
+
+
+/**
+ * Controller: tb_iport_order -- 进口申报单
+ * @author lbl 
+ */
+@RestController
+@RequestMapping("/TbIportOrder/")
+public class TbIportOrderController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbIportOrderService tbIportOrderService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbIportOrder.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbIportOrder t){
+		tbIportOrderService.add(t);
+		t = tbIportOrderService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbIportOrder.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbIportOrderService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbIportOrder.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbIportOrder.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbIportOrder.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbIportOrder t){
+		tbIportOrderService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(TbIportOrder.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		TbIportOrder t = tbIportOrderService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(TbIportOrder.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbIportOrder> list = tbIportOrderService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_iport_order/TbIportOrderMapper.java

@@ -0,0 +1,30 @@
+package com.pj.tb_iport_order;
+
+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_iport_order -- 进口申报单
+ * @author lbl 
+ */
+
+@Mapper
+@Repository
+public interface TbIportOrderMapper extends BaseMapper <TbIportOrder> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbIportOrder> getList(SoMap so);
+
+
+}

+ 64 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_iport_order/TbIportOrderMapper.xml

@@ -0,0 +1,64 @@
+<?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_iport_order.TbIportOrderMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, idno, border_putrec_no, border_name, settle_bill_no, pre_ieport_no, buy_confirm_status, pay_status, cooper_entrust_status, cooper_entrust_time, apply_confirm_status, apply_confirm_time from tb_iport_order  -->
+
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_iport_order.TbIportOrder"></resultMap>
+
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select *
+		from tb_iport_order
+	</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("idno") '> and idno = #{idno} </if>
+			<if test=' this.has("borderPutrecNo") '> and border_putrec_no = #{borderPutrecNo} </if>
+			<if test=' this.has("borderName") '> and border_name = #{borderName} </if>
+			<if test=' this.has("settleBillNo") '> and settle_bill_no = #{settleBillNo} </if>
+			<if test=' this.has("preIeportNo") '> and pre_ieport_no = #{preIeportNo} </if>
+			<if test=' this.has("buyConfirmStatus") '> and buy_confirm_status = #{buyConfirmStatus} </if>
+			<if test=' this.has("payStatus") '> and pay_status = #{payStatus} </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>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> idno desc </when>
+			<when test='sortType == 3'> border_putrec_no desc </when>
+			<when test='sortType == 4'> border_name desc </when>
+			<when test='sortType == 5'> settle_bill_no desc </when>
+			<when test='sortType == 6'> pre_ieport_no desc </when>
+			<when test='sortType == 7'> buy_confirm_status desc </when>
+			<when test='sortType == 8'> pay_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+
+
+
+
+
+
+
+
+
+
+</mapper>

+ 54 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_iport_order/TbIportOrderService.java

@@ -0,0 +1,54 @@
+package com.pj.tb_iport_order;
+
+import java.util.List;
+
+import com.pj.api.client.async_server.AsyncServerInterface;
+import com.pj.utils.so.SoMap;
+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;
+
+/**
+ * Service: tb_iport_order -- 进口申报单
+ * @author lbl
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbIportOrderService extends ServiceImpl<TbIportOrderMapper, TbIportOrder> implements IService<TbIportOrder>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbIportOrderMapper tbIportOrderMapper;
+	@Autowired
+	private AsyncServerInterface asyncServerInterface;
+
+	/** 增 */
+	void add(TbIportOrder t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbIportOrder t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbIportOrder getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<TbIportOrder> getList(SoMap so) {
+		return tbIportOrderMapper.getList(so);
+	}
+
+
+}