|
|
@@ -5,17 +5,20 @@ import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.lc.ibps.base.core.util.AppUtil;
|
|
|
import com.lc.ibps.cloud.entity.APIPageList;
|
|
|
import com.lc.ibps.cloud.entity.APIRequest;
|
|
|
import com.lc.ibps.cloud.entity.APIResult;
|
|
|
import com.lc.ibps.cloud.redis.utils.RedisUtil;
|
|
|
import com.lc.ibps.config.JcjdConfig;
|
|
|
+import com.lc.ibps.org.api.IPartyPositionService;
|
|
|
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.WxyhDao;
|
|
|
import com.lc.ibps.wx.entity.*;
|
|
|
+import com.lc.ibps.wx.services.EmployeeService;
|
|
|
import com.lc.ibps.wx.services.UserRoleService;
|
|
|
import com.lc.ibps.wx.services.UserSituationService;
|
|
|
import com.lc.ibps.wx.services.wxServices;
|
|
|
@@ -59,9 +62,11 @@ public class wxServicesImpl implements wxServices {
|
|
|
UserSituationService userSituationService;
|
|
|
@Autowired
|
|
|
FileAttachmentMapper fileAttachmentMapper;
|
|
|
+ @Autowired
|
|
|
+ EmployeeService employeeService;
|
|
|
|
|
|
|
|
|
- //直接签到
|
|
|
+ //直接签到findByParams
|
|
|
public APIResult<Void> openId(@RequestParam String code, @RequestParam String state) {
|
|
|
APIResult<Void> apiResult = new APIResult<>();
|
|
|
log.info("签到:",code+" "+state);
|
|
|
@@ -97,21 +102,14 @@ 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());
|
|
|
+ Employee employee = employeeService.findByName(wxUser.getShouJi(),wxUser.getXingMing());
|
|
|
+ hyqd.setBuMen(employee.getPositions());//部门
|
|
|
+ String role = userRoleService.findUserRole(employee.getId());
|
|
|
hyqd.setGangWeiJiaoSe(!role.isEmpty() ? role:""); //角色
|
|
|
- UserSituation user = userSituationService.findByUserId(hyqd.getId());
|
|
|
+ UserSituation user = userSituationService.findByUserId(employee.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);
|
|
|
@@ -221,10 +219,11 @@ public class wxServicesImpl implements wxServices {
|
|
|
hyqd.setHuiYiChangJing(map.get("state").toString()); //场景id
|
|
|
hyqd.setQianDaoRenYuan(employeePo.getName()); //用户名
|
|
|
hyqd.setQianDaoShiJian(DateUtil.now()); //存放签到时间
|
|
|
- hyqd.setBuMen(employeePo.getPositions());//部门
|
|
|
- String role = userRoleService.findUserRole(employeePo.getId());
|
|
|
+ Employee employee = employeeService.findByName(wxUser.getShouJi(),wxUser.getXingMing());
|
|
|
+ hyqd.setBuMen(employee.getPositions());//部门
|
|
|
+ String role = userRoleService.findUserRole(employee.getId());
|
|
|
hyqd.setGangWeiJiaoSe(!role.isEmpty() ? role:""); //角色
|
|
|
- UserSituation user = userSituationService.findByUserId(hyqd.getId());
|
|
|
+ UserSituation user = userSituationService.findByUserId(employee.getId());
|
|
|
FileAttachment file = fileAttachmentMapper.findByid(user.getQianZiTuWen());
|
|
|
hyqd.setQianZiTuWen(!file.getId().isEmpty()?file.getId():"");//签字图文
|
|
|
hyqd.setTuWenMingCheng(!file.fileName.isEmpty()?file.fileName:"");//图文名称
|