add:增加报价单
This commit is contained in:
@@ -36,6 +36,22 @@ public class ClientEntity implements Serializable {
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String tel;
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
private String bank;
|
||||
/**
|
||||
* 卡号
|
||||
*/
|
||||
private String card;
|
||||
/**
|
||||
* 行业
|
||||
*/
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
package com.boge.modules.contract.controller;
|
||||
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.contract.service.ContractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.contract.service.ContractService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -48,8 +43,7 @@ public class ContractController {
|
||||
@RequestMapping("/info/{contractId}")
|
||||
//@RequiresPermissions("flow:contract:info")
|
||||
public R info(@PathVariable("contractId") Integer contractId){
|
||||
ContractEntity contract = contractService.getById(contractId);
|
||||
|
||||
ContractEntity contract = contractService.selectDtlById(contractId);
|
||||
return R.ok().put("contract", contract);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.boge.modules.contract.dao;
|
||||
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.contract.dto.ContractDto;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -13,5 +15,11 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractDao extends BaseMapper<ContractEntity> {
|
||||
/**
|
||||
* 查询售后合同明细包含客户信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ContractDto selectDtlById(Integer id);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.boge.modules.contract.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.client.entity.ClientEntity;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Data
|
||||
public class ContractDto extends ContractEntity {
|
||||
/**
|
||||
* 客户信息
|
||||
*/
|
||||
private ClientEntity client;
|
||||
}
|
||||
@@ -2,10 +2,10 @@ package com.boge.modules.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -44,6 +44,11 @@ public class ContractEntity implements Serializable {
|
||||
* 物料信息
|
||||
*/
|
||||
private String materialJson;
|
||||
/**
|
||||
/**
|
||||
* 报价单编码
|
||||
*/
|
||||
private String fileNo;
|
||||
/**
|
||||
* 是否验收
|
||||
*/
|
||||
@@ -64,5 +69,6 @@ public class ContractEntity implements Serializable {
|
||||
* 文件id
|
||||
*/
|
||||
private String storageId;
|
||||
private String status;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.boge.modules.contract.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.contract.dto.ContractDto;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -16,5 +17,7 @@ import java.util.Map;
|
||||
public interface ContractService extends IService<ContractEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
ContractDto selectDtlById(Integer id);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package com.boge.modules.contract.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.Query;
|
||||
|
||||
import com.boge.modules.contract.dao.ContractDao;
|
||||
import com.boge.modules.contract.dto.ContractDto;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.contract.service.ContractService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service("contractService")
|
||||
@Service
|
||||
public class ContractServiceImpl extends ServiceImpl<ContractDao, ContractEntity> implements ContractService {
|
||||
|
||||
@Override
|
||||
@@ -26,4 +27,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractDao, ContractEntity
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractDto selectDtlById(Integer id) {
|
||||
return this.baseMapper.selectDtlById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import liquibase.pro.packaged.S;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 20:06:39
|
||||
@@ -36,6 +38,14 @@ public class MaterialEntity implements Serializable {
|
||||
* 物料类型
|
||||
*/
|
||||
private Integer materialType;
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
private String materialSpec;
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
private String unitName;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.boge.modules.price.controller;
|
||||
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import com.boge.modules.price.service.PriceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("flow/price")
|
||||
public class PriceController {
|
||||
@Autowired
|
||||
private PriceService priceService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
//@RequiresPermissions("flow:contract:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = priceService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{priceId}")
|
||||
//@RequiresPermissions("flow:contract:info")
|
||||
public R info(@PathVariable("priceId") Integer priceId){
|
||||
PriceEntity contract = priceService.getById(priceId);
|
||||
return R.ok().put("price", contract);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
//@RequiresPermissions("flow:contract:save")
|
||||
public R save(@RequestBody PriceEntity priceEntity){
|
||||
priceService.save(priceEntity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
//@RequiresPermissions("flow:contract:update")
|
||||
public R update(@RequestBody PriceEntity priceEntity){
|
||||
priceService.updateById(priceEntity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
//@RequiresPermissions("flow:contract:delete")
|
||||
public R delete(@RequestBody Integer[] priceIds){
|
||||
priceService.removeByIds(Arrays.asList(priceIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.boge.modules.price.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Mapper
|
||||
public interface PriceDao extends BaseMapper<PriceEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.boge.modules.price.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_price")
|
||||
public class PriceEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Integer priceId;
|
||||
/**
|
||||
* 报价单类型
|
||||
*/
|
||||
private Integer priceType;
|
||||
/**
|
||||
* 报价单编号
|
||||
*/
|
||||
private String fileNo;
|
||||
/**
|
||||
* 报价人
|
||||
*/
|
||||
private String quoter;
|
||||
/**
|
||||
* 接收人
|
||||
*/
|
||||
private String fattn;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String ftel;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long clientId;
|
||||
/**
|
||||
* 客户接收人
|
||||
*/
|
||||
private String tattn;
|
||||
/**
|
||||
* 客户接收人联系方法
|
||||
*/
|
||||
private String ttel;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private String materialJson;
|
||||
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
private String totalPrice;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.boge.modules.price.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
public interface PriceService extends IService<PriceEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.boge.modules.price.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.Query;
|
||||
import com.boge.modules.price.dao.PriceDao;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import com.boge.modules.price.service.PriceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
public class PriceServiceImpl extends ServiceImpl<PriceDao, PriceEntity> implements PriceService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<PriceEntity> page = this.page(
|
||||
new Query<PriceEntity>().getPage(params),
|
||||
new QueryWrapper<PriceEntity>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.boge.modules.project.contract.controller;
|
||||
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.project.contract.entity.ProjectContractEntity;
|
||||
import com.boge.modules.project.contract.service.ProjectContractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("flow/projectContract")
|
||||
public class ProjectContractController {
|
||||
@Autowired
|
||||
private ProjectContractService contractService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
//@RequiresPermissions("flow:contract:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = contractService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{contractId}")
|
||||
//@RequiresPermissions("flow:contract:info")
|
||||
public R info(@PathVariable("contractId") Integer contractId){
|
||||
ProjectContractEntity contract = contractService.getById(contractId);
|
||||
|
||||
return R.ok().put("contract", contract);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
//@RequiresPermissions("flow:contract:save")
|
||||
public R save(@RequestBody ProjectContractEntity contract){
|
||||
contractService.save(contract);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
//@RequiresPermissions("flow:contract:update")
|
||||
public R update(@RequestBody ProjectContractEntity contract){
|
||||
contractService.updateById(contract);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
//@RequiresPermissions("flow:contract:delete")
|
||||
public R delete(@RequestBody Integer[] contractIds){
|
||||
contractService.removeByIds(Arrays.asList(contractIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.boge.modules.project.contract.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.project.contract.entity.ProjectContractEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProjectContractDao extends BaseMapper<ProjectContractEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.boge.modules.project.contract.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_project_contract")
|
||||
public class ProjectContractEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Integer contractId;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private Integer contractType;
|
||||
/**
|
||||
* 是否是主合同
|
||||
*/
|
||||
private Integer isMaster;
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractNumber;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long clientId;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private String materialJson;
|
||||
/**
|
||||
/**
|
||||
* 质保期天
|
||||
*/
|
||||
private Integer validity;
|
||||
/**
|
||||
* 是否验收
|
||||
*/
|
||||
private Integer isAcceptance;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private Date acceptanceTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private String storageId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.boge.modules.project.contract.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.project.contract.entity.ProjectContractEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
public interface ProjectContractService extends IService<ProjectContractEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.boge.modules.project.contract.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.Query;
|
||||
import com.boge.modules.project.contract.dao.ProjectContractDao;
|
||||
import com.boge.modules.project.contract.entity.ProjectContractEntity;
|
||||
import com.boge.modules.project.contract.service.ProjectContractService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
public class ProjectContractServiceImpl extends ServiceImpl<ProjectContractDao, ProjectContractEntity> implements ProjectContractService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<ProjectContractEntity> page = this.page(
|
||||
new Query<ProjectContractEntity>().getPage(params),
|
||||
new QueryWrapper<ProjectContractEntity>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
package com.boge.modules.sys.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.boge.modules.sys.entity.SysMenuEntity;
|
||||
import com.boge.common.annotation.SysLog;
|
||||
import com.boge.common.exception.RRException;
|
||||
@@ -47,14 +48,14 @@ public class SysMenuController extends AbstractController {
|
||||
Set<String> permissions = shiroService.getUserPermissions(getUserId());
|
||||
return R.ok().put("menuList", menuList).put("permissions", permissions);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 所有菜单列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("sys:menu:list")
|
||||
public List<SysMenuEntity> list(){
|
||||
List<SysMenuEntity> menuList = sysMenuService.list();
|
||||
List<SysMenuEntity> menuList = sysMenuService.list(new QueryWrapper<SysMenuEntity>().orderByAsc("order_num"));
|
||||
HashMap<Long, SysMenuEntity> menuMap = new HashMap<>(12);
|
||||
for (SysMenuEntity s : menuList) {
|
||||
menuMap.put(s.getMenuId(), s);
|
||||
@@ -70,7 +71,7 @@ public class SysMenuController extends AbstractController {
|
||||
|
||||
return menuList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择菜单(添加、修改菜单)
|
||||
*/
|
||||
@@ -79,7 +80,7 @@ public class SysMenuController extends AbstractController {
|
||||
public R select(){
|
||||
//查询列表数据
|
||||
List<SysMenuEntity> menuList = sysMenuService.queryNotButtonList();
|
||||
|
||||
|
||||
//添加顶级菜单
|
||||
SysMenuEntity root = new SysMenuEntity();
|
||||
root.setMenuId(0L);
|
||||
@@ -87,10 +88,10 @@ public class SysMenuController extends AbstractController {
|
||||
root.setParentId(-1L);
|
||||
root.setOpen(true);
|
||||
menuList.add(root);
|
||||
|
||||
|
||||
return R.ok().put("menuList", menuList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 菜单信息
|
||||
*/
|
||||
@@ -100,7 +101,7 @@ public class SysMenuController extends AbstractController {
|
||||
SysMenuEntity menu = sysMenuService.getById(menuId);
|
||||
return R.ok().put("menu", menu);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@@ -110,12 +111,12 @@ public class SysMenuController extends AbstractController {
|
||||
public R save(@RequestBody SysMenuEntity menu){
|
||||
//数据校验
|
||||
verifyForm(menu);
|
||||
|
||||
|
||||
sysMenuService.save(menu);
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@@ -125,12 +126,12 @@ public class SysMenuController extends AbstractController {
|
||||
public R update(@RequestBody SysMenuEntity menu){
|
||||
//数据校验
|
||||
verifyForm(menu);
|
||||
|
||||
|
||||
sysMenuService.updateById(menu);
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@@ -152,7 +153,7 @@ public class SysMenuController extends AbstractController {
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证参数是否正确
|
||||
*/
|
||||
@@ -160,25 +161,25 @@ public class SysMenuController extends AbstractController {
|
||||
if(StringUtils.isBlank(menu.getName())){
|
||||
throw new RRException("菜单名称不能为空");
|
||||
}
|
||||
|
||||
|
||||
if(menu.getParentId() == null){
|
||||
throw new RRException("上级菜单不能为空");
|
||||
}
|
||||
|
||||
|
||||
//菜单
|
||||
if(menu.getType() == Constant.MenuType.MENU.getValue()){
|
||||
if(StringUtils.isBlank(menu.getUrl())){
|
||||
throw new RRException("菜单URL不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//上级菜单类型
|
||||
int parentType = Constant.MenuType.CATALOG.getValue();
|
||||
if(menu.getParentId() != 0){
|
||||
SysMenuEntity parentMenu = sysMenuService.getById(menu.getParentId());
|
||||
parentType = parentMenu.getType();
|
||||
}
|
||||
|
||||
|
||||
//目录、菜单
|
||||
if(menu.getType() == Constant.MenuType.CATALOG.getValue() ||
|
||||
menu.getType() == Constant.MenuType.MENU.getValue()){
|
||||
@@ -187,7 +188,7 @@ public class SysMenuController extends AbstractController {
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//按钮
|
||||
if(menu.getType() == Constant.MenuType.BUTTON.getValue()){
|
||||
if(parentType != Constant.MenuType.MENU.getValue()){
|
||||
|
||||
@@ -30,14 +30,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
|
||||
private SysUserService sysUserService;
|
||||
@Autowired
|
||||
private SysRoleMenuService sysRoleMenuService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SysMenuEntity> queryListParentId(Long parentId, List<Long> menuIdList) {
|
||||
List<SysMenuEntity> menuList = queryListParentId(parentId);
|
||||
if(menuIdList == null){
|
||||
return menuList;
|
||||
}
|
||||
|
||||
|
||||
List<SysMenuEntity> userMenuList = new ArrayList<>();
|
||||
for(SysMenuEntity menu : menuList){
|
||||
if(menuIdList.contains(menu.getMenuId())){
|
||||
@@ -63,7 +63,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
|
||||
if(userId == Constant.SUPER_ADMIN){
|
||||
return getMenuList(null);
|
||||
}
|
||||
|
||||
|
||||
//用户菜单列表
|
||||
List<Long> menuIdList = sysUserService.queryAllMenuId(userId);
|
||||
return getMenuList(menuIdList);
|
||||
@@ -77,7 +77,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
|
||||
private List<SysMenuEntity> getMenuList(List<Long> menuIdList) {
|
||||
// 查询拥有的所有菜单
|
||||
List<SysMenuEntity> menus = this.baseMapper.selectList(new QueryWrapper<SysMenuEntity>()
|
||||
.in(Objects.nonNull(menuIdList), "menu_id", menuIdList).in("type", 0, 1));
|
||||
.in(Objects.nonNull(menuIdList), "menu_id", menuIdList).in("type", 0, 1).orderByAsc("order_num"));
|
||||
// 将id和菜单绑定
|
||||
HashMap<Long, SysMenuEntity> menuMap = new HashMap<>(12);
|
||||
for (SysMenuEntity s : menus) {
|
||||
@@ -114,7 +114,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
|
||||
List<SysMenuEntity> menuList = queryListParentId(0L, menuIdList);
|
||||
//递归获取子菜单
|
||||
getMenuTreeList(menuList, menuIdList);
|
||||
|
||||
|
||||
return menuList;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
|
||||
*/
|
||||
private List<SysMenuEntity> getMenuTreeList(List<SysMenuEntity> menuList, List<Long> menuIdList){
|
||||
List<SysMenuEntity> subMenuList = new ArrayList<SysMenuEntity>();
|
||||
|
||||
|
||||
for(SysMenuEntity entity : menuList){
|
||||
//目录
|
||||
if(entity.getType() == Constant.MenuType.CATALOG.getValue()){
|
||||
@@ -131,7 +131,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
|
||||
}
|
||||
subMenuList.add(entity);
|
||||
}
|
||||
|
||||
|
||||
return subMenuList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ public class TicketsEntity implements Serializable {
|
||||
*/
|
||||
private String errorType;
|
||||
/**
|
||||
* 合同编号
|
||||
* 项目合同编号
|
||||
*/
|
||||
private String contractId;
|
||||
private String contractCode;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/flowable?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
url: jdbc:mysql://localhost:3306/basefast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
initial-size: 10
|
||||
|
||||
@@ -15,6 +15,8 @@ spring:
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
mapper:
|
||||
accept-case-insensitive-properties: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
====================================================================================================================
|
||||
|
||||
************* 欢迎使用 工作流Flowable管理系统 *************
|
||||
|
||||
====================================================================================================================
|
||||
@@ -9,10 +9,14 @@
|
||||
<result property="clientName" column="client_name"/>
|
||||
<result property="juridicalPerson" column="juridical_person"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="fax" column="address"/>
|
||||
<result property="tel" column="address"/>
|
||||
<result property="bank" column="address"/>
|
||||
<result property="card" column="address"/>
|
||||
<result property="industry" column="industry"/>
|
||||
<result property="isOn" column="is_on"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -16,6 +16,36 @@
|
||||
<result property="acceptanceTime" column="acceptance_time"/>
|
||||
<result property="remarks" column="remarks"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="com.boge.modules.contract.dto.ContractDto" id="contractDtoMap">
|
||||
<result property="contractId" column="contract_id"/>
|
||||
<result property="contractType" column="contract_type"/>
|
||||
<result property="isMaster" column="is_master"/>
|
||||
<result property="contractNumber" column="contract_number"/>
|
||||
<result property="clientId" column="client_id"/>
|
||||
<result property="materialJson" column="material_json"/>
|
||||
<result property="isAcceptance" column="is_acceptance"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="acceptanceTime" column="acceptance_time"/>
|
||||
<result property="remarks" column="remarks"/>
|
||||
<result property="storageId" column="storage_id"/>
|
||||
<result property="fileNo" column="file_no"/>
|
||||
<!-- ClientEntity关联对象 -->
|
||||
<association property="client" javaType="com.boge.modules.client.entity.ClientEntity">
|
||||
<result property="clientId" column="client_id"/>
|
||||
<result property="clientName" column="client_name"/>
|
||||
<result property="juridicalPerson" column="juridical_person"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="fax" column="address"/>
|
||||
<result property="tel" column="address"/>
|
||||
<result property="bank" column="address"/>
|
||||
<result property="card" column="address"/>
|
||||
<result property="industry" column="industry"/>
|
||||
<result property="isOn" column="is_on"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
<select id="selectDtlById" resultMap="contractDtoMap">
|
||||
select * from sys_contract left join sys_client on sys_contract.client_id = sys_client.client_id
|
||||
where contract_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
<result property="materialId" column="material_id"/>
|
||||
<result property="materialCode" column="material_code"/>
|
||||
<result property="materialName" column="material_name"/>
|
||||
<result property="materialSpec" column="material_spec"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="materialType" column="material_type"/>
|
||||
<result property="isOn" column="is_on"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
<mapper namespace="com.boge.modules.sys.dao.SysUserDao">
|
||||
<!-- 查询用户的所有权限 -->
|
||||
<select id="queryAllPerms" resultType="string">
|
||||
select m.perms from sys_user_role ur
|
||||
LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
|
||||
LEFT JOIN sys_menu m on rm.menu_id = m.menu_id
|
||||
select m.perms from sys_user_role ur
|
||||
LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
|
||||
LEFT JOIN sys_menu m on rm.menu_id = m.menu_id
|
||||
where ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<!-- 查询用户的所有菜单ID -->
|
||||
|
||||
<!-- 查询用户的所有菜单ID -->
|
||||
<select id="queryAllMenuId" resultType="long">
|
||||
select distinct rm.menu_id from sys_user_role ur
|
||||
LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
|
||||
select distinct rm.menu_id from sys_user_role ur
|
||||
LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
|
||||
where ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryByUserName" resultType="com.boge.modules.sys.entity.SysUserEntity">
|
||||
select * from sys_user where username = #{username}
|
||||
</select>
|
||||
@@ -28,4 +28,4 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user