Merge branch 'test' into dev-lili-330

# Conflicts:
#	jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/OcrTaskPackageMapper.xml
pull/18/head
LILI 1 year ago
commit 22a78f1c07

@ -20,7 +20,7 @@ public interface CacheConstants {
//缓存超时时间,单位:秒,目前验证码使用
int CACHE_TIME = 300;//300;
//缓存超时时间,单位:秒,目前ai统计使用 24小时
//缓存超时时间,单位:秒,目前ai统计使用 24小时,获取验证码在使用
int TOOLSCOUNT_TENANTID_CACHE_TIME = 86400;
//保存ai统计租户id对象

@ -84,7 +84,7 @@ public class SmsLoginServiceImpl implements SmsLoginService {
iCacheManager.put(CacheConstants.USER_PHONE_MODEL_NAME,phone,code,CacheConstants.CACHE_TIME);
// 更新手机号当天获取验证码的次数
iCacheManager.put(CacheConstants.USER_PHONE_MODEL_NAME, cacheKey, count + 1, CacheConstants.CACHE_TIME);
iCacheManager.put(CacheConstants.USER_PHONE_MODEL_NAME, cacheKey, count + 1, CacheConstants.TOOLSCOUNT_TENANTID_CACHE_TIME);
//保存验证码到 缓存中
return ResultVoUtil.success(code);

@ -59,4 +59,26 @@ public class OcrDictionaryController {
}
return new ResultVo<>(ResultVo.ERROR,"根据field查询不到字典组!");
}
/**
*valuelable
*
*mail.zhangyong@gmail.com
*2024-01-14 10:27:02
**/
@GetMapping("/getLabelByValue")
@ResponseBody
public ResultVo<IPage<OcrDictionary>> getLabelByValue(HttpServletResponse response,
HttpServletRequest request,
@RequestParam(name="field", defaultValue="upName",required = true) String field,
@RequestParam(name="value", defaultValue="",required = true) String value) {
String tenantId = request.getHeader("X-Tenant-Id");
if(StringUtils.isBlank(tenantId)){
return ResultVoUtil.error("租户主键不能为空");
}
String result= ocrDictionaryService.queryLabelByValue(field,value,tenantId);
return new ResultVo<>(ResultVo.ERROR,result);
}
}

@ -66,38 +66,38 @@ public class OcrSUserTController {
if(map.get("newPassword").equals(map.get("rePasswrod"))){
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
UpdateWrapper<OcrSUserT> updatewrapper = new UpdateWrapper<>();
updatewrapper.eq("LOGINNAME", map.get("loginname")).set("PASSWORD",bCryptPasswordEncoder.encode(map.get("newPassword")));
updatewrapper.eq("MOBILE", map.get("loginname")).set("PASSWORD",bCryptPasswordEncoder.encode(map.get("newPassword")));
boolean update = sUserTService.update(updatewrapper);
if(update){
// return new ResponseEntity<Object>("密码重设成功!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"密码重设成功!");
return ResultVoUtil.success(ResultVo.SUCCESS,"密码重设成功!");
}
}else{
// return new ResponseEntity<Object>("两次密码输入不一致!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"两次密码输入不一致!");
return ResultVoUtil.error(ResultVo.ERROR,"两次密码输入不一致!");
}
}else{
// return new ResponseEntity<Object>("请再次输入新密码!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请再次输入新密码!");
return ResultVoUtil.error(ResultVo.ERROR,"请再次输入新密码!");
}
}else{
// return new ResponseEntity<Object>("请输入新密码!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入新密码!");
return ResultVoUtil.error(ResultVo.ERROR,"请输入新密码!");
}
}else {
// return new ResponseEntity<Object>("请输入同时包含英文、数字的8~16位密码",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入同时包含英文、数字的8~16位密码");
return ResultVoUtil.error(ResultVo.ERROR,"请输入同时包含英文、数字的8~16位密码");
}
return ResultVoUtil.error(ResultVo.SUCCESS);
return ResultVoUtil.error(ResultVo.ERROR);
}
@ApiOperation(value = "忘记密码", notes = "忘记密码")

@ -110,7 +110,11 @@ public class OcrTaskPackageController extends BaseController {
@RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize,
HttpServletRequest req) {
Page<Map<String, Object>> result = ocrTaskPackageService.getPackageList(pageNo, pageSize, packageName);
String tenantId = req.getHeader("X-Tenant-Id");
if(StringUtils.isBlank(tenantId)){
return ResultVoUtil.error("租户主键不能为空");
}
Page<Map<String, Object>> result = ocrTaskPackageService.getPackageList(pageNo, pageSize, packageName,tenantId);
return ResultVoUtil.success(result);
}

@ -20,5 +20,6 @@ import java.util.Map;
@Mapper
public interface OcrTaskPackageMapper extends BaseMapper<OcrTaskPackage> {
Page<Map<String,Object>> getPackageList(Page<Map<String, Object>> page, @Param("packageName") String packageName);
Page<Map<String,Object>> getPackageList(Page<Map<String, Object>> page, @Param("packageName") String packageName,
@Param("tenantId") String tenantId);
}

@ -1,9 +1,12 @@
package cn.jyjz.xiaoyao.ocr.dataobject;
import cn.jyjz.xiaoyao.common.base.jsonDomain.DateNotimeSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
/**
* ClassName $className$.java
@ -12,6 +15,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
* Date 2024/3/22 07:09
*/
@TableName(value = "ocr_picture_info")
@Data
public class OcrPictureInfo {
/**
*
@ -47,12 +51,14 @@ public class OcrPictureInfo {
*
*/
@TableField(value = "upload_time")
@JsonSerialize(using = DateNotimeSerializer.class)
private Long uploadTime;
/**
*
*/
@TableField(value = "create_time")
@JsonSerialize(using = DateNotimeSerializer.class)
private Long createTime;
/**
@ -65,6 +71,7 @@ public class OcrPictureInfo {
*
*/
@TableField(value = "tag_time")
@JsonSerialize(using = DateNotimeSerializer.class)
private Long tagTime;
/**
@ -73,183 +80,4 @@ public class OcrPictureInfo {
@TableField(value = "`source`")
private String source;
/**
*
*
* @return id -
*/
public Long getId() {
return id;
}
/**
*
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
*
*
* @return picture_id -
*/
public Long getPictureId() {
return pictureId;
}
/**
*
*
* @param pictureId
*/
public void setPictureId(Long pictureId) {
this.pictureId = pictureId;
}
/**
*
*
* @return img_size -
*/
public String getImgSize() {
return imgSize;
}
/**
*
*
* @param imgSize
*/
public void setImgSize(String imgSize) {
this.imgSize = imgSize;
}
/**
*
*
* @return img_format -
*/
public String getImgFormat() {
return imgFormat;
}
/**
*
*
* @param imgFormat
*/
public void setImgFormat(String imgFormat) {
this.imgFormat = imgFormat;
}
/**
*
*
* @return img_measure -
*/
public String getImgMeasure() {
return imgMeasure;
}
/**
*
*
* @param imgMeasure
*/
public void setImgMeasure(String imgMeasure) {
this.imgMeasure = imgMeasure;
}
/**
*
*
* @return upload_time -
*/
public Long getUploadTime() {
return uploadTime;
}
/**
*
*
* @param uploadTime
*/
public void setUploadTime(Long uploadTime) {
this.uploadTime = uploadTime;
}
/**
*
*
* @return create_time -
*/
public Long getCreateTime() {
return createTime;
}
/**
*
*
* @param createTime
*/
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
/**
*
*
* @return img_space -
*/
public String getImgSpace() {
return imgSpace;
}
/**
*
*
* @param imgSpace
*/
public void setImgSpace(String imgSpace) {
this.imgSpace = imgSpace;
}
/**
*
*
* @return tag_time -
*/
public Long getTagTime() {
return tagTime;
}
/**
*
*
* @param tagTime
*/
public void setTagTime(Long tagTime) {
this.tagTime = tagTime;
}
/**
*
*
* @return source -
*/
public String getSource() {
return source;
}
/**
*
*
* @param source
*/
public void setSource(String source) {
this.source = source;
}
}

@ -34,5 +34,5 @@ public interface IOcrTaskPackageService extends IService<OcrTaskPackage> {
* @param packageName
* @return
*/
Page<Map<String, Object>> getPackageList(Integer pageNo, Integer pageSize, String packageName);
Page<Map<String, Object>> getPackageList(Integer pageNo, Integer pageSize, String packageName,String tenantId);
}

@ -2,7 +2,6 @@ package cn.jyjz.xiaoyao.ocr.service;
import cn.jyjz.xiaoyao.common.mybatisplus.base.BaseService;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrDictionary;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrDictionaryGroup;
import liquibase.pro.packaged.L;
/**
*
@ -27,4 +26,14 @@ public interface OcrDictionaryService extends BaseService<OcrDictionary> {
* @return
*/
OcrDictionaryGroup queryGroupByField(String field);
/**
* value lable
*
* @param field
* @param value 1.value(xxx) ,2.value(xxx,xxx)
* @param tenantId
* @return
*/
String queryLabelByValue(String field, String value, String tenantId);
}

@ -1,5 +1,7 @@
package cn.jyjz.xiaoyao.ocr.service.impl;
import cn.hutool.core.util.ArrayUtil;
import cn.jyjz.xiaoyao.common.base.util.StringUtils;
import cn.jyjz.xiaoyao.common.mybatisplus.base.BaseServiceImpl;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrDictionaryDao;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrDictionaryGroupDao;
@ -8,9 +10,12 @@ import cn.jyjz.xiaoyao.ocr.dataobject.OcrDictionaryGroup;
import cn.jyjz.xiaoyao.ocr.service.OcrDictionaryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
/**
@ -47,4 +52,33 @@ public class OcrDictionaryServiceImpl extends BaseServiceImpl<OcrDictionaryDao,
}
return null;
}
@Override
public String queryLabelByValue(String field, String value, String tenantId) {
if(!StringUtils.isNotBlank(value)){
return null;
}
OcrDictionaryGroup dictionaryGroup = this.queryGroupByField(field);
if(dictionaryGroup==null){
return null;
}
String[] values = value.split(",");
if(values!=null && values.length>0){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("group_id",dictionaryGroup.getId());
queryWrapper.eq("tenant_id",tenantId);
queryWrapper.in("value",values);
List<OcrDictionary> dictionaries = baseMapper.selectList(queryWrapper);
List<String> result = new ArrayList<>();
if(dictionaries!=null && dictionaries.size()>0){
for (OcrDictionary dictionary: dictionaries) {
result.add(dictionary.getLable());
}
return String.join(",",result);
}
}
return null;
}
}

@ -743,15 +743,14 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
break;
}
String formatName = ImageIO.getImageReadersByMIMEType("image/jpeg").next().getFormatName();
System.out.println("Image Size: " + imageSize + " bytes");
System.out.println("Width: " + width + ", Height: " + height);
System.out.println("Color Space: " + colorSpaceType);
info.setCreateTime(System.currentTimeMillis());
info.setUploadTime(System.currentTimeMillis());
info.setTagTime(System.currentTimeMillis());
info.setImgSpace(colorSpaceType);
info.setImgSize(imageSize.toString());
info.setImgMeasure(width + "x" + height);
info.setImgFormat(formatName);
info.setSource("无量云2.0");
return info;
} else {
log.info("Cannot read image from URL.");

@ -19,6 +19,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -47,6 +48,8 @@ public class OcrTaskPackageServiceImpl extends ServiceImpl<OcrTaskPackageMapper,
private OcrFieldService fieldService;
@Resource
private UserService userService;
@Resource
private OcrDictionaryService ocrDictionaryService;
@Override
public ResultVo saveTaskPackage(OcrTaskPackageDto ocrTaskPackage) {
@ -65,9 +68,9 @@ public class OcrTaskPackageServiceImpl extends ServiceImpl<OcrTaskPackageMapper,
}
@Override
public Page<Map<String, Object>> getPackageList(Integer pageNo, Integer pageSize, String packageName) {
public Page<Map<String, Object>> getPackageList(Integer pageNo, Integer pageSize, String packageName,String tenantId) {
Page<Map<String, Object>> page = new Page<>(pageNo, pageSize);
Page<Map<String, Object>> result = taskPackageMapper.getPackageList(page, packageName);
Page<Map<String, Object>> result = taskPackageMapper.getPackageList(page, packageName,tenantId);
if (CollectionUtils.isNotEmpty(result.getRecords())) {
List<OcrField> list = fieldService.list(new LambdaQueryWrapper<OcrField>().eq(OcrField::getReviewType, 1));
List<Map<String, Object>> records = result.getRecords();
@ -83,7 +86,7 @@ public class OcrTaskPackageServiceImpl extends ServiceImpl<OcrTaskPackageMapper,
map.put(field, "");
}
}
disMapData(map);
disMapData(map,tenantId);
map.putAll(record);
record.putAll(map);
}
@ -92,12 +95,12 @@ public class OcrTaskPackageServiceImpl extends ServiceImpl<OcrTaskPackageMapper,
return result;
}
private void disMapData(Map map) {
Object field1 = map.get("field1");
private void disMapData(Map map,String tenantId) {
Object field1 = map.get("upuserid");
if (ObjectUtils.isNotEmpty(field1)) {
User user = userService.getById(field1.toString());
if (ObjectUtils.isNotEmpty(user)) {
map.put("field1", user.getUsername());
String result = ocrDictionaryService.queryLabelByValue("person",field1.toString(),tenantId);
if (!StringUtils.isEmpty(result)) {
map.put("upuserid", result);
}
}
}

@ -192,7 +192,9 @@ public class PictureDisposeTask implements Runnable{
picture.setField11(pictureSourceResult.getVisitDate());
//提报日期时间戳
picture.setSubmitDateTimestamp(pictureSourceResult.getSubmitTime());
// picture.setSubmitDateTimestamp(pictureSourceResult.getSubmitTime());
picture.setSubmitDateTimestamp(System.currentTimeMillis());
picture.setPhotoDateTimestamp(System.currentTimeMillis());
System.out.println("SubmitDateTimestamp1=================>>>>>>>"+pictureSourceResult.getSubmitTime());
System.out.println("SubmitDateTimestamp2=================>>>>>>>"+picture.getSubmitDateTimestamp());

@ -9,10 +9,10 @@
LEFT JOIN ocr_check_duplicate t2 ON t1.check_duplicate_id = t2.id
left join s_user_t t3 on t1.create_by = t3.ID
<where>
t1.tenant_id = #{tenantId}
<if test="packageName != null and packageName != ''">
t1.name like concat('%', #{packageName}, '%') or T3.USERNAME like concat('%', #{packageName}, '%')
and t1.name like concat('%', #{packageName}, '%') or T3.USERNAME like concat('%', #{packageName}, '%')
</if>
</where>
ORDER BY T1.create_time desc
</select>
</mapper>
Loading…
Cancel
Save