文末获取源码
开发语言:Java
开发工具:IDEA /Eclipse
数据库:MYSQL5.7/8.0
应用服务:Tomcat7/Tomcat8
是否Maven项目:是
后端框架:SpringBoot
前端框架:vue+element等
JDK版本:jdk1.8
项目架构:B/S架构
前言介绍
本系统主要包括管理员,责任单位和供应商三个角色组成,主要包括以下功能:
(1)前台:首页、招标项目、结果公示、中标公告、市场监督、帮助中心、新闻公告、个人中心、后台管理。
(2)管理员:首页、个人中心、责任单位管理、供应商管理、招标分类管理、招标项目管理、在线投标管理、结果公示管理、中标公告管理、市场监督管理、帮助中心管理、新闻公告管理、管理员管理、系统管理。
(3)责任单位:首页、个人中心、招标项目管理、在线投标管理、结果公示管理、中标公告管理。
(4)供应商:首页、个人中心、在线投标管理、中标公告管理。
系统展示
前台
招标项目
管理员
供应商管理
招标分类管理
帮助中心管理
责任单位
招标项目管理
供应商
部分核心代码
/**
* 登录相关
*/
@RequestMapping("config")
@RestController
public class ConfigController{
@Autowired
private ConfigService configService;
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
return R.ok().put("data", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* 详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* 根据name获取信息
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name){
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
return R.ok().put("data", config);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.insert(config);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.updateById(config);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
configService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
/**
* 供应商
* 后端接口
* @author
* @email
* @date 2022-05-18 09:48:23
*/
@RestController
@RequestMapping("/gongyingshang")
public class GongyingshangController {
@Autowired
private GongyingshangService gongyingshangService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingshangmingcheng", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
if("否".equals(user.getSfsh())) return R.error("账号已锁定,请联系管理员审核。");
String token = tokenService.generateToken(user.getId(), username,"gongyingshang", "供应商" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody GongyingshangEntity gongyingshang){
//ValidatorUtils.validateEntity(gongyingshang);
GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingshangmingcheng", gongyingshang.getGongyingshangmingcheng()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
gongyingshang.setId(uId);
gongyingshangService.insert(gongyingshang);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
GongyingshangEntity user = gongyingshangService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingshangmingcheng", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
gongyingshangService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,GongyingshangEntity gongyingshang,
HttpServletRequest request){
EntityWrapper<GongyingshangEntity> ew = new EntityWrapper<GongyingshangEntity>();
PageUtils page = gongyingshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongyingshang), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,GongyingshangEntity gongyingshang,
HttpServletRequest request){
EntityWrapper<GongyingshangEntity> ew = new EntityWrapper<GongyingshangEntity>();
PageUtils page = gongyingshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongyingshang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( GongyingshangEntity gongyingshang){
EntityWrapper<GongyingshangEntity> ew = new EntityWrapper<GongyingshangEntity>();
ew.allEq(MPUtil.allEQMapPre( gongyingshang, "gongyingshang"));
return R.ok().put("data", gongyingshangService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(GongyingshangEntity gongyingshang){
EntityWrapper< GongyingshangEntity> ew = new EntityWrapper< GongyingshangEntity>();
ew.allEq(MPUtil.allEQMapPre( gongyingshang, "gongyingshang"));
GongyingshangView gongyingshangView = gongyingshangService.selectView(ew);
return R.ok("查询供应商成功").put("data", gongyingshangView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
GongyingshangEntity gongyingshang = gongyingshangService.selectById(id);
return R.ok().put("data", gongyingshang);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
GongyingshangEntity gongyingshang = gongyingshangService.selectById(id);
return R.ok().put("data", gongyingshang);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GongyingshangEntity gongyingshang, HttpServletRequest request){
gongyingshang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(gongyingshang);
GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingshangmingcheng", gongyingshang.getGongyingshangmingcheng()));
if(user!=null) {
return R.error("用户已存在");
}
gongyingshang.setId(new Date().getTime());
gongyingshangService.insert(gongyingshang);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody GongyingshangEntity gongyingshang, HttpServletRequest request){
gongyingshang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(gongyingshang);
GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingshangmingcheng", gongyingshang.getGongyingshangmingcheng()));
if(user!=null) {
return R.error("用户已存在");
}
gongyingshang.setId(new Date().getTime());
gongyingshangService.insert(gongyingshang);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody GongyingshangEntity gongyingshang, HttpServletRequest request){
//ValidatorUtils.validateEntity(gongyingshang);
gongyingshangService.updateById(gongyingshang);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
gongyingshangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<GongyingshangEntity> wrapper = new EntityWrapper<GongyingshangEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = gongyingshangService.selectCount(wrapper);
return R.ok().put("count", count);
}
}