|
|
@@ -5,7 +5,6 @@ import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.esotericsoftware.minlog.Log;
|
|
|
import com.lc.ibps.cloud.entity.APIPageList;
|
|
|
import com.lc.ibps.cloud.entity.APIRequest;
|
|
|
import com.lc.ibps.cloud.entity.APIResult;
|
|
|
@@ -15,7 +14,6 @@ import com.lc.ibps.org.party.persistence.entity.PartyEmployeePo;
|
|
|
import com.lc.ibps.sysdata.dao.UpdateDataTableDao;
|
|
|
import com.lc.ibps.wx.dao.FileAttachmentMapper;
|
|
|
import com.lc.ibps.wx.dao.HyqdDao;
|
|
|
-import com.lc.ibps.wx.dao.UserRole;
|
|
|
import com.lc.ibps.wx.dao.WxyhDao;
|
|
|
import com.lc.ibps.wx.entity.*;
|
|
|
import com.lc.ibps.wx.services.UserRoleService;
|
|
|
@@ -24,7 +22,6 @@ import com.lc.ibps.wx.services.wxServices;
|
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import lombok.val;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -33,7 +30,6 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
@@ -64,6 +60,8 @@ public class wxServicesImpl implements wxServices {
|
|
|
@Autowired
|
|
|
FileAttachmentMapper fileAttachmentMapper;
|
|
|
|
|
|
+
|
|
|
+ //直接签到
|
|
|
public APIResult<Void> openId(@RequestParam String code, @RequestParam String state) {
|
|
|
APIResult<Void> apiResult = new APIResult<>();
|
|
|
log.info("签到:",code+" "+state);
|
|
|
@@ -99,6 +97,21 @@ public class wxServicesImpl implements wxServices {
|
|
|
hyqd.setHuiYiChangJing(state);
|
|
|
hyqd.setShouJi(wxUser.getShouJi());
|
|
|
hyqd.setQianDaoShiJian(DateUtil.now()); //存放签到时间
|
|
|
+ //获取系统用户添加签到表
|
|
|
+ APIRequest request = new APIRequest(1,10);
|
|
|
+ request.addParameters("Q^NAME_^SL",map.get("name").toString());
|
|
|
+ request.addParameters("Q^MOBILE_^SL",map.get("mobile").toString());
|
|
|
+ APIResult<APIPageList<PartyEmployeePo>> query = employeeServiceClient.query(request);
|
|
|
+ List<PartyEmployeePo> result = query.getData().getDataResult();
|
|
|
+ PartyEmployeePo employeePo = result.get(0);
|
|
|
+ hyqd.setBuMen(employeePo.getPositions());//部门
|
|
|
+ String role = userRoleService.findUserRole(employeePo.getId());
|
|
|
+ hyqd.setGangWeiJiaoSe(!role.isEmpty() ? role:""); //角色
|
|
|
+ UserSituation user = userSituationService.findByUserId(hyqd.getId());
|
|
|
+ FileAttachment file = fileAttachmentMapper.findByid(user.getQianZiTuWen());
|
|
|
+ hyqd.setQianZiTuWen(!file.getId().isEmpty()?file.getId():"");//签字图文
|
|
|
+ hyqd.setTuWenMingCheng(!file.fileName.isEmpty()?file.fileName:"");//图文名称
|
|
|
+
|
|
|
hyqdDao.add(hyqd);
|
|
|
apiResult.setMessage("签到成功!");
|
|
|
apiResult.setState(JcjdConfig.successful);
|
|
|
@@ -159,7 +172,7 @@ public class wxServicesImpl implements wxServices {
|
|
|
*/
|
|
|
|
|
|
|
|
|
-
|
|
|
+ //注册并签到
|
|
|
public APIResult<Void> addWxUser(@RequestBody String data){
|
|
|
APIResult<Void> apiResult = new APIResult<>();
|
|
|
System.out.println(data);
|