Commit 8a51cce4 by 吴迪

Merge remote-tracking branch 'origin/master'

parents 2ab1b0f2 60f0f9b0
......@@ -265,6 +265,48 @@
<version>2.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.mail/mail -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>code</groupId>
<artifactId>code</artifactId>
<version>1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/code.jar</systemPath>
</dependency>
<dependency>
<groupId>barcode4j-2.2.0-SNAPSHOT</groupId>
<artifactId>barcode4j-2.2.0-SNAPSHOT</artifactId>
<version>1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/barcode4j-2.2.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>barcode4j-light-2.2.0-SNAPSHOT</groupId>
<artifactId>barcode4j-light-2.2.0-SNAPSHOT</artifactId>
<version>1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/barcode4j-light-2.2.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>barcode4j-spi-2.2.0-SNAPSHOT</groupId>
<artifactId>barcode4j-spi-2.2.0-SNAPSHOT</artifactId>
<version>1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/barcode4j-spi-2.2.0-SNAPSHOT.jar</systemPath>
</dependency>
</dependencies>
<build>
......
package io.office.modules.manage.controller;
import io.office.common.utils.R;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.GS1CodeListEntity;
import io.office.modules.manage.service.BarcodeGenerationService;
import io.office.modules.manage.utils.CheckAICodeUtil;
import io.office.modules.manage.vo.request.CheckAIVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
/**
* ${条码生成}
*
* @author zyf
* @email
* @date 2021-12-09 15:26:10
*/
@RestController
@RequestMapping("/barcodegeneration")
public class BarcodeGenerationController {
@Autowired
private BarcodeGenerationService barcodeGenerationService;
/**
* 条码生成
* @param param 条码内容
* @return pictureUrl 获取条形码地址
*/
@Login
@PostMapping("/api/createQRcode")
public R createQRcode(@RequestBody Map<String,String> param) {
String url = this.barcodeGenerationService.createPicture(param.get("content"));
return R.ok().put("pictureUrl", url);
}
@Login
@ApiOperation(value = "SSCC方式获取GS1 AI标识符列表", response = GS1CodeListEntity.class)
@PostMapping("/api/getGS1CodeListSSCC")
public R getGS1CodeListSSCC() {
List<GS1CodeListEntity> ais = barcodeGenerationService.getGS1CodeListSSCC();
return R.ok().put("ais",ais);
}
@Login
@ApiOperation(value = "GRAI方式获取GS1 AI标识符", response = GS1CodeListEntity.class)
@PostMapping("/api/getGS1CodeListGRAI")
public R getGS1CodeListGRAI() {
GS1CodeListEntity ai = barcodeGenerationService.getGS1CodeListGRAI();
return R.ok().put("ai",ai);
}
@Login
@ApiOperation(value = "校验GS1 AI标识符")
@PostMapping("/api/checkGS1Code")
public R checkGS1Code(@ApiParam(required = true)@Valid @RequestBody CheckAIVo body) {
String result = CheckAICodeUtil.ckeckCode(body.getCode(),body.getContent());
return R.ok().put("result",result);
}
}
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.PartnersEntity;
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.CasesEntity;
import io.office.modules.manage.service.CasesService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* 案例介绍
*
* @author tgl
* @email
* @date 2021-12-09 10:33:11
*/
@RestController
@RequestMapping("/cases")
public class CasesController {
@Autowired
private CasesService casesService;
/**
* 前台查询列表
*/
@RequestMapping("/api/frontList")
@Login
// @RequiresPermissions("manage:partners:list")
public R frontList(){
List<CasesEntity> casesList = this.casesService.frontList();
return R.ok().put("casesList", casesList);
}
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:cases:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = casesService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:cases:info")
public R info(@PathVariable("id") Integer id){
CasesEntity cases = casesService.getById(id);
return R.ok().put("cases", cases);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:cases:save")
public R save(@RequestBody CasesEntity cases){
casesService.save(cases);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:cases:update")
public R update(@RequestBody CasesEntity cases){
casesService.updateById(cases);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:cases:delete")
public R delete(@RequestBody Integer[] ids){
casesService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
......@@ -3,6 +3,7 @@ package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import io.office.modules.app.annotation.Login;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -39,6 +40,7 @@ public class LogLoginController {
* 用户登录
*/
@RequestMapping("/api/login")
@Login
// @RequiresPermissions("manage:member:list")
public R login(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){
logLoginService.login(params,request,response);
......
......@@ -3,6 +3,7 @@ package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import io.office.modules.app.annotation.Login;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -36,6 +37,7 @@ public class MemberController {
/**
* 用户注册
*/
@Login
@RequestMapping("/api/userRegistered")
// @RequiresPermissions("manage:member:list")
public R userRegistered(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){
......
......@@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.ProductEntity;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
......@@ -47,6 +48,17 @@ public class PartnersController extends AbstractController {
return R.ok().put("page", pageUtils);
}
/**
* 前台查询列表
*/
@RequestMapping("/api/frontList")
@Login
// @RequiresPermissions("manage:partners:list")
public R frontList(/*@RequestBody Map<String, Object> params*/){
List<PartnersEntity> partnersList = this.partnersService.frontList(null);
return R.ok().put("partnersList", partnersList);
}
/**
* 信息
......
......@@ -5,6 +5,8 @@ import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.utils.RedisKeys;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.sys.controller.AbstractController;
import io.swagger.models.auth.In;
......@@ -119,6 +121,7 @@ public class ProductController extends AbstractController {
* @param param:分页参数
* @return
*/
@Login
@RequestMapping("/api/findPage")
// @RequiresPermissions("manage:product:findPage")
public R findPage(@RequestBody Map<String,String> param){
......
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import io.office.modules.app.annotation.Login;
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.TimescodeFindpsEntity;
import io.office.modules.manage.service.TimescodeFindpsService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* 忘记密码
*
* @author wudi
* @email
* @date 2021-12-09 17:41:41
*/
@RestController
@RequestMapping("/timescodefindps")
public class TimescodeFindpsController {
@Autowired
private TimescodeFindpsService timescodeFindpsService;
/**
*忘记密码(手机号找回)
*/
@RequestMapping("api/forgotPasswordPhone")
@Login
// @RequiresPermissions("manage:timescodefindps:list")
public R forgotPasswordPhone(@RequestBody Map<String, Object> params){
timescodeFindpsService.forgotPasswordPhone(params);
return R.ok();
}
/**
*忘记密码(邮箱找回)
*/
@RequestMapping("api/forgotPasswordEmiail")
@Login
// @RequiresPermissions("manage:timescodefindps:list")
public R forgotPasswordEmiail(@RequestBody Map<String, Object> params){
timescodeFindpsService.forgotPasswordEmiail(params);
return R.ok();
}
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:timescodefindps:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = timescodeFindpsService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{phone}")
// @RequiresPermissions("manage:timescodefindps:info")
public R info(@PathVariable("phone") String phone){
TimescodeFindpsEntity timescodeFindps = timescodeFindpsService.getById(phone);
return R.ok().put("timescodeFindps", timescodeFindps);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:timescodefindps:save")
public R save(@RequestBody TimescodeFindpsEntity timescodeFindps){
timescodeFindpsService.save(timescodeFindps);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:timescodefindps:update")
public R update(@RequestBody TimescodeFindpsEntity timescodeFindps){
timescodeFindpsService.updateById(timescodeFindps);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:timescodefindps:delete")
public R delete(@RequestBody String[] phones){
timescodeFindpsService.removeByIds(Arrays.asList(phones));
return R.ok();
}
}
......@@ -3,6 +3,7 @@ package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import io.office.modules.app.annotation.Login;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -38,6 +39,7 @@ public class TimescodeRegiController {
/**
* 获取验证码
*/
@Login
@RequestMapping("/api/getVerificationCode")
// @RequiresPermissions("manage:timescoderegi:list")
public R getVerificationCode(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){
......
......@@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import io.office.modules.app.annotation.Login;
import io.office.modules.sys.controller.AbstractController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -38,6 +39,7 @@ public class UserFunctionBindingController extends AbstractController {
/**
* 查询
*/
@Login
@RequestMapping("/api/find")
public R find(){
Integer id=getUserId().intValue();
......@@ -50,6 +52,7 @@ public class UserFunctionBindingController extends AbstractController {
/**
* 修改
*/
@Login
@RequestMapping("/api/update")
// @RequiresPermissions("manage:userfunctionbinding:update")
public R update(@RequestBody Integer[] functionids){
......@@ -63,6 +66,7 @@ public class UserFunctionBindingController extends AbstractController {
/**
* 保存
*/
@Login
@RequestMapping("/api/save")
// @RequiresPermissions("manage:userfunctionbinding:save")
public R save(@RequestBody Integer[] functionids){
......@@ -78,6 +82,7 @@ public class UserFunctionBindingController extends AbstractController {
/**
* 列表
*/
@Login
@RequestMapping("/api/list")
// @RequiresPermissions("manage:userfunctionbinding:list")
public R list(@RequestParam Map<String, Object> params){
......@@ -88,6 +93,7 @@ public class UserFunctionBindingController extends AbstractController {
/**
* 信息
*/
@Login
@RequestMapping("/api/info/{id}")
// @RequiresPermissions("manage:userfunctionbinding:info")
public R info(@PathVariable("id") Integer id){
......@@ -98,6 +104,7 @@ public class UserFunctionBindingController extends AbstractController {
/**
* 删除
*/
@Login
@RequestMapping("/delete")
// @RequiresPermissions("manage:userfunctionbinding:delete")
public R delete(@RequestBody Integer[] ids){
......
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.CasesEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-09 10:33:11
*/
@Mapper
public interface CasesDao extends BaseMapper<CasesEntity> {
@Select("select * from Cases where status=#{status} and levels>#{levels} order by id desc")
List<CasesEntity> selectByStatusAndLevels(String status, String levels);
}
......@@ -5,6 +5,7 @@ import io.office.modules.manage.entity.MemberEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.repository.query.Param;
/**
......@@ -19,4 +20,10 @@ public interface MemberDao extends BaseMapper<MemberEntity> {
@Select("select * from member where username=#{userName}")
MemberEntity selectByName(@Param("userName") String userName);
@Update("UPDATE member SET pass = #{passWord} WHERE id = #{id}")
void updateByIdPassWord(@Param("id") Integer id,@Param("passWord") String passWord);
/*@Select("select * from member where username=#{userName} or firmcode=#{userName}")
MemberEntity selectByNameAndSn(@Param("userName") String userName);*/
}
......@@ -5,6 +5,7 @@ import io.office.modules.manage.entity.PartnersEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
......@@ -20,4 +21,7 @@ import java.util.Map;
public interface PartnersDao extends BaseMapper<PartnersEntity> {
List<PartnersEntity> selectPartnersList(@Param("params") Map<String, Object> params, Page page);
@Select("select * from Partners where status=#{status} and levels>#{levels} order by id desc")
List<PartnersEntity> selectByStatusAndLevels(@Param("status")String status, @Param("levels")String levels);
}
package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.GS1CodeListEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface QRcodeDao extends BaseMapper<GS1CodeListEntity> {
List<GS1CodeListEntity> getGS1CodeList();
GS1CodeListEntity getGS1ByMark();
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.TimescodeFindpsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-09 17:41:41
*/
@Mapper
public interface TimescodeFindpsDao extends BaseMapper<TimescodeFindpsEntity> {
}
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-09 10:33:11
*/
@Data
@TableName("Cases")
public class CasesEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private String title;
/**
* $column.comments
*/
private String brief;
/**
* $column.comments
*/
private String service;
/**
* $column.comments
*/
private Date registerdate;
/**
* $column.comments
*/
private Date updatedate;
/**
* $column.comments
*/
private String showtime;
/**
* $column.comments
*/
private String editor;
/**
* $column.comments
*/
private String lasteditor;
/**
* $column.comments
*/
private Integer levels;
/**
* $column.comments
*/
private Integer status;
/**
* $column.comments
*/
private String auditor;
/**
* $column.comments
*/
private Date checkdate;
}
package io.office.modules.manage.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* Created by zyf on 2021/12/10.
*/
@Setter
@Getter
@ApiModel(value = "GS1CodeList")
public class GS1CodeListEntity {
@ApiModelProperty(value = "标识符ID")
public String id;
@ApiModelProperty(value = "AI标识符名称")
public String codeName;
@ApiModelProperty(value = "AI标识符编号")
public String codeValue;
/** 是否可变长度(0 不可变 1 可变) */
@ApiModelProperty(value = "是否可变长度(0 不可变 1 可变)")
private Integer isVariable; //
/** 最后一位是否是校验位(0 否 1是) */
@ApiModelProperty(value = "最后一位是否是校验位(0 否 1是)")
private Integer isCheck;
/** 最小长度 */
@ApiModelProperty(value = "最小长度")
private Integer minLength;
/** 最大长度 */
@ApiModelProperty(value = "用户允许输入的最大长度")
private Integer maxLength;
/** 是否是日期(0 否 1是) */
@ApiModelProperty(value = "是否是日期(0 否 1是)")
private Integer isDate;
/** 是否包含小数位(0 不包含 1 包含) */
@ApiModelProperty(value = "是否包含小数位(0 不包含 1 包含)")
private Integer isDecimal;
/** 是否全是数字(0 否 1 是) */
@ApiModelProperty(value = "是否全是数字(0 否 1 是)")
private Integer isNum;
/** 格式 */
@ApiModelProperty(value = "格式")
private String format;
/** 是否需要特殊符号 */
@ApiModelProperty(value = "是否需要特殊符号(0:否 1:是)")
private Integer isFnc1;
/** 数据名称 */
@ApiModelProperty(value = "数据名称")
private String dataName;
/** 输入提示 */
@ApiModelProperty(value = "输入提示")
private String prompt;
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
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-09 17:41:41
*/
@Data
@TableName("timescode_findps")
public class TimescodeFindpsEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId(type = IdType.INPUT)
private String phone;
/**
* $column.comments
*/
private String date;
/**
* $column.comments
*/
private Integer times;
public TimescodeFindpsEntity(String phone, String date, Integer times) {
this.phone = phone;
this.date = date;
this.times = times;
}
}
package io.office.modules.manage.service;
import io.office.modules.manage.entity.GS1CodeListEntity;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* ${comments}
*
* @author zyf
* @email
* @date 2021-12-09 15:26:10
*/
@Service
public interface BarcodeGenerationService {
String createPicture(String content);
List<GS1CodeListEntity> getGS1CodeListSSCC();
GS1CodeListEntity getGS1CodeListGRAI();
}
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.CasesEntity;
import java.util.List;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-09 10:33:11
*/
public interface CasesService extends IService<CasesEntity> {
PageUtils queryPage(Map<String, Object> params);
List<CasesEntity> frontList();
}
......@@ -26,5 +26,7 @@ public interface PartnersService extends IService<PartnersEntity> {
Page<PartnersEntity> selectPartnersList(Map<String, Object> params, Page page);
R verifyPartners(PartnersEntity partnersEntity, SysUserEntity user);
List<PartnersEntity> frontList(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.TimescodeFindpsEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-09 17:41:41
*/
public interface TimescodeFindpsService extends IService<TimescodeFindpsEntity> {
PageUtils queryPage(Map<String, Object> params);
void forgotPasswordPhone(Map<String, Object> params);
void forgotPasswordEmiail(Map<String, Object> params);
}
package io.office.modules.manage.service.impl;
import io.office.common.exception.RRException;
import io.office.modules.manage.dao.QRcodeDao;
import io.office.modules.manage.entity.GS1CodeListEntity;
import io.office.modules.manage.service.BarcodeGenerationService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("barcodegenerationservice")
public class BarcodeGenerationServiceImpl implements BarcodeGenerationService {
@Autowired
private QRcodeDao qRcodeDao;
private final Log logger = LogFactory.getLog(getClass());
public static final String prefix_host="http://localhost:9091/office/";
public static final String prefix_url= "barcodegeneration/api/gensvg?type=";
@Override
public String createPicture(String content) {
String url = "";
if (content.length() > 50) {
throw new RRException("最大50位!");
}
url = prefix_host+prefix_url+"ean128&msg="+content+"&fmt=png&hrsize=5pt&hrfont=song&qz=0.6cm&wf=1&mw=0.17mm&height=1cm";
return url;
}
@Override
public List<GS1CodeListEntity> getGS1CodeListSSCC() {
return this.qRcodeDao.getGS1CodeList();
}
@Override
public GS1CodeListEntity getGS1CodeListGRAI() {
return this.qRcodeDao.getGS1ByMark();
}
}
package io.office.modules.manage.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
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;
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.CasesDao;
import io.office.modules.manage.entity.CasesEntity;
import io.office.modules.manage.service.CasesService;
@Service("casesService")
public class CasesServiceImpl extends ServiceImpl<CasesDao, CasesEntity> implements CasesService {
@Autowired
private CasesDao casesDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<CasesEntity> page = this.page(
new Query<CasesEntity>().getPage(params),
new QueryWrapper<CasesEntity>()
);
return new PageUtils(page);
}
@Override
public List<CasesEntity> frontList() {
String status="1";//代表审核状态,编辑从后台提交专题后,默认初始状态为status=0,审核成功status=1,审核失败status=-1
String levels="0";//levels代表级别,取值从0到9。其中,0代表隐藏,1级以上可以显示,9级为最高级
return casesDao.selectByStatusAndLevels(status,levels);
}
}
\ No newline at end of file
package io.office.modules.manage.service.impl;
import io.office.common.exception.RRException;
import io.office.common.utils.IPUtils;
import io.office.modules.manage.dao.MemberDao;
import io.office.modules.manage.entity.MemberEntity;
import io.office.modules.manage.utils.MD5Util;
......@@ -9,6 +10,8 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Map;
import java.util.regex.Pattern;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -28,8 +31,10 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
@Autowired
private LogLoginDao logLoginDao;
@Autowired
private MemberDao memberDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<LogLoginEntity> page = this.page(
......@@ -40,6 +45,8 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
return new PageUtils(page);
}
@Override
public void login(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) {
String userName = String.valueOf(params.get("userName")==null?"":params.get("userName"));
......@@ -47,16 +54,44 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
String verification = String.valueOf(params.get("verification")==null?"":params.get("verification"));//验证码
//session中获取验证码
//判断 验证码是否正确
//判断用户是否是手机号 是手机号调用 第三方接口登录 不是继续
int userType; //1.业务大厅 2.网站用户
if (matchPhoneNumber(userName)){
//TODO tgl 调用第三方登录接口
userType=1;
}else {
userType=2;
//查询Member表
MemberEntity memberEntity = memberDao.selectByName(userName);
//用户类型 www:为官网用户 条码卡:为条码卡用户
String source = memberEntity.getSource();
if (!"条码卡".equals(source)){//官网用户
}
}
MemberEntity user=memberDao.selectByName(userName);
String phone = user.getPhone();
String password = user.getPassword();
String password = user.getPass();
String passwordMD5 = MD5Util.md5Encrypt32Upper(passWord);
//判断密码是否正确
if (!passwordMD5.equals(password)){
throw new RRException("密码不正确!");
}
//添加登录日志 log_login
logLoginDao.insert(new LogLoginEntity(1,userName,"用户来源","条码卡号",phone,new Date(),"IP","url"));
//TODO tgl 参数不正确添加登录日志 log_login
logLoginDao.insert(new LogLoginEntity(1,userName,"用户来源","条码卡号",phone,new Date(), IPUtils.getIpAddr(request),request.getRequestURL().toString()));
}
/**
* 验证手机号 由于号码段不断的更新,只需要判断手机号有11位,并且全是数字以及1开头等
* @param phoneNumber 手机号码
* @return
*/
private static boolean matchPhoneNumber(String phoneNumber) {
String regex = "1[358][0-9]{9}";
if(phoneNumber==null||phoneNumber.length()<=0){
return false;
}
return Pattern.matches(regex, phoneNumber);
}
}
\ No newline at end of file
......@@ -55,7 +55,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
String passWord_repeat = params.get("passWord_repeat") == null ? "" : String.valueOf( params.get("passWord_repeat")); //重复密码
//判断用户名合法性
if (!checkUserName(userName)){
throw new RRException("用户名只能是数字加字母,长度2-8位");
throw new RRException("用户名不能是纯数字,长度2-8位");
}
//判断密码合法性
if (!checkPassWord(passWord)){
......@@ -77,8 +77,12 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
String subjoinReq = request.getSession().getAttribute("subjoin")==null?"":String.valueOf(request.getSession().getAttribute("subjoin"));
String telReq = request.getSession().getAttribute("tel")==null?"":String.valueOf(request.getSession().getAttribute("tel"));
Long dateReq = request.getSession().getAttribute("date")==null?0:Long.valueOf(String.valueOf(request.getSession().getAttribute("date")));//毫秒值
//获取验证码验证次数
subjoinReq="344942";
telReq="13159872863";
long l = System.currentTimeMillis();
//dateReq=(l-dateReq)/1000;
dateReq=30L;
//获取验证码验证次数
TimescodeRegiEntity timescodeRegiEntity = timescodeRegiDao.selectById(phone);
if (timescodeRegiEntity==null){
throw new RRException("该手机格未获取过验证码");
......@@ -91,7 +95,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
MemberEntity memberEntity = new MemberEntity();
memberEntity.setUsername(userName);
//MD5加密密码
memberEntity.setPassword(MD5Util.md5Encrypt32Upper(passWord));
memberEntity.setPass(MD5Util.md5Encrypt32Upper(passWord));
memberEntity.setEmail(emiail);
memberEntity.setPhone(phone);
memberEntity.setOicq("");
......
......@@ -2,6 +2,7 @@ package io.office.modules.manage.service.impl;
import io.office.modules.manage.vo.request.NewsMovieEntityVo;
import io.office.modules.sys.entity.SysUserEntity;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
......@@ -31,12 +32,12 @@ public class NewsMovieServiceImpl extends ServiceImpl<NewsMovieDao, NewsMovieEnt
} else{
newsMovieEntityQueryWrapper.gt("levels","0");
}
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("title"),"title",params.get("levels"));
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("author"),"author",params.get("author"));
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("auditor"),"auditor",params.get("auditor"));
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("keyword"),"keyword",params.get("keyword"));
newsMovieEntityQueryWrapper.eq(params.containsKey("status"),"status",params.get("status"));
newsMovieEntityQueryWrapper.eq(params.containsKey("clanguage"),"clanguage",params.get("clanguage"));
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("title") && StringUtils.isNotBlank(String.valueOf(params.get("title"))),"title",params.get("title"));
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("author")&& StringUtils.isNotBlank(String.valueOf(params.get("author"))),"author",params.get("author"));
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("auditor")&& StringUtils.isNotBlank(String.valueOf(params.get("auditor"))),"auditor",params.get("auditor"));
newsMovieEntityQueryWrapper.likeLeft(params.containsKey("keyword")&& StringUtils.isNotBlank(String.valueOf(params.get("keyword"))),"keyword",params.get("keyword"));
newsMovieEntityQueryWrapper.eq(params.containsKey("status")&& StringUtils.isNotBlank(String.valueOf(params.get("status"))),"status",params.get("status"));
newsMovieEntityQueryWrapper.eq(params.containsKey("clanguage")&& StringUtils.isNotBlank(String.valueOf(params.get("clanguage"))),"clanguage",params.get("clanguage"));
newsMovieEntityQueryWrapper.orderByDesc("releasedate");
IPage<NewsMovieEntity> page = this.page(
......
......@@ -74,4 +74,11 @@ public class PartnersServiceImpl extends ServiceImpl<PartnersDao, PartnersEntity
}
}
@Override
public List<PartnersEntity> frontList(Map<String, Object> params) {
String status="1";//代表审核状态,编辑从后台提交专题后,默认初始状态为status=0,审核成功status=1,审核失败status=-1
String levels="0";//levels代表级别,取值从0到9。其中,0代表隐藏,1级以上可以显示,9级为最高级
return partnersDao.selectByStatusAndLevels(status,levels);
}
}
\ No newline at end of file
package io.office.modules.manage.service.impl;
import io.office.common.exception.RRException;
import io.office.modules.manage.dao.MemberDao;
import io.office.modules.manage.entity.MemberEntity;
import io.office.modules.manage.utils.*;
import org.apache.commons.httpclient.NameValuePair;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
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.TimescodeFindpsDao;
import io.office.modules.manage.entity.TimescodeFindpsEntity;
import io.office.modules.manage.service.TimescodeFindpsService;
import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
@Service("timescodeFindpsService")
public class TimescodeFindpsServiceImpl extends ServiceImpl<TimescodeFindpsDao, TimescodeFindpsEntity> implements TimescodeFindpsService {
@Autowired
private TimescodeFindpsDao tFindpsDao;
@Autowired
private MemberDao memberDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<TimescodeFindpsEntity> page = this.page(
new Query<TimescodeFindpsEntity>().getPage(params),
new QueryWrapper<TimescodeFindpsEntity>()
);
return new PageUtils(page);
}
@Override
public void forgotPasswordPhone(Map<String, Object> params) {
try {
String state="";
String userName = params.get("userName")==null?"":String.valueOf(params.get("userName"));
String phone = params.get("phone")==null?"":String.valueOf(params.get("phone"));
if ("".equals(userName)){
throw new RRException("请输入用户名!");
}
if ("".equals(phone)){
throw new RRException("请输入手机号!");
}
if ("admin".equals(userName)){ //管理员不能修改密码
throw new RRException("用户名不存在!");
}
MemberEntity memberEntity = memberDao.selectByName(userName);
if (memberEntity!=null){
Integer id = memberEntity.getId();
String phone_DB = memberEntity.getPhone();
if (phone.equals(phone_DB)){
//获取6位随机字符串
String uuid = UUID.randomUUID().toString().replaceAll("-", "").substring(0,6);
//更换密码
memberDao.updateByIdPassWord(id,MD5Util.md5Encrypt32Upper(uuid));
///////// 以下添加短信发送次数验证
int flag = 1;
TimescodeFindpsEntity timescodeFindpsEntity = tFindpsDao.selectById(phone);
if (timescodeFindpsEntity!=null){
Integer times = timescodeFindpsEntity.getTimes();
String date = timescodeFindpsEntity.getDate();
String date_1 = DateUtils.getDay();
if (date_1.equals(date)){
times = times + 1;
date = date_1;
tFindpsDao.updateById(new TimescodeFindpsEntity(phone,date,times));
if (times <= 3){
flag = 1;
}else{
flag = 0;
}
}else {
times = 1;
date = date_1;
tFindpsDao.updateById(new TimescodeFindpsEntity(phone,date,times));
flag = 1;
}
}else {
String date = DateUtils.getDay();
int times = 1;
tFindpsDao.insert(new TimescodeFindpsEntity(phone,date,times));
}
if (flag==0){
throw new RRException("同一手机号每日最多操作三次!");
}else {
//调用短信接口发送短信
String res = "res";
String account = "gs1cn";
String password = "test@2021";
String userid = "9220";
String content="您在中国物品编码中心网站注册的用户昵称为:"+userName+", 密码为:"+uuid+",请妥善保管!同一手机号每日最多操作三次!【中国物品编码中心】";
String post= VerificationCodeUtils.sendVerificationCode(res,account,password,userid,content,phone);
Document document = DocumentHelper.parseText(post);
// 获取returnstatus节点对象
String returnstatus = document.selectSingleNode("//returnstatus").getText();
//获取发送结果
if (returnstatus.equals("Success")){
//保存验证码信息log_message表
state="发送成功";
}else if (returnstatus.equals("Faild")){
state="发送失败";
throw new RRException("验证码发送失败:"+ document.selectSingleNode("//message").getText());
}else {
state="发送失败";
throw new RRException("密码发送失败,请稍后再试!");
}
}
}else {
throw new RRException("手机号输入错误!");
}
}else {
throw new RRException("用户名不存在!");
}
} catch (RRException e) {
e.printStackTrace();
throw new RRException(e.getLocalizedMessage());
}catch (Exception e){
throw new RRException("密码发送失败");
}
}
@Override
public void forgotPasswordEmiail(Map<String, Object> params) {
try {
String state="";
String userName = params.get("userName")==null?"":String.valueOf(params.get("userName"));
String emiail = params.get("e-miail")==null?"":String.valueOf(params.get("e-miail"));
if ("".equals(userName)){
throw new RRException("请输入用户名!");
}
if ("".equals(emiail)){
throw new RRException("请输入邮箱!");
}
if ("admin".equals(userName)){ //管理员不能修改密码
throw new RRException("用户名不存在!");
}
MemberEntity memberEntity = memberDao.selectByName(userName);
if (memberEntity!=null){
Integer id = memberEntity.getId();
String emiail_DB = memberEntity.getEmail();
if (emiail.equals(emiail_DB)){
//获取6位随机字符串
String uuid = UUID.randomUUID().toString().replaceAll("-", "").substring(0,6);
//更换密码
memberDao.updateByIdPassWord(id,MD5Util.md5Encrypt32Upper(uuid));
//发送邮箱
String body="您在中国物品编码中心网站注册的用户昵称为:"+userName+", 密码为:"+uuid+",请妥善保管!";
MailUtlis.sendMail(userName,"中国编码用户密码找回",body,emiail);
}else {
throw new RRException("邮箱输入错误!");
}
}else {
throw new RRException("用户名不存在!");
}
} catch (RRException e) {
e.printStackTrace();
throw new RRException(e.getLocalizedMessage());
}catch (Exception e){
throw new RRException("密码发送失败");
}
}
public static void main(String[] args) throws Exception {
Properties props = new Properties(); // 用于连接邮件服务器的参数配置(发送邮件时才需要用到)
Session session= Session.getInstance(props);
}
}
\ No newline at end of file
package io.office.modules.manage.utils;
import io.office.common.exception.RRException;
import org.apache.commons.lang3.ArrayUtils;
/**
* Created by naihe on 2019/10/21.
*/
public class CheckAICodeUtil {
public static String ckeckCode(String ai, String code){
String substring = ai.substring(0, 2);
Integer intCode = Integer.valueOf(substring);
if (intCode<10){
if (intCode == 0 ){
if (code.length() != 17)throw new RRException("AI 为00 的信息需要填充17位数字");
return antoFixCheckCode(code);
}else if(intCode == 1 ){
if (code.length() != 13)throw new RRException("AI 为01 的信息需要填充13位数字");
return antoFixCheckCode(code);
}else if (intCode == 2 ){
if (code.length() != 13)throw new RRException("AI 为02 的信息需要填充13位数字");
return antoFixCheckCode(code);
}
}
return code;
}
//00 01
//返回一位校验码
private static String antoFixCheckCode(String gtinNo){
//gtinNo = "0690123456789";
int sum = 0;
char[] charArray = gtinNo.toCharArray();
ArrayUtils.reverse(charArray);
for(int i =0 ; i < charArray.length ;i++){
char n = charArray[i];
int num = Integer.parseInt(n+"");
if(i%2 != 0){
sum+=num;
}else{
sum+=num*3;
}
}
int ss = (int) Math.ceil(sum/10)*10;
if(ss < sum){
ss+=10;
}
int checkCode = ss -sum;
return checkCode+"";
}
public static void main(String[] args) {
String s="0045848885699885554";
String s1="2121384585698";
System.out.println(antoFixCheckCode(s1));
}
}
package io.office.modules.manage.utils;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;
public class HttpUtlis {
/**
* application/x-www-form-urlencoded 格式
* 发送post 数据
* @param urls
* @return
*/
public static String sendPostXwwwformurlencoded(String urls, NameValuePair[] data) {
try {
PostMethod postMethod = null;
postMethod = new PostMethod(urls) ;
postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8") ;
//参数设置,需要注意的就是里边不能传NULL,要传空字符串
postMethod.setRequestBody(data);
org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient();
int response = httpClient.executeMethod(postMethod); // 执行POST方法
String result = postMethod.getResponseBodyAsString() ;
return result;
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
}
......@@ -48,7 +48,7 @@ public class MD5Util {
* @param string 需要进行MD5加密的字符串
* @return 加密后的字符串(小写)
*/
public static String md5Encrypt32Lower(String string) {
/* public static String md5Encrypt32Lower(String string) {
byte[] hash;
try {
//创建一个MD5算法对象,并获得MD5字节数组,16*8=128位
......@@ -66,7 +66,7 @@ public class MD5Util {
hex.append(Integer.toHexString(b & 0xFF));
}
return hex.toString().toLowerCase();
}
}*/
/**
* 将二进制字节数组转换为十六进制字符串
......@@ -105,9 +105,9 @@ public class MD5Util {
}
public static void main(String[] args) {
String md5Encrypt32Lower = MD5Util.md5Encrypt32Lower("0123456789");
// String md5Encrypt32Lower = MD5Util.md5Encrypt32Lower("0123456789");
String md5Encrypt32Upper1 = MD5Util.md5Encrypt32Upper("1234");
System.out.println(md5Encrypt32Lower);
//System.out.println(md5Encrypt32Lower);
System.out.println(md5Encrypt32Upper1);
}
}
\ No newline at end of file
package io.office.modules.manage.utils;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.util.Date;
import java.util.Properties;
public class MailUtlis {
// 发件人的 邮箱 和 密码(替换为自己的邮箱和密码)
// PS: 某些邮箱服务器为了增加邮箱本身密码的安全性,给 SMTP 客户端设置了独立密码(有的邮箱称为“授权码”),
// 对于开启了独立密码的邮箱, 这里的邮箱密码必需使用这个独立密码(授权码)。
public static String myEmailAccount = "1476171348@qq.com";
//public static String myEmailAccount = "webmaster@ancc.org.cn";
public static String myEmailPassword = "esaiwmaygjpdfjge";
// 发件人邮箱的 SMTP 服务器地址, 必须准确, 不同邮件服务器地址不同, 一般(只是一般, 绝非绝对)格式为: smtp.xxx.com
// 网易126邮箱的 SMTP 服务器地址为: smtp.126.com qq为: smtp.qq.com
public static String myEmailSMTPHost = "smtp.qq.com";
// 收件人邮箱(替换为自己知道的有效邮箱)
//public static String receiveMailAccount = "13159872863@163.com";
public static void sendMail(String userName,String theme,String body,String receiveMailAccount) throws Exception {
/*public static void main(String[] args) throws Exception {*/
// 1. 创建参数配置, 用于连接邮件服务器的参数配置
Properties props = new Properties(); // 参数配置
props.setProperty("mail.transport.protocol", "smtp"); // 使用的协议(JavaMail规范要求)
props.setProperty("mail.smtp.host", myEmailSMTPHost); // 发件人的邮箱的 SMTP 服务器地址
props.setProperty("mail.smtp.auth", "true"); // 需要请求认证
// PS: 某些邮箱服务器要求 SMTP 连接需要使用 SSL 安全认证 (为了提高安全性, 邮箱支持SSL连接, 也可以自己开启),
// 如果无法连接邮件服务器, 仔细查看控制台打印的 log, 如果有有类似 “连接失败, 要求 SSL 安全连接” 等错误,
// 取消下面 /* ... */ 之间的注释代码, 开启 SSL 安全连接。
/*
// SMTP 服务器的端口 (非 SSL 连接的端口一般默认为 25, 可以不添加, 如果开启了 SSL 连接,
// 需要改为对应邮箱的 SMTP 服务器的端口, 具体可查看对应邮箱服务的帮助,
// QQ邮箱的SMTP(SLL)端口为465或587, 其他邮箱自行去查看)
final String smtpPort = "465";
props.setProperty("mail.smtp.port", smtpPort);
props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.socketFactory.port", smtpPort);
*/
// 2. 根据配置创建会话对象, 用于和邮件服务器交互
Session session = Session.getInstance(props);
// 设置为debug模式, 可以查看详细的发送 log
session.setDebug(true);
// 3. 创建一封邮件
MimeMessage message = createMimeMessage(session, myEmailAccount, receiveMailAccount,userName,theme,body);
// 4. 根据 Session 获取邮件传输对象
Transport transport = session.getTransport();
// 5. 使用 邮箱账号 和 密码 连接邮件服务器, 这里认证的邮箱必须与 message 中的发件人邮箱一致, 否则报错
//
// PS_01: 如果连接服务器失败, 都会在控制台输出相应失败原因的log。
// 仔细查看失败原因, 有些邮箱服务器会返回错误码或查看错误类型的链接,
// 根据给出的错误类型到对应邮件服务器的帮助网站上查看具体失败原因。
//
// PS_02: 连接失败的原因通常为以下几点, 仔细检查代码:
// (1) 邮箱没有开启 SMTP 服务;
// (2) 邮箱密码错误, 例如某些邮箱开启了独立密码;
// (3) 邮箱服务器要求必须要使用 SSL 安全连接;
// (4) 请求过于频繁或其他原因, 被邮件服务器拒绝服务;
// (5) 如果以上几点都确定无误, 到邮件服务器网站查找帮助。
//
transport.connect(myEmailAccount, myEmailPassword);
// 6. 发送邮件, 发到所有的收件地址, message.getAllRecipients() 获取到的是在创建邮件对象时添加的所有收件人, 抄送人, 密送人
transport.sendMessage(message, message.getAllRecipients());
// 7. 关闭连接
transport.close();
}
/**
* 创建一封只包含文本的简单邮件
*
* @param session 和服务器交互的会话
* @param sendMail 发件人邮箱
* @param receiveMail 收件人邮箱
* @return
* @throws Exception
*/
public static MimeMessage createMimeMessage(Session session, String sendMail, String receiveMail,String userName,String theme,String body) throws Exception {
// 1. 创建一封邮件
MimeMessage message = new MimeMessage(session);
// 2. From: 发件人
message.setFrom(new InternetAddress(sendMail, "中国编码", "UTF-8"));
// 3. To: 收件人(可以增加多个收件人、抄送、密送)
message.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(receiveMail, userName+"用户", "UTF-8"));
// 4. Subject: 邮件主题
message.setSubject(theme, "UTF-8");
// 5. Content: 邮件正文(可以使用html标签)
message.setContent(body, "text/html;charset=UTF-8");
// 6. 设置发件时间
message.setSentDate(new Date());
// 7. 保存设置
message.saveChanges();
return message;
}
}
\ No newline at end of file
package io.office.modules.manage.utils;
import org.apache.commons.httpclient.NameValuePair;
//发送验证码工具类
public class VerificationCodeUtils {
/**
* 发送手机短信
* @param res
* @param account 用户名
* @param password 密码
* @param userid 用户ID
* @param content 短信内容
* @param phone 手机号
* @return
*/
public static String sendVerificationCode(String res, String account, String password, String userid, String content, String phone) {
NameValuePair[] data = {
new NameValuePair("action", "send"),
new NameValuePair("userid", userid),
new NameValuePair("account", account),
new NameValuePair("password", password),
new NameValuePair("mobile", phone),
new NameValuePair("content", content),
new NameValuePair("sendTime", DateUtils.getDay()),
new NameValuePair("mobilenumber", "2"),
new NameValuePair("countnumber", "2"),
new NameValuePair("telephonenumber", "0"),
};
return HttpUtlis.sendPostXwwwformurlencoded("http://39.106.204.178:8888/sms.aspx",data);
}
}
package io.office.modules.manage.vo.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.NotBlank;
import java.io.Serializable;
/**
* Created by zyf on 2021/12/10.
*/
@Setter
@Getter
public class CheckAIVo implements Serializable {
@NotBlank(message = "AI标识符不能为空!!!")
@ApiModelProperty(value = "AI标识符")
public String code;
@NotBlank(message = "输入的内容不能为空!!!")
@ApiModelProperty(value = "输入的内容")
public String content;
}
Manifest-Version: 1.0
Built-By: wangll
Build-Jdk: 1.8.0_111
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Tue Jun 16 15:30:10 CST 2020
version=2.2.0-SNAPSHOT
groupId=net.sf.barcode4j
m2e.projectName=barcode4j-light
m2e.projectLocation=D\:\\\u5F00\u53D1\u5DE5\u5177\\java64\\barcode4j-develop\\barcode4j-light
artifactId=barcode4j-light
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j-parent</artifactId>
<version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>barcode4j-light</artifactId>
<packaging>jar</packaging>
<name>barcode4j-light</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>barcode4j-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<!-- <dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
</dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
org.krysalis.barcode4j.impl.codabar.CodabarBean
org.krysalis.barcode4j.impl.code39.Code39Bean
org.krysalis.barcode4j.impl.code128.Code128Bean
org.krysalis.barcode4j.impl.code128.EAN128Bean
org.krysalis.barcode4j.impl.int2of5.Interleaved2Of5Bean
org.krysalis.barcode4j.impl.int2of5.ITF14Bean
org.krysalis.barcode4j.impl.upcean.EAN13Bean
org.krysalis.barcode4j.impl.upcean.EAN8Bean
org.krysalis.barcode4j.impl.upcean.UPCABean
org.krysalis.barcode4j.impl.upcean.UPCEBean
org.krysalis.barcode4j.impl.postnet.POSTNETBean
org.krysalis.barcode4j.impl.fourstate.RoyalMailCBCBean
org.krysalis.barcode4j.impl.fourstate.USPSIntelligentMailBean
org.krysalis.barcode4j.impl.pdf417.PDF417Bean
org.krysalis.barcode4j.impl.datamatrix.DataMatrixBean
org.krysalis.barcode4j.impl.qr.QRCodeBean
00=n17+cd
01=n13+cd
02=n13+cd
10=an1-20
11=d6
13=d6
15=d6
17=d6
20=n2
21=an-20
22=an-29
23x=e
230=n1
231=n10
232=n19
240=an-30
241=an-30
250=an-30
251=an-30
252=n2
30=n-8
310x=n6
311x=n6
312x=n6
313x=n6
314x=n6
315x=n6
316x=n6
32xx=n6
330x=n6
331x=n6
332x=n6
333x=n6
334x=n6
335x=n6
336x=n6
337x=n6
34xx=n6
350x=n6
351x=n6
352x=n6
353x=n6
354x=n6
355x=n6
356x=n6
36xx=n6
37=n-8
390x=n-15
391x=n4-18
392x=n-15
393x=n4-18
400=an-30
401=an-30
402=n17
403=an-30
# 410=n12+cd
# 411=n12+cd
# 412=n12+cd
# 413=n12+cd
# 414=n12+cd
# 415=n12+cd
410=n13
411=n13
412=n13
413=n13
414=n13
415=n13
420=an-9
#???420=an-20
#############################
#421=an4-12
421=n3+an1-9
##############
422=n3
8001=n14
8002=an-20
#############################
#8003=an15-30
8003=n13+cd+an1-16
##############
8004=an-30
8005=n6
#############################
#8006=n18
8006=n13+cd+n2+n2
##############
8007=an-30
8008=n9-12
8018=n18
8020=an-25
#?Typo??8020=an25
8100=n6
8101=n10
8102=n2
9x=an-30
#############################
#91=n2+n9+n2-8+cd0
#420=n5
##############
7001=n13
7002=an-30
7003=n10
7004=n-4
7005=an12
7006=n6
7007=d6
7008=an-3
7009=an-10
7010=an-2
7020=an-20
7021=an-20
7022=an-20
7023=an-30
703s=an4-30
710=an-20
711=an-20
712=an-20
713=an-20
714=an-20
242=n1-6
243=an1-20
253=an14-30
254=an1-20
255=n14-25
1;H;2;E;3
2;B;10;A;0
3;J;12;C;8
4;F;5;G;11
5;I;9;D;1
6;A;1;F;12
7;C;5;B;8
8;E;4;J;11
9;G;3;I;10
10;D;9;H;6
11;F;11;B;4
12;I;5;C;12
13;J;10;A;2
14;H;1;G;7
15;D;6;E;9
16;A;3;I;6
17;G;4;C;7
18;B;1;J;9
19;H;10;F;2
20;E;0;D;8
21;G;2;A;4
22;I;11;B;0
23;J;8;D;12
24;C;6;H;7
25;F;1;E;10
26;B;12;G;9
27;H;3;I;0
28;F;8;J;7
29;E;6;C;10
30;D;4;A;5
31;I;4;F;7
32;H;11;B;9
33;G;0;J;6
34;A;6;E;8
35;C;1;D;2
36;F;9;I;12
37;E;11;G;1
38;J;5;H;4
39;D;3;B;2
40;A;7;C;0
41;B;3;E;1
42;G;10;D;5
43;I;7;J;4
44;C;11;F;6
45;A;8;H;12
46;E;2;I;1
47;F;10;D;0
48;J;3;A;9
49;G;5;C;4
50;H;8;B;7
51;F;0;E;5
52;C;3;A;10
53;G;12;J;2
54;D;11;B;6
55;I;8;H;9
56;F;4;A;11
57;B;5;C;2
58;J;1;E;12
59;I;3;G;6
60;H;0;D;7
61;E;7;H;5
62;A;12;B;11
63;C;9;J;0
64;G;8;F;3
65;D;10;I;2
<?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.QRcodeDao">
<select id="getGS1CodeList" resultType="io.office.modules.manage.entity.GS1CodeListEntity">
SELECT id, CONCAT(mark,'(',meaning,')') as codeName,mark codeValue, is_variable isVariable, min_length minLength, enable_max_length maxLength,
is_decimal isDecimal,is_check isCheck, is_num isNum, format, is_fnc1 isFnc1, data_name dataName ,is_date isDate, prompt
FROM gs1_standard
</select>
<select id="getGS1ByMark" resultType="io.office.modules.manage.entity.GS1CodeListEntity">
SELECT id, CONCAT(mark,'(',meaning,')') as codeName,mark codeValue, is_variable isVariable, min_length minLength, enable_max_length maxLength,
is_decimal isDecimal,is_check isCheck, is_num isNum, format, is_fnc1 isFnc1, data_name dataName ,is_date isDate, prompt
FROM gs1_standard where mark='8003'
</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