Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3b03d69e9f
|
|
@ -49,6 +49,8 @@ public class MaterialConstants {
|
||||||
*/
|
*/
|
||||||
public static final Integer TEN_CONSTANT = 10;
|
public static final Integer TEN_CONSTANT = 10;
|
||||||
|
|
||||||
|
public final static String STRING_ADMIN = "admin";
|
||||||
|
|
||||||
/** 协议号的开头字母 */
|
/** 协议号的开头字母 */
|
||||||
public static final String AGREEMENT_PREFIX = "H";
|
public static final String AGREEMENT_PREFIX = "H";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.back.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
@ -16,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.bonus.material.back.domain.BackApplyDetails;
|
import com.bonus.material.back.domain.BackApplyDetails;
|
||||||
import com.bonus.material.back.service.IBackApplyDetailsService;
|
import com.bonus.material.back.service.IBackApplyDetailsService;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,7 +64,7 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
@ApiOperation(value = "获取领料任务详细信息")
|
@ApiOperation(value = "获取领料任务详细信息")
|
||||||
//@RequiresPermissions("lease:info:query")
|
//@RequiresPermissions("lease:info:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
public AjaxResult getInfo(@PathVariable("id") @NotNull(message = "领料任务ID不能为空") Long id) {
|
||||||
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id));
|
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,5 +56,20 @@ public class LeaseApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "数据所属组织")
|
@ApiModelProperty(value = "数据所属组织")
|
||||||
private Long companyId;
|
private Long companyId;
|
||||||
|
|
||||||
|
public LeaseApplyDetails(Long id, Long parentId, Long typeId, Long preNum, Long auditNum, Long alNum, String status, Long companyId) {
|
||||||
|
this.id = id;
|
||||||
|
this.parentId = parentId;
|
||||||
|
this.typeId = typeId;
|
||||||
|
this.preNum = preNum;
|
||||||
|
this.auditNum = auditNum;
|
||||||
|
this.alNum = alNum;
|
||||||
|
this.status = status;
|
||||||
|
this.companyId = companyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LeaseApplyDetails() {}
|
||||||
|
|
||||||
|
public LeaseApplyDetails(Long parentId) {
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.material.lease.domain;
|
package com.bonus.material.lease.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
@ -130,6 +132,10 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "费用承担方(01项目03分包)")
|
@ApiModelProperty(value = "费用承担方(01项目03分包)")
|
||||||
private String costBearingParty;
|
private String costBearingParty;
|
||||||
|
|
||||||
|
/** 机具规格详情列表 */
|
||||||
|
@ApiModelProperty(value = "机具规格详情列表")
|
||||||
|
List<LeaseApplyDetails> leaseApplyDetails;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租赁工程")
|
@ApiModelProperty(value = "租赁工程")
|
||||||
private String leaseProject;
|
private String leaseProject;
|
||||||
|
|
||||||
|
|
@ -139,5 +145,4 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "协议号")
|
@ApiModelProperty(value = "协议号")
|
||||||
private String agreementCode;
|
private String agreementCode;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
package com.bonus.material.lease.domain.vo;
|
package com.bonus.material.lease.domain.vo;
|
||||||
|
|
||||||
import com.bonus.common.core.annotation.Excel;
|
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -20,6 +17,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class LeaseApplyRequestVo extends BaseEntity {
|
public class LeaseApplyRequestVo extends BaseEntity {
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,14 @@ public interface LeaseOutDetailsMapper {
|
||||||
*/
|
*/
|
||||||
public List<LeaseOutDetails> selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails);
|
public List<LeaseOutDetails> selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询领料出库详细列表--by任务id
|
||||||
|
*
|
||||||
|
* @param parentId 任务id
|
||||||
|
* @return 领料出库详细集合
|
||||||
|
*/
|
||||||
|
List<LeaseOutDetails> selectLeaseOutDetailsListByParentId(String parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增领料出库详细
|
* 新增领料出库详细
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public interface ILeaseApplyInfoService {
|
||||||
* @param id 领料任务主键
|
* @param id 领料任务主键
|
||||||
* @return 领料任务
|
* @return 领料任务
|
||||||
*/
|
*/
|
||||||
public LeaseApplyInfo selectLeaseApplyInfoById(Long id);
|
LeaseApplyRequestVo selectLeaseApplyInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务列表
|
* 查询领料任务列表
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.lease.service.impl;
|
package com.bonus.material.lease.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
|
|
@ -9,12 +10,9 @@ import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.basic.domain.BmFileInfo;
|
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
|
||||||
import com.bonus.material.purchase.domain.dto.PurchaseCheckDto;
|
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import com.bonus.material.task.domain.TmTaskAgreement;
|
import com.bonus.material.task.domain.TmTaskAgreement;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
||||||
|
|
@ -50,6 +48,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
@Resource
|
@Resource
|
||||||
TmTaskAgreementMapper tmTaskAgreementMapper;
|
TmTaskAgreementMapper tmTaskAgreementMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务
|
* 查询领料任务
|
||||||
*
|
*
|
||||||
|
|
@ -57,10 +56,29 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
* @return 领料任务
|
* @return 领料任务
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public LeaseApplyInfo selectLeaseApplyInfoById(Long id) {
|
public LeaseApplyRequestVo selectLeaseApplyInfoById(Long id) {
|
||||||
return leaseApplyInfoMapper.selectLeaseApplyInfoById(id);
|
try {
|
||||||
|
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(id));
|
||||||
|
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||||
|
|
||||||
|
optionalInfo.ifPresent(info -> {
|
||||||
|
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||||
|
// 获取领料单详情
|
||||||
|
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(id));
|
||||||
|
if (!CollectionUtils.isEmpty(details)) {
|
||||||
|
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return leaseApplyRequestVo;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 记录异常日志
|
||||||
|
System.err.println("Error occurred while selecting lease apply info by ID: " + id + e.getMessage());
|
||||||
|
throw new RuntimeException("Failed to select lease apply info", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务列表
|
* 查询领料任务列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,11 @@ package com.bonus.material.task.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -116,4 +119,33 @@ public class TmTaskController extends BaseController {
|
||||||
public AjaxResult remove(@PathVariable Long[] taskIds) {
|
public AjaxResult remove(@PathVariable Long[] taskIds) {
|
||||||
return toAjax(tmTaskService.deleteTmTaskByTaskIds(taskIds));
|
return toAjax(tmTaskService.deleteTmTaskByTaskIds(taskIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询机具领料申请列表(个人)
|
||||||
|
*
|
||||||
|
* @param task 筛选条件
|
||||||
|
* @param souceBy app为1 web为0
|
||||||
|
* @return 列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询机具领料申请列表")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@RequiresPermissions("task:task:query")
|
||||||
|
@SysLog(title = "任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->查询机具领料申请列表")
|
||||||
|
@GetMapping(value = "getLeaseAuditListAll")
|
||||||
|
public AjaxResult getLeaseAuditListAll(TmTaskRequestVo task, Integer souceBy) {
|
||||||
|
if (StringUtils.isNull(task)) {
|
||||||
|
return AjaxResult.error("参数错误");
|
||||||
|
}
|
||||||
|
List<TmTaskRequestVo> leaseAuditList;
|
||||||
|
if (souceBy != null && souceBy == 1) {
|
||||||
|
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||||
|
return AjaxResult.success(leaseAuditList);
|
||||||
|
} else {
|
||||||
|
startPage();
|
||||||
|
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||||
|
return AjaxResult.success(getDataTable(leaseAuditList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,6 @@ public class TmTaskRequestVo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
||||||
private Integer monthOrder;
|
private Integer monthOrder;
|
||||||
|
|
||||||
@ApiModelProperty(value = "领料任务汇总")
|
|
||||||
private LeaseApplyInfo leaseApplyInfo;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "领料任务物资列表")
|
|
||||||
private List<LeaseApplyDetails> leaseApplyDetailsList;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "协议id")
|
@ApiModelProperty(value = "协议id")
|
||||||
private Long agreementId;
|
private Long agreementId;
|
||||||
|
|
||||||
|
|
@ -66,7 +60,44 @@ public class TmTaskRequestVo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "往来单位id")
|
@ApiModelProperty(value = "往来单位id")
|
||||||
private Long unitId;
|
private Long unitId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "往来单位")
|
||||||
|
//@Excel(name = "领料单位", sort = 2)
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程id")
|
@ApiModelProperty(value = "工程id")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "工程名称")
|
||||||
|
@Excel(name = "领料工程", sort = 3)
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预领料合计数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预领料合计数")
|
||||||
|
private Integer preCountNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料任务实体集合
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "领料任务实体集合")
|
||||||
|
private List<LeaseApplyInfo> leaseApplyInfoList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领料任务汇总")
|
||||||
|
private LeaseApplyInfo leaseApplyInfo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领料任务物资列表")
|
||||||
|
private List<LeaseApplyDetails> leaseApplyDetailsList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
package com.bonus.material.task.mapper;
|
package com.bonus.material.task.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
|
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -84,4 +88,12 @@ public interface TmTaskMapper {
|
||||||
int updateStatusById(@Param("updatedStatus") Integer updatedStatus, @Param("id") String id);
|
int updateStatusById(@Param("updatedStatus") Integer updatedStatus, @Param("id") String id);
|
||||||
|
|
||||||
int deleteTmTaskByPurchaseIds(Long[] ids);
|
int deleteTmTaskByPurchaseIds(Long[] ids);
|
||||||
|
|
||||||
|
List<TmTaskRequestVo> getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||||
|
|
||||||
|
List<TmTaskRequestVo> getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||||
|
|
||||||
|
List<LeaseApplyInfo> getAuditListByLeaseInfo(@Param("record") TmTaskRequestVo record);
|
||||||
|
|
||||||
|
List<LeaseApplyDetails> getLeaseApplyDetails(@Param("record") LeaseApplyInfo record);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.task.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
|
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务Service接口
|
* 任务Service接口
|
||||||
|
|
@ -57,4 +58,6 @@ public interface ITmTaskService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTmTaskByTaskId(Long taskId);
|
public int deleteTmTaskByTaskId(Long taskId);
|
||||||
|
|
||||||
|
List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTask);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,15 @@
|
||||||
package com.bonus.material.task.service.impl;
|
package com.bonus.material.task.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
|
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
|
|
@ -95,4 +102,53 @@ public class TmTaskServiceImpl implements ITmTaskService {
|
||||||
public int deleteTmTaskByTaskId(Long taskId) {
|
public int deleteTmTaskByTaskId(Long taskId) {
|
||||||
return tmTaskMapper.deleteTmTaskByTaskId(taskId);
|
return tmTaskMapper.deleteTmTaskByTaskId(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单个申请列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTaskRequestVo) {
|
||||||
|
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
|
List<TmTaskRequestVo> tmTaskList;
|
||||||
|
if (roles.contains(MaterialConstants.STRING_ADMIN)) {
|
||||||
|
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(tmTaskRequestVo);
|
||||||
|
} else {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
tmTaskRequestVo.setCreateBy(username);
|
||||||
|
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(tmTaskRequestVo);
|
||||||
|
}
|
||||||
|
for (TmTaskRequestVo tmTask : tmTaskList) {
|
||||||
|
int count = 0;
|
||||||
|
if (tmTask != null) {
|
||||||
|
// 去查询任务分单表
|
||||||
|
List<LeaseApplyInfo> auditListByLeaseInfo = tmTaskMapper.getAuditListByLeaseInfo(tmTask);
|
||||||
|
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||||
|
// 对领料任务集合查询具体详情
|
||||||
|
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
||||||
|
if (leaseApplyInfo != null) {
|
||||||
|
// 去查询领料任务详情表
|
||||||
|
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo);
|
||||||
|
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
|
||||||
|
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
||||||
|
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
|
||||||
|
// 统计预领数量
|
||||||
|
count += leaseApplyDetail.getPreNum();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 塞入领料任务详情的集合中
|
||||||
|
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 存入领料任务实体集合
|
||||||
|
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
|
||||||
|
tmTask.setRemark(auditListByLeaseInfo.get(0).getRemark());
|
||||||
|
}
|
||||||
|
// 塞入预领的合计数量
|
||||||
|
tmTask.setPreCountNum(count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmTaskList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,25 +25,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectLeaseApplyDetailsVo">
|
<sql id="selectLeaseApplyDetailsVo">
|
||||||
select id, parent_id, type_id, pre_num, audit_num, al_num, status, create_by, create_time, update_by, update_time, remark, company_id from lease_apply_details
|
select
|
||||||
|
lad.id, lad.parent_id, lad.type_id, lad.pre_num, lad.audit_num, lad.al_num, lad.status,
|
||||||
|
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id
|
||||||
|
from
|
||||||
|
lease_apply_details lad
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" resultMap="LeaseApplyDetailsResult">
|
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" resultMap="LeaseApplyDetailsResult">
|
||||||
<include refid="selectLeaseApplyDetailsVo"/>
|
<include refid="selectLeaseApplyDetailsVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
<if test="parentId != null "> and lad.parent_id = #{parentId}</if>
|
||||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
<if test="typeId != null "> and lad.type_id = #{typeId}</if>
|
||||||
<if test="preNum != null "> and pre_num = #{preNum}</if>
|
<if test="preNum != null "> and lad.pre_num = #{preNum}</if>
|
||||||
<if test="auditNum != null "> and audit_num = #{auditNum}</if>
|
<if test="auditNum != null "> and lad.audit_num = #{auditNum}</if>
|
||||||
<if test="alNum != null "> and al_num = #{alNum}</if>
|
<if test="alNum != null "> and lad.al_num = #{alNum}</if>
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="status != null and status != ''"> and lad.status = #{status}</if>
|
||||||
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="companyId != null "> and lad.company_id = #{companyId}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectLeaseApplyDetailsById" parameterType="Long" resultMap="LeaseApplyDetailsResult">
|
<select id="selectLeaseApplyDetailsById" parameterType="Long" resultMap="LeaseApplyDetailsResult">
|
||||||
<include refid="selectLeaseApplyDetailsVo"/>
|
<include refid="selectLeaseApplyDetailsVo"/>
|
||||||
where id = #{id}
|
where lad.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertLeaseApplyDetails" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertLeaseApplyDetails" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
|
||||||
|
|
@ -21,26 +21,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectLeaseOutDetailsVo">
|
<sql id="selectLeaseOutDetailsVo">
|
||||||
select id, parent_id, type_id, ma_id, out_num, out_type, create_by, create_time, update_by, update_time, remark, company_id, car_code, push_notifications from lease_out_details
|
select
|
||||||
|
lod.id, lod.parent_id, lod.type_id, lod.ma_id, lod.out_num, lod.out_type, lod.create_by, lod.create_time,
|
||||||
|
lod.update_by, lod.update_time, lod.remark, lod.company_id, lod.car_code, lod.push_notifications
|
||||||
|
from
|
||||||
|
lease_out_details lod
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectLeaseOutDetailsList" parameterType="com.bonus.material.lease.domain.LeaseOutDetails" resultMap="LeaseOutDetailsResult">
|
<select id="selectLeaseOutDetailsList" parameterType="com.bonus.material.lease.domain.LeaseOutDetails" resultMap="LeaseOutDetailsResult">
|
||||||
<include refid="selectLeaseOutDetailsVo"/>
|
<include refid="selectLeaseOutDetailsVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
<if test="parentId != null "> and lod.parent_id = #{parentId}</if>
|
||||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
<if test="typeId != null "> and lod.type_id = #{typeId}</if>
|
||||||
<if test="maId != null "> and ma_id = #{maId}</if>
|
<if test="maId != null "> and lod.ma_id = #{maId}</if>
|
||||||
<if test="outNum != null "> and out_num = #{outNum}</if>
|
<if test="outNum != null "> and lod.out_num = #{outNum}</if>
|
||||||
<if test="outType != null and outType != ''"> and out_type = #{outType}</if>
|
<if test="outType != null and outType != ''"> and lod.out_type = #{outType}</if>
|
||||||
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="companyId != null "> and lod.company_id = #{companyId}</if>
|
||||||
<if test="carCode != null and carCode != ''"> and car_code = #{carCode}</if>
|
<if test="carCode != null and carCode != ''"> and lod.car_code = #{carCode}</if>
|
||||||
<if test="pushNotifications != null "> and push_notifications = #{pushNotifications}</if>
|
<if test="pushNotifications != null "> and lod.push_notifications = #{pushNotifications}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectLeaseOutDetailsById" parameterType="Long" resultMap="LeaseOutDetailsResult">
|
<select id="selectLeaseOutDetailsById" parameterType="Long" resultMap="LeaseOutDetailsResult">
|
||||||
<include refid="selectLeaseOutDetailsVo"/>
|
<include refid="selectLeaseOutDetailsVo"/>
|
||||||
where id = #{id}
|
where lod.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectLeaseOutDetailsListByParentId" parameterType="com.bonus.material.lease.domain.LeaseOutDetails" resultMap="LeaseOutDetailsResult">
|
||||||
|
<include refid="selectLeaseOutDetailsVo"/>
|
||||||
|
<where>
|
||||||
|
lod.parent_id = #{parentId}
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertLeaseOutDetails" parameterType="com.bonus.material.lease.domain.LeaseOutDetails" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertLeaseOutDetails" parameterType="com.bonus.material.lease.domain.LeaseOutDetails" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
|
||||||
|
|
@ -128,4 +128,133 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="getAuditListByLeaseTmTask" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">
|
||||||
|
SELECT DISTINCT
|
||||||
|
tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
||||||
|
bpl.pro_id as proId,bpl.pro_name as projectName,
|
||||||
|
bui.unit_id as unitId,bui.unit_name as unitName,
|
||||||
|
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,d.`name` as taskName,lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,
|
||||||
|
case when d.id = '31' then lai.company_audit_remark
|
||||||
|
when d.id = '32' then lai.dept_audit_remark
|
||||||
|
when d.id = '33' 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
|
||||||
|
FROM
|
||||||
|
tm_task tt
|
||||||
|
LEFT JOIN sys_user su ON tt.create_by = su.user_name
|
||||||
|
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||||
|
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
||||||
|
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
|
||||||
|
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
|
||||||
|
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||||
|
LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id
|
||||||
|
LEFT JOIN sys_dic d ON d.id = tt.task_status
|
||||||
|
WHERE
|
||||||
|
tt.task_type = '29' and tt.status = '1'
|
||||||
|
<if test="record.taskId != null and record.taskId != '' ">
|
||||||
|
AND tt.task_id = #{record.taskId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">
|
||||||
|
AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.unitId != null and record.unitId != ''">
|
||||||
|
AND bui.unit_id = #{record.unitId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.projectId != null and record.projectId != ''">
|
||||||
|
AND bpl.pro_id = #{record.projectId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.keyWord != null and record.keyWord != ''">
|
||||||
|
AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or
|
||||||
|
tt.code like concat('%', #{record.keyWord}, '%'))
|
||||||
|
</if>
|
||||||
|
GROUP BY tt.task_id
|
||||||
|
ORDER BY tt.update_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAuditListByLeaseTmTaskByPeople" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">
|
||||||
|
SELECT DISTINCT
|
||||||
|
tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
||||||
|
bpl.pro_id as proId,bpl.pro_name as projectName,
|
||||||
|
bui.unit_id as unitId,bui.unit_name as unitName,
|
||||||
|
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,d.`name` as taskName,lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,
|
||||||
|
case when d.id = '31' then lai.company_audit_remark
|
||||||
|
when d.id = '32' then lai.dept_audit_remark
|
||||||
|
when d.id = '33' 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
|
||||||
|
FROM
|
||||||
|
tm_task tt
|
||||||
|
LEFT JOIN sys_user su ON tt.create_by = su.user_name
|
||||||
|
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||||
|
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
||||||
|
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
|
||||||
|
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
|
||||||
|
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||||
|
LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id
|
||||||
|
LEFT JOIN sys_dic d ON d.id = tt.task_status
|
||||||
|
WHERE
|
||||||
|
tt.task_type = '29' and tt.status = '1' and tt.create_by = #{record.createBy}
|
||||||
|
<if test="record.taskId != null and record.taskId != '' ">
|
||||||
|
AND tt.task_id = #{record.taskId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">
|
||||||
|
AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.unitId != null and record.unitId != ''">
|
||||||
|
AND bui.unit_id = #{record.unitId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.projectId != null and record.projectId != ''">
|
||||||
|
AND bpl.pro_id = #{record.projectId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="record.keyWord != null and record.keyWord != ''">
|
||||||
|
AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or
|
||||||
|
tt.code like concat('%', #{record.keyWord}, '%'))
|
||||||
|
</if>
|
||||||
|
GROUP BY tt.task_id
|
||||||
|
ORDER BY tt.update_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAuditListByLeaseInfo" resultType="com.bonus.material.lease.domain.LeaseApplyInfo">
|
||||||
|
SELECT
|
||||||
|
lai.*
|
||||||
|
FROM
|
||||||
|
lease_apply_info lai
|
||||||
|
WHERE
|
||||||
|
lai.task_id = #{record.taskId} AND lai.`code` = #{record.code}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getLeaseApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
|
SELECT
|
||||||
|
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
|
||||||
|
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
|
||||||
|
mt.num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode
|
||||||
|
FROM
|
||||||
|
lease_apply_details lad
|
||||||
|
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||||
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
|
LEFT JOIN ma_machine mm ON lad.type_id = mm.type_id
|
||||||
|
WHERE
|
||||||
|
lad.parent_id = #{record.id} AND lad.company_id = #{record.companyId}
|
||||||
|
GROUP BY
|
||||||
|
lad.id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue