Commit e08800cf authored by 耿迪迪's avatar 耿迪迪

采购代码优化

parent ef9d6f49
...@@ -28,12 +28,12 @@ public class TPurchase extends BaseEntity ...@@ -28,12 +28,12 @@ public class TPurchase extends BaseEntity
@Excel(name = "采购申请部门") @Excel(name = "采购申请部门")
private Long purchaseDeptId; private Long purchaseDeptId;
public Long getHandled_by_user_id() { public Long getHandledByUserId() {
return handled_by_user_id; return handledByUserId;
} }
public void setHandled_by_user_id(Long handled_by_user_id) { public void setHandledByUserId(Long handledByUserId) {
this.handled_by_user_id = handled_by_user_id; this.handledByUserId = handledByUserId;
} }
private String userName; private String userName;
...@@ -55,7 +55,7 @@ public class TPurchase extends BaseEntity ...@@ -55,7 +55,7 @@ public class TPurchase extends BaseEntity
private String purchaseDeptName; private String purchaseDeptName;
private Long handled_by_user_id; private Long handledByUserId;
/** 采购名称 */ /** 采购名称 */
@Excel(name = "采购名称") @Excel(name = "采购名称")
private String purchaseName; private String purchaseName;
......
...@@ -76,7 +76,7 @@ public class TPurchaseServiceImpl implements ITPurchaseService ...@@ -76,7 +76,7 @@ public class TPurchaseServiceImpl implements ITPurchaseService
tPurchase.setCreateTime(DateUtils.getNowDate()); tPurchase.setCreateTime(DateUtils.getNowDate());
SysUser user = SecurityUtils.getLoginUser().getUser(); SysUser user = SecurityUtils.getLoginUser().getUser();
tPurchase.setPurchaseDeptId(user.getDeptId()); tPurchase.setPurchaseDeptId(user.getDeptId());
tPurchase.setHandled_by_user_id(user.getUserId());//经办人 tPurchase.setHandledByUserId(user.getUserId());//经办人
return tPurchaseMapper.insertTPurchase(tPurchase); return tPurchaseMapper.insertTPurchase(tPurchase);
} }
......
...@@ -97,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -97,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="queryDebitDeptId != null "> and debit_dept_id = #{queryDebitDeptId}</if> <if test="queryDebitDeptId != null "> and debit_dept_id = #{queryDebitDeptId}</if>
<if test="queryLendDeptId != null "> and lend_dept_id = #{queryLendDeptId}</if> <if test="queryLendDeptId != null "> and lend_dept_id = #{queryLendDeptId}</if>
</where> </where>
ORDER BY create_time DESC
</select> </select>
<select id="selectTDebitCreditById" parameterType="Long" resultMap="TDebitCreditResult"> <select id="selectTDebitCreditById" parameterType="Long" resultMap="TDebitCreditResult">
......
...@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TPurchase" id="TPurchaseResult"> <resultMap type="TPurchase" id="TPurchaseResult">
<result property="purchaseId" column="purchase_id" /> <result property="purchaseId" column="purchase_id" />
<result property="purchaseDeptId" column="purchase_dept_id" /> <result property="purchaseDeptId" column="purchase_dept_id" />
<result property="handledByUserId" column="handled_by_user_id" />
<result property="purchaseName" column="purchase_name" /> <result property="purchaseName" column="purchase_name" />
<result property="specifications" column="specifications" /> <result property="specifications" column="specifications" />
<result property="modelType" column="model_type" /> <result property="modelType" column="model_type" />
...@@ -34,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -34,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT SELECT
p.purchase_id, p.purchase_id,
p.purchase_dept_id, p.purchase_dept_id,
p.handled_by_user_id,
p.purchase_name, p.purchase_name,
p.specifications, p.specifications,
p.model_type, p.model_type,
...@@ -61,13 +63,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -61,13 +63,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select (select dept_name from sys_dept where dept_id =purchase_dept_id)purchase_dept_name, select (select dept_name from sys_dept where dept_id =purchase_dept_id)purchase_dept_name,
(select t1.nick_name from sys_user t1 where t1.user_id=t.user_id )user_name, (select t1.nick_name from sys_user t1 where t1.user_id=t.user_id )user_name,
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = t.approved_user_id) approved_user_name, (SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = t.approved_user_id) approved_user_name,
purchase_id, purchase_dept_id, purchase_name, specifications, model_type, application_description, user_id, price, count, total, purchase_dept_manager_id, approved_user_id, remark, create_time, is_del, update_time, purchase_status, approved_time from t_purchase t purchase_id,handled_by_user_id, purchase_dept_id, purchase_name, specifications, model_type, application_description, user_id, price, count, total, purchase_dept_manager_id, approved_user_id, remark, create_time, is_del, update_time, purchase_status, approved_time from t_purchase t
<where> <where>
<if test="purchaseDeptId != null "> and purchase_dept_id = #{purchaseDeptId}</if> <if test="purchaseDeptId != null "> and purchase_dept_id = #{purchaseDeptId}</if>
<if test="handledByUserId != null "> and handled_by_user_id = #{handledByUserId}</if>
<if test="purchaseName != null and purchaseName != ''"> and purchase_name like concat('%', #{purchaseName}, '%')</if> <if test="purchaseName != null and purchaseName != ''"> and purchase_name like concat('%', #{purchaseName}, '%')</if>
<if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if> <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
<if test="modelType != null and modelType != ''"> and model_type = #{modelType}</if> <if test="modelType != null and modelType != ''"> and model_type = #{modelType}</if>
<if test="applicationDescription != null and applicationDescription != ''"> and application_description = #{applicationDescription}</if> <if test="applicationDescription != null and applicationDescription != ''"> and application_description like concat('%', #{applicationDescription}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
<if test="price != null "> and price = #{price}</if> <if test="price != null "> and price = #{price}</if>
<if test="count != null "> and count = #{count}</if> <if test="count != null "> and count = #{count}</if>
...@@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseId != null">purchase_id,</if> <if test="purchaseId != null">purchase_id,</if>
<if test="purchaseDeptId != null">purchase_dept_id,</if> <if test="purchaseDeptId != null">purchase_dept_id,</if>
<if test="handledByUserId != null">handled_by_user_id,</if>
<if test="purchaseName != null">purchase_name,</if> <if test="purchaseName != null">purchase_name,</if>
<if test="specifications != null">specifications,</if> <if test="specifications != null">specifications,</if>
<if test="modelType != null">model_type,</if> <if test="modelType != null">model_type,</if>
...@@ -110,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -110,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseId != null">#{purchaseId},</if> <if test="purchaseId != null">#{purchaseId},</if>
<if test="purchaseDeptId != null">#{purchaseDeptId},</if> <if test="purchaseDeptId != null">#{purchaseDeptId},</if>
<if test="handledByUserId != null">#{handledByUserId},</if>
<if test="purchaseName != null">#{purchaseName},</if> <if test="purchaseName != null">#{purchaseName},</if>
<if test="specifications != null">#{specifications},</if> <if test="specifications != null">#{specifications},</if>
<if test="modelType != null">#{modelType},</if> <if test="modelType != null">#{modelType},</if>
...@@ -133,6 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -133,6 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_purchase update t_purchase
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="purchaseDeptId != null">purchase_dept_id = #{purchaseDeptId},</if> <if test="purchaseDeptId != null">purchase_dept_id = #{purchaseDeptId},</if>
<if test="handledByUserId != null">handled_by_user_id = #{handledByUserId},</if>
<if test="purchaseName != null">purchase_name = #{purchaseName},</if> <if test="purchaseName != null">purchase_name = #{purchaseName},</if>
<if test="specifications != null">specifications = #{specifications},</if> <if test="specifications != null">specifications = #{specifications},</if>
<if test="modelType != null">model_type = #{modelType},</if> <if test="modelType != null">model_type = #{modelType},</if>
......
...@@ -120,10 +120,10 @@ ...@@ -120,10 +120,10 @@
<!--<el-table-column type="selection" width="55" align="center" />--> <!--<el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="采购主键" align="center" prop="purchaseId" />--> <!-- <el-table-column label="采购主键" align="center" prop="purchaseId" />-->
<!-- <el-table-column label="采购申请部门" align="center" prop="purchaseDeptName" />--> <!-- <el-table-column label="采购申请部门" align="center" prop="purchaseDeptName" />-->
<el-table-column label="采购名称" align="center" prop="purchaseName" /> <el-table-column label="采购名称" align="center" prop="purchaseName" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="规格" align="center" prop="specifications" />--> <!-- <el-table-column label="规格" align="center" prop="specifications" />-->
<!-- <el-table-column label="型号" align="center" prop="modelType" />--> <!-- <el-table-column label="型号" align="center" prop="modelType" />-->
<el-table-column label="用途说明" align="center" prop="applicationDescription" /> <el-table-column label="用途说明" align="center" prop="applicationDescription" :show-overflow-tooltip="true"/>
<el-table-column label="使用人" align="center" prop="userName" /> <el-table-column label="使用人" align="center" prop="userName" />
<el-table-column label="单价" align="center" prop="price" /> <el-table-column label="单价" align="center" prop="price" />
<el-table-column label="数量" align="center" prop="count" /> <el-table-column label="数量" align="center" prop="count" />
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:purchase:remove']" v-hasPermi="['system:purchase:remove']"
v-if="(scope.row.purchaseStatus == '0' || scope.row.purchaseStatus == '3') && scope.row.applyId == $store.state.user.userId" v-if="(scope.row.purchaseStatus == '0' || scope.row.purchaseStatus == '3') && scope.row.handledByUserId == $store.state.user.userId"
>删除</el-button> >删除</el-button>
<OperatorButton <OperatorButton
v-for="item in scope.row.operators" v-for="item in scope.row.operators"
...@@ -366,6 +366,7 @@ export default { ...@@ -366,6 +366,7 @@ export default {
this.getList(); this.getList();
this.getUsers(); this.getUsers();
this.getPurchaseStatusList(); this.getPurchaseStatusList();
console.log("fdsfdsfdsf0-----------------",this.$store.state.user.userId)
}, },
methods: { methods: {
getPurchaseStatusList(){ getPurchaseStatusList(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment