Procházet zdrojové kódy

- [ ] 业务模版及公证书模版中模版管理页面的列表,要加搜索:产品类型、合同类型、文书类型、所属机构 productType 产品类型 ,contractType 合同类型,code 文书类型,notaryOfficeId 所属机构
- [ ] 订单列表筛选字段加“公证员姓名”、“受理咨询号” notaryUserName 公证员姓名 ,consultNo 受理咨询号
- [ ] 用户列表上要加个“机构”筛选条件
- [ ] 后台用户管理禁用用户后,APP端依然可以登录。应是APP端也要提示无法登录,与后台管理平台一致

- [ ] 订单列表中“姓名”字段的搜索无效,“姓名”改为“当事人”,要模糊查询;“客户经理”字段不支持模糊查询
- [ ] 短信模版列表中“短信内容”字段的搜索无效
- [ ] 在线用户列表中的全表模糊搜索无效,表格中“用户名”改为“登录名”,“用户昵称”改为“姓名”,“部门”去掉,加一列“所属机构”

everydatestudy před 3 roky
rodič
revize
864b218518

+ 4 - 1
eladmin-security/src/main/java/me/zhengjie/security/service/dto/OnlineUserDto.java

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.annotation.JSONField;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
+import lombok.ToString;
+
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
 
@@ -14,6 +16,7 @@ import java.util.List;
 @Getter
 @Setter
 @NoArgsConstructor
+@ToString
 public class OnlineUserDto implements UserDetails {
     private Long userId;
     private String username;
@@ -29,7 +32,7 @@ public class OnlineUserDto implements UserDetails {
     private boolean enabled;
     private List<Long> dataScopes;
     private List<GrantedAuthority> authorities;
-
+    private String orgName;
     @Override
     public List<GrantedAuthority> getAuthorities() {
         return authorities;

+ 15 - 15
eladmin-sign/src/main/java/me/zhengjie/sign/connector/HttpConnector.java

@@ -54,21 +54,21 @@ public class HttpConnector implements InitializingBean {
 
     @Override
     public void afterPropertiesSet() throws Exception {
-        Path temp = Paths.get(new File(HttpConnector.class.getClassLoader().getResource("").getPath().concat(keyStorePath)).getAbsolutePath());
-        Files.copy(HttpClient.class.getClassLoader().getResourceAsStream(keyStorePath), temp, StandardCopyOption.REPLACE_EXISTING);
-        keyStorePath = temp.toFile().getPath();
-        trustStorePath = keyStorePath;
-        httpClient.config.connectTimeout = connectTimeout;
-        httpClient.config.readTimeout = readTimeout;
-        httpClient.httpConfig.userAgent = "TrustSign FEP";
-        httpClient.httpConfig.contentType = MIMEType.FORM;
-        httpClient.httpConfig.accept = MIMEType.JSON;
-        if (isSSL) {
-            httpClient.initSSL(keyStorePath, keyStorePassword.toCharArray(), trustStorePath, trustStorePassword.toCharArray());
-        }
-        if (!url.endsWith("/")) {
-            url += "/";
-        }
+//        Path temp = Paths.get(new File(HttpConnector.class.getClassLoader().getResource("").getPath().concat(keyStorePath)).getAbsolutePath());
+//        Files.copy(HttpClient.class.getClassLoader().getResourceAsStream(keyStorePath), temp, StandardCopyOption.REPLACE_EXISTING);
+//        keyStorePath = temp.toFile().getPath();
+//        trustStorePath = keyStorePath;
+//        httpClient.config.connectTimeout = connectTimeout;
+//        httpClient.config.readTimeout = readTimeout;
+//        httpClient.httpConfig.userAgent = "TrustSign FEP";
+//        httpClient.httpConfig.contentType = MIMEType.FORM;
+//        httpClient.httpConfig.accept = MIMEType.JSON;
+//        if (isSSL) {
+//            httpClient.initSSL(keyStorePath, keyStorePassword.toCharArray(), trustStorePath, trustStorePassword.toCharArray());
+//        }
+//        if (!url.endsWith("/")) {
+//            url += "/";
+//        }
     }
 
     public String post(String uri, String data, String signature) {

+ 69 - 65
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/vo/NotaryOrderQueryReq.java

@@ -17,69 +17,73 @@ import java.time.LocalDateTime;
 @Data
 public class NotaryOrderQueryReq extends BaseRequest {
 
-    /**
-     * 合同
-     */
-    private String contractNo;
-
-
-    /**
-     * 借款人姓名
-     */
-    private String loanName;
-
-
-    /**
-     * 手机号
-     */
-    private String phone;
-
-    /**
-     * 证件号
-     */
-    private String idCard;
-
-    /**
-     * 借款起始金额
-     */
-    private String loanMoneyStart;
-
-    /**
-     * 借款终止金额
-     */
-    private String loanMoneyEnd;
-
-    /**
-     * 所属银行
-     */
-    private String bankName;
-
-    /**
-     * 客户经理名称
-     */
-    private String customerName;
-
-    private String status;
-
-   //开始时间
-    private String startDate;
-    //结束时间
-    private String endDate;
-
-
-    // 查询使用
-    private String id;
-
-    // 退户原因
-    private String returnReason;
-    // 驳回原因
-    private String rejectReason;
-    // 当事人 通过 使用入参
-    private String partyId;
-    private String roleId; // 1 借款人  2 抵押人  3 担保人
-
-    private String businessNo;
-    private String orderType;
-    private String prodId;
-    private String content;
+	/**
+	 * 合同
+	 */
+	private String contractNo;
+
+	/**
+	 * 借款人姓名
+	 */
+	private String loanName;
+
+	/**
+	 * 手机号
+	 */
+	private String phone;
+
+	/**
+	 * 证件号
+	 */
+	private String idCard;
+
+	/**
+	 * 借款起始金额
+	 */
+	private String loanMoneyStart;
+
+	/**
+	 * 借款终止金额
+	 */
+	private String loanMoneyEnd;
+
+	/**
+	 * 所属银行
+	 */
+	private String bankName;
+
+	/**
+	 * 客户经理名称
+	 */
+	private String customerName;
+
+	private String status;
+
+	// 开始时间
+	private String startDate;
+	// 结束时间
+	private String endDate;
+
+	// 查询使用
+	private String id;
+
+	// 退户原因
+	private String returnReason;
+	// 驳回原因
+	private String rejectReason;
+	// 当事人 通过 使用入参
+	private String partyId;
+	private String roleId; // 1 借款人 2 抵押人 3 担保人
+
+	private String businessNo;
+	private String orderType;
+	private String prodId;
+	private String content;
+	// 咨询受理号
+	private String consultNo;
+	//公证员姓名
+	private String notaryUserName;
+	//当事人
+	private String name;
+	
 }

+ 2 - 1
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/vo/NotaryOrderQueryRsp.java

@@ -60,7 +60,8 @@ public class NotaryOrderQueryRsp {
 	// 申请时间
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
 	private LocalDateTime applyTime;
-
+	// 流程是否已经完成
+	private String notarizedFlag;
 	public LocalDateTime getApplyTime() {
 
 		return applyTime = createTime;

+ 1 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/vo/UserReq.java

@@ -16,4 +16,5 @@ public class UserReq extends BaseRequest {
     private String blurry;
     private Boolean enabled;
     private List<Timestamp> createTime;
+    private String orgId;
 }

+ 25 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/AdminOrderServiceImpl.java

@@ -5,9 +5,12 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 import me.zhengjie.dao.mybatis.entity.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +37,7 @@ import me.zhengjie.application.admin.controller.vo.PartyEntity;
 import me.zhengjie.application.admin.service.AdminOrderService;
 import me.zhengjie.application.admin.service.OrderCochainService;
 import me.zhengjie.application.admin.service.SmsTemplateService;
+import me.zhengjie.application.bank.controller.vo.BankOrderVO;
 import me.zhengjie.application.bank.service.BankOrderService;
 import me.zhengjie.application.bank.service.FileInfoService;
 import me.zhengjie.base.AppBaseResponse;
@@ -44,6 +48,7 @@ import me.zhengjie.base.util.ApplicationContextUtil;
 import me.zhengjie.base.util.BeanCopyUtils;
 import me.zhengjie.base.util.FileUploadUtil;
 import me.zhengjie.base.util.StatusEnum;
+import me.zhengjie.base.util.StatusEnum.NotaryStatusEnum;
 import me.zhengjie.dao.mybatis.ContractOrderRepository;
 import me.zhengjie.dao.mybatis.ModelRepository;
 import me.zhengjie.dao.mybatis.OrderFileRepository;
@@ -141,8 +146,28 @@ public class AdminOrderServiceImpl implements AdminOrderService {
 		page = contractOrderMapper.selectPage(page, qw);
 		List<ContractOrderEntity> list = page.getRecords();
 		List<NotaryOrderQueryRsp> res = BeanCopyUtils.convertList2List(list, NotaryOrderQueryRsp.class);
+	
+		//待公证增加状态
+		String status=NotaryStatusEnum.NOTARIZED.getStatus().toString();
+		if(status.equals(req.getStatus())) {
+			 List<String> bizNoList = res.stream().map(NotaryOrderQueryRsp::getBusinessNo).collect(Collectors.toList());
+		        if (bizNoList != null && bizNoList.size() > 0) {
+		            Set<String> set = new HashSet<>();
+		            List<OrderFileEntity> fileList = orderFileRepository.getOrderNoteList(bizNoList);
+		            if (fileList != null && fileList.size() > 0) {
+		                set = fileList.stream().map(OrderFileEntity::getBusinessNo).collect(Collectors.toSet());
+		            }
+		            for (NotaryOrderQueryRsp order : res) {
+		            	//流程是否已经完成
+		                order.setNotarizedFlag(set.contains(order.getBusinessNo()) ? "1" : "0");
+		            }
+		        }
+		}
+		
 		response.setData(new AppResultData<List<NotaryOrderQueryRsp>>(res,
 				new me.zhengjie.base.Page(req.getIndex(), req.getSize(), (int) page.getTotal())));
+		 
+		
 		return response;
 	}
 

+ 219 - 201
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/ModelNotarizationServiceImpl.java

@@ -36,212 +36,230 @@ import java.util.*;
 @Slf4j
 public class ModelNotarizationServiceImpl implements ModelNotarizationService {
 
-    @Autowired
-    private ModelMapper modelMapper;
-    @Autowired
-    private UserDomain userDomain;
-    @Autowired
-    private NotaryNoteMapper notaryNoteDao;
-    @Autowired
-    private NotaryOfficeMapper notaryOfficeMapper;
-    @Autowired
-    private ApplicationContextUtil contextUtil;
+	@Autowired
+	private ModelMapper modelMapper;
+	@Autowired
+	private UserDomain userDomain;
+	@Autowired
+	private NotaryNoteMapper notaryNoteDao;
+	@Autowired
+	private NotaryOfficeMapper notaryOfficeMapper;
+	@Autowired
+	private ApplicationContextUtil contextUtil;
 
-    /**
-     * 查询公证文书列表
-     *
-     * @param req
-     * @return
-     */
-    @Override
-    public AppBaseResponse query(ModelReq req) {
-        AppBaseResponse<List<ModelReq>> response = new AppBaseResponse<>();
-        QueryWrapper<ModelEntity> qw = getQueryWrapper(req);
-        if (qw == null) {
-            return AppBaseResponse.error(ResultCode.PERMISSION_UNAUTHORISE);
-        }
-        IPage<ModelEntity> page = new Page<>(req.getIndex(), req.getSize());
-        page = modelMapper.selectPage(page, qw);
-        List<ModelEntity> list = page.getRecords();
-        List<ModelReq> res = BeanCopyUtils.convertList2List(list, ModelReq.class);
-        if (list != null && list.size() > 0) {
-            Set<Integer> officeNames = new HashSet<>();
-            for (ModelReq modelReq : res) {
-                officeNames.add(modelReq.getNotaryOfficeId());
-            }
-            List<NotaryOfficeEntity> officeList = notaryOfficeMapper.selectBatchIds(officeNames);
-            Map<String, String> officeNameMap = new HashMap<String, String>();
-            for (NotaryOfficeEntity entity : officeList) {
-                officeNameMap.put(String.valueOf(entity.getId()), entity.getName());
-            }
-            for (ModelReq model : res) {
-                model.setNotaryOfficeName(officeNameMap.get(String.valueOf(model.getNotaryOfficeId())));
-                if (ModelConstant.MODEL_TYPE_NOTE.equals(model.getCode())) {
-                    model.setNotaryNote(getNotaryNote(model));
-                }
-            }
-        }
-        response.setData(new AppResultData<List<ModelReq>>(res, new me.zhengjie.base.Page(req.getIndex(), req.getSize(), (int) page.getTotal())));
-        return response;
-    }
+	/**
+	 * 查询公证文书列表
+	 *
+	 * @param req
+	 * @return
+	 */
+	@Override
+	public AppBaseResponse query(ModelReq req) {
+		AppBaseResponse<List<ModelReq>> response = new AppBaseResponse<>();
+		QueryWrapper<ModelEntity> qw = getQueryWrapper(req);
+		if (qw == null) {
+			return AppBaseResponse.error(ResultCode.PERMISSION_UNAUTHORISE);
+		}
+		IPage<ModelEntity> page = new Page<>(req.getIndex(), req.getSize());
+		page = modelMapper.selectPage(page, qw);
+		List<ModelEntity> list = page.getRecords();
+		List<ModelReq> res = BeanCopyUtils.convertList2List(list, ModelReq.class);
+		if (list != null && list.size() > 0) {
+			Set<Integer> officeNames = new HashSet<>();
+			for (ModelReq modelReq : res) {
+				officeNames.add(modelReq.getNotaryOfficeId());
+			}
+			List<NotaryOfficeEntity> officeList = notaryOfficeMapper.selectBatchIds(officeNames);
+			Map<String, String> officeNameMap = new HashMap<String, String>();
+			for (NotaryOfficeEntity entity : officeList) {
+				officeNameMap.put(String.valueOf(entity.getId()), entity.getName());
+			}
+			for (ModelReq model : res) {
+				model.setNotaryOfficeName(officeNameMap.get(String.valueOf(model.getNotaryOfficeId())));
+				if (ModelConstant.MODEL_TYPE_NOTE.equals(model.getCode())) {
+					model.setNotaryNote(getNotaryNote(model));
+				}
+			}
+		}
+		response.setData(new AppResultData<List<ModelReq>>(res,
+				new me.zhengjie.base.Page(req.getIndex(), req.getSize(), (int) page.getTotal())));
+		return response;
+	}
 
-    /**
-     * 获取面谈笔录
-     *
-     * @param res
-     * @return
-     */
-    private List<NotaryNoteReq> getNotaryNote(ModelReq res) {
-        QueryWrapper<NotaryNoteEntity> notaryNoteQw = new QueryWrapper<>();
-        notaryNoteQw.eq("model_id", res.getId());
-        notaryNoteQw.orderByAsc("sort");
-        List<NotaryNoteEntity> notaryNoteList = notaryNoteDao.selectList(notaryNoteQw);
-        return BeanCopyUtils.convertList2List(notaryNoteList, NotaryNoteReq.class);
-    }
+	/**
+	 * 获取面谈笔录
+	 *
+	 * @param res
+	 * @return
+	 */
+	private List<NotaryNoteReq> getNotaryNote(ModelReq res) {
+		QueryWrapper<NotaryNoteEntity> notaryNoteQw = new QueryWrapper<>();
+		notaryNoteQw.eq("model_id", res.getId());
+		notaryNoteQw.orderByAsc("sort");
+		List<NotaryNoteEntity> notaryNoteList = notaryNoteDao.selectList(notaryNoteQw);
+		return BeanCopyUtils.convertList2List(notaryNoteList, NotaryNoteReq.class);
+	}
 
-    /**
-     * 获取查询对象
-     *
-     * @param req
-     * @return
-     */
-    private QueryWrapper<ModelEntity> getQueryWrapper(ModelReq req) {
-        QueryWrapper<ModelEntity> qw = new QueryWrapper<>();
-        String roleName = userDomain.getUserMaxRole();
-        if ("超级管理员".equals(roleName)) {
-        } else if ("公证处管理员".equals(roleName)) {
-            JwtUserDto user = contextUtil.getCurrentUser();
-            qw.eq("notary_office_id", user.getUser().getOrgId().split("_")[1]);
-        } else {
-            return null;
-        }
-        Set<String> codes = null;
-        if ("notary".equals(req.getChannel())) {
-            codes = new HashSet<>(Arrays.asList("10,11,12".split(",")));
-        } else {
-            codes = new HashSet<>(Arrays.asList("1,2,3,4,5,6,7,8,9".split(",")));
-        }
-        qw.in("code", codes);
-        qw.in("status", "0", "1");
-        qw.orderByAsc("sort");
-        return qw;
-    }
+	/**
+	 * 获取查询对象
+	 *
+	 * @param req
+	 * @return
+	 */
+	private QueryWrapper<ModelEntity> getQueryWrapper(ModelReq req) {
+		QueryWrapper<ModelEntity> qw = new QueryWrapper<>();
+		String roleName = userDomain.getUserMaxRole();
+		if ("超级管理员".equals(roleName)) {
+		} else if ("公证处管理员".equals(roleName)) {
+			JwtUserDto user = contextUtil.getCurrentUser();
+			qw.eq("notary_office_id", user.getUser().getOrgId().split("_")[1]);
+		} else {
+			return null;
+		}
+		// 产品类型
+		if (StringUtils.isNotBlank(req.getProductType())) {
+			qw.eq("product_type", req.getProductType());
+		}
+		// 合同类型
+		if (req.getContractType() != null) {
+			qw.eq("contract_type", req.getContractType());
+		}
+		// 文书类型
+		if (StringUtils.isNotBlank(req.getCode())) {
+			qw.eq("code", req.getCode());
+		}
+		// 所属机构notary_office_id
+		if (req.getNotaryOfficeId()!=null) {
+			qw.eq("notary_office_id", req.getNotaryOfficeId());
+		}
+		Set<String> codes = null;
+		if ("notary".equals(req.getChannel())) {
+			codes = new HashSet<>(Arrays.asList("10,11,12".split(",")));
+		} else {
+			codes = new HashSet<>(Arrays.asList("1,2,3,4,5,6,7,8,9".split(",")));
+		}
+		qw.in("code", codes);
+		qw.in("status", "0", "1");
+		qw.orderByAsc("sort");
+		return qw;
+	}
 
-    /**
-     * 创建公证文书模板
-     *
-     * @param req
-     * @return
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public AppBaseResponse create(ModelReq req) {
-        AppBaseResponse response = new AppBaseResponse();
-        ModelEntity existModel = getModel(req);
-        if (existModel != null) {
-            response.fail(ResultCode.MODEL_ALREADY_EXISGT);
-            return response;
-        }
-        if ("1,2,3,4,5,6,7,8,9".indexOf(req.getCode()) > -1 && isSortExist(req)) {
-            response.fail(ResultCode.MODEL_SORT_EXISTED);
-            return response;
-        }
-        ModelEntity model = ModelEntity.builder().code(req.getCode()).content(req.getContent())
-                .ifModify(0).notaryOfficeId(req.getNotaryOfficeId()).productType(req.getProductType()).contractType(req.getContractType())
-                .status(1).title(req.getTitle()).createTime(new Date()).build();
-        if ("1,2,3,4,5,6,7,8,9".indexOf(req.getCode()) > -1) {
-            model.setSort(req.getSort());
-        } else {
-            model.setSort(0);
-        }
-        modelMapper.insert(model);
-        //
-        if (ModelConstant.MODEL_TYPE_NOTE.equals(req.getCode())) {
-            ModelEntity savedModel = getModel(req);
-            List<NotaryNoteEntity> entityList = BeanCopyUtils.convertList2List(req.getNotaryNote(), NotaryNoteEntity.class);
-            int i = 1;
-            for (NotaryNoteEntity entity : entityList) {
-                entity.setModelId(savedModel.getId());
-                entity.setCreateTime(LocalDateTime.now());
-                entity.setSort(i++);
-                notaryNoteDao.insert(entity);
-            }
-        }
-        return response;
-    }
+	/**
+	 * 创建公证文书模板
+	 *
+	 * @param req
+	 * @return
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public AppBaseResponse create(ModelReq req) {
+		AppBaseResponse response = new AppBaseResponse();
+		ModelEntity existModel = getModel(req);
+		if (existModel != null) {
+			response.fail(ResultCode.MODEL_ALREADY_EXISGT);
+			return response;
+		}
+		if ("1,2,3,4,5,6,7,8,9".indexOf(req.getCode()) > -1 && isSortExist(req)) {
+			response.fail(ResultCode.MODEL_SORT_EXISTED);
+			return response;
+		}
+		ModelEntity model = ModelEntity.builder().code(req.getCode()).content(req.getContent()).ifModify(0)
+				.notaryOfficeId(req.getNotaryOfficeId()).productType(req.getProductType())
+				.contractType(req.getContractType()).status(1).title(req.getTitle()).createTime(new Date()).build();
+		if ("1,2,3,4,5,6,7,8,9".indexOf(req.getCode()) > -1) {
+			model.setSort(req.getSort());
+		} else {
+			model.setSort(0);
+		}
+		modelMapper.insert(model);
+		//
+		if (ModelConstant.MODEL_TYPE_NOTE.equals(req.getCode())) {
+			ModelEntity savedModel = getModel(req);
+			List<NotaryNoteEntity> entityList = BeanCopyUtils.convertList2List(req.getNotaryNote(),
+					NotaryNoteEntity.class);
+			int i = 1;
+			for (NotaryNoteEntity entity : entityList) {
+				entity.setModelId(savedModel.getId());
+				entity.setCreateTime(LocalDateTime.now());
+				entity.setSort(i++);
+				notaryNoteDao.insert(entity);
+			}
+		}
+		return response;
+	}
 
-    /**
-     * 获取模型
-     * @param req
-     * @return
-     */
-    private ModelEntity getModel(ModelReq req) {
-        QueryWrapper<ModelEntity> qw = new QueryWrapper<>();
-        qw.eq("code", req.getCode());
-        qw.eq("notary_office_id", req.getNotaryOfficeId());
-        qw.eq("product_type", req.getProductType());
-        qw.eq("contract_type", req.getContractType());
-        qw.in("status", 0, 1);
-        ModelEntity model = modelMapper.selectOne(qw);
-        return model;
-    }
+	/**
+	 * 获取模型
+	 * 
+	 * @param req
+	 * @return
+	 */
+	private ModelEntity getModel(ModelReq req) {
+		QueryWrapper<ModelEntity> qw = new QueryWrapper<>();
+		qw.eq("code", req.getCode());
+		qw.eq("notary_office_id", req.getNotaryOfficeId());
+		qw.eq("product_type", req.getProductType());
+		qw.eq("contract_type", req.getContractType());
+		qw.in("status", 0, 1);
+		ModelEntity model = modelMapper.selectOne(qw);
+		return model;
+	}
 
-    /**
-     * 排序值是否已经存在
-     *
-     * @param req
-     * @return
-     */
-    private boolean isSortExist(ModelReq req) {
-        QueryWrapper<ModelEntity> qw = new QueryWrapper<>();
-        qw.ne("code", req.getCode());
-        qw.eq("notary_office_id", req.getNotaryOfficeId());
-        qw.eq("product_type", req.getProductType());
-        qw.eq("contract_type", req.getContractType());
-        qw.eq("sort", req.getSort());
-        if (req.getId() != null && req.getId() != 0) {
-            qw.ne("id", req.getId());
-        }
-        qw.in("status", 0, 1);
-        List<ModelEntity> modelList = modelMapper.selectList(qw);
-        return modelList != null && modelList.size() > 0;
-    }
+	/**
+	 * 排序值是否已经存在
+	 *
+	 * @param req
+	 * @return
+	 */
+	private boolean isSortExist(ModelReq req) {
+		QueryWrapper<ModelEntity> qw = new QueryWrapper<>();
+		qw.ne("code", req.getCode());
+		qw.eq("notary_office_id", req.getNotaryOfficeId());
+		qw.eq("product_type", req.getProductType());
+		qw.eq("contract_type", req.getContractType());
+		qw.eq("sort", req.getSort());
+		if (req.getId() != null && req.getId() != 0) {
+			qw.ne("id", req.getId());
+		}
+		qw.in("status", 0, 1);
+		List<ModelEntity> modelList = modelMapper.selectList(qw);
+		return modelList != null && modelList.size() > 0;
+	}
 
-
-    /**
-     * 修改公证文书模板
-     *
-     * @param req
-     * @return
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public AppBaseResponse update(ModelReq req) {
-        AppBaseResponse response = new AppBaseResponse();
-        if ("1,2,3,4,5,6,7,8,9".indexOf(req.getCode()) > -1 && isSortExist(req)) {
-            response.fail(ResultCode.MODEL_SORT_EXISTED);
-            return response;
-        }
-        ModelEntity model = ModelEntity.builder()
-                .id(req.getId()).code(req.getCode()).sort(req.getSort())
-                .content(req.getContent()).notaryOfficeId(req.getNotaryOfficeId()).status(req.getStatus()).contractType(req.getContractType())
-                .title(req.getTitle()).productType(req.getProductType()).build();
-        modelMapper.updateById(model);
-        if (ModelConstant.MODEL_TYPE_NOTE.equals(req.getCode())) {
-            QueryWrapper<NotaryNoteEntity> qw = new QueryWrapper<>();
-            qw.eq("model_id", req.getId());
-            notaryNoteDao.delete(qw);
-            //
-            List<NotaryNoteEntity> entityList = BeanCopyUtils.convertList2List(req.getNotaryNote(), NotaryNoteEntity.class);
-            int i = 1;
-            for (NotaryNoteEntity entity : entityList) {
-                entity.setId(null);
-                entity.setModelId(req.getId());
-                entity.setCreateTime(LocalDateTime.now());
-                entity.setSort(i++);
-                notaryNoteDao.insert(entity);
-            }
-        }
-        return response;
-    }
+	/**
+	 * 修改公证文书模板
+	 *
+	 * @param req
+	 * @return
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public AppBaseResponse update(ModelReq req) {
+		AppBaseResponse response = new AppBaseResponse();
+		if ("1,2,3,4,5,6,7,8,9".indexOf(req.getCode()) > -1 && isSortExist(req)) {
+			response.fail(ResultCode.MODEL_SORT_EXISTED);
+			return response;
+		}
+		ModelEntity model = ModelEntity.builder().id(req.getId()).code(req.getCode()).sort(req.getSort())
+				.content(req.getContent()).notaryOfficeId(req.getNotaryOfficeId()).status(req.getStatus())
+				.contractType(req.getContractType()).title(req.getTitle()).productType(req.getProductType()).build();
+		modelMapper.updateById(model);
+		if (ModelConstant.MODEL_TYPE_NOTE.equals(req.getCode())) {
+			QueryWrapper<NotaryNoteEntity> qw = new QueryWrapper<>();
+			qw.eq("model_id", req.getId());
+			notaryNoteDao.delete(qw);
+			//
+			List<NotaryNoteEntity> entityList = BeanCopyUtils.convertList2List(req.getNotaryNote(),
+					NotaryNoteEntity.class);
+			int i = 1;
+			for (NotaryNoteEntity entity : entityList) {
+				entity.setId(null);
+				entity.setModelId(req.getId());
+				entity.setCreateTime(LocalDateTime.now());
+				entity.setSort(i++);
+				notaryNoteDao.insert(entity);
+			}
+		}
+		return response;
+	}
 }

+ 9 - 2
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/SmsTemplateServiceImpl.java

@@ -184,8 +184,15 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
 	// 4---开始公证(待公证) -- 2个公证员
 	@Override
 	public void startNotarize(String businessNo) {
-
-		sendNotary(4, businessNo, "公证员", sendSmsPhone());
+		
+		QueryWrapper<SmsSendLogEntity> smsSend = new QueryWrapper<>();
+		smsSend.eq("business_no", businessNo);
+		smsSend.eq("order_type", 4);
+		long count = sendLogMapper.selectCount(smsSend);
+		if (count == 0) {
+			sendNotary(4, businessNo, "公证员", sendSmsPhone());
+		}
+		
 	}
 
 	public Set<String> sendSmsPhone() {

+ 1 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/UserDetailsServiceImpl.java

@@ -95,6 +95,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
                 jwtUserDto.setPassword(user.getPassword());
                 jwtUserDto.setNickName(user.getNickName());
                 jwtUserDto.setDept(user.getDept().getName());
+                jwtUserDto.setOrgName(user.getOrgName());
             }
             return jwtUserDto;
 //        }

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/UserServiceImpl.java

@@ -199,6 +199,7 @@ public class UserServiceImpl implements UserService {
         JwtUserDto userDto = contextUtil.getCurrentUser();
         String maxRole = userDomain.getUserMaxRole();
         if ("超级管理员".equals(maxRole)) {
+        	   qw.eq(StringUtils.isNotBlank(userReq.getOrgId()),"org_id",userReq.getOrgId() );
         } else if ("公证处管理员".equals(maxRole) || "银行管理员".equals(maxRole)) {
             qw.eq("org_id", userDto.getUser().getOrgId());
         } else {
@@ -210,6 +211,9 @@ public class UserServiceImpl implements UserService {
         if (userReq.getEnabled() != null) {
             qw.eq("enabled", userReq.getEnabled() ? 1 : 0);
         }
+        if (userReq.getEnabled() != null) {
+            qw.eq("enabled", userReq.getEnabled() ? 1 : 0);
+        }
         if (userReq.getCreateTime() != null) {
             qw.ge("create_time", userReq.getCreateTime().get(0));
             qw.le("create_time", userReq.getCreateTime().get(1));

+ 6 - 1
eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/BankLoginServiceImpl.java

@@ -9,6 +9,7 @@ import me.zhengjie.application.bank.service.SysUserService;
 import me.zhengjie.base.ResponseDTO;
 import me.zhengjie.base.ResultCode;
 import me.zhengjie.dao.mybatis.entity.SysUserEntity;
+import me.zhengjie.exception.AccountNoActivationException;
 import me.zhengjie.security.security.TokenProvider;
 import org.springframework.stereotype.Service;
 
@@ -32,6 +33,10 @@ public class BankLoginServiceImpl implements BankLoginService {
 		sysUser.setPassword(loginVo.getPassword());
 		sysUser = userService.login(sysUser);
 		if (sysUser != null && sysUser.getOrgId().startsWith("bank")) {
+			if (!(sysUser.getEnabled() == 1)) {
+				throw new AccountNoActivationException("账号未激活!");
+			}
+
 			String token = tokenProvider.appToken(loginVo.getPhone());
 			tokenProvider.setTokenTime(token, JSONObject.toJSONString(sysUser));
 			BankLoginVO bankLoginVO = new BankLoginVO();
@@ -42,7 +47,7 @@ public class BankLoginServiceImpl implements BankLoginService {
 		return ResponseDTO.error(ResultCode.USER_LOGIN_ERROR);
 	}
 
-	public void logout(String authToken){
+	public void logout(String authToken) {
 		tokenProvider.delToken(authToken);
 	}
 }

+ 2 - 1
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/ContractOrderEntity.java

@@ -140,7 +140,8 @@ public class ContractOrderEntity implements Serializable {
 
     @TableField("customer_id")
     private String customerId;
-
+    
+    @QueryWapper(QueryKeyword.LIKE)
     @TableField("customer_name")
     private String customerName;
 

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/SmsTemplateEntity.java

@@ -51,7 +51,7 @@ public class SmsTemplateEntity extends QueryEntity implements Serializable {
 	/**
 	 * 模板内容
 	 */
-	@QueryWapper(value = { QueryKeyword.LIKE }, attribute = { "startDate", "endDate" })
+	@QueryWapper(value = { QueryKeyword.LIKE })
 	@TableField("template_content")
 	private String templateContent;