|
|
@@ -10,6 +10,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
@@ -20,29 +21,25 @@ import com.jeeplus.common.constant.CacheNames;
|
|
|
import com.jeeplus.common.constant.CommonConstants;
|
|
|
import com.jeeplus.common.redis.RedisUtils;
|
|
|
import com.jeeplus.common.utils.RequestUtils;
|
|
|
+import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.flowable.feign.IHumanApi;
|
|
|
import com.jeeplus.sys.domain.*;
|
|
|
import com.jeeplus.sys.feign.IDictApi;
|
|
|
-import com.jeeplus.sys.feign.IOfficeApi;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.mapper.OfficeMapper;
|
|
|
+import com.jeeplus.sys.mapper.UserSignatureInfoMapper;
|
|
|
import com.jeeplus.sys.mapper.UserMapper;
|
|
|
import com.jeeplus.sys.service.dto.*;
|
|
|
import com.jeeplus.sys.service.mapstruct.CertWrapper;
|
|
|
import com.jeeplus.sys.service.mapstruct.UserWrapper;
|
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.validation.constraints.NotNull;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -74,6 +71,9 @@ public class UserService extends ServiceImpl<UserMapper, User> {
|
|
|
private OfficeMapper officeMapper;
|
|
|
|
|
|
@Autowired
|
|
|
+ private UserSignatureInfoMapper userSignatureInfoMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private SysConfigService sysConfigService;
|
|
|
|
|
|
@Autowired
|
|
|
@@ -660,15 +660,50 @@ public class UserService extends ServiceImpl<UserMapper, User> {
|
|
|
* @return
|
|
|
*/
|
|
|
public IPage<UserDTO> findPage1(UserDTO dto, Page<UserDTO> page) {
|
|
|
- OfficeDTO officeDTO = dto.getCompanyDTO();
|
|
|
- String companyId = "";
|
|
|
- if (null != officeDTO) {
|
|
|
- companyId = officeDTO.getId();
|
|
|
+ QueryWrapper<UserDTO> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("post.NAME","签字注师2");
|
|
|
+ queryWrapper.eq("post.del_flag ","0");
|
|
|
+ queryWrapper.eq("sc.type","6");
|
|
|
+ if(StringUtils.isNotBlank(dto.getCompanyDTO().getId())){
|
|
|
+ queryWrapper.eq("a.company_id",dto.getCompanyDTO().getId());
|
|
|
+ }
|
|
|
+ IPage<UserDTO> list1 = baseMapper.findUserList2(page, queryWrapper);
|
|
|
+ //List<UserDTO> list1 = baseMapper.findList1(dto, companyId);
|
|
|
+ return list1;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *根据签字注师id查询签章份数
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public UserDTO findCountById(String userId) {
|
|
|
+ QueryWrapper<UserDTO> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("a.id",userId);
|
|
|
+ UserDTO result = baseMapper.findCountById(queryWrapper);
|
|
|
+ Integer accountantUserCount = getAccountantUserCount(result.getId());
|
|
|
+ result.setAccountantUserCount(accountantUserCount);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *添加默认的签字注师1,100次可签章份数
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void addDefaultSignatureCount(String userId) {
|
|
|
+ UserSignatureInfo info = userSignatureInfoMapper.findById(userId);
|
|
|
+ if(info == null){
|
|
|
+ UserSignatureInfo userSignatureInfo = new UserSignatureInfo();
|
|
|
+ userSignatureInfo.setSignatureCount("100");
|
|
|
+ userSignatureInfo.setUserId(userId);
|
|
|
+ userSignatureInfo.setCreateById("1");
|
|
|
+ userSignatureInfo.setCreateById("1");
|
|
|
+ userSignatureInfoMapper.insert(userSignatureInfo);
|
|
|
}
|
|
|
- List<UserDTO> list1 = baseMapper.findList1(dto, companyId);
|
|
|
- // 将List<UserDTO>数据设置到Page对象中
|
|
|
- page.setRecords(list1);
|
|
|
- return page;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -978,7 +1013,17 @@ public class UserService extends ServiceImpl<UserMapper, User> {
|
|
|
users = Lists.newArrayList();
|
|
|
}
|
|
|
return users;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改注会的可签章份数
|
|
|
+ */
|
|
|
+ public void updateSignatureCount(String id, String signatureCount) {
|
|
|
+ userSignatureInfoMapper.update(
|
|
|
+ null,
|
|
|
+ new UpdateWrapper<UserSignatureInfo>()
|
|
|
+ .set("signature_count", signatureCount)
|
|
|
+ .eq("user_id", id)
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|