修改bug

This commit is contained in:
yangjun 2024-05-23 13:19:25 +08:00
parent 7d0ba72d6e
commit 2d90714086
4 changed files with 52 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package org.jeecg.modules.kc.wjxDjxx.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -13,6 +14,8 @@ import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmlbPage;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx;
import org.jeecg.modules.kc.wjxDjxx.mapper.WjxDjxxMapper;
import org.jeecg.modules.kc.wjxDjxx.service.IWjxDjxxService;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import org.jeecg.modules.kc.wjxWjxx.mapper.WjxWjxxMapper;
import org.jeecg.modules.kc.wjxWjxx.utils.WjxUtil;
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmxx;
import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper;
@ -37,6 +40,8 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
private WjxUtil wjxUtil;
@Autowired
private WjxWjxxTmxxMapper wjxWjxxTmxxMapper;
@Autowired
private WjxWjxxMapper wjxWjxxMapper;
/**
* 提交问卷并查询答卷
@ -198,6 +203,25 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
return jsonResult.getString("errormsg");
}
}
//修改问卷状态
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
wjxWjxxQueryWrapper.eq("vid",vid);
wjxWjxxQueryWrapper.last("limit 1");
WjxWjxx wjxWjxx = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
int xkrs = Integer.parseInt(wjxWjxx.getXkrs());
QueryWrapper<WjxDjxx> djxxQueryWrapper = new QueryWrapper<>();
djxxQueryWrapper.eq("vid",vid);
List<WjxDjxx> listNum = baseMapper.selectList(djxxQueryWrapper);
int djsl = listNum.size();
System.out.println(xkrs+"------------------------"+djsl);
if(1 == 1){
wjxWjxx.setQpublish("2");
wjxWjxxMapper.updateById(wjxWjxx);
}
return "提交成功!";
}

View File

@ -66,7 +66,7 @@ public class WjxWjxx implements Serializable {
private java.lang.String content;
/**是否发布问卷*/
@Excel(name = "是否发布问卷", width = 15, dicCode = "yn")
@Dict(dicCode = "yn")
@Dict(dicCode = "zy_status")
@ApiModelProperty(value = "是否发布问卷")
private java.lang.String qpublish;
/**是否图片压缩*/

View File

@ -70,7 +70,7 @@
and b.flag = #{param.flag}
</if>
</if>
order by a.create_time desc,a.start_time asc
order by a.end_time desc
</select>
<select id="kcxx" parameterType="String" resultType="org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx">

View File

@ -20,6 +20,8 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.SpringContextHolder;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.kc.zyInfoStudent.service.IZyInfoStudentService;
@ -62,6 +64,9 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@Autowired
private IZyInfoStudentService zyInfoStudentService;
@Autowired
private IZyInfoService zyInfoService;
@Value("${jeecg.path.upload}")
private String upLoadPath;
/**
@ -119,6 +124,27 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@RequestMapping(value = "/editFabu", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editFabu(@RequestBody ZyInfoStudent zyInfoStudent) {
zyInfoStudentService.editFabu(zyInfoStudent);
ZyInfoStudent zyInfoStudentPar = zyInfoStudentService.getById(zyInfoStudent.getId());
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper = new QueryWrapper<>();
zyInfoStudentQueryWrapper.eq("main_id",zyInfoStudentPar.getMainId());
List<ZyInfoStudent> list = zyInfoStudentService.list(zyInfoStudentQueryWrapper);
int a = list.size();
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper2 = new QueryWrapper<>();
zyInfoStudentQueryWrapper2.eq("main_id",zyInfoStudentPar.getMainId());
zyInfoStudentQueryWrapper2.eq("score_fabu","1");
List<ZyInfoStudent> list2 = zyInfoStudentService.list(zyInfoStudentQueryWrapper2);
int b = list2.size();
if(a==b){
UpdateWrapper<ZyInfo> zyInfo = new UpdateWrapper<>();
zyInfo.eq("id",zyInfoStudentPar.getMainId());
zyInfo.set("zy_status","2");
zyInfoService.update(zyInfo);
}
return Result.OK("编辑成功!");
}
/**