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