领料申请驳回代码提交
This commit is contained in:
parent
4e7c28d3ce
commit
d7b78162ec
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -84,7 +85,7 @@ public class TmTask implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value="创建时间")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +99,7 @@ public class TmTask implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value="更新时间")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -238,6 +238,19 @@ public class Convert
|
|||
return toNumber(value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为int<br>
|
||||
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
|
||||
* 转换失败不会报错
|
||||
*
|
||||
* @param value 被转换的值
|
||||
* @return 结果
|
||||
*/
|
||||
public static Integer toInt(Object value)
|
||||
{
|
||||
return toInt(value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为int<br>
|
||||
* 如果给定的值为空,或者转换失败,返回默认值<br>
|
||||
|
|
@ -276,19 +289,6 @@ public class Convert
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为int<br>
|
||||
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
|
||||
* 转换失败不会报错
|
||||
*
|
||||
* @param value 被转换的值
|
||||
* @return 结果
|
||||
*/
|
||||
public static Integer toInt(Object value)
|
||||
{
|
||||
return toInt(value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为Integer数组<br>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -19,33 +19,25 @@ import reactor.core.publisher.Mono;
|
|||
*/
|
||||
@Order(-1)
|
||||
@Configuration
|
||||
public class GatewayExceptionHandler implements ErrorWebExceptionHandler
|
||||
{
|
||||
public class GatewayExceptionHandler implements ErrorWebExceptionHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GatewayExceptionHandler.class);
|
||||
|
||||
@Override
|
||||
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex)
|
||||
{
|
||||
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
|
||||
if (exchange.getResponse().isCommitted())
|
||||
{
|
||||
if (exchange.getResponse().isCommitted()) {
|
||||
return Mono.error(ex);
|
||||
}
|
||||
|
||||
String msg;
|
||||
|
||||
if (ex instanceof NotFoundException)
|
||||
{
|
||||
if (ex instanceof NotFoundException) {
|
||||
msg = "服务未找到";
|
||||
}
|
||||
else if (ex instanceof ResponseStatusException)
|
||||
{
|
||||
} else if (ex instanceof ResponseStatusException) {
|
||||
ResponseStatusException responseStatusException = (ResponseStatusException) ex;
|
||||
msg = responseStatusException.getMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
msg = "内部服务器错误";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@
|
|||
<version>5.8.18</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.annotation.Logical;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresRoles;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -51,6 +54,7 @@ public class TmTaskController extends BaseController {
|
|||
|
||||
/**
|
||||
* 领料审核,分公司,分管,机具分公司统一接口
|
||||
*
|
||||
* @param task 审核信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -60,6 +64,19 @@ public class TmTaskController extends BaseController {
|
|||
return toAjax(tmTaskService.updateLeaseTaskAuditInfo(task));
|
||||
}
|
||||
|
||||
/**
|
||||
* 领料驳回,分公司,分管,机具分公司统一接口
|
||||
*
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "领料驳回", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("rejectLeaseByCompany")
|
||||
public AjaxResult rejectLeaseByCompany(@RequestBody TmTask task) {
|
||||
return toAjax(tmTaskService.updateLeaseTaskRejectInfo(task));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据任务id删除任务表及任务信息
|
||||
*/
|
||||
|
|
@ -162,7 +179,9 @@ public class TmTaskController extends BaseController {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isEmpty(taskId)) { return AjaxResult.error("任务编号为空,创建失败"); }
|
||||
if (StringUtils.isEmpty(taskId)) {
|
||||
return AjaxResult.error("任务编号为空,创建失败");
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("创建任务失败");
|
||||
}
|
||||
|
|
@ -175,6 +194,7 @@ public class TmTaskController extends BaseController {
|
|||
|
||||
/**
|
||||
* 机具分公司直接创建领料申请
|
||||
*
|
||||
* @param task 任务信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -234,7 +254,9 @@ public class TmTaskController extends BaseController {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isEmpty(taskId)) { return AjaxResult.error("任务编号为空,创建失败"); }
|
||||
if (StringUtils.isEmpty(taskId)) {
|
||||
return AjaxResult.error("任务编号为空,创建失败");
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("创建任务失败");
|
||||
}
|
||||
|
|
@ -247,11 +269,13 @@ public class TmTaskController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查询机具领料审核列表 - 后台
|
||||
*
|
||||
* @param task 筛选条件
|
||||
* @return 列表
|
||||
*/
|
||||
@Log(title = "查询机具领料审核列表- 后台", businessType = BusinessType.QUERY)
|
||||
@GetMapping(value = "getLeaseAuditListAll")
|
||||
@RequiresRoles(value = {"admin", "kg", "fgs", "nbry"}, logical = Logical.OR)
|
||||
public AjaxResult getLeaseAuditListAll(TmTask task) {
|
||||
if (StringUtils.isNull(task)) {
|
||||
return AjaxResult.error("参数错误");
|
||||
|
|
@ -263,6 +287,7 @@ public class TmTaskController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查询机具领料审核列表 - app
|
||||
*
|
||||
* @param task 筛选条件
|
||||
* @return 列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,9 +36,15 @@ public interface TmTaskMapper {
|
|||
/** 更新LeaseApplyInfo审批信息 */
|
||||
int updateLeaseApplyInfoAuditInfo(@Param("record") LeaseApplyInfo record);
|
||||
|
||||
/** 更新LeaseApplyInfo驳回信息 */
|
||||
int updateLeaseApplyInfoRejectInfo(@Param("record") LeaseApplyInfo record);
|
||||
|
||||
/** 更新leaseApplyDetails审批信息 */
|
||||
int updateLeaseApplyDetailsAuditInfo(@Param("record") LeaseApplyDetails record);
|
||||
|
||||
/** 更新leaseApplyDetails驳回信息 */
|
||||
int updateLeaseApplyDetailsRejectInfo(@Param("record") LeaseApplyDetails record);
|
||||
|
||||
int deleteTaskByPrimaryKey(String taskId);
|
||||
|
||||
int deleteTaskInfoByTaskId(String taskId);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ public interface TmTaskService{
|
|||
/** 领料任务审核状态修改 */
|
||||
int updateLeaseTaskAuditInfo(TmTask record);
|
||||
|
||||
int updateLeaseTaskRejectInfo(TmTask record);
|
||||
|
||||
String genderLeaseCode();
|
||||
|
||||
AjaxResult deleteByPrimaryKey(String taskId);
|
||||
|
|
|
|||
|
|
@ -105,6 +105,41 @@ public class TmTaskServiceImpl implements TmTaskService{
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 领料任务驳回
|
||||
*
|
||||
* @param record 审核数据及信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateLeaseTaskRejectInfo(TmTask record) {
|
||||
int result = 0;
|
||||
if (StringUtils.isNotNull(record)) {
|
||||
// 先审核任务表
|
||||
result += tmTaskMapper.updateTmTaskAuditStatus(record);
|
||||
// 再审核领料任务信息表
|
||||
if (CollUtil.isNotEmpty(record.getLeaseApplyInfoList())) {
|
||||
for (LeaseApplyInfo leaseApplyInfo : record.getLeaseApplyInfoList()) {
|
||||
if (leaseApplyInfo != null) {
|
||||
//leaseApplyInfo.setExamineStatusId(record.getExamineStatusId());
|
||||
result += tmTaskMapper.updateLeaseApplyInfoRejectInfo(leaseApplyInfo);
|
||||
// 再审核领料任务详情表
|
||||
if (CollUtil.isNotEmpty(leaseApplyInfo.getLeaseApplyDetails())) {
|
||||
for (LeaseApplyDetails leaseApplyDetails : leaseApplyInfo.getLeaseApplyDetails()) {
|
||||
if (StringUtils.isNotNull(leaseApplyDetails)) {
|
||||
result += tmTaskMapper.updateLeaseApplyDetailsRejectInfo(leaseApplyDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String genderLeaseCode() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
|
|
|||
|
|
@ -461,7 +461,11 @@
|
|||
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,d.`name` as taskName,
|
||||
case when d.id = '30' then lai.company_audit_remark
|
||||
when d.id = '31' then lai.dept_audit_remark
|
||||
when d.id = '32' then lai.direct_audit_remark end examineStatus ,
|
||||
when d.id = '32' then lai.direct_audit_remark
|
||||
when d.id = '98' then lai.company_audit_remark
|
||||
when d.id = '99' then lai.dept_audit_remark
|
||||
when d.id = '100' then lai.direct_audit_remark
|
||||
end examineStatus ,
|
||||
d.id as examineStatusId,
|
||||
bai.agreement_code as agreementCode,
|
||||
tt.create_time as createTimes, tt.update_time as updateTimes
|
||||
|
|
@ -608,6 +612,35 @@
|
|||
update_by = #{record.companyAuditBy},
|
||||
update_time = now(),
|
||||
</if>
|
||||
<if test="record.examineStatusId == 35 and record.examineStatusId == '35'">
|
||||
update_by = #{record.companyAuditBy},
|
||||
update_time = now(),
|
||||
</if>
|
||||
</trim>
|
||||
WHERE
|
||||
task_id = #{record.taskId}
|
||||
</update>
|
||||
|
||||
<update id="updateLeaseApplyInfoRejectInfo">
|
||||
UPDATE
|
||||
lease_apply_info
|
||||
set
|
||||
<trim suffixOverrides=",">
|
||||
<if test="record.examineStatusId == 98 and record.examineStatusId == '98'">
|
||||
company_audit_by = #{record.companyAuditBy},
|
||||
company_audit_time = now(),
|
||||
company_audit_remark = #{record.companyAuditRemark},
|
||||
</if>
|
||||
<if test="record.examineStatusId == 99 and record.examineStatusId == '99'">
|
||||
dept_audit_by = #{record.companyAuditBy},
|
||||
dept_audit_time = now(),
|
||||
dept_audit_remark = #{record.companyAuditRemark},
|
||||
</if>
|
||||
<if test="record.examineStatusId == 100 and record.examineStatusId == '100'">
|
||||
direct_audit_by = #{record.companyAuditBy},
|
||||
direct_audit_time = now(),
|
||||
direct_audit_remark = #{record.companyAuditRemark},
|
||||
</if>
|
||||
</trim>
|
||||
WHERE
|
||||
task_id = #{record.taskId}
|
||||
|
|
@ -636,6 +669,29 @@
|
|||
parennt_id = #{record.parenntId}
|
||||
</update>
|
||||
|
||||
<update id="updateLeaseApplyDetailsRejectInfo">
|
||||
update
|
||||
lease_apply_details
|
||||
set
|
||||
<trim suffixOverrides=",">
|
||||
<if test="record.auditNum != null and record.auditNum != '' ">
|
||||
audit_num = #{record.auditNum},
|
||||
</if>
|
||||
<if test="record.alNum != null and record.alNum != '' ">
|
||||
al_num = #{record.alNum},
|
||||
</if>
|
||||
<if test="record.status!= null and record.status!= '' ">
|
||||
status = #{record.status},
|
||||
</if>
|
||||
<if test="record.updateBy != null and record.updateBy != '' ">
|
||||
update_by = #{record.updateBy},
|
||||
</if>
|
||||
update_time = now()
|
||||
</trim>
|
||||
where
|
||||
parennt_id = #{record.parenntId}
|
||||
</update>
|
||||
|
||||
<update id="updateLeaseInfo">
|
||||
UPDATE lease_apply_info SET lease_person = #{leasePerson}, phone = #{phone}, remark = #{remark}
|
||||
WHERE task_id = #{taskId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue