Commit 514a3824 by 吴迪

【新增】自行车公告

parent ccb6cf8f
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
import io.office.common.utils.IPUtils;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.SearchgtinlogEntity;
import io.office.modules.manage.service.SearchgtinlogService;
import io.office.modules.manage.vo.request.BikeFirmVo;
import io.office.modules.manage.vo.request.DomesticCodeDetailRequest;
import io.office.modules.sys.service.SysCaptchaService;
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.BikefirmEntity;
import io.office.modules.manage.service.BikefirmService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import javax.servlet.http.HttpServletRequest;
/**
......@@ -31,6 +37,11 @@ public class BikefirmController {
@Autowired
private BikefirmService bikefirmService;
@Autowired
private SysCaptchaService sysCaptchaService;
@Autowired
private SearchgtinlogService searchgtinlogService;
/**
* 列表
*/
......@@ -87,4 +98,35 @@ public class BikefirmController {
return R.ok();
}
@Login
@PostMapping("/api/getBikeFirm")
public R getBikeFirm(@RequestBody BikeFirmVo bikeFirmVo, HttpServletRequest request) {
boolean captcha = sysCaptchaService.validate(bikeFirmVo.getUuid(), bikeFirmVo.getCaptcha());
if(!captcha){
return R.error("验证码不正确");
}
SearchgtinlogEntity searchgtinlogEntity = new SearchgtinlogEntity();
searchgtinlogEntity.setCreatedate(new Date());
searchgtinlogEntity.setIp(IPUtils.getIpAddr(request));
if(StringUtils.isNotBlank(bikeFirmVo.getCode())) {
searchgtinlogEntity.setKeyword(bikeFirmVo.getCode());
searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业代码查询");
}
if(StringUtils.isNotBlank(bikeFirmVo.getFirmName())) {
searchgtinlogEntity.setKeyword(bikeFirmVo.getFirmName());
searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业名称查询");
}
searchgtinlogEntity.setSearchsource(0);
//新增查询日志
searchgtinlogService.save(searchgtinlogEntity);
return R.ok().put("data",bikefirmService.getBikeFirm(bikeFirmVo));
}
}
......@@ -2,8 +2,11 @@ package io.office.modules.manage.dao;
import io.office.modules.manage.entity.BikefirmEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.vo.request.BikeFirmVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* ${comments}
*
......@@ -13,5 +16,8 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface BikefirmDao extends BaseMapper<BikefirmEntity> {
List<BikeFirmVo> getBikeFirm(BikeFirmVo bikeFirmVo);
}
......@@ -3,7 +3,9 @@ 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 io.office.modules.manage.vo.request.BikeFirmVo;
import java.util.List;
import java.util.Map;
/**
......@@ -16,5 +18,9 @@ import java.util.Map;
public interface BikefirmService extends IService<BikefirmEntity> {
PageUtils queryPage(Map<String, Object> params);
List<BikeFirmVo> getBikeFirm(BikeFirmVo bikeFirmVo);
}
package io.office.modules.manage.service.impl;
import io.office.modules.manage.vo.request.BikeFirmVo;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -26,4 +29,9 @@ public class BikefirmServiceImpl extends ServiceImpl<BikefirmDao, BikefirmEntity
return new PageUtils(page);
}
@Override
public List<BikeFirmVo> getBikeFirm(BikeFirmVo bikeFirmVo) {
return baseMapper.getBikeFirm(bikeFirmVo);
}
}
\ No newline at end of file
package io.office.modules.manage.vo.request;
import lombok.Data;
import java.io.Serializable;
/**
*
* 
 @description:
*
* @author wudi
* @date 14:18 2021/12/6
*/
@Data
public class BikeFirmVo implements Serializable {
private String code;
private String firmName;
private String captcha;
private String uuid;
}
......@@ -50,4 +50,18 @@
</resultMap>
<select id="getBikeFirm" parameterType="io.office.modules.manage.vo.request.BikeFirmVo" resultType="io.office.modules.manage.vo.request.BikeFirmVo">
select a.firm_name,b.code from ancc_db2.dbo.bikefirm a left join ancc_db2.dbo.bikecode b on a.id=b.bikeid where check_stat=1
<if test="code!='' and code!=null">
and b.code= #{code}
</if>
<if test="firmName!='' and firmName!=null">
and firm_name_real like concat('%',#{firmName},'%')
</if>
order by id desc
</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