Commit c7ab9608 authored by 耿迪迪's avatar 耿迪迪
parents 96f52008 45742500
......@@ -51,6 +51,10 @@ public class TBorrowingApplyForController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TBorrowingApplyFor tBorrowingApplyFor)
{
SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
if (!"核算部".equals(user.getDept().getDeptName())){
tBorrowingApplyFor.setBorrowingDeptId(user.getDeptId());
}
startPage();
List<TBorrowingApplyFor> list = tBorrowingApplyForService.selectTBorrowingApplyForList(tBorrowingApplyFor);
return getDataTable(list);
......@@ -89,6 +93,10 @@ public class TBorrowingApplyForController extends BaseController
SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
if (StringUtils.isNotNull(user)) {
tBorrowingApplyFor.setHandledByUserId(user.getUserId());
//设置经办人部门
tBorrowingApplyFor.setBorrowingDeptId(user.getDeptId());
//设置审批状态
tBorrowingApplyFor.setApprovalStatus(1);
}
tBorrowingApplyFor.setRegistrationDate(new Date());
return toAjax(tBorrowingApplyForService.insertTBorrowingApplyFor(tBorrowingApplyFor));
......@@ -102,12 +110,18 @@ public class TBorrowingApplyForController extends BaseController
@PutMapping
public int edit(@RequestBody TBorrowingApplyFor tBorrowingApplyFor)
{
if (tBorrowingApplyFor.getApprovalStatus()==3){
//修改借支申请表状态
tBorrowingApplyForService.updateTBorrowingApplyFor(tBorrowingApplyFor);
return 3;
}
/**查询部门余额是否足够*/
int isSufficient = tBorrowingApplyForService.selectTacc(tBorrowingApplyFor);
SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
tBorrowingApplyFor.setApprovedUserId(user.getUserId());
//0部门余额不足 1余额足够
if (isSufficient!=0){
tBorrowingApplyFor.setApprovalTime(new Date());
//修改部门余额
tBorrowingApplyForService.deletebBalance(tBorrowingApplyFor);
//修改借支申请表状态
......@@ -117,14 +131,15 @@ public class TBorrowingApplyForController extends BaseController
tCashOperate.setOperateType("2");
tCashOperate.setOperateAmount(tBorrowingApplyFor.getTotalFigures());
tCashOperate.setIsDel("0");
tCashOperate.setOperateType("2");
tCashOperate.setOperateTime(new Date());
//增加资金操作记录
tCashOperateService.insertTCashOperate(tCashOperate);
return 1;
}else {
tBorrowingApplyFor.setApprovalStatus(3);
// tBorrowingApplyFor.setApprovalStatus(3);
//修改借支申请表状态
tBorrowingApplyForService.updateTBorrowingApplyFor(tBorrowingApplyFor);
// tBorrowingApplyForService.updateTBorrowingApplyFor(tBorrowingApplyFor);
return 2;
}
......
......@@ -54,7 +54,7 @@ public class TBorrowingApplyFor extends BaseEntity
private Long approvedUserId;
/** 登记日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "登记日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date registrationDate;
......@@ -66,9 +66,35 @@ public class TBorrowingApplyFor extends BaseEntity
@Excel(name = "是否删除 0未删除 1删除")
private String isDel;
/**审批状态 1未审批 2审批通过 3审批拒绝 */
/**审批状态 1未审批 2通过 3驳回 */
private Integer approvalStatus;
private String deptName;
/**
* 审批时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "登记日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date approvalTime;
public Date getApprovalTime() {
return approvalTime;
}
public void setApprovalTime(Date approvalTime) {
this.approvalTime = approvalTime;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
private String handledByUserIdName;
private String userIdName;
......@@ -236,6 +262,8 @@ public class TBorrowingApplyFor extends BaseEntity
", attachmentUrl='" + attachmentUrl + '\'' +
", isDel='" + isDel + '\'' +
", approvalStatus=" + approvalStatus +
", deptName='" + deptName + '\'' +
", approvalTime=" + approvalTime +
", handledByUserIdName='" + handledByUserIdName + '\'' +
", userIdName='" + userIdName + '\'' +
", ApprovedUserIdName='" + ApprovedUserIdName + '\'' +
......
......@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="approvalStatus" column="approval_status" />
<result property="approvalTime" column="approval_time" />
</resultMap>
......@@ -34,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user c on a.user_id=c.user_id
left join sys_user d on a.approved_user_id=d.user_id
<where>
a.is_del='0'
<if test="feeName != null and feeName != ''"> and a.fee_name like concat('%', #{feeName}, '%')</if>
<if test="borrowingDeptId != null "> and a.borrowing_dept_id = #{borrowingDeptId}</if>
<if test="handledByUserId != null "> and a.handled_by_user_id = #{handledByUserId}</if>
......@@ -50,8 +52,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectTBorrowingApplyForById" parameterType="Long" resultMap="TBorrowingApplyForResult">
<include refid="selectTBorrowingApplyForVo"/>
where borrowing = #{borrowing}
SELECT a.*,b.nick_name handledByUserIdName,c.nick_name userIdName,d.nick_name ApprovedUserIdName,e.dept_name deptName FROM t_borrowing_apply_for a
left join sys_user b on a.handled_by_user_id=b.user_id
left join sys_user c on a.user_id=c.user_id
left join sys_user d on a.approved_user_id=d.user_id
left join sys_dept e on a.borrowing_dept_id=e.dept_id
where a.borrowing = #{borrowing}
</select>
......@@ -73,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null">is_del,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="approvalTime != null">approval_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="borrowing != null">#{borrowing},</if>
......@@ -90,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null">#{isDel},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="approvalTime != null">#{approvalTime},</if>
</trim>
</insert>
......@@ -112,13 +120,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="approvalStatus != null">approval_status = #{approvalStatus},</if>
<if test="approvalTime != null">approval_time = #{approvalTime},</if>
</trim>
where borrowing = #{borrowing}
</update>
<delete id="deleteTBorrowingApplyForById" parameterType="Long">
delete from t_borrowing_apply_for where borrowing = #{borrowing}
</delete>
<!-- <delete id="deleteTBorrowingApplyForById" parameterType="Long">-->
<!-- delete from t_borrowing_apply_for where borrowing = #{borrowing}-->
<!-- </delete>-->
<update id="deleteTBorrowingApplyForById" parameterType="Long">
update t_borrowing_apply_for set is_del='1' where borrowing = #{borrowing}
</update>
<delete id="deleteTBorrowingApplyForByIds" parameterType="String">
delete from t_borrowing_apply_for where borrowing in
......
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