提交代码

dev_xd
姜玉琦 2024-12-30 23:08:14 +08:00
parent b02c67b7a3
commit eaa5ad1167
10 changed files with 310 additions and 52 deletions

View File

@ -92,12 +92,16 @@ public class ProProjectInfoSubdeptsGroup extends BaseEntity
@Excel(name = "删除标识") @Excel(name = "删除标识")
private Long isDel; private Long isDel;
/** 委托人正面照片 */ /** 班组长正面照片 */
private String groupLeaderCardImgPos; private String groupLeaderCardImgPos;
/** 委托人反面照片 */ /** 班组长反面照片 */
private String groupLeaderCardImgInv; private String groupLeaderCardImgInv;
/** 委托人半身照片 */ /** 班组长半身照片 */
private String groupLeaderUserPicture; private String groupLeaderUserPicture;
/** 班组长半身照片 */
private String groupLeaderSubPowerPath;
/** 班组长学历信息 */
private String groupLeaderDegreeGrade;
public void setId(Long id) public void setId(Long id)
{ {
@ -302,6 +306,22 @@ public class ProProjectInfoSubdeptsGroup extends BaseEntity
this.groupLeaderUserPicture = groupLeaderUserPicture; this.groupLeaderUserPicture = groupLeaderUserPicture;
} }
public String getGroupLeaderSubPowerPath() {
return groupLeaderSubPowerPath;
}
public void setGroupLeaderSubPowerPath(String groupLeaderSubPowerPath) {
this.groupLeaderSubPowerPath = groupLeaderSubPowerPath;
}
public String getGroupLeaderDegreeGrade() {
return groupLeaderDegreeGrade;
}
public void setGroupLeaderDegreeGrade(String groupLeaderDegreeGrade) {
this.groupLeaderDegreeGrade = groupLeaderDegreeGrade;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -92,6 +92,18 @@ public class ProProjectInfoController extends BaseController
} }
} }
/**
*
* @param proId
* @return
*/
@RequiresPermissions("manage:proProjectInfo:edit")
@GetMapping("/resetProQrCode/{proId}")
public AjaxResult resetProQrCode(@PathVariable("proId") Long proId)
{
return toAjax(proProjectInfoService.resetProQrCode(proId));
}
/** /**
* *
*/ */

View File

@ -43,6 +43,13 @@ public interface IProProjectInfoService
*/ */
public int updateProProjectInfo(ProProjectInfo proProjectInfo); public int updateProProjectInfo(ProProjectInfo proProjectInfo);
/**
*
* @param id
* @return
*/
public int resetProQrCode(Long id);
/** /**
* *
* *

View File

@ -23,7 +23,6 @@ import com.yanzhu.manage.utils.WxQrCodeUtils;
import com.yanzhu.system.api.RemoteDeptService; import com.yanzhu.system.api.RemoteDeptService;
import com.yanzhu.system.api.domain.SysDept; import com.yanzhu.system.api.domain.SysDept;
import com.yanzhu.system.api.domain.SysUser; import com.yanzhu.system.api.domain.SysUser;
import me.chanjar.weixin.mp.api.WxMpService;
import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
@ -177,16 +176,20 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
@Override @Override
public int updateProProjectInfo(ProProjectInfo proProjectInfo) public int updateProProjectInfo(ProProjectInfo proProjectInfo)
{ {
try { if(StringUtils.isEmpty(proProjectInfo.getProjectQrCode())){
String accessToken = wxMaService.getAccessToken(); try {
String imgPath = profileConfig.getPath()+"/"+System.currentTimeMillis()+".png"; String accessToken = wxMaService.getAccessToken();
log.info("accessToken...{}",accessToken); String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String scene = "QRPID="+proProjectInfo.getId()+"&signType=1"; String savePath = ProfileConfig.profilePath+"/"+filePath;
WxQrCodeUtils.generateQrCode(imgPath, "pages/project_qr/index", scene, accessToken); String profilePath = ProfileConfig.profile+"/"+filePath;
// TODO:生成二维码 log.info("accessToken...{}",accessToken);
proProjectInfo.setProjectQrCode(imgPath); // 生成二维码
}catch (Exception e){ String scene = "QRPID="+proProjectInfo.getId()+"&signType=1";
log.error(e.getMessage()); WxQrCodeUtils.generateQrCode(savePath, "pages/project_qr/index", scene, accessToken);
proProjectInfo.setProjectQrCode(profilePath);
}catch (Exception e){
log.error(e.getMessage());
}
} }
proProjectInfo.setUpdateTime(DateUtils.getNowDate()); proProjectInfo.setUpdateTime(DateUtils.getNowDate());
proProjectInfo.setUpdateBy(SecurityContextHolder.getUserName()); proProjectInfo.setUpdateBy(SecurityContextHolder.getUserName());
@ -228,6 +231,31 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
return res; return res;
} }
/**
*
* @param id
* @return
*/
@Override
public int resetProQrCode(Long id){
ProProjectInfo proProjectInfo = proProjectInfoMapper.selectProProjectInfoById(id);
int res = 0;
try {
// 生成二维码
String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
log.info("accessToken...{}",accessToken);
WxQrCodeUtils.generateQrCode(savePath, "pages/project_qr/index", "SIGID=1&QRPID="+proProjectInfo.getId(), accessToken);
proProjectInfo.setProjectQrCode(profilePath);
res = proProjectInfoMapper.updateProProjectInfo(proProjectInfo);
}catch (Exception e){
log.error(e.getMessage());
}
return res;
}
/** /**
* *
* *

View File

@ -1,26 +1,34 @@
package com.yanzhu.manage.service.impl; package com.yanzhu.manage.service.impl;
import java.util.List; import cn.binarywang.wx.miniapp.api.WxMaService;
import java.util.Objects;
import com.yanzhu.common.core.constant.SecurityConstants; import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.domain.R; import com.yanzhu.common.core.enums.*;
import com.yanzhu.common.core.enums.CardTypeEnums; import com.yanzhu.common.core.exception.ServiceException;
import com.yanzhu.common.core.enums.UserTypeEnums;
import com.yanzhu.common.core.utils.DateUtils; import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils; import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.security.utils.SecurityUtils; import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.manage.config.ProfileConfig;
import com.yanzhu.manage.domain.ProProjectInfoSubdepts; import com.yanzhu.manage.domain.ProProjectInfoSubdepts;
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsGroup;
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
import com.yanzhu.manage.enums.UserPostEnums;
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsGroupMapper;
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsMapper; import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsMapper;
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
import com.yanzhu.manage.service.IProProjectInfoSubdeptsGroupService;
import com.yanzhu.manage.service.IUniService;
import com.yanzhu.manage.utils.WxQrCodeUtils;
import com.yanzhu.system.api.RemoteUserService; import com.yanzhu.system.api.RemoteUserService;
import com.yanzhu.system.api.domain.SysUser; import com.yanzhu.system.api.domain.SysUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsGroupMapper;
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsGroup;
import com.yanzhu.manage.service.IProProjectInfoSubdeptsGroupService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
/** /**
* Service * Service
* *
@ -31,6 +39,12 @@ import org.springframework.transaction.annotation.Transactional;
public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSubdeptsGroupService public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSubdeptsGroupService
{ {
@Autowired
private IUniService uniService;
@Autowired
private WxMaService wxMaService;
@Autowired @Autowired
private RemoteUserService remoteUserService; private RemoteUserService remoteUserService;
@ -40,6 +54,11 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
@Autowired @Autowired
private ProProjectInfoSubdeptsGroupMapper proProjectInfoSubdeptsGroupMapper; private ProProjectInfoSubdeptsGroupMapper proProjectInfoSubdeptsGroupMapper;
@Autowired
private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper;
private static final Logger log = LoggerFactory.getLogger(ProProjectInfoSubdeptsGroupServiceImpl.class);
/** /**
* *
* *
@ -83,13 +102,14 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsGroup.setSubDeptCode(info.getSubDeptCode()); proProjectInfoSubdeptsGroup.setSubDeptCode(info.getSubDeptCode());
proProjectInfoSubdeptsGroup.setSubDeptType(info.getSubDeptType()); proProjectInfoSubdeptsGroup.setSubDeptType(info.getSubDeptType());
} }
// 单位委托人信息 // 班组组长信息
if(StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderName()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderCode()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderPhone())){ if(StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderName()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderCode()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderPhone())){
SysUser sysUser = new SysUser(); SysUser sysUser = new SysUser();
sysUser.setUserName(proProjectInfoSubdeptsGroup.getGroupLeaderPhone()); sysUser.setUserName(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
sysUser.setNickName(proProjectInfoSubdeptsGroup.getGroupLeaderName()); sysUser.setNickName(proProjectInfoSubdeptsGroup.getGroupLeaderName());
sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode()); sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode());
sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardType(CardTypeEnums.SFZ.getCode());
sysUser.setPhonenumber(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
sysUser.setCardCode(proProjectInfoSubdeptsGroup.getGroupLeaderCode()); sysUser.setCardCode(proProjectInfoSubdeptsGroup.getGroupLeaderCode());
sysUser.setUserPicture(proProjectInfoSubdeptsGroup.getGroupLeaderUserPicture()); sysUser.setUserPicture(proProjectInfoSubdeptsGroup.getGroupLeaderUserPicture());
sysUser.setCardImgPos(proProjectInfoSubdeptsGroup.getGroupLeaderCardImgPos()); sysUser.setCardImgPos(proProjectInfoSubdeptsGroup.getGroupLeaderCardImgPos());
@ -99,17 +119,63 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
sysUser.setCreateTime(DateUtils.getNowDate()); sysUser.setCreateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdeptsGroup.getSubDeptName()); sysUser.setRemark(proProjectInfoSubdeptsGroup.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdeptsGroup.getProjectId()); sysUser.setActiveProjectId(proProjectInfoSubdeptsGroup.getProjectId());
Long userId = sysUser.getUserId();
try { try {
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER); userId = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER).getData();
}catch (Exception e){ }catch (Exception e){
// 已注册账号!!忽略异常... // 已注册账号!!忽略异常...
} }
if(Objects.nonNull(userId)){
proProjectInfoSubdeptsGroup.setCreateBy(SecurityUtils.getUsername());
proProjectInfoSubdeptsGroup.setCreateTime(DateUtils.getNowDate());
int res = proProjectInfoSubdeptsGroupMapper.insertProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
// TODO:实名制接入 // 系统添加的人员默认增加入场信息
uniService.syncUniUser(userId,info.getId());
if(res>0){
// 保存单位人员信息
ProProjectInfoSubdeptsUsers subdeptsUser = new ProProjectInfoSubdeptsUsers();
subdeptsUser.setComId(info.getComId());
subdeptsUser.setProjectId(info.getId());
subdeptsUser.setSubDeptId(proProjectInfoSubdeptsGroup.getSubDeptId());
subdeptsUser.setSubDeptName(proProjectInfoSubdeptsGroup.getSubDeptName());
subdeptsUser.setSubDeptType(proProjectInfoSubdeptsGroup.getSubDeptType());
subdeptsUser.setSubDeptPowerPath(proProjectInfoSubdeptsGroup.getGroupLeaderSubPowerPath());
subdeptsUser.setSubDeptGroup(proProjectInfoSubdeptsGroup.getId());
subdeptsUser.setSubDeptGroupName(proProjectInfoSubdeptsGroup.getGroupName());
subdeptsUser.setUserId(userId);
subdeptsUser.setUserPost(UserPostEnums.BZZ.getCode());
subdeptsUser.setCraftType(proProjectInfoSubdeptsGroup.getCraftType());
subdeptsUser.setCraftPost(proProjectInfoSubdeptsGroup.getCraftPost());
subdeptsUser.setDegreeGrade(proProjectInfoSubdeptsGroup.getGroupLeaderDegreeGrade());
subdeptsUser.setEduStatus(ShiFouEnums.FOU.getCodeStr());
subdeptsUser.setSubStep(1L);
subdeptsUser.setUseStatus(UseStateEnums.IN.getCode());
subdeptsUser.setCreateBy(SecurityUtils.getUsername());
subdeptsUser.setApproveStatus(ApproveStatus.passed.getCode());
subdeptsUser.setCreateTime(DateUtils.getNowDate());
res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(subdeptsUser);
if(res>0){
try {
String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
log.info("accessToken...{}",accessToken);
// 生成二维码
WxQrCodeUtils.generateQrCode(savePath, "pages/project_qr/index", "SIGID=4&QRPID="+info.getId()+"&PARID="+subdeptsUser.getId(), accessToken);
subdeptsUser.setQrCode(profilePath);
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(subdeptsUser);
}catch (Exception e){
log.error(e.getMessage());
}
}
}
return res;
}
} }
proProjectInfoSubdeptsGroup.setCreateBy(SecurityUtils.getUsername()); return 0;
proProjectInfoSubdeptsGroup.setCreateTime(DateUtils.getNowDate());
return proProjectInfoSubdeptsGroupMapper.insertProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
} }
/** /**
@ -122,13 +188,14 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
@Transactional @Transactional
public int updateProProjectInfoSubdeptsGroup(ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup) public int updateProProjectInfoSubdeptsGroup(ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup)
{ {
// 单位委托人信息 // 班组组长信息
if(StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderName()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderCode()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderPhone())){ if(StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderName()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderCode()) && StringUtils.isNotEmpty(proProjectInfoSubdeptsGroup.getGroupLeaderPhone())){
SysUser sysUser = new SysUser(); SysUser sysUser = new SysUser();
sysUser.setUserName(proProjectInfoSubdeptsGroup.getGroupLeaderPhone()); sysUser.setUserName(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
sysUser.setNickName(proProjectInfoSubdeptsGroup.getGroupLeaderName()); sysUser.setNickName(proProjectInfoSubdeptsGroup.getGroupLeaderName());
sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode()); sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode());
sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardType(CardTypeEnums.SFZ.getCode());
sysUser.setPhonenumber(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
sysUser.setCardCode(proProjectInfoSubdeptsGroup.getGroupLeaderCode()); sysUser.setCardCode(proProjectInfoSubdeptsGroup.getGroupLeaderCode());
sysUser.setUserPicture(proProjectInfoSubdeptsGroup.getGroupLeaderUserPicture()); sysUser.setUserPicture(proProjectInfoSubdeptsGroup.getGroupLeaderUserPicture());
sysUser.setCardImgPos(proProjectInfoSubdeptsGroup.getGroupLeaderCardImgPos()); sysUser.setCardImgPos(proProjectInfoSubdeptsGroup.getGroupLeaderCardImgPos());
@ -138,17 +205,115 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
sysUser.setCreateTime(DateUtils.getNowDate()); sysUser.setCreateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdeptsGroup.getSubDeptName()); sysUser.setRemark(proProjectInfoSubdeptsGroup.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdeptsGroup.getProjectId()); sysUser.setActiveProjectId(proProjectInfoSubdeptsGroup.getProjectId());
Long userId = sysUser.getUserId();
try { try {
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER); userId = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER).getData();
}catch (Exception e){ }catch (Exception e){
// 已注册账号!!忽略异常... // 已注册账号!!忽略异常...
} }
// TODO:实名制接入 if(Objects.nonNull(userId)){
proProjectInfoSubdeptsGroup.setUpdateBy(SecurityUtils.getUsername());
proProjectInfoSubdeptsGroup.setUpdateTime(DateUtils.getNowDate());
int res = proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
// 判断班组组长是否变更
ProProjectInfoSubdeptsGroup entity = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(proProjectInfoSubdeptsGroup.getId());
if(Objects.equals(entity.getGroupLeaderPhone(),proProjectInfoSubdeptsGroup.getGroupLeaderPhone())){
ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers();
query.setProjectId(proProjectInfoSubdeptsGroup.getProjectId());
query.setPhoneNumber(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
List<ProProjectInfoSubdeptsUsers> dataList = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(query);
if (StringUtils.isEmpty(dataList)) {
throw new ServiceException("用户信息异常...");
}
ProProjectInfoSubdeptsUsers subdeptsUser = dataList.get(0);
subdeptsUser.setSubDeptPowerPath(proProjectInfoSubdeptsGroup.getGroupLeaderSubPowerPath());
subdeptsUser.setSubDeptGroupName(proProjectInfoSubdeptsGroup.getGroupName());
subdeptsUser.setUserPost(UserPostEnums.BZZ.getCode());
subdeptsUser.setCraftType(proProjectInfoSubdeptsGroup.getCraftType());
subdeptsUser.setCraftPost(proProjectInfoSubdeptsGroup.getCraftPost());
subdeptsUser.setDegreeGrade(proProjectInfoSubdeptsGroup.getGroupLeaderDegreeGrade());
subdeptsUser.setUpdateBy(SecurityUtils.getUsername());
subdeptsUser.setUpdateTime(DateUtils.getNowDate());
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(subdeptsUser);
}else{
// 判断当前用户是否已有账号
ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers();
query.setProjectId(proProjectInfoSubdeptsGroup.getProjectId());
query.setPhoneNumber(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
List<ProProjectInfoSubdeptsUsers> dataList = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(query);
if (StringUtils.isEmpty(dataList)) {
if(res>0){
// 保存单位人员信息
ProProjectInfoSubdeptsUsers subdeptsUser = new ProProjectInfoSubdeptsUsers();
subdeptsUser.setComId(proProjectInfoSubdeptsGroup.getComId());
subdeptsUser.setProjectId(proProjectInfoSubdeptsGroup.getProjectId());
subdeptsUser.setSubDeptId(proProjectInfoSubdeptsGroup.getSubDeptId());
subdeptsUser.setSubDeptName(proProjectInfoSubdeptsGroup.getSubDeptName());
subdeptsUser.setSubDeptType(proProjectInfoSubdeptsGroup.getSubDeptType());
subdeptsUser.setSubDeptPowerPath(proProjectInfoSubdeptsGroup.getGroupLeaderSubPowerPath());
subdeptsUser.setSubDeptGroup(proProjectInfoSubdeptsGroup.getId());
subdeptsUser.setSubDeptGroupName(proProjectInfoSubdeptsGroup.getGroupName());
subdeptsUser.setUserId(userId);
subdeptsUser.setUserPost(UserPostEnums.BZZ.getCode());
subdeptsUser.setCraftType(proProjectInfoSubdeptsGroup.getCraftType());
subdeptsUser.setCraftPost(proProjectInfoSubdeptsGroup.getCraftPost());
subdeptsUser.setDegreeGrade(proProjectInfoSubdeptsGroup.getGroupLeaderDegreeGrade());
subdeptsUser.setEduStatus(ShiFouEnums.FOU.getCodeStr());
subdeptsUser.setSubStep(1L);
subdeptsUser.setCreateBy(SecurityUtils.getUsername());
subdeptsUser.setApproveStatus(ApproveStatus.passed.getCode());
subdeptsUser.setCreateTime(DateUtils.getNowDate());
res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(subdeptsUser);
if(res>0){
try {
String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
log.info("accessToken...{}",accessToken);
// 生成二维码
WxQrCodeUtils.generateQrCode(savePath, "pages/project_qr/index", "SIGID=4&QRPID="+subdeptsUser.getProjectName()+"&PARID="+subdeptsUser.getId(), accessToken);
subdeptsUser.setQrCode(profilePath);
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(subdeptsUser);
}catch (Exception e){
log.error(e.getMessage());
}
}
}
}else{
ProProjectInfoSubdeptsUsers subdeptsUser = dataList.get(0);
subdeptsUser.setSubDeptPowerPath(proProjectInfoSubdeptsGroup.getGroupLeaderSubPowerPath());
subdeptsUser.setSubDeptGroupName(proProjectInfoSubdeptsGroup.getGroupName());
subdeptsUser.setUserPost(UserPostEnums.BZZ.getCode());
subdeptsUser.setCraftType(proProjectInfoSubdeptsGroup.getCraftType());
subdeptsUser.setCraftPost(proProjectInfoSubdeptsGroup.getCraftPost());
subdeptsUser.setDegreeGrade(proProjectInfoSubdeptsGroup.getGroupLeaderDegreeGrade());
subdeptsUser.setUpdateBy(SecurityUtils.getUsername());
subdeptsUser.setUpdateTime(DateUtils.getNowDate());
subdeptsUser.setUseStatus(UseStateEnums.IN.getCode());
try {
String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
log.info("accessToken...{}",accessToken);
// 生成二维码
WxQrCodeUtils.generateQrCode(savePath, "pages/project_qr/index", "SIGID=4&QRPID="+subdeptsUser.getProjectId()+"&PARID="+subdeptsUser.getId(), accessToken);
subdeptsUser.setQrCode(profilePath);
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(subdeptsUser);
}catch (Exception e){
log.error(e.getMessage());
}
}
}
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(userId,proProjectInfoSubdeptsGroup.getProjectId());
return res;
}
} }
proProjectInfoSubdeptsGroup.setUpdateBy(SecurityUtils.getUsername()); return 0;
proProjectInfoSubdeptsGroup.setUpdateTime(DateUtils.getNowDate());
return proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
} }
/** /**

View File

@ -1,5 +1,6 @@
package com.yanzhu.manage.service.impl; package com.yanzhu.manage.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import com.yanzhu.common.core.constant.CacheConstants; import com.yanzhu.common.core.constant.CacheConstants;
import com.yanzhu.common.core.constant.SecurityConstants; import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.domain.R; import com.yanzhu.common.core.domain.R;
@ -47,7 +48,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
private IUniService uniService; private IUniService uniService;
@Autowired @Autowired
private WxMpService wxMpService; private WxMaService wxMaService;
@Autowired @Autowired
private RedisService redisService; private RedisService redisService;
@ -160,7 +161,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
uniService.syncUniUser(subdeptsUser.getUserId(),subdeptsUser.getProjectId()); uniService.syncUniUser(subdeptsUser.getUserId(),subdeptsUser.getProjectId());
try { try {
if(r>0){ if(r>0){
String accessToken = wxMpService.getAccessToken(); String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png"; String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath; String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath; String profilePath = ProfileConfig.profile+"/"+filePath;
@ -175,7 +176,6 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
}catch (Exception e){ }catch (Exception e){
log.error(e.getMessage()); log.error(e.getMessage());
} }
} }
return res; return res;
} }

View File

@ -1,5 +1,6 @@
package com.yanzhu.manage.service.impl; package com.yanzhu.manage.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import com.yanzhu.common.core.constant.SecurityConstants; import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.enums.*; import com.yanzhu.common.core.enums.*;
import com.yanzhu.common.core.exception.ServiceException; import com.yanzhu.common.core.exception.ServiceException;
@ -49,7 +50,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
private IUniService uniService; private IUniService uniService;
@Autowired @Autowired
private WxMpService wxMpService; private WxMaService wxMaService;
@Autowired @Autowired
private BasTemplateMapper basTemplateMapper; private BasTemplateMapper basTemplateMapper;
@ -127,7 +128,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
if(res>0 && Objects.nonNull(proProjectInfoSubdeptsUsers.getUserPost())){ if(res>0 && Objects.nonNull(proProjectInfoSubdeptsUsers.getUserPost())){
// 生成二维码 // 生成二维码
try { try {
String accessToken = wxMpService.getAccessToken(); String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png"; String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath; String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath; String profilePath = ProfileConfig.profile+"/"+filePath;
@ -562,7 +563,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdepts.setApproveStatus(ApproveStatus.exempt.getCode()); proProjectInfoSubdepts.setApproveStatus(ApproveStatus.exempt.getCode());
// 生成二维码 // 生成二维码
try { try {
String accessToken = wxMpService.getAccessToken(); String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png"; String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath; String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath; String profilePath = ProfileConfig.profile+"/"+filePath;
@ -577,7 +578,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsMapper.updateProProjectInfoSubdepts(proProjectInfoSubdepts); proProjectInfoSubdeptsMapper.updateProProjectInfoSubdepts(proProjectInfoSubdepts);
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.XMJL.getCode())){ }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.XMJL.getCode())){
try { try {
String accessToken = wxMpService.getAccessToken(); String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png"; String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath; String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath; String profilePath = ProfileConfig.profile+"/"+filePath;
@ -593,7 +594,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsGroup.setApproveStatus(ApproveStatus.exempt.getCode()); proProjectInfoSubdeptsGroup.setApproveStatus(ApproveStatus.exempt.getCode());
proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup); proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
try { try {
String accessToken = wxMpService.getAccessToken(); String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png"; String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath; String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath; String profilePath = ProfileConfig.profile+"/"+filePath;

View File

@ -2,9 +2,9 @@
module.exports = { module.exports = {
timeout: 60000, timeout: 60000,
appId: "wx46466c7828eede2b", appId: "wx46466c7828eede2b",
//baseUrl: 'https:xiangguan.sxyanzhu.com', baseUrl: 'https:xiangguan.sxyanzhu.com',
baseUrl: 'http://127.0.0.1:8080', //baseUrl: 'http://127.0.0.1:8080',
//baseImgUrl: 'https:xiangguan.sxyanzhu.com/file', baseImgUrl: 'https:xiangguan.sxyanzhu.com/file',
baseImgUrl: 'http://127.0.0.1:9300', //baseImgUrl: 'http://127.0.0.1:9300',
noSecuritys:['/code','/auth/wxLogin','/auth/getMaOpenId','/auth/getMaPhoneNumber','/auth/maLogin'] noSecuritys:['/code','/auth/wxLogin','/auth/getMaOpenId','/auth/getMaPhoneNumber','/auth/maLogin']
}; };

View File

@ -35,6 +35,15 @@ export function updateProProjectInfo(data) {
}) })
} }
// 重置项目二维码
export function resetProQrCode(id) {
return request({
url: '/manage/proProjectInfo/resetProQrCode/'+id,
method: 'get'
})
}
// 删除项目信息 // 删除项目信息
export function delProProjectInfo(id) { export function delProProjectInfo(id) {
return request({ return request({

View File

@ -122,14 +122,16 @@
<Edit /> <Edit />
</el-icon> </el-icon>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-hasPermi="['manage:proProjectInfo:edit']" command="resetQr"
style="color: var(--el-color-primary);"><el-icon :size="14" color="var(--el-color-primary)">
<Refresh />
</el-icon>
</el-dropdown-item>
<el-dropdown-item divided v-hasPermi="['manage:costOutput:add']" command="outCost" <el-dropdown-item divided v-hasPermi="['manage:costOutput:add']" command="outCost"
style="color: var(--el-color-primary);"><el-icon :size="14" color="var(--el-color-primary)"> style="color: var(--el-color-primary);"><el-icon :size="14" color="var(--el-color-primary)">
<Money /> <Money />
</el-icon> </el-icon>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided v-hasPermi="['manage:proProjectInfo:remove']" command="delete" <el-dropdown-item divided v-hasPermi="['manage:proProjectInfo:remove']" command="delete"
style="color: var(--el-color-primary);"><el-icon :size="14" color="var(--el-color-primary)"> style="color: var(--el-color-primary);"><el-icon :size="14" color="var(--el-color-primary)">
<Delete /> <Delete />
@ -369,7 +371,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-form> </el-form>
@ -387,7 +388,7 @@
<script setup name="ProProjectInfo"> <script setup name="ProProjectInfo">
import { deptTreeSelect } from "@/api/system/user"; import { deptTreeSelect } from "@/api/system/user";
import { listProProjectInfo, getProProjectInfo, delProProjectInfo, addProProjectInfo, updateProProjectInfo } from "@/api/manage/proProjectInfo"; import { listProProjectInfo, getProProjectInfo, delProProjectInfo, addProProjectInfo, updateProProjectInfo, resetProQrCode } from "@/api/manage/proProjectInfo";
import BaiduMap from "@/components/BaiduMap/Map.vue"; import BaiduMap from "@/components/BaiduMap/Map.vue";
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import costOutputDrawer from "../costOutput/costOutputDrawer.vue"; import costOutputDrawer from "../costOutput/costOutputDrawer.vue";
@ -476,6 +477,10 @@ function menuCommand(e,row){
handleUpdate(row); handleUpdate(row);
return; return;
} }
if(e=="resetQr"){
handleResetQr(row);
return;
}
if(e=="delete"){ if(e=="delete"){
handleDelete(row); handleDelete(row);
return; return;
@ -632,6 +637,17 @@ function handleUpdate(row) {
}); });
} }
/** 重置项目二维码 */
function handleResetQr(row) {
proxy.$modal.confirm('是否确认重置项目二维码编号为"' + row.id + '"的数据项?').then(function () {
loading.value = true;
return resetProQrCode(row.id);
}).then(() => {
getList();
proxy.$modal.msgSuccess("重置成功");
}).catch(() => { });
}
/** 参建单位序号 */ /** 参建单位序号 */
function rowProjectDeptsIndex({ row, rowIndex }) { function rowProjectDeptsIndex({ row, rowIndex }) {
row.index = rowIndex + 1; row.index = rowIndex + 1;