|
@@ -12,6 +12,7 @@ import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -59,6 +60,7 @@ import com.qunzhixinxi.hnqz.admin.entity.WmUserSignDetail;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmWkAlbum;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmWkArticle;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmWkArticleShare;
|
|
|
+import com.qunzhixinxi.hnqz.admin.entity.dto.SignAgreementDTO;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.NoticeApiInput;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageApiInput;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageApiOutput;
|
|
@@ -137,6 +139,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -880,6 +883,20 @@ public class ApiController {
|
|
|
mapOne.put("existEidResult", false);
|
|
|
}
|
|
|
|
|
|
+ // 签署协议信息
|
|
|
+ mapOne.put("signHonestAgreement", false);
|
|
|
+ if (StrUtil.isNotBlank(sysU.getSignAgreement())) {
|
|
|
+ JSONArray agreements = JSONUtil.parseArray(sysU.getSignAgreement());
|
|
|
+ for (Object agreement : agreements) {
|
|
|
+ SignAgreementDTO signAgreementDTO = BeanUtil.toBean(agreement, SignAgreementDTO.class);
|
|
|
+ if (SignAgreementDTO.SignAgreementType.HONEST_AGREEMENT.equals(signAgreementDTO.getAgreementType())) {
|
|
|
+ // 廉洁协议是否签署
|
|
|
+ mapOne.put("signHonestAgreement", true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 获取发起认证的令牌
|
|
|
String randomStr;
|
|
|
|
|
@@ -4597,4 +4614,34 @@ public class ApiController {
|
|
|
return R.ok(Collections.emptyList());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 小程序签署协议
|
|
|
+ *
|
|
|
+ * @param signAgreementDTO 请求参数
|
|
|
+ * @return {@link R}<{@link ?}> 结果
|
|
|
+ */
|
|
|
+ @SysLog("小程序签署协议")
|
|
|
+ @PostMapping("/sign-agreement")
|
|
|
+ public R<Boolean> signAgreement(@Validated @RequestBody SignAgreementDTO signAgreementDTO) {
|
|
|
+ log.info("小程序签署协议请求:{}", signAgreementDTO);
|
|
|
+
|
|
|
+ Integer userId = SecurityUtils.getUser().getId();
|
|
|
+
|
|
|
+ SysUser queryUser = sysUserService.getById(userId);
|
|
|
+ List<Object> signAgreementDTOList = new ArrayList<>();
|
|
|
+ if (StrUtil.isBlank(queryUser.getSignAgreement())) {
|
|
|
+ signAgreementDTOList.add(signAgreementDTO);
|
|
|
+ } else {
|
|
|
+ JSONArray agreements = JSONUtil.parseArray(queryUser.getSignAgreement());
|
|
|
+ signAgreementDTOList.add(signAgreementDTO);
|
|
|
+ signAgreementDTOList.addAll(agreements);
|
|
|
+ }
|
|
|
+
|
|
|
+ SysUser user = new SysUser();
|
|
|
+ user.setUserId(userId);
|
|
|
+ user.setSignAgreement(JSONUtil.toJsonStr(signAgreementDTOList));
|
|
|
+ user.setUpdateTime(LocalDateTime.now());
|
|
|
+
|
|
|
+ return R.ok(sysUserService.updateById(user));
|
|
|
+ }
|
|
|
}
|