qzyReal 3 سال پیش
والد
کامیت
2adafb604b

+ 30 - 7
sp-admin/sa-frame/menu-list.js

@@ -314,6 +314,7 @@ var menuList = [{
 
 				]
 			},
+
 			{
 				id: 'tb-car-disincle-list',
 				name: '其他业务',
@@ -340,7 +341,7 @@ var menuList = [{
 					},
 				]
 			},
-			
+
 
 		]
 	},
@@ -350,6 +351,29 @@ var menuList = [{
 		icon: 'el-icon-notebook-2',
 		parent: true,
 		childList: [{
+				id: 'relation-goods-type-list',
+				name: '业务项管理',
+				icon: 'el-icon-folder-opened',
+				url: 'sa-view/relation-goods-type/relation-goods-type-list.html',
+				childList: [
+					{
+						id: 'relation-goods-type-add',
+						name: '添加',
+						isShow: false
+					},
+					{
+						id: 'relation-goods-type-del',
+						name: '删除',
+						isShow: false
+					},
+					{
+						id: 'relation-goods-type-edit',
+						name: '修改',
+						isShow: false
+					},
+					]
+			},
+			{
 				id: 'tb-item-type-list',
 				name: '收费项管理',
 				url: 'sa-view/tb-item-type/tb-item-type-list.html',
@@ -376,7 +400,7 @@ var menuList = [{
 
 				]
 			},
-			
+
 			{
 				id: 'tb-item-re-list',
 				name: '明细管理',
@@ -403,11 +427,10 @@ var menuList = [{
 				name: '项目顺序',
 				url: 'sa-view/tb-business-sort/tb-business-sort-list.html',
 				childList: [{
-						id: 'tb-business-sort-edit',
-						name: '修改',
-						isShow: false
-					},
-				]
+					id: 'tb-business-sort-edit',
+					name: '修改',
+					isShow: false
+				}, ]
 			},
 		],
 

+ 95 - 0
sp-server/src/main/java/com/pj/project/relation_goods_type/RelationGoodsType.java

@@ -0,0 +1,95 @@
+package com.pj.project.relation_goods_type;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: relation_goods_type -- 业务类型与作业项
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(RelationGoodsType.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class RelationGoodsType extends Model<RelationGoodsType> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "relation_goods_type";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "relation-goods-type";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 *  
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 *  
+	 */
+	private Long goodsId;	
+
+	/**
+	 * 作业类型 
+	 */
+	private String goodsName;	
+
+	/**
+	 *  
+	 */
+	private Long typeId;	
+
+	/**
+	 * 类型名称 
+	 */
+	private String typeName;	
+
+	/**
+	 * 载重是否必填(1=是,0=否) 
+	 */
+	private String needWeight;	
+
+	/**
+	 * 规格是否必填(1=是,0=否) 
+	 */
+	private String needCarSize;	
+
+	/**
+	 * 申报单是否必填(1=是,0=否) 
+	 */
+	private String needDeclare;	
+
+	/**
+	 * 申报时间是否必填(1=是,0=否) 
+	 */
+	private String needOperateTime;	
+
+	/**
+	 * 是否必选(1=是,0=否) 
+	 */
+	private Integer needSelect;	
+
+
+
+
+
+	
+
+
+}

+ 145 - 0
sp-server/src/main/java/com/pj/project/relation_goods_type/RelationGoodsTypeController.java

@@ -0,0 +1,145 @@
+package com.pj.project.relation_goods_type;
+
+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: relation_goods_type -- 业务类型与作业项
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/RelationGoodsType/")
+public class RelationGoodsTypeController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	RelationGoodsTypeService relationGoodsTypeService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
+	public AjaxJson add(RelationGoodsType r){
+		relationGoodsTypeService.add(r);
+		r = relationGoodsTypeService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(r);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson delete(Long id){
+		int line = relationGoodsTypeService.delete(id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(RelationGoodsType.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson update(RelationGoodsType r){
+		int line = relationGoodsTypeService.update(r);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		RelationGoodsType r = relationGoodsTypeService.getById(id);
+		return AjaxJson.getSuccessData(r);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<RelationGoodsType> list = relationGoodsTypeService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	/** 改 - 载重是否必填(1=是,0=否) */  
+	@RequestMapping("updateNeedWeight")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson updateNeedWeight(Long id, String value){
+		int line = SP.publicMapper.updateColumnById(RelationGoodsType.TABLE_NAME, "need_weight", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 规格是否必填(1=是,0=否) */  
+	@RequestMapping("updateNeedCarSize")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson updateNeedCarSize(Long id, String value){
+		int line = SP.publicMapper.updateColumnById(RelationGoodsType.TABLE_NAME, "need_car_size", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 申报单是否必填(1=是,0=否) */  
+	@RequestMapping("updateNeedDeclare")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson updateNeedDeclare(Long id, String value){
+		int line = SP.publicMapper.updateColumnById(RelationGoodsType.TABLE_NAME, "need_declare", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 申报时间是否必填(1=是,0=否) */  
+	@RequestMapping("updateNeedOperateTime")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson updateNeedOperateTime(Long id, String value){
+		int line = SP.publicMapper.updateColumnById(RelationGoodsType.TABLE_NAME, "need_operate_time", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 是否必选(1=是,0=否) */  
+	@RequestMapping("updateNeedSelect")
+	@SaCheckPermission(RelationGoodsType.PERMISSION_CODE)
+	public AjaxJson updateNeedSelect(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(RelationGoodsType.TABLE_NAME, "need_select", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+	// ------------------------- 前端接口 -------------------------
+	
+	
+	/** 改 - 不传不改 [G] */
+	@RequestMapping("updateByNotNull")
+	public AjaxJson updateByNotNull(Long id){
+		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
+		// 鉴别身份,是否为数据创建者 
+		long userId = SP.publicMapper.getColumnByIdToLong(RelationGoodsType.TABLE_NAME, "user_id", id);
+		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
+		// 开始修改 (请只保留需要修改的字段)
+		SoMap so = SoMap.getRequestSoMap();
+		so.clearNotIn("id", "goodsId", "goodsName", "typeId", "typeName", "needWeight", "needCarSize", "needDeclare", "needOperateTime", "needSelect").clearNull().humpToLineCase();	
+		int line = SP.publicMapper.updateBySoMapById(RelationGoodsType.TABLE_NAME, so, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+	
+	
+	
+	
+
+}

+ 56 - 0
sp-server/src/main/java/com/pj/project/relation_goods_type/RelationGoodsTypeMapper.java

@@ -0,0 +1,56 @@
+package com.pj.project.relation_goods_type;
+
+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: relation_goods_type -- 业务类型与作业项
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface RelationGoodsTypeMapper extends BaseMapper <RelationGoodsType> {
+
+	/**
+	 * 增  
+	 * @param r 实体对象 
+	 * @return 受影响行数 
+	 */
+	int add(RelationGoodsType r);
+
+	/**
+	 * 删  
+	 * @param id 要删除的数据id  
+	 * @return 受影响行数 
+	 */
+	int delete(Long id);	 
+
+	/** 
+	 * 改  
+	 * @param r 实体对象 
+	 * @return 受影响行数 
+	 */
+	int update(RelationGoodsType r);
+
+	/** 
+	 * 查 - 根据id  
+	 * @param id 要查询的数据id 
+	 * @return 实体对象 
+	 */
+	RelationGoodsType getById(Long id);	 
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<RelationGoodsType> getList(SoMap so);
+
+
+}

+ 104 - 0
sp-server/src/main/java/com/pj/project/relation_goods_type/RelationGoodsTypeMapper.xml

@@ -0,0 +1,104 @@
+<?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.project.relation_goods_type.RelationGoodsTypeMapper">
+
+	<!-- 增 [G] -->
+	<insert id="add">
+		insert into 
+		relation_goods_type (id, goods_id, goods_name, type_id, type_name, need_weight, need_car_size, need_declare, need_operate_time, need_select) 
+		values (#{id}, #{goodsId}, #{goodsName}, #{typeId}, #{typeName}, #{needWeight}, #{needCarSize}, #{needDeclare}, #{needOperateTime}, #{needSelect}) 
+	</insert>
+
+	<!-- 删 -->
+	<delete id="delete">
+		delete from relation_goods_type 
+		where id = #{id}
+	</delete>
+
+	<!-- 改 [G] -->
+	<update id="update">
+		update relation_goods_type set
+		id = #{id}, 
+		goods_id = #{goodsId}, 
+		goods_name = #{goodsName}, 
+		type_id = #{typeId}, 
+		type_name = #{typeName}, 
+		need_weight = #{needWeight}, 
+		need_car_size = #{needCarSize}, 
+		need_declare = #{needDeclare}, 
+		need_operate_time = #{needOperateTime}, 
+		need_select = #{needSelect}
+		where id = #{id}
+	</update>
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, goods_id, goods_name, type_id, type_name, need_weight, need_car_size, need_declare, need_operate_time, need_select from relation_goods_type  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.relation_goods_type.RelationGoodsType">
+		<result property="id" column="id" />
+		<result property="goodsId" column="goods_id" />
+		<result property="goodsName" column="goods_name" />
+		<result property="typeId" column="type_id" />
+		<result property="typeName" column="type_name" />
+		<result property="needWeight" column="need_weight" />
+		<result property="needCarSize" column="need_car_size" />
+		<result property="needDeclare" column="need_declare" />
+		<result property="needOperateTime" column="need_operate_time" />
+		<result property="needSelect" column="need_select" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from relation_goods_type 
+	</sql>
+	
+	<!-- 查 - 根据id -->
+	<select id="getById" resultMap="model">
+		<include refid="select_sql"></include>
+		where id = #{id}
+	</select>
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [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("goodsId") '> and goods_id = #{goodsId} </if>
+			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
+			<if test=' this.has("typeId") '> and type_id = #{typeId} </if>
+			<if test=' this.has("typeName") '> and type_name = #{typeName} </if>
+			<if test=' this.has("needWeight") '> and need_weight = #{needWeight} </if>
+			<if test=' this.has("needCarSize") '> and need_car_size = #{needCarSize} </if>
+			<if test=' this.has("needDeclare") '> and need_declare = #{needDeclare} </if>
+			<if test=' this.has("needOperateTime") '> and need_operate_time = #{needOperateTime} </if>
+			<if test=' this.has("needSelect") '> and need_select = #{needSelect} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> goods_id desc </when>
+			<when test='sortType == 3'> goods_name desc </when>
+			<when test='sortType == 4'> type_id desc </when>
+			<when test='sortType == 5'> type_name desc </when>
+			<when test='sortType == 6'> need_weight desc </when>
+			<when test='sortType == 7'> need_car_size desc </when>
+			<when test='sortType == 8'> need_declare desc </when>
+			<when test='sortType == 9'> need_operate_time desc </when>
+			<when test='sortType == 10'> need_select desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 48 - 0
sp-server/src/main/java/com/pj/project/relation_goods_type/RelationGoodsTypeService.java

@@ -0,0 +1,48 @@
+package com.pj.project.relation_goods_type;
+
+import java.util.List;
+
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.pj.utils.sg.*;
+
+/**
+ * Service: relation_goods_type -- 业务类型与作业项
+ * @author qzy 
+ */
+@Service
+public class RelationGoodsTypeService {
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	RelationGoodsTypeMapper relationGoodsTypeMapper;
+
+	/** 增 */
+	int add(RelationGoodsType r){
+		return relationGoodsTypeMapper.add(r);
+	}
+
+	/** 删 */
+	int delete(Long id){
+		return relationGoodsTypeMapper.delete(id);
+	}
+
+	/** 改 */
+	int update(RelationGoodsType r){
+		return relationGoodsTypeMapper.update(r);
+	}
+
+	/** 查 */
+	RelationGoodsType getById(Long id){
+		return relationGoodsTypeMapper.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<RelationGoodsType> getList(SoMap so) {
+		return relationGoodsTypeMapper.getList(so);	
+	}
+	
+
+}