Browse Source

Merge branch 'branch-nt-1.0.0' of https://git.flowbb.cn/RK-Dev/fqgz-server into branch-nt-1.0.0

humuyu 3 năm trước cách đây
mục cha
commit
830736d1b4

+ 7 - 1
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/AdminOrderController.java

@@ -10,6 +10,7 @@ import me.zhengjie.application.admin.service.AdminOrderService;
 import me.zhengjie.base.AppBaseResponse;
 import me.zhengjie.base.AppResultData;
 import me.zhengjie.base.ResultCode;
+import me.zhengjie.base.util.FileUploadUtil;
 import me.zhengjie.base.util.TencentServiceUtil;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -183,10 +184,15 @@ public class AdminOrderController {
 	}
 
 	@RequestMapping("/preview")
-	public AppBaseResponse previewNotarization(@RequestBody NotaryOrderQueryReq req) {
+	public AppBaseResponse modifyNotarization(@RequestBody NotaryOrderQueryReq req) {
 		return adminOrderService.previewNotarization(req);
 	}
 
+	@RequestMapping("/preview-notarization")
+	public AppBaseResponse previewNotarization(@RequestBody NotaryOrderQueryReq req) {
+		return adminOrderService.previewNotarizationPdf(req);
+	}
+
 	@RequestMapping("/saveContent")
 	public AppBaseResponse saveContent(@RequestBody NotaryOrderQueryReq req) {
 		return adminOrderService.saveContent(req);

+ 16 - 5
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/UserController.java

@@ -28,19 +28,20 @@ import me.zhengjie.application.admin.service.dto.JwtUserDto;
 import me.zhengjie.application.admin.service.dto.RoleSmallDto;
 import me.zhengjie.application.admin.service.dto.UserDto;
 import me.zhengjie.application.admin.service.dto.UserQueryCriteria;
-import me.zhengjie.application.bank.service.FileInfoService;
 import me.zhengjie.base.AppBaseResponse;
 import me.zhengjie.base.util.ApplicationContextUtil;
 import me.zhengjie.base.util.FileUploadUtil;
 import me.zhengjie.config.RsaProperties;
-import me.zhengjie.dao.mybatis.entity.*;
+import me.zhengjie.dao.mybatis.entity.Dept;
+import me.zhengjie.dao.mybatis.entity.FileInfoEntity;
+import me.zhengjie.dao.mybatis.entity.NotaryOfficeEntity;
+import me.zhengjie.dao.mybatis.entity.User;
 import me.zhengjie.dao.mybatis.mapper.BankMapper;
 import me.zhengjie.dao.mybatis.mapper.FileInfoMapper;
 import me.zhengjie.dao.mybatis.mapper.NotaryOfficeMapper;
 import me.zhengjie.exception.BadRequestException;
 import me.zhengjie.utils.RsaUtils;
 import me.zhengjie.utils.enums.CodeEnum;
-
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -149,6 +150,17 @@ public class UserController {
         return new ResponseEntity<>(userList,HttpStatus.OK);
     }
 
+    @Log("重置密码")
+    @ApiOperation("重置密码")
+    @PostMapping("/reset-password")
+    @PreAuthorize("@el.check('user:reset')")
+    public AppBaseResponse resetPassword(@RequestBody User user) {
+        checkLevel(user);
+        // 默认密码 123456
+        userService.updatePass(user.getUsername(), passwordEncoder.encode("123456"));
+        return AppBaseResponse.success();
+    }
+
     @Log("新增用户")
     @ApiOperation("新增用户")
     @PostMapping
@@ -215,7 +227,7 @@ public class UserController {
 
     @ApiOperation("修改头像")
     @PostMapping(value = "/updateAvatar")
-    public ResponseEntity<Object> updateUserAvatar(@RequestParam MultipartFile avatar){
+    public ResponseEntity<Object> updateUserAvatar(@RequestParam MultipartFile avatar) {
         return new ResponseEntity<>(userService.updateAvatar(avatar), HttpStatus.OK);
     }
 
@@ -277,7 +289,6 @@ public class UserController {
      * @param user
      * @return
      */
-
     @PostMapping(value = "/uploadSeal")
     public AppBaseResponse uploadSeal(@RequestBody User user){
         return userService.uploadSeal(user);

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

@@ -42,6 +42,8 @@ public class NotaryOrderQueryRsp {
 	private String bankName;
 	// 客户经理
 	private String customerName;
+	// 公证员姓名
+	private String notaryUserName;
 	//'所属银行id',
 	private String bankId;
 	// 自动生成公证书标记

+ 2 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/service/AdminOrderService.java

@@ -51,6 +51,8 @@ public interface AdminOrderService {
 
     AppBaseResponse<String> previewNotarization(NotaryOrderQueryReq req);
 
+    AppBaseResponse<String> previewNotarizationPdf(NotaryOrderQueryReq req);
+
     AppBaseResponse saveContent(NotaryOrderQueryReq req);
 
     AppBaseResponse<?> bankCustomer(NotaryOrderQueryReq req);

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

@@ -424,7 +424,6 @@ public class AdminOrderServiceImpl implements AdminOrderService {
 	/**
 	 * 订单状态更新为通过公证
 	 *
-	 * @param orderId
 	 * @param businessNo
 	 */
 	private void updateStatusPass(String businessNo) {
@@ -469,6 +468,15 @@ public class AdminOrderServiceImpl implements AdminOrderService {
 	}
 
 	@Override
+	public AppBaseResponse<String> previewNotarizationPdf(NotaryOrderQueryReq req) {
+		AppBaseResponse<String> response = new AppBaseResponse<>();
+		String html = modelSynthesizerDomain.composeNotarizationTemplate(1000, req.getContent());
+		String url = FileUploadUtil.getPreviewUrl(FileUploadUtil.savePdf(html, req.getBusinessNo()));
+		response.setData(new AppResultData<String>(url));
+		return response;
+	}
+
+	@Override
 	public AppBaseResponse saveContent(NotaryOrderQueryReq req) {
 		OrderFileEntity curOrderFile = orderFileRepository.getOrderNotarization(req.getBusinessNo());
 		OrderFileEntity saveOrderFile = new OrderFileEntity();

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

@@ -110,7 +110,7 @@ public class NotaryNoteServiceImpl implements NotaryNoteService {
 
 	/**
 	 * 关联当前公证员ID
-	 * 
+	 *
 	 * @param businessNo
 	 */
 	private void saveNotaryUserId(String businessNo) {
@@ -119,6 +119,7 @@ public class NotaryNoteServiceImpl implements NotaryNoteService {
 		ContractOrderEntity saveOrder = new ContractOrderEntity();
 		saveOrder.setId(curOrder.getId());
 		saveOrder.setNotaryUserId(currentUserId);
+		saveOrder.setNotaryUserName(contextUtil.getCurrentUser().getNickName());
 		contractOrderRepository.updateWithId(saveOrder);
 	}
 

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankLoginController.java

@@ -52,7 +52,7 @@ public class BankLoginController extends BaseController {
      * @return
      */
     @AnonymousPostMapping("/login")
-    public ResponseDTO<String> login(@Valid @RequestBody BankLoginVO loginVo) {
+    public ResponseDTO<BankLoginVO> login(@Valid @RequestBody BankLoginVO loginVo) {
         return bankLoginService.login(loginVo);
     }
 

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/vo/BankLoginVO.java

@@ -24,4 +24,8 @@ public class BankLoginVO {
 	@NotNull(message = "密码")
 	@ApiModelProperty(value = "密码")
 	private String password;
+
+	private String nickName;
+
+	private String token;
 }

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/application/bank/service/BankLoginService.java

@@ -17,5 +17,5 @@ public interface BankLoginService {
 	 * @param sms
 	 * @return
 	 */
-	ResponseDTO<String> login(BankLoginVO sms);
+	ResponseDTO<BankLoginVO> login(BankLoginVO sms);
 }

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

@@ -26,15 +26,18 @@ public class BankLoginServiceImpl implements BankLoginService {
 	private final TokenProvider tokenProvider;
 
 	@Override
-	public ResponseDTO<String> login(BankLoginVO loginVo) {
+	public ResponseDTO<BankLoginVO> login(BankLoginVO loginVo) {
 		SysUserEntity sysUser = new SysUserEntity();
 		sysUser.setPhone(loginVo.getPhone());
 		sysUser.setPassword(loginVo.getPassword());
 		sysUser = userService.login(sysUser);
-		if (sysUser != null) {
+		if (sysUser != null && sysUser.getOrgId().startsWith("bank")) {
 			String token = tokenProvider.appToken(loginVo.getPhone());
 			tokenProvider.setTokenTime(token, JSONObject.toJSONString(sysUser));
-			return ResponseDTO.success(token);
+			BankLoginVO bankLoginVO = new BankLoginVO();
+			bankLoginVO.setNickName(sysUser.getNickName());
+			bankLoginVO.setToken(token);
+			return ResponseDTO.success(bankLoginVO);
 		}
 		return ResponseDTO.error(ResultCode.USER_LOGIN_ERROR);
 	}

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/base/util/HtmlConvertPdf.java

@@ -75,7 +75,7 @@ public class HtmlConvertPdf {
 		pdf.setHtmlWidth(width);
 		// 设置字体的数据
 		int topValue = 20;
-		int leftValue = 10;
+		int leftValue = 15;
 		int rightValue = 10;
 		int bottomValue = 25;
 

+ 3 - 0
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/ContractOrderEntity.java

@@ -149,6 +149,9 @@ public class ContractOrderEntity implements Serializable {
     @TableField("notary_user_id")
     private String notaryUserId;
 
+    @TableField("notary_user_name")
+    private String notaryUserName;
+
     @TableField("auto_generate")
     private String autoGenerate;
 

+ 2 - 2
eladmin-system/src/main/resources/cfca.properties

@@ -2,13 +2,13 @@ connectTimeout = 30000
 readTimeout = 30000
 isSSL = true
 alias = anxinsign
-#????
+# product configuration
 #platID = E96620D49426837BE053345B210A8F01
 #cfcaURL = https://cs.anxinsign.com/FEP/
 #channel = prod
 #jksPath = anxinqian.jks
 #jksPWD = anxinqian1234
-#????
+# test configuration
 platID = D998E5EBBF4C2D95E05312016B0A7677
 cfcaURL = https://210.74.42.33:9443/FEP/
 channel = test

+ 5 - 0
eladmin-system/src/main/resources/template/note/notary-note.html

@@ -18,12 +18,17 @@
     width: 100%;
     text-align: center;
     padding-top: 5px;
+	font-family: 'simsun';
 }
 .box p {
     font-size: 12px;
 	padding: 8px 0 0 0;
 	margin: 0;
 	line-height: 22px;
+		font-family: 'simfang';
+}
+.box table {
+	font-family: 'simsun';
 }
 .box table.tb {
     width: 100%;