问题修改
This commit is contained in:
parent
e656419492
commit
cf4ea24379
|
|
@ -14,9 +14,7 @@ import com.bonus.common.core.exception.ServiceException;
|
|||
import com.bonus.common.core.utils.ServletUtils;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.archives.service.ArchivesService;
|
||||
import com.bonus.material.back.domain.BackApplyDetails;
|
||||
import com.bonus.material.back.domain.HandlingOrder;
|
||||
import com.bonus.material.back.domain.MaCode;
|
||||
import com.bonus.material.back.domain.*;
|
||||
import com.bonus.material.back.domain.vo.*;
|
||||
import com.bonus.material.basic.domain.BmUnit;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
|
|
@ -28,7 +26,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.back.service.IBackApplyInfoService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -535,4 +532,39 @@ public class BackApplyInfoController extends BaseController {
|
|||
|
||||
|
||||
/** -------装卸单结束------- */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** -------出门证开始------- */
|
||||
|
||||
/**
|
||||
* 出门证列表展示
|
||||
*/
|
||||
@ApiOperation(value = "出门证列表展示")
|
||||
@GetMapping("/getExitPermitList")
|
||||
public AjaxResult getExitPermitList(ExitPermit bean) {
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
try {
|
||||
List<ExitPermit> list = backApplyInfoService.getExitPermitList(bean);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出门证
|
||||
*/
|
||||
@ApiOperation(value = "新增出门证")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "新增出门证", businessType = OperaType.INSERT, logType = 1, module = "业务办理->新增出门证")
|
||||
@PostMapping("/addExitPermit")
|
||||
public AjaxResult addExitPermit(@RequestBody ExitPermit bean) {
|
||||
return backApplyInfoService.addExitPermit(bean);
|
||||
}
|
||||
|
||||
/** -------出门证结束------- */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
package com.bonus.material.back.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 出门证
|
||||
* @author 16043
|
||||
*/
|
||||
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
@ToString
|
||||
public class ExitPermit implements Serializable {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "登录用户id")
|
||||
private Long userId;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
|
||||
@ApiModelProperty(value="姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "车牌号")
|
||||
private String carCode;
|
||||
|
||||
@ApiModelProperty(value = "物资")
|
||||
private String material;
|
||||
|
||||
@ApiModelProperty(value = "日期")
|
||||
private String addDate;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
|
@ -5,10 +5,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.back.domain.BackApplyDetails;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.back.domain.HandlingOrder;
|
||||
import com.bonus.material.back.domain.MaCodeDto;
|
||||
import com.bonus.material.back.domain.*;
|
||||
import com.bonus.material.back.domain.vo.BackApplyInfoVo;
|
||||
import com.bonus.material.back.domain.vo.BackApplyVo;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
|
|
@ -476,6 +473,20 @@ public interface BackApplyInfoMapper {
|
|||
*/
|
||||
List<SltAgreementInfo> getTbList(BackApplyInfo bean);
|
||||
|
||||
/**
|
||||
* 获取出门证
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<ExitPermit> getExitPermitList(ExitPermit bean);
|
||||
|
||||
/**
|
||||
* 新增出门证
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int addExitPermit(ExitPermit bean);
|
||||
|
||||
/**
|
||||
* 查看机具在用数据
|
||||
* @param applyInfo
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@ package com.bonus.material.back.service;
|
|||
import java.util.List;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.back.domain.BackApplyDetails;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.back.domain.HandlingOrder;
|
||||
import com.bonus.material.back.domain.MaCode;
|
||||
import com.bonus.material.back.domain.*;
|
||||
import com.bonus.material.back.domain.vo.*;
|
||||
|
||||
/**
|
||||
|
|
@ -218,6 +215,20 @@ public interface IBackApplyInfoService {
|
|||
*/
|
||||
AjaxResult getSort(HandlingOrder bean);
|
||||
|
||||
/**
|
||||
* 获取出门证列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<ExitPermit> getExitPermitList(ExitPermit bean);
|
||||
|
||||
/**
|
||||
* 新增出门证
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
AjaxResult addExitPermit(ExitPermit bean);
|
||||
|
||||
/**
|
||||
* 班组退料提交
|
||||
* @param backApplyInfo
|
||||
|
|
|
|||
|
|
@ -2334,6 +2334,33 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExitPermit> getExitPermitList(ExitPermit bean) {
|
||||
try {
|
||||
return backApplyInfoMapper.getExitPermitList(bean);
|
||||
} catch (Exception e) {
|
||||
log.error("获取退料任务列表失败", e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult addExitPermit(ExitPermit bean) {
|
||||
try {
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
bean.setCreateBy(userId.toString());
|
||||
int re = backApplyInfoMapper.addExitPermit(bean);
|
||||
if (re > 0) {
|
||||
return AjaxResult.success("添加成功");
|
||||
} else {
|
||||
return AjaxResult.error("添加失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("添加出门证失败", e);
|
||||
return AjaxResult.error("添加出门证失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ public class PartTypeController extends BaseController
|
|||
maTypeVos.addAll(partTypeService.getListByParentId(parentId.longValue(), partType));
|
||||
}
|
||||
if (BooleanUtils.isTrue(partType.getDisplayBindRelationship())) {
|
||||
List<PartType> finalMaTypeVos = partTypeService.getMyTypeAndBindUsers(maTypeVos);
|
||||
Long userId = partType.getUserId();
|
||||
List<PartType> finalMaTypeVos = partTypeService.getMyTypeAndBindUsers(maTypeVos,userId);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, finalMaTypeVos));
|
||||
} else {
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, maTypeVos));
|
||||
|
|
|
|||
|
|
@ -129,4 +129,6 @@ public class PartType extends BaseEntity
|
|||
private String thirdLevel;
|
||||
|
||||
private Integer flag;
|
||||
|
||||
private Long typeId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public interface PartTypeMapper
|
|||
* @param partType
|
||||
* @return
|
||||
*/
|
||||
PartType getUserName(PartType partType);
|
||||
List<PartType> getUserName(PartType partType);
|
||||
|
||||
/**
|
||||
* 根据配件配置管理,以及领用配件数量,查询配件列表
|
||||
|
|
|
|||
|
|
@ -89,9 +89,10 @@ public interface IPartTypeService
|
|||
/**
|
||||
* 获取当前配件库管员
|
||||
* @param maTypeVos
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<PartType> getMyTypeAndBindUsers(List<PartType> maTypeVos);
|
||||
List<PartType> getMyTypeAndBindUsers(List<PartType> maTypeVos,Long userId);
|
||||
|
||||
/**
|
||||
* 根据配件配置管理,以及领用配件数量,查询配件列表
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.bonus.common.biz.enums.HttpCodeEnum;
|
|||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.ma.domain.TypeKeeper;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -277,14 +278,26 @@ public class PartTypeServiceImpl implements IPartTypeService
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PartType> getMyTypeAndBindUsers(List<PartType> maTypeVos) {
|
||||
public List<PartType> getMyTypeAndBindUsers(List<PartType> maTypeVos, Long userId) {
|
||||
List<PartType> typeList = partTypeMapper.getUserName(new PartType());
|
||||
if (!CollectionUtils.isEmpty(maTypeVos)) {
|
||||
for (PartType partType : maTypeVos) {
|
||||
// 根据id查询绑定库管员
|
||||
PartType type = partTypeMapper.getUserName(partType);
|
||||
if (type != null) {
|
||||
partType.setKeepUserName(type.getKeepUserName());
|
||||
partType.setUserId(type.getUserId());
|
||||
if (CollectionUtils.isNotEmpty(typeList)) {
|
||||
for (PartType partType1 : typeList) {
|
||||
if (Objects.nonNull(partType1.getTypeId()) && partType1.getTypeId().equals(partType.getId())) {
|
||||
if(userId !=null){
|
||||
Long keeperId = partType1.getUserId();
|
||||
if (keeperId.equals(userId)){
|
||||
partType.setUserId(partType1.getUserId());
|
||||
partType.setKeepUserName(partType1.getKeepUserName());
|
||||
}
|
||||
}else{
|
||||
partType.setUserId(partType1.getUserId());
|
||||
partType.setKeepUserName(partType1.getKeepUserName());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -777,6 +777,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{createBy}, now())
|
||||
</insert>
|
||||
|
||||
<insert id="addExitPermit">
|
||||
insert into bm_exit_permit (material,name,car_code,add_date,create_by,create_time)
|
||||
values (#{material}, #{name}, #{carCode}, #{addDate}, #{createBy}, now())
|
||||
</insert>
|
||||
|
||||
<delete id="deleteBackApply">
|
||||
delete from back_apply_info where id = #{id}
|
||||
</delete>
|
||||
|
|
@ -1460,6 +1465,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
order by start_time asc
|
||||
</select>
|
||||
<select id="getExitPermitList" resultType="com.bonus.material.back.domain.ExitPermit">
|
||||
SELECT
|
||||
id,
|
||||
`name`,
|
||||
material,
|
||||
car_code as carCode,
|
||||
add_date as addDate
|
||||
FROM
|
||||
bm_exit_permit
|
||||
WHERE
|
||||
is_active='1'
|
||||
</select>
|
||||
|
||||
<select id="getUserList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -273,12 +273,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getUserName" resultType="com.bonus.material.ma.domain.PartType">
|
||||
SELECT
|
||||
mp.user_id AS userId,
|
||||
mp.type_id AS typeId,
|
||||
su.nick_name AS keepUserName
|
||||
FROM
|
||||
ma_part_type_keeper mp
|
||||
LEFT JOIN sys_user su ON mp.user_id = su.user_id
|
||||
WHERE
|
||||
mp.type_id = #{id}
|
||||
<where>
|
||||
<if test="userId != null "> and mp.user_id = #{userId}</if>
|
||||
<if test="typeId != null "> and mp.type_id = #{typeId}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectPartTypeListNew" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||
SELECT
|
||||
|
|
|
|||
Loading…
Reference in New Issue