fix
This commit is contained in:
parent
c58b78a130
commit
5c1bf635a8
|
|
@ -5,6 +5,8 @@ import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据字典对象 sys_dic
|
||||
*
|
||||
|
|
@ -66,6 +68,17 @@ public class SysDic extends BaseEntity {
|
|||
*/
|
||||
private String creator;
|
||||
|
||||
/** 导出选中列表 */
|
||||
private List<Long> dataCondition;
|
||||
|
||||
public List<Long> getDataCondition() {
|
||||
return dataCondition;
|
||||
}
|
||||
|
||||
public void setDataCondition(List<Long> dataCondition) {
|
||||
this.dataCondition = dataCondition;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.sgzb.system.api.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.annotation.Excel.ColumnType;
|
||||
|
|
@ -52,6 +54,17 @@ public class SysLogininfor extends BaseEntity
|
|||
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date accessTime;
|
||||
|
||||
/** 导出选中列表 */
|
||||
private List<Long> dataCondition;
|
||||
|
||||
public List<Long> getDataCondition() {
|
||||
return dataCondition;
|
||||
}
|
||||
|
||||
public void setDataCondition(List<Long> dataCondition) {
|
||||
this.dataCondition = dataCondition;
|
||||
}
|
||||
|
||||
public Long getInfoId()
|
||||
{
|
||||
return infoId;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.sgzb.system.api.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.annotation.Excel.ColumnType;
|
||||
|
|
@ -46,6 +48,17 @@ public class SysOperLog extends BaseEntity
|
|||
@Excel(name = "操作人员")
|
||||
private String operName;
|
||||
|
||||
/** 导出选中列表 */
|
||||
private List<Long> dataCondition;
|
||||
|
||||
public List<Long> getDataCondition() {
|
||||
return dataCondition;
|
||||
}
|
||||
|
||||
public void setDataCondition(List<Long> dataCondition) {
|
||||
this.dataCondition = dataCondition;
|
||||
}
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户昵称")
|
||||
private String nickName;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.system.api.domain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
|
@ -55,6 +56,17 @@ public class SysRole extends BaseEntity
|
|||
/** 用户是否存在此角色标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
/** 导出选中列表 */
|
||||
private List<Long> dataCondition;
|
||||
|
||||
public List<Long> getDataCondition() {
|
||||
return dataCondition;
|
||||
}
|
||||
|
||||
public void setDataCondition(List<Long> dataCondition) {
|
||||
this.dataCondition = dataCondition;
|
||||
}
|
||||
|
||||
/** 菜单组 */
|
||||
private Long[] menuIds;
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,17 @@ public class SysUser extends BaseEntity
|
|||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
/** 导出选中列表 */
|
||||
private List<Long> dataCondition;
|
||||
|
||||
public List<Long> getDataCondition() {
|
||||
return dataCondition;
|
||||
}
|
||||
|
||||
public void setDataCondition(List<Long> dataCondition) {
|
||||
this.dataCondition = dataCondition;
|
||||
}
|
||||
|
||||
/** 所属组织id */
|
||||
private Long companyId;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
|||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -21,6 +22,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 基础管理 往来单位
|
||||
|
|
@ -103,7 +106,7 @@ public class BmUnitInfoController extends BaseController{
|
|||
@PostMapping
|
||||
public AjaxResult unitInfoAdd(@Validated @RequestBody BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
return toAjax(bmUnitInfoService.unitInfoAdd(bmUnitInfo));
|
||||
return bmUnitInfoService.unitInfoAdd(bmUnitInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -139,7 +142,7 @@ public class BmUnitInfoController extends BaseController{
|
|||
public AjaxResult edit(@Validated @RequestBody BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
|
||||
return toAjax(bmUnitInfoService.updateBmUnitInfo(bmUnitInfo));
|
||||
return bmUnitInfoService.updateBmUnitInfo(bmUnitInfo);
|
||||
}
|
||||
@ApiOperation(value = "往来单位导出")
|
||||
@Log(title = "往来单位导出", businessType = BusinessType.EXPORT)
|
||||
|
|
@ -147,7 +150,13 @@ public class BmUnitInfoController extends BaseController{
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
List<BmUnitInfo> list = bmUnitInfoService.getUnitInfoAll(bmUnitInfo);
|
||||
List<BmUnitInfo> list;
|
||||
list = bmUnitInfoService.getUnitInfoAll(bmUnitInfo);
|
||||
//根据前端列表选中选择性列表导出
|
||||
if (CollectionUtils.isNotEmpty(bmUnitInfo.getDataCondition())) {
|
||||
list = list.stream().filter(Objects::nonNull).
|
||||
filter(u -> bmUnitInfo.getDataCondition().contains(u.getUnitId())).collect(Collectors.toList());
|
||||
}
|
||||
ExcelUtil<BmUnitInfo> util = new ExcelUtil<BmUnitInfo>(BmUnitInfo.class);
|
||||
util.exportExcel(response, list, "往来单位");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDic;
|
||||
import com.bonus.sgzb.base.service.ISysDicService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -78,7 +81,13 @@ public class SysDicController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDic sysDic)
|
||||
{
|
||||
List<SysDic> list = sysDicService.selectSysDicList(sysDic);
|
||||
List<SysDic> list;
|
||||
list = sysDicService.selectSysDicList(sysDic);
|
||||
//根据前端列表选中选择性列表导出
|
||||
if (CollectionUtils.isNotEmpty(sysDic.getDataCondition())) {
|
||||
list = list.stream().filter(Objects::nonNull).
|
||||
filter(u -> sysDic.getDataCondition().contains(u.getId())).collect(Collectors.toList());
|
||||
}
|
||||
ExcelUtil<SysDic> util = new ExcelUtil<SysDic>(SysDic.class);
|
||||
util.exportExcel(response, list, "数据字典数据");
|
||||
}
|
||||
|
|
@ -101,7 +110,7 @@ public class SysDicController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysDic sysDic)
|
||||
{
|
||||
return toAjax(sysDicService.insertSysDic(sysDic));
|
||||
return sysDicService.insertSysDic(sysDic);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -112,7 +121,7 @@ public class SysDicController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysDic sysDic)
|
||||
{
|
||||
return toAjax(sysDicService.updateSysDic(sysDic));
|
||||
return sysDicService.updateSysDic(sysDic);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BmUnitInfo {
|
||||
|
|
@ -69,6 +70,17 @@ public class BmUnitInfo {
|
|||
@ApiModelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 导出选中列表 */
|
||||
private List<Long> dataCondition;
|
||||
|
||||
public List<Long> getDataCondition() {
|
||||
return dataCondition;
|
||||
}
|
||||
|
||||
public void setDataCondition(List<Long> dataCondition) {
|
||||
this.dataCondition = dataCondition;
|
||||
}
|
||||
|
||||
public long getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ public class MaHouseSet {
|
|||
* 主键Id
|
||||
*/
|
||||
@ApiModelProperty(value="主键Id")
|
||||
private long id; /**
|
||||
private long id;
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
@ApiModelProperty(value="仓库ID")
|
||||
|
|
|
|||
|
|
@ -25,4 +25,6 @@ public interface BmUnitInfoMapper {
|
|||
public int updateBmUnitInfo(BmUnitInfo bmUnitInfo);
|
||||
|
||||
public int deleteUnitInfoById(Long unitId);
|
||||
|
||||
Integer selectByName(String unitName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,4 +76,11 @@ public interface SysDicMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDicByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据名称校验唯一性
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
Integer selectByName(String name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.base.service;
|
|||
|
||||
import com.bonus.sgzb.base.domain.BmUnitInfo;
|
||||
import com.bonus.sgzb.base.domain.BmUnitType;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -28,11 +29,11 @@ public interface BmUnitInfoService {
|
|||
|
||||
public List<BmUnitInfo> getUnitInfo(BmUnitInfo bmUnitInfo);
|
||||
|
||||
public int unitInfoAdd(BmUnitInfo bmUnitInfo);
|
||||
AjaxResult unitInfoAdd(BmUnitInfo bmUnitInfo);
|
||||
|
||||
public void remove(Long[] unitIds);
|
||||
|
||||
public int updateBmUnitInfo(BmUnitInfo bmUnitInfo);
|
||||
AjaxResult updateBmUnitInfo(BmUnitInfo bmUnitInfo);
|
||||
|
||||
public int deleteUnitInfoById(Long unitId);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.base.service;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDic;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ public interface ISysDicService
|
|||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDic(SysDic sysDic);
|
||||
AjaxResult insertSysDic(SysDic sysDic);
|
||||
|
||||
/**
|
||||
* 修改数据字典
|
||||
|
|
@ -56,7 +57,7 @@ public interface ISysDicService
|
|||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDic(SysDic sysDic);
|
||||
AjaxResult updateSysDic(SysDic sysDic);
|
||||
/**
|
||||
* 修改数据字典
|
||||
* @param sysDic 数据字典状态
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.bonus.sgzb.base.mapper.BmUnitPersonMapper;
|
|||
import com.bonus.sgzb.base.service.BmUnitInfoService;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -44,8 +45,12 @@ public class BmUnitInfoServiceImpl implements BmUnitInfoService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int unitInfoAdd(BmUnitInfo bmUnitInfo) {
|
||||
return bmUnitInfoMapper.unitInfoAdd(bmUnitInfo);
|
||||
public AjaxResult unitInfoAdd(BmUnitInfo bmUnitInfo) {
|
||||
Integer count = bmUnitInfoMapper.selectByName(bmUnitInfo.getUnitName());
|
||||
if (count != 0) {
|
||||
return AjaxResult.error("新增往来单位名称重复,请重新提交!!!");
|
||||
}
|
||||
return AjaxResult.success(bmUnitInfoMapper.unitInfoAdd(bmUnitInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -54,8 +59,12 @@ public class BmUnitInfoServiceImpl implements BmUnitInfoService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int updateBmUnitInfo(BmUnitInfo bmUnitInfo) {
|
||||
return bmUnitInfoMapper.updateBmUnitInfo(bmUnitInfo);
|
||||
public AjaxResult updateBmUnitInfo(BmUnitInfo bmUnitInfo) {
|
||||
Integer count = bmUnitInfoMapper.selectByName(bmUnitInfo.getUnitName());
|
||||
if (count != 0) {
|
||||
return AjaxResult.error("往来单位名称已经存在,请重新修改提交!!!");
|
||||
}
|
||||
return AjaxResult.success(bmUnitInfoMapper.updateBmUnitInfo(bmUnitInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.sgzb.base.domain.BmUnitType;
|
|||
import com.bonus.sgzb.base.mapper.SysDicMapper;
|
||||
import com.bonus.sgzb.base.service.ISysDicService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -75,10 +76,14 @@ public class SysDicServiceImpl implements ISysDicService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysDic(SysDic sysDic)
|
||||
public AjaxResult insertSysDic(SysDic sysDic)
|
||||
{
|
||||
sysDic.setCreateTime(DateUtils.getNowDate());
|
||||
return sysDicMapper.insertSysDic(sysDic);
|
||||
Integer count = sysDicMapper.selectByName(sysDic.getName());
|
||||
if (count != 0) {
|
||||
return AjaxResult.error("新增单位类型名称重复,请重新提交!!!");
|
||||
}
|
||||
return AjaxResult.success(sysDicMapper.insertSysDic(sysDic));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -88,9 +93,13 @@ public class SysDicServiceImpl implements ISysDicService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysDic(SysDic sysDic)
|
||||
public AjaxResult updateSysDic(SysDic sysDic)
|
||||
{
|
||||
return sysDicMapper.updateSysDic(sysDic);
|
||||
Integer count = sysDicMapper.selectByName(sysDic.getName());
|
||||
if (count != 0) {
|
||||
return AjaxResult.error("单位类型名称已经存在,请重新修改提交!!!");
|
||||
}
|
||||
return AjaxResult.success(sysDicMapper.updateSysDic(sysDic));
|
||||
}
|
||||
/**
|
||||
* 修改单位状态bm_unit_type(同数据字典合并)
|
||||
|
|
|
|||
|
|
@ -170,9 +170,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND type_name = #{typeName}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByName" resultType="java.lang.Integer">
|
||||
select count(*) from bm_unit_info
|
||||
where
|
||||
<if test="unitName != null and unitName != '' ">and unit_name = #{unitName}</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="unitInfoAdd" parameterType="com.bonus.sgzb.base.domain.BmUnitInfo">
|
||||
insert into bm_unit_info (
|
||||
<if test="unitName != null and unitName != '' ">unit_name,</if>
|
||||
|
|
|
|||
|
|
@ -63,6 +63,11 @@
|
|||
<include refid="selectSysDicVo"/>
|
||||
where id = '0'
|
||||
</select>
|
||||
<select id="selectByName" resultType="java.lang.Integer">
|
||||
select count(*) from sys_dic
|
||||
where
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
</select>
|
||||
<insert id="insertSysDic" parameterType="com.bonus.sgzb.base.api.domain.SysDic">
|
||||
insert into sys_dic
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import lombok.Getter;
|
|||
@AllArgsConstructor
|
||||
public enum ExceptionEnum {
|
||||
|
||||
SAVE_TO_DATABASE(500, "盘点入库新增保存失败,请联系管理员!!!");
|
||||
SAVE_TO_DATABASE(500, "新增保存失败,请联系管理员!!!");
|
||||
|
||||
private Integer code;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
package com.bonus.sgzb.material.controller;
|
||||
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.service.PlanManagementService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划管理控制层
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/9 9:30
|
||||
*/
|
||||
@Api(tags = " 计划管理")
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/planManagement")
|
||||
public class PlanManagementController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private PlanManagementService planManagementService;
|
||||
|
||||
/**
|
||||
* 获取计划管理列表
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取计划管理列表")
|
||||
@GetMapping("/getList")
|
||||
public TableDataInfo getList(@RequestParam(value = "name", required = false) String name) {
|
||||
startPage();
|
||||
List<PlanManagementVO> list = planManagementService.getList(name);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("计划管理导出")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, @RequestParam(value = "name", required = false) String name)
|
||||
{
|
||||
List<PlanManagementVO> list = planManagementService.getList(name);
|
||||
ExcelUtil<PlanManagementVO> util = new ExcelUtil<>(PlanManagementVO.class);
|
||||
util.exportExcel(response, list, "计划管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者修改计划管理
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("新增或者修改计划管理")
|
||||
@PostMapping("/addOrUpdate")
|
||||
public AjaxResult addOrUpdate(@ApiParam(value = "添加信息", required = true)
|
||||
@RequestBody PlanManagementDto dto){
|
||||
if (dto.getPlanId() != null) {
|
||||
log.info("更新计划管理:{}", dto);
|
||||
dto.setUpdateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
return AjaxResult.success(planManagementService.update(dto));
|
||||
}
|
||||
log.info("新增计划管理:{}", dto);
|
||||
dto.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
return planManagementService.insert(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划管理
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据id删除计划管理")
|
||||
@DeleteMapping("/deleteById/{planId}")
|
||||
public AjaxResult addOrUpdate(@PathVariable(name = "计划ID",value = "planId") Long planId){
|
||||
return AjaxResult.success(planManagementService.deleteById(planId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 计划管理表单集合dto
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/9 13:40
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CheckDetailsInfo {
|
||||
|
||||
/** 计划ID */
|
||||
@ApiModelProperty(value = "计划ID")
|
||||
private Integer planId;
|
||||
|
||||
/** 类型id */
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private String typeId;
|
||||
|
||||
/** 基层单位id */
|
||||
@ApiModelProperty(value = "基层单位id")
|
||||
private String unitId;
|
||||
|
||||
/** 基层单位名称 */
|
||||
@ApiModelProperty(value = "基层单位名称")
|
||||
private String unitName;
|
||||
|
||||
/** 计划单价 */
|
||||
@ApiModelProperty(value = "计划单价")
|
||||
private Double purchasePrice;
|
||||
|
||||
/** 计划数量 */
|
||||
@ApiModelProperty(value = "计划数量")
|
||||
private Double purchaseNum;
|
||||
|
||||
/** 计划总价 */
|
||||
@ApiModelProperty(value = "计划总价")
|
||||
private Double totalPrice;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 创建者 */
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 更新者 */
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Integer companyId;
|
||||
|
||||
/** 物资名称 */
|
||||
@ApiModelProperty(value = "物资名称")
|
||||
private String typeName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划管理入参dto
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/9 10:49
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PlanManagementDto {
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Integer id;
|
||||
|
||||
/** 计划ID */
|
||||
@ApiModelProperty(value = "计划ID")
|
||||
private Integer planId;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 创建者 */
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 更新者 */
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/** 计划管理表单集合 */
|
||||
private List<CheckDetailsInfo> checkDetailsList;
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 计划管理返回VO
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/9 9:53
|
||||
*/
|
||||
@Data
|
||||
public class PlanManagementVO {
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Integer id;
|
||||
|
||||
/** 计划ID */
|
||||
@ApiModelProperty(value = "计划ID")
|
||||
private Integer planId;
|
||||
|
||||
/** 借出方单位id */
|
||||
@Excel(name = "借出方单位id")
|
||||
@ApiModelProperty(value = "借出方单位id")
|
||||
private String unitId;
|
||||
|
||||
/** 借出方单位 */
|
||||
@Excel(name = "借出方单位")
|
||||
@ApiModelProperty(value = "借出方单位")
|
||||
private String lenderCompany;
|
||||
|
||||
/** 借入方单位 */
|
||||
@Excel(name = "借入方单位")
|
||||
@ApiModelProperty(value = "借入方单位")
|
||||
private String borrowerCompany;
|
||||
|
||||
/** 物资名称 */
|
||||
@Excel(name = "物资名称")
|
||||
@ApiModelProperty(value = "物资名称")
|
||||
private String typeName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
/** 借出方原计划数 */
|
||||
@Excel(name = "借出方原计划数")
|
||||
@ApiModelProperty(value = "借出方原计划数")
|
||||
private String lenderOrigPlanNum;
|
||||
|
||||
/** 借出方现计划数 */
|
||||
@Excel(name = "借出方现计划数")
|
||||
@ApiModelProperty(value = "借出方现计划数")
|
||||
private String lenderNowPlanNum;
|
||||
|
||||
/** 借入方原计划数 */
|
||||
@Excel(name = "借入方原计划数")
|
||||
@ApiModelProperty(value = "借入方原计划数")
|
||||
private String borrowerOrigPlanNum;
|
||||
|
||||
/** 借入方现计划数 */
|
||||
@Excel(name = "借入方现计划数")
|
||||
@ApiModelProperty(value = "借入方现计划数")
|
||||
private String borrowerNowPlanNum;
|
||||
|
||||
/** 借出数 */
|
||||
@Excel(name = "借出数")
|
||||
@ApiModelProperty(value = "借出数")
|
||||
private String borrowNum;
|
||||
|
||||
/** 计划单价 */
|
||||
@Excel(name = "计划单价")
|
||||
@ApiModelProperty(value = "计划单价")
|
||||
private String planPrice;
|
||||
|
||||
/** 计划总价 */
|
||||
@Excel(name = "计划总价")
|
||||
@ApiModelProperty(value = "计划总价")
|
||||
private String planCost;
|
||||
|
||||
/** 创建者 */
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@Excel(name = "操作人")
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@ApiModelProperty(value = "更新时间 ")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "操作时间")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.CheckDetailsInfo;
|
||||
import com.bonus.sgzb.material.domain.PlanManagementDto;
|
||||
import com.bonus.sgzb.material.domain.PlanManagementVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划管理mapper层
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/9 9:35
|
||||
*/
|
||||
@Mapper
|
||||
public interface PlanManagementMapper {
|
||||
|
||||
/**
|
||||
* 新增plan_need_info表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int insertPlanNeedInfo(CheckDetailsInfo dto);
|
||||
|
||||
/**
|
||||
* 新增plan_need_details
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
int insertPlanNeedDetail(CheckDetailsInfo info);
|
||||
|
||||
/**
|
||||
* 查询计划管理列表
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
List<PlanManagementVO> selectPlanInfo(@Param("name") String name);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.CheckDetailsInfo;
|
||||
import com.bonus.sgzb.material.domain.PlanManagementDto;
|
||||
import com.bonus.sgzb.material.domain.PlanManagementVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划管理服务层
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/9 9:33
|
||||
*/
|
||||
public interface PlanManagementService {
|
||||
|
||||
/**
|
||||
* 获取计划管理列表
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
List<PlanManagementVO> getList(String name);
|
||||
|
||||
/**
|
||||
* 修改计划管理
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Integer update(PlanManagementDto dto);
|
||||
|
||||
/**
|
||||
* 新增计划管理
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult insert(PlanManagementDto dto);
|
||||
|
||||
/**
|
||||
* 根据id删除计划管理
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
Integer deleteById(Long planId);
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.config.ExceptionEnum;
|
||||
import com.bonus.sgzb.material.domain.CheckDetailsInfo;
|
||||
import com.bonus.sgzb.material.domain.PlanManagementDto;
|
||||
import com.bonus.sgzb.material.domain.PlanManagementVO;
|
||||
import com.bonus.sgzb.material.mapper.PlanManagementMapper;
|
||||
import com.bonus.sgzb.material.service.PlanManagementService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划管理服务实现层
|
||||
* @Author ma_sh
|
||||
* @create 2024/4/9 9:34
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PlanManagementServiceImpl implements PlanManagementService {
|
||||
|
||||
@Autowired
|
||||
private PlanManagementMapper planManagementMapper;
|
||||
|
||||
/**
|
||||
* 获取计划管理列表
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PlanManagementVO> getList(String name) {
|
||||
return selectPlanInfo(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划管理列表
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private List<PlanManagementVO> selectPlanInfo(String name) {
|
||||
return planManagementMapper.selectPlanInfo(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划管理
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer update(PlanManagementDto dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划管理
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult insert(PlanManagementDto dto) {
|
||||
int res = 0;
|
||||
try {
|
||||
res = insertPlanManagement(dto);
|
||||
if (res == 0) {
|
||||
log.error("insertPlanManagement方法插入异常");
|
||||
throw new RuntimeException("insertPlanManagement方法插入异常");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("新增计划管理异常:{}",e.getMessage());
|
||||
// 添加事务回滚逻辑,保证入库全部成功或者全部失败
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error(ExceptionEnum.SAVE_TO_DATABASE.getCode(), ExceptionEnum.SAVE_TO_DATABASE.getMsg());
|
||||
}
|
||||
return AjaxResult.success(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存到计划管理表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
private int insertPlanManagement(PlanManagementDto dto) {
|
||||
int res = 0;
|
||||
for (CheckDetailsInfo info : dto.getCheckDetailsList()) {
|
||||
info.setRemark(dto.getRemark());
|
||||
info.setCreateBy(dto.getCreateBy());
|
||||
info.setUpdateBy(dto.getUpdateBy());
|
||||
if (info.getPurchasePrice() != null && info.getPurchaseNum() != null) {
|
||||
Double total = info.getPurchasePrice() * info.getPurchaseNum();
|
||||
total = (double) Math.round(total * 100) / 100;
|
||||
info.setTotalPrice(total);
|
||||
} else {
|
||||
info.setTotalPrice(0.00);
|
||||
}
|
||||
res += planManagementMapper.insertPlanNeedInfo(info);
|
||||
res += planManagementMapper.insertPlanNeedDetail(info);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除计划管理
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer deleteById(Long planId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<?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.sgzb.material.mapper.PlanManagementMapper">
|
||||
<insert id="insertPlanNeedInfo" useGeneratedKeys="true" keyProperty="planId">
|
||||
insert into plan_need_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
now()
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertPlanNeedDetail">
|
||||
insert into plan_need_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="purchaseNum != null">plan_num,</if>
|
||||
<if test="purchasePrice != null">plan_price,</if>
|
||||
<if test="totalPrice != null">plan_cost,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">#{planId},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="purchaseNum != null">#{purchaseNum},</if>
|
||||
<if test="purchasePrice != null">#{purchasePrice},</if>
|
||||
<if test="totalPrice != null">#{totalPrice},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
now()
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="selectPlanInfo" resultType="com.bonus.sgzb.material.domain.PlanManagementVO">
|
||||
SELECT pn.plan_id AS planId,
|
||||
bu.unit_name AS lenderCompany,
|
||||
bu.unit_id AS unitId,
|
||||
pnd.plan_num AS lenderOrigPlanNum,
|
||||
pnd.plan_price AS planPrice,
|
||||
pnd.plan_cost AS planCost,
|
||||
pn.create_by AS createBy,
|
||||
pn.create_time AS createTime,
|
||||
pn.remark AS remark,
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt.unit_name AS unitName
|
||||
FROM plan_need_info pn
|
||||
LEFT JOIN plan_need_details pnd ON pn.plan_id = pnd.plan_id
|
||||
LEFT JOIN bm_unit_info bu ON pn.unit_id = bu.unit_id
|
||||
LEFT JOIN ma_type mt ON pnd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
WHERE
|
||||
1=1
|
||||
<if test="name != null and name != ''">
|
||||
and (bu.unit_name like concat('%', #{name}, '%') or
|
||||
mt2.type_name like concat('%',#{name},'%') or
|
||||
mt.type_name like concat('%',#{name},'%'))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
package com.bonus.sgzb.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
|
@ -52,7 +56,13 @@ public class SysLogininforController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysLogininfor logininfor)
|
||||
{
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
List<SysLogininfor> list;
|
||||
list = logininforService.selectLogininforList(logininfor);
|
||||
//根据前端列表选中选择性列表导出
|
||||
if (CollectionUtils.isNotEmpty(logininfor.getDataCondition())) {
|
||||
list = list.stream().filter(Objects::nonNull).
|
||||
filter(u -> logininfor.getDataCondition().contains(u.getInfoId())).collect(Collectors.toList());
|
||||
}
|
||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||
util.exportExcel(response, list, "登录日志");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.bonus.sgzb.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
|
@ -47,7 +51,13 @@ public class SysOperlogController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysOperLog operLog)
|
||||
{
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
List<SysOperLog> list;
|
||||
list = operLogService.selectOperLogList(operLog);
|
||||
//根据前端列表选中选择性列表导出
|
||||
if (CollectionUtils.isNotEmpty(operLog.getDataCondition())) {
|
||||
list = list.stream().filter(Objects::nonNull).
|
||||
filter(u -> operLog.getDataCondition().contains(u.getOperId())).collect(Collectors.toList());
|
||||
}
|
||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||
util.exportExcel(response, list, "操作日志");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.bonus.sgzb.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
|
@ -51,8 +55,13 @@ public class SysPostController extends BaseController
|
|||
@RequiresPermissions("system:post:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysPost post)
|
||||
{
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
{ List<SysPost> list;
|
||||
list = postService.selectPostList(post);
|
||||
//根据前端列表选中选择性列表导出
|
||||
if (CollectionUtils.isNotEmpty(post.getDataCondition())) {
|
||||
list = list.stream().filter(Objects::nonNull).
|
||||
filter(u -> post.getDataCondition().contains(u.getPostId())).collect(Collectors.toList());
|
||||
}
|
||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
||||
util.exportExcel(response, list, "岗位数据");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.bonus.sgzb.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
|
@ -60,7 +64,13 @@ public class SysRoleController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysRole role)
|
||||
{
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
List<SysRole> list;
|
||||
list = roleService.selectRoleList(role);
|
||||
//根据前端列表选中选择性列表导出
|
||||
if (CollectionUtils.isNotEmpty(role.getDataCondition())) {
|
||||
list = list.stream().filter(Objects::nonNull).
|
||||
filter(u -> role.getDataCondition().contains(u.getRoleId())).collect(Collectors.toList());
|
||||
}
|
||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||
util.exportExcel(response, list, "角色数据");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.bonus.sgzb.system.api.domain.SysUser;
|
|||
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||
import com.bonus.sgzb.system.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -32,7 +33,9 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -94,7 +97,13 @@ public class SysUserController extends BaseController {
|
|||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user) {
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
List<SysUser> list;
|
||||
list = userService.selectUserList(user);
|
||||
//根据前端列表选中选择性列表导出
|
||||
if (CollectionUtils.isNotEmpty(user.getDataCondition())) {
|
||||
list = list.stream().filter(Objects::nonNull).
|
||||
filter(u -> user.getDataCondition().contains(u.getUserId())).collect(Collectors.toList());
|
||||
}
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.exportExcel(response, list, "用户数据");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import com.bonus.sgzb.common.core.annotation.Excel;
|
|||
import com.bonus.sgzb.common.core.annotation.Excel.ColumnType;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位表 sys_post
|
||||
*
|
||||
|
|
@ -37,6 +39,17 @@ public class SysPost extends BaseEntity
|
|||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 导出选中列表 */
|
||||
private List<Long> dataCondition;
|
||||
|
||||
public List<Long> getDataCondition() {
|
||||
return dataCondition;
|
||||
}
|
||||
|
||||
public void setDataCondition(List<Long> dataCondition) {
|
||||
this.dataCondition = dataCondition;
|
||||
}
|
||||
|
||||
/** 用户是否存在此岗位标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue