|
@@ -30,6 +30,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
@@ -89,7 +90,7 @@ public class ReplacementInstrumentActivityController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "修改")
|
|
|
- @GetMapping("/update")
|
|
|
+ @PostMapping("/update")
|
|
|
@PreAuthorize("@pcs.hasPermissions('replacementInstrumentActivity/update')")
|
|
|
public HttpResponseResult<ReplacementInstrumentActivity> update(ReplacementInstrumentActivity replacementInstrumentActivity) {
|
|
|
ReplacementInstrumentActivity oldReplacementInstrumentActivity = replacementInstrumentActivityDao.getLock(replacementInstrumentActivity.getId());
|
|
@@ -147,12 +148,24 @@ public class ReplacementInstrumentActivityController extends BaseController {
|
|
|
if (pageList.getTotal() <= 0) {
|
|
|
throw new BizException("没有可导出的记录");
|
|
|
}
|
|
|
+ for (ReplacementInstrumentActivityStatDto row : pageList.getRows()) {
|
|
|
+ if (row.getQuestionResult().substring(0, 1).equals("1")) {
|
|
|
+ row.setHasYesFirstAnswer("是");
|
|
|
+ } else {
|
|
|
+ row.setHasYesFirstAnswer("否");
|
|
|
+ }
|
|
|
+ if(row.getHasInstrumentsId() == null){
|
|
|
+ row.setHasInstrumentsId("否");
|
|
|
+ }else {
|
|
|
+ row.setHasInstrumentsId("是");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
HSSFWorkbook workbook = null;
|
|
|
try {
|
|
|
- String[] header = {"分部", "合作单位编号", "合作单位", "学员编号", "学员姓名", "联系电话", "声部", "品牌", "型号"};
|
|
|
- String[] body = {"organName", "cooperationOrganId", "cooperationOrganName", "userId", "userName", "mobileNo", "subjectName", "brand", "specification"};
|
|
|
+ String[] header = {"分部", "合作单位编号", "合作单位", "学员编号", "学员姓名", "联系电话", "声部", "品牌", "型号", "是否参与校赛", "是否置换乐器"};
|
|
|
+ String[] body = {"organName", "cooperationOrganId", "cooperationOrganName", "userId", "userName", "mobileNo", "subjectName", "brand", "specification","hasYesFirstAnswer","hasInstrumentsId"};
|
|
|
workbook = POIUtil.exportExcel(header, body, pageList.getRows());
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=replacement-" + DateUtil.getDate(new Date()) + ".xls");
|