Commit dad59c2b by 吴迪

【新增】新增条码查询功能

parent 70c41a39
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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 io.office.modules.manage.entity.BikecodeEntity;
import io.office.modules.manage.service.BikecodeService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
@RestController
@RequestMapping("/bikecode")
public class BikecodeController {
@Autowired
private BikecodeService bikecodeService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:bikecode:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = bikecodeService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{bikeid}")
// @RequiresPermissions("manage:bikecode:info")
public R info(@PathVariable("bikeid") Integer bikeid){
BikecodeEntity bikecode = bikecodeService.getById(bikeid);
return R.ok().put("bikecode", bikecode);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:bikecode:save")
public R save(@RequestBody BikecodeEntity bikecode){
bikecodeService.save(bikecode);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:bikecode:update")
public R update(@RequestBody BikecodeEntity bikecode){
bikecodeService.updateById(bikecode);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:bikecode:delete")
public R delete(@RequestBody Integer[] bikeids){
bikecodeService.removeByIds(Arrays.asList(bikeids));
return R.ok();
}
}
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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 io.office.modules.manage.entity.BikefirmEntity;
import io.office.modules.manage.service.BikefirmService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
@RestController
@RequestMapping("/bikefirm")
public class BikefirmController {
@Autowired
private BikefirmService bikefirmService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:bikefirm:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = bikefirmService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:bikefirm:info")
public R info(@PathVariable("id") Integer id){
BikefirmEntity bikefirm = bikefirmService.getById(id);
return R.ok().put("bikefirm", bikefirm);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:bikefirm:save")
public R save(@RequestBody BikefirmEntity bikefirm){
bikefirmService.save(bikefirm);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:bikefirm:update")
public R update(@RequestBody BikefirmEntity bikefirm){
bikefirmService.updateById(bikefirm);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:bikefirm:delete")
public R delete(@RequestBody Integer[] ids){
bikefirmService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
......@@ -4,22 +4,29 @@ import java.util.Arrays;
import java.util.Date;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.utils.IPUtils;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.ProductEntity;
import io.office.modules.manage.entity.SearchgtinlogEntity;
import io.office.modules.manage.service.SearchgtinlogService;
import io.office.modules.manage.vo.request.TerminologyVo;
import io.office.modules.manage.vo.request.TopicNewsPartyRequestVo;
import io.office.modules.sys.controller.AbstractController;
import io.office.modules.sys.service.SysCaptchaService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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 org.springframework.web.bind.annotation.*;
import io.office.modules.manage.entity.GlossaryEntity;
import io.office.modules.manage.service.GlossaryService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import javax.servlet.http.HttpServletRequest;
/**
......@@ -29,11 +36,16 @@ import io.office.common.utils.R;
* @email
* @date 2021-11-15 18:29:59
*/
@Slf4j
@RestController
@RequestMapping("/glossary")
public class GlossaryController extends AbstractController {
@Autowired
private GlossaryService glossaryService;
@Autowired
private SysCaptchaService sysCaptchaService;
@Autowired
private SearchgtinlogService searchgtinlogService;
/**
* 列表
......@@ -98,6 +110,48 @@ public class GlossaryController extends AbstractController {
}
@Login
@PostMapping("/api/terminology")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R terminology(@RequestBody TerminologyVo terminologyVo, HttpServletRequest request) {
try {
boolean captcha = sysCaptchaService.validate(terminologyVo.getUuid(), terminologyVo.getCaptcha());
if(!captcha){
return R.error("验证码不正确");
}
SearchgtinlogEntity searchgtinlogEntity = new SearchgtinlogEntity();
searchgtinlogEntity.setCreatedate(new Date());
searchgtinlogEntity.setIp(IPUtils.getIpAddr(request));
QueryWrapper<GlossaryEntity> queryWrapper = new QueryWrapper<>();
if(terminologyVo.getType().equals("1")) {
searchgtinlogEntity.setClassStr("术语查询:中文标题查询");
queryWrapper.like("title_CN",terminologyVo.getKeyword());
}
if(terminologyVo.getType().equals("2")) {
searchgtinlogEntity.setClassStr("术语查询:英文标题查询");
queryWrapper.like("title_En",terminologyVo.getKeyword());
}
if(terminologyVo.getType().equals("3")) {
searchgtinlogEntity.setClassStr("术语查询:关键字查询");
queryWrapper.like("keyword",terminologyVo.getKeyword());
}
if(terminologyVo.getType().equals("4")) {
searchgtinlogEntity.setClassStr("术语查询:术语解释查询");
queryWrapper.like("content",terminologyVo.getKeyword());
}
searchgtinlogEntity.setKeyword(terminologyVo.getKeyword());
searchgtinlogEntity.setSearchsource(0);
//新增查询日志
searchgtinlogService.save(searchgtinlogEntity);
return R.ok().put("data", glossaryService.list(queryWrapper));
} catch (Exception e) {
log.error("get4PartyTopNews error: {}", e);
return R.error(e.getMessage());
}
}
......
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.BikecodeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
@Mapper
public interface BikecodeDao extends BaseMapper<BikecodeEntity> {
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.BikefirmEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
@Mapper
public interface BikefirmDao extends BaseMapper<BikefirmEntity> {
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
@Data
@TableName("bikecode")
public class BikecodeEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer bikeid;
/**
* $column.comments
*/
private Integer code;
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
@Data
@TableName("bikefirm")
public class BikefirmEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private String tccode;
/**
* $column.comments
*/
private String dm;
/**
* $column.comments
*/
private String tJDm;
/**
* $column.comments
*/
private String firmType;
/**
* $column.comments
*/
private String firmName;
/**
* $column.comments
*/
private String firmNameReal;
/**
* $column.comments
*/
private String firmName1;
/**
* $column.comments
*/
private String registerAddressReal;
/**
* $column.comments
*/
private String registerAddress;
/**
* $column.comments
*/
private String registerAddress1;
/**
* $column.comments
*/
private String registerPostalcode;
/**
* $column.comments
*/
private String address;
/**
* $column.comments
*/
private String address1;
/**
* $column.comments
*/
private String postcode;
/**
* $column.comments
*/
private String certificateCode;
/**
* $column.comments
*/
private String political;
/**
* $column.comments
*/
private BigDecimal registerPrincipal;
/**
* $column.comments
*/
private String coinType;
/**
* $column.comments
*/
private String firmCode;
/**
* $column.comments
*/
private String leader;
/**
* $column.comments
*/
private String leaderReal;
/**
* $column.comments
*/
private String leaderTele;
/**
* $column.comments
*/
private String leaderHandset;
/**
* $column.comments
*/
private String branchCode;
/**
* $column.comments
*/
private String branchUser;
/**
* $column.comments
*/
private Date loginDate;
/**
* $column.comments
*/
private String editUser;
/**
* $column.comments
*/
private Date editDate;
/**
* $column.comments
*/
private Date logoutDate;
/**
* $column.comments
*/
private Date checkDate;
/**
* $column.comments
*/
private Integer checkStat;
/**
* $column.comments
*/
private String checkUser;
/**
* $column.comments
*/
private String logoutFlag;
/**
* $column.comments
*/
private String contactman;
/**
* $column.comments
*/
private String telecode;
/**
* $column.comments
*/
private String tele;
/**
* $column.comments
*/
private String fax;
/**
* $column.comments
*/
private String branchRealname;
/**
* $column.comments
*/
private Date branchRealdate;
/**
* $column.comments
*/
private Boolean isupload;
/**
* $column.comments
*/
private Boolean changeflag;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.BikecodeEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
public interface BikecodeService extends IService<BikecodeEntity> {
PageUtils queryPage(Map<String, Object> params);
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.BikefirmEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-01 21:14:01
*/
public interface BikefirmService extends IService<BikefirmEntity> {
PageUtils queryPage(Map<String, Object> params);
}
......@@ -6,6 +6,7 @@ import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.GlossaryEntity;
import io.office.modules.manage.entity.ProductEntity;
import java.util.List;
import java.util.Map;
/**
......@@ -20,5 +21,8 @@ public interface GlossaryService extends IService<GlossaryEntity> {
PageUtils queryPage(Map<String, Object> params);
Page<GlossaryEntity> selectGlossaryList(Map<String, Object> params, Page page);
}
package io.office.modules.manage.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 io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.BikecodeDao;
import io.office.modules.manage.entity.BikecodeEntity;
import io.office.modules.manage.service.BikecodeService;
@Service("bikecodeService")
public class BikecodeServiceImpl extends ServiceImpl<BikecodeDao, BikecodeEntity> implements BikecodeService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<BikecodeEntity> page = this.page(
new Query<BikecodeEntity>().getPage(params),
new QueryWrapper<BikecodeEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
package io.office.modules.manage.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 io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.BikefirmDao;
import io.office.modules.manage.entity.BikefirmEntity;
import io.office.modules.manage.service.BikefirmService;
@Service("bikefirmService")
public class BikefirmServiceImpl extends ServiceImpl<BikefirmDao, BikefirmEntity> implements BikefirmService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<BikefirmEntity> page = this.page(
new Query<BikefirmEntity>().getPage(params),
new QueryWrapper<BikefirmEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
package io.office.modules.manage.vo.request;
import lombok.Data;
import java.io.Serializable;
/**
*
* 
 @description:
*
* @author wudi
* @date 12:40 2021/12/5
*/
@Data
public class TerminologyVo implements Serializable {
private String type;
private String keyword;
private String captcha;
private String uuid;
}
<?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="io.office.modules.manage.dao.BikecodeDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.BikecodeEntity" id="bikecodeMap">
<result property="bikeid" column="bikeid"/>
<result property="code" column="code"/>
</resultMap>
</mapper>
\ No newline at end of file
<?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="io.office.modules.manage.dao.BikefirmDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.BikefirmEntity" id="bikefirmMap">
<result property="id" column="id"/>
<result property="tccode" column="tccode"/>
<result property="dm" column="dm"/>
<result property="tJDm" column="t_j_dm"/>
<result property="firmType" column="firm_type"/>
<result property="firmName" column="firm_name"/>
<result property="firmNameReal" column="firm_name_real"/>
<result property="firmName1" column="firm_name1"/>
<result property="registerAddressReal" column="register_address_real"/>
<result property="registerAddress" column="register_address"/>
<result property="registerAddress1" column="register_address1"/>
<result property="registerPostalcode" column="register_postalcode"/>
<result property="address" column="address"/>
<result property="address1" column="address1"/>
<result property="postcode" column="postcode"/>
<result property="certificateCode" column="certificate_code"/>
<result property="political" column="political"/>
<result property="registerPrincipal" column="register_principal"/>
<result property="coinType" column="coin_type"/>
<result property="firmCode" column="firm_code"/>
<result property="leader" column="leader"/>
<result property="leaderReal" column="leader_real"/>
<result property="leaderTele" column="leader_tele"/>
<result property="leaderHandset" column="leader_handset"/>
<result property="branchCode" column="branch_code"/>
<result property="branchUser" column="branch_user"/>
<result property="loginDate" column="login_date"/>
<result property="editUser" column="edit_user"/>
<result property="editDate" column="edit_date"/>
<result property="logoutDate" column="logout_date"/>
<result property="checkDate" column="check_date"/>
<result property="checkStat" column="check_stat"/>
<result property="checkUser" column="check_user"/>
<result property="logoutFlag" column="logout_flag"/>
<result property="contactman" column="contactman"/>
<result property="telecode" column="telecode"/>
<result property="tele" column="tele"/>
<result property="fax" column="fax"/>
<result property="branchRealname" column="branch_realname"/>
<result property="branchRealdate" column="branch_realdate"/>
<result property="isupload" column="isupload"/>
<result property="changeflag" column="changeflag"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -80,7 +80,4 @@
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment