1.工程分包班组下拉框编写
This commit is contained in:
parent
3858f6bb9f
commit
a09efe86d0
|
|
@ -0,0 +1,86 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmOrg;
|
||||
import com.bonus.bmw.domain.vo.MapBeanVo;
|
||||
import com.bonus.bmw.domain.vo.PmOrgVo;
|
||||
import com.bonus.bmw.service.PmOrgService;
|
||||
import com.bonus.bmw.service.SelectService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/8/19
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/select")
|
||||
public class SelectController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private SelectService service;
|
||||
|
||||
/**
|
||||
* 查询工程下拉框
|
||||
*/
|
||||
@PostMapping("/selectPro")
|
||||
@SysLog(title = "工程查询", businessType = OperaType.UPDATE, logType = 0, module = "下拉选公用类->工程")
|
||||
public AjaxResult selectPro(@Validated @RequestBody MapBeanPo po) {
|
||||
try {
|
||||
List<MapBeanVo> list = service.selectPro(po);
|
||||
return new AjaxResult(200,"查询成功",list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询分包下拉框
|
||||
*/
|
||||
@PostMapping("/selectSub")
|
||||
@SysLog(title = "分包查询", businessType = OperaType.UPDATE, logType = 0, module = "下拉选公用类->分包")
|
||||
public AjaxResult selectSub(@Validated @RequestBody MapBeanPo po) {
|
||||
try {
|
||||
List<MapBeanVo> list = service.selectSub(po);
|
||||
return new AjaxResult(200,"查询成功",list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组下拉框
|
||||
*/
|
||||
@PostMapping("/selectTeam")
|
||||
@SysLog(title = "班组查询", businessType = OperaType.UPDATE, logType = 0, module = "下拉选公用类->班组查询")
|
||||
public AjaxResult selectTeam(@Validated @RequestBody MapBeanPo po) {
|
||||
try {
|
||||
List<MapBeanVo> list = service.selectTeam(po);
|
||||
return new AjaxResult(200,"查询成功",list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.bmw.domain.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MapBeanPo {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer subComId;
|
||||
|
||||
private Integer proId;
|
||||
|
||||
private Integer subId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.bonus.bmw.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MapBeanVo {
|
||||
|
||||
private String key;
|
||||
|
||||
private String value;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmOrg;
|
||||
import com.bonus.bmw.domain.vo.MapBeanVo;
|
||||
import com.bonus.bmw.domain.vo.PmOrgVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SelectMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询工程
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
List<MapBeanVo> selectPro(MapBeanPo po);
|
||||
|
||||
/**
|
||||
* 查询分包
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
List<MapBeanVo> selectSub(MapBeanPo po);
|
||||
|
||||
/**
|
||||
* 查询班组
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
List<MapBeanVo> selectTeam(MapBeanPo po);
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmOrg;
|
||||
import com.bonus.bmw.domain.vo.MapBeanVo;
|
||||
import com.bonus.bmw.domain.vo.PmOrgVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SelectService {
|
||||
|
||||
/**
|
||||
* 查询工程下拉框
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
List<MapBeanVo> selectPro(MapBeanPo po);
|
||||
|
||||
/**
|
||||
* 查询分包下拉框
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
List<MapBeanVo> selectSub(MapBeanPo po);
|
||||
|
||||
/**
|
||||
* 班组下拉框
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
List<MapBeanVo> selectTeam(MapBeanPo po);
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmOrg;
|
||||
import com.bonus.bmw.domain.po.PmProject;
|
||||
import com.bonus.bmw.domain.vo.MapBeanVo;
|
||||
import com.bonus.bmw.domain.vo.PmOrgVo;
|
||||
import com.bonus.bmw.domain.vo.PmProjectVo;
|
||||
import com.bonus.bmw.mapper.PmOrgMapper;
|
||||
import com.bonus.bmw.mapper.PmProjectMapper;
|
||||
import com.bonus.bmw.mapper.SelectMapper;
|
||||
import com.bonus.bmw.service.PmOrgService;
|
||||
import com.bonus.bmw.service.SelectService;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/14
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SelectServiceImpl implements SelectService {
|
||||
|
||||
@Resource
|
||||
private SelectMapper mapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<MapBeanVo> selectPro(MapBeanPo po) {
|
||||
return mapper.selectPro(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MapBeanVo> selectSub(MapBeanPo po) {
|
||||
return mapper.selectSub(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MapBeanVo> selectTeam(MapBeanPo po) {
|
||||
return mapper.selectTeam(po);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.bmw.mapper.SelectMapper">
|
||||
|
||||
<select id="selectPro" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
|
||||
select
|
||||
id,
|
||||
pro_name as `name`
|
||||
from pm_project pp
|
||||
<where>
|
||||
pp.is_active = 1
|
||||
<if test="subComId != null">
|
||||
and pp.sub_com_id = #{subComId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSub" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
|
||||
select
|
||||
ps.id,
|
||||
ps.sub_name as `name`
|
||||
from pm_sub ps
|
||||
<if test="proId != null">
|
||||
inner join bm_sub_contract bsc on ps.id = bsc.sub_id and bsc.sub_ein_status = 1 and bsc.is_active = 1
|
||||
</if>
|
||||
<where>
|
||||
ps.is_active = 1
|
||||
<if test="proId != null">
|
||||
and bsc.pro_id = #{proId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTeam" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
|
||||
|
||||
select
|
||||
pst.id,
|
||||
pst.team_name as `name`
|
||||
from pm_sub_team pst
|
||||
<if test="subId != null or proId != null">
|
||||
inner join pm_sub_team_contract pstc on pst.id = pstc.team_id and pstc.team_ein_status = 1 and pstc.is_active = 1
|
||||
</if>
|
||||
<where>
|
||||
pst.is_active = 1
|
||||
<if test="subId != null">
|
||||
and pstc.sub_id = #{subId}
|
||||
</if>
|
||||
<if test="proId != null">
|
||||
and pstc.pro_id = #{proId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue