|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
+import com.xjrsoft.common.enums.ArchivesStatusEnum;
|
|
|
import com.xjrsoft.common.enums.AssessQuestionTypeEnum;
|
|
import com.xjrsoft.common.enums.AssessQuestionTypeEnum;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
@@ -551,33 +552,54 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean sendMsg(AssessmentTemplatePlanSureDto dto) {
|
|
public Boolean sendMsg(AssessmentTemplatePlanSureDto dto) {
|
|
|
|
|
+ Long teacherId = null;
|
|
|
|
|
+ List<String> roleList = StpUtil.getRoleList();
|
|
|
|
|
+ if(roleList.size() == 2 && roleList.contains("TEACHER") && roleList.contains("CLASSTE")){
|
|
|
|
|
+ teacherId = StpUtil.getLoginIdAsLong();
|
|
|
|
|
+ }
|
|
|
//先查询班上的所有学生
|
|
//先查询班上的所有学生
|
|
|
MPJLambdaWrapper<XjrUser> queryWrapper = new MPJLambdaWrapper<>();
|
|
MPJLambdaWrapper<XjrUser> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
queryWrapper
|
|
queryWrapper
|
|
|
.select(XjrUser.class, x -> VoToColumnUtil.fieldsToColumns(XjrUser.class).contains(x.getProperty()))
|
|
.select(XjrUser.class, x -> VoToColumnUtil.fieldsToColumns(XjrUser.class).contains(x.getProperty()))
|
|
|
.innerJoin(AssessmentPlanAnswerStudent.class, AssessmentPlanAnswerStudent::getStudentUserId,XjrUser::getId)
|
|
.innerJoin(AssessmentPlanAnswerStudent.class, AssessmentPlanAnswerStudent::getStudentUserId,XjrUser::getId)
|
|
|
.innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId,XjrUser::getId)
|
|
.innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId,XjrUser::getId)
|
|
|
- .eq(BaseStudentSchoolRoll::getClassId , dto.getClassId())
|
|
|
|
|
- .eq(AssessmentPlanAnswerStudent::getAssessmentTemplatePlanId , dto.getId())
|
|
|
|
|
|
|
+ .innerJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
|
|
|
|
|
+ .eq(BaseStudentSchoolRoll::getClassId, dto.getClassId())
|
|
|
|
|
+ .eq(AssessmentPlanAnswerStudent::getAssessmentTemplatePlanId, dto.getId())
|
|
|
|
|
+ .eq(teacherId != null, BaseClass::getTeacherId, teacherId)
|
|
|
|
|
+ .eq(BaseStudentSchoolRoll::getArchivesStatus, ArchivesStatusEnum.FB2901.getCode())
|
|
|
.disableSubLogicDel();
|
|
.disableSubLogicDel();
|
|
|
List<XjrUser> userList = xjrUserMapper.selectJoinList(XjrUser.class, queryWrapper);
|
|
List<XjrUser> userList = xjrUserMapper.selectJoinList(XjrUser.class, queryWrapper);
|
|
|
AssessmentTemplatePlan templatePlan = templatePlanMapper.selectById(dto.getId());
|
|
AssessmentTemplatePlan templatePlan = templatePlanMapper.selectById(dto.getId());
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
|
|
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ String templateId = "sHsmz7LRj7HLd7GSTS3r2jCLvK-4Wp19iGzEvYK8n_I";
|
|
|
for (XjrUser user : userList) {
|
|
for (XjrUser user : userList) {
|
|
|
WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
|
|
WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
|
|
|
weChatSendMessageDto.setUserId(user.getOpenId());
|
|
weChatSendMessageDto.setUserId(user.getOpenId());
|
|
|
|
|
|
|
|
- weChatSendMessageDto.setTemplateId(weChatUtil.getAssessmentTemplate());
|
|
|
|
|
|
|
+ weChatSendMessageDto.setTemplateId(templateId);
|
|
|
weChatSendMessageDto.setUrl(StrUtil.format("{}/pages/student/canteen/evaluate?id={}", commonPropertiesConfig.getDomainApp(), dto.getId()));
|
|
weChatSendMessageDto.setUrl(StrUtil.format("{}/pages/student/canteen/evaluate?id={}", commonPropertiesConfig.getDomainApp(), dto.getId()));
|
|
|
weChatSendMessageDto.setMsgId(dto.getId().toString());
|
|
weChatSendMessageDto.setMsgId(dto.getId().toString());
|
|
|
|
|
|
|
|
- JSONObject data = new JSONObject();
|
|
|
|
|
- data.put("thing1.DATA", templatePlan.getName());
|
|
|
|
|
- data.put("time2.DATA", sdf.format(templatePlan.getStartTime()));
|
|
|
|
|
- data.put("time3.DATA", sdf.format(templatePlan.getEndTime()));
|
|
|
|
|
- data.put("thing5.DATA", "test");
|
|
|
|
|
- data.put("thing8.DATA", "test");
|
|
|
|
|
- weChatSendMessageDto.setContent(data);
|
|
|
|
|
|
|
+ JSONObject paramJson = new JSONObject();
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject thing8 = new JSONObject();
|
|
|
|
|
+ thing8.put("value", "食堂评价");
|
|
|
|
|
+ paramJson.put("thing8", thing8);
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject thing2 = new JSONObject();
|
|
|
|
|
+ thing2.put("value", templatePlan.getName());
|
|
|
|
|
+ paramJson.put("thing2", thing2);
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject thing6 = new JSONObject();
|
|
|
|
|
+ thing6.put("value", "重庆市铜梁职业教育中心");
|
|
|
|
|
+ paramJson.put("thing6", thing6);
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject time3 = new JSONObject();
|
|
|
|
|
+ time3.put("value", sdf.format(templatePlan.getStartTime()));
|
|
|
|
|
+ paramJson.put("time3", time3);
|
|
|
|
|
+
|
|
|
|
|
+ weChatSendMessageDto.setContent(paramJson);
|
|
|
weChatService.sendTemplateMessage(weChatSendMessageDto);
|
|
weChatService.sendTemplateMessage(weChatSendMessageDto);
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|