修改潜在客户列表展示接口条件 题库列表新增 区分管理员和老师数据隔离 修改批量导入客观题逻辑 修改新增案例题接口 新增删除案例题等接口

master
xiaoCJ
parent b91ed33bca
commit 1e8f87d902

@ -49,10 +49,31 @@ public class CaseController {
@PostMapping("/insertOrUpdateInvestmentPlan") @PostMapping("/insertOrUpdateInvestmentPlan")
@ApiOperation("新增/编辑案例,投资规划") @ApiOperation("新增/编辑案例,投资规划")
private ResultEntity<HttpStatus> insertOrUpdateInvestmentPlan(@ApiParam("老师或管理员新增修改不传userId")@RequestBody CaseInvestmentPlanDto caseInvestmentPlanDto) { private ResultEntity<HttpStatus> insertOrUpdateInvestmentPlan(@ApiParam("老师或管理员新增修改不传userId") @RequestBody CaseInvestmentPlanDto caseInvestmentPlanDto) {
return caseService.insertOrUpdateInvestmentPlan(caseInvestmentPlanDto); return caseService.insertOrUpdateInvestmentPlan(caseInvestmentPlanDto);
} }
@PostMapping("/deleteCase")
@ApiOperation("删除案例题")
private ResultEntity<HttpStatus> deleteCase(@RequestParam String caseId,
@ApiParam("管理员/老师")@RequestParam String role) {
CaseInfo caseInfo = caseInfoMapper.selectByPrimaryKey(caseId);
if (role.equals("老师")) {
if (caseInfo.getSource().equals("999999999")) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "内置题目,无法删除");
}
caseInfoMapper.deleteByPrimaryKey(caseId);
return new ResultEntity<HttpStatus>(HttpStatus.OK, "删除成功");
}
if (role.equals("管理员")) {
caseInfoMapper.deleteByPrimaryKey(caseId);
return new ResultEntity<HttpStatus>(HttpStatus.OK, "删除成功");
}
return null;
}
@PostMapping("/ZHGHType") @PostMapping("/ZHGHType")
@ApiOperation("综合规划下方展示类型") @ApiOperation("综合规划下方展示类型")
@AnonymousAccess @AnonymousAccess

@ -40,8 +40,8 @@ public class ProductCenter {
@ApiOperation("基金产品查询") @ApiOperation("基金产品查询")
@AnonymousAccess @AnonymousAccess
public ResultEntity<PageInfo<FundProduct>> selectFundProduct(@RequestParam(required = false) String param, public ResultEntity<PageInfo<FundProduct>> selectFundProduct(@RequestParam(required = false) String param,
@RequestParam Integer index, @RequestParam Integer index,
@RequestParam Integer size) { @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
FundProductExample example = new FundProductExample(); FundProductExample example = new FundProductExample();
if (param != null) { if (param != null) {
@ -65,9 +65,10 @@ public class ProductCenter {
@PostMapping("selectBankDeposits") @PostMapping("selectBankDeposits")
@ApiOperation("银行储蓄查询") @ApiOperation("银行储蓄查询")
@AnonymousAccess @AnonymousAccess
public ResultEntity<PageInfo<BankDeposits>> selectBankDeposits(@RequestParam(required = false) String bankName, @RequestParam String schoolId, public ResultEntity<PageInfo<BankDeposits>> selectBankDeposits(@RequestParam(required = false) String bankName,
@RequestParam Integer index, @RequestParam String schoolId,
@RequestParam Integer size) { @RequestParam Integer index,
@RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
BankDepositsExample example = new BankDepositsExample(); BankDepositsExample example = new BankDepositsExample();
BankDepositsExample.Criteria criteria = example.createCriteria(); BankDepositsExample.Criteria criteria = example.createCriteria();
@ -92,8 +93,8 @@ public class ProductCenter {
@ApiOperation("P2P产品查询") @ApiOperation("P2P产品查询")
@AnonymousAccess @AnonymousAccess
public ResultEntity<PageInfo<p2pProduct>> selectP2PProduct(@RequestParam(required = false) String productName, public ResultEntity<PageInfo<p2pProduct>> selectP2PProduct(@RequestParam(required = false) String productName,
@RequestParam Integer index, @RequestParam Integer index,
@RequestParam Integer size) { @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
p2pProductExample example = new p2pProductExample(); p2pProductExample example = new p2pProductExample();
if (productName != null) { if (productName != null) {
@ -111,7 +112,7 @@ public class ProductCenter {
@ApiOperation("实务黄金查询") @ApiOperation("实务黄金查询")
@AnonymousAccess @AnonymousAccess
public ResultEntity<PageInfo<RealGoldProduct>> selectRealGoldProduct(@RequestParam Integer index, public ResultEntity<PageInfo<RealGoldProduct>> selectRealGoldProduct(@RequestParam Integer index,
@RequestParam Integer size) { @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
RealGoldProductExample example = new RealGoldProductExample(); RealGoldProductExample example = new RealGoldProductExample();
example.setOrderByClause("trading_day asc"); example.setOrderByClause("trading_day asc");
@ -124,9 +125,9 @@ public class ProductCenter {
@ApiOperation("保险产品查询") @ApiOperation("保险产品查询")
@AnonymousAccess @AnonymousAccess
public ResultEntity<PageInfo<InsurancePro>> selectInsurancePro(@ApiParam("保险子类") @RequestParam(required = false) String kind, public ResultEntity<PageInfo<InsurancePro>> selectInsurancePro(@ApiParam("保险子类") @RequestParam(required = false) String kind,
@ApiParam("搜索参数") @RequestParam(required = false) String name, @ApiParam("搜索参数") @RequestParam(required = false) String name,
@RequestParam Integer index, @RequestParam Integer index,
@RequestParam Integer size) { @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
InsuranceProExample example = new InsuranceProExample(); InsuranceProExample example = new InsuranceProExample();
InsuranceProExample.Criteria criteria = example.createCriteria(); InsuranceProExample.Criteria criteria = example.createCriteria();

@ -58,9 +58,9 @@ public class TopicController {
if (!objectiveQuestion.getOutline().equals("普通题库") && StringUtils.isBlank(objectiveQuestion.getSubclass())) { if (!objectiveQuestion.getOutline().equals("普通题库") && StringUtils.isBlank(objectiveQuestion.getSubclass())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "大纲子类不能为空!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "大纲子类不能为空!");
} }
if (StringUtils.isBlank(objectiveQuestion.getChapterId()) || StringUtils.isBlank(objectiveQuestion.getChapterName())) { // if (StringUtils.isBlank(objectiveQuestion.getChapterId()) || StringUtils.isBlank(objectiveQuestion.getChapterName())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "所属章节信息不能为空!"); // return new ResultEntity<>(HttpStatus.BAD_REQUEST, "所属章节信息不能为空!");
} // }
if (objectiveQuestion.getType() == 1 || objectiveQuestion.getType() == 0) { if (objectiveQuestion.getType() == 1 || objectiveQuestion.getType() == 0) {
if (StringUtils.isBlank(objectiveQuestion.getQuestionA()) || StringUtils.isBlank(objectiveQuestion.getQuestionB()) if (StringUtils.isBlank(objectiveQuestion.getQuestionA()) || StringUtils.isBlank(objectiveQuestion.getQuestionB())
|| StringUtils.isBlank(objectiveQuestion.getQuestionC()) || StringUtils.isBlank(objectiveQuestion.getQuestionD())) || StringUtils.isBlank(objectiveQuestion.getQuestionC()) || StringUtils.isBlank(objectiveQuestion.getQuestionD()))
@ -141,12 +141,13 @@ public class TopicController {
@AnonymousAccess @AnonymousAccess
private ResultEntity<PageInfo<ObjectiveQuestionWithBLOBs>> getObjectiveByType(@RequestParam Integer index, private ResultEntity<PageInfo<ObjectiveQuestionWithBLOBs>> getObjectiveByType(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@ApiParam("0单选1多选2判断") @RequestParam int type, @ApiParam("0单选1多选2判断") @RequestParam(required = false) Integer type,
@ApiParam("普通题库/金融智能/银行从业") @RequestParam String outLine, @ApiParam("普通题库/金融智能/银行从业") @RequestParam String outLine,
@ApiParam("理论知识/专业能力公共基础/个人理财/风险管理/公司信贷/个人贷款") @RequestParam(required = false) String subClass, @ApiParam("理论知识/专业能力公共基础/个人理财/风险管理/公司信贷/个人贷款") @RequestParam(required = false) String subClass,
@RequestParam(required = false) String content) { @RequestParam(required = false) String content,
@RequestParam(required = false) String schoolId) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
List<ObjectiveQuestionWithBLOBs> list = objectiveQuestionMapper.getObjectiveByType(type, outLine, subClass, content); List<ObjectiveQuestionWithBLOBs> list = objectiveQuestionMapper.getObjectiveByType(type, outLine, subClass, content,schoolId);
PageInfo pageInfo = new PageInfo(list); PageInfo pageInfo = new PageInfo(list);
return new ResultEntity<PageInfo<ObjectiveQuestionWithBLOBs>>(pageInfo); return new ResultEntity<PageInfo<ObjectiveQuestionWithBLOBs>>(pageInfo);
} }
@ -165,8 +166,8 @@ public class TopicController {
@AnonymousAccess @AnonymousAccess
private ResultEntity<List<ObjectiveQuestionDto>> getObjectiveRecord(@RequestParam String chapterId, private ResultEntity<List<ObjectiveQuestionDto>> getObjectiveRecord(@RequestParam String chapterId,
@RequestParam String trainingId, @RequestParam String trainingId,
@ApiParam("重新作答按钮传true")@RequestParam boolean flag) { @ApiParam("重新作答按钮传true") @RequestParam boolean flag) {
List<ObjectiveQuestionDto> list = objectiveQuestionService.getObjectiveRecord(chapterId, trainingId,flag); List<ObjectiveQuestionDto> list = objectiveQuestionService.getObjectiveRecord(chapterId, trainingId, flag);
return new ResultEntity<List<ObjectiveQuestionDto>>(list); return new ResultEntity<List<ObjectiveQuestionDto>>(list);
} }

@ -43,10 +43,11 @@ public interface ObjectiveQuestionMapper {
List<TopicDto> getObjectiveCountByChapterId(@Param("outLine") String outLine, List<TopicDto> getObjectiveCountByChapterId(@Param("outLine") String outLine,
@Param("chapterId") String chapterId); @Param("chapterId") String chapterId);
List<ObjectiveQuestionWithBLOBs> getObjectiveByType(@Param("type") int type, List<ObjectiveQuestionWithBLOBs> getObjectiveByType(@Param("type") Integer type,
@Param("outLine") String outLine, @Param("outLine") String outLine,
@Param("subClass") String subClass, @Param("subClass") String subClass,
@Param("content") String content); @Param("content") String content,
@Param("schoolId") String schoolId);
int batchDelete(@Param("list") List<String> objectiveQuestionId); int batchDelete(@Param("list") List<String> objectiveQuestionId);

@ -361,7 +361,7 @@ public class CaseServiceImpl implements CaseService {
} }
if (type.equals("生涯规划-消费规划")) { if (type.equals("生涯规划-消费规划")) {
CaseConsumptionPlanWithBLOBs caseConsumptionPlan = gson.fromJson(json, CaseConsumptionPlanWithBLOBs.class); CaseConsumptionPlan caseConsumptionPlan = gson.fromJson(json, CaseConsumptionPlan.class);
if (StringUtils.isBlank(caseConsumptionPlan.getCaseConsumptionPlanId())) { if (StringUtils.isBlank(caseConsumptionPlan.getCaseConsumptionPlanId())) {
caseConsumptionPlan.setCaseConsumptionPlanId(IdUtil.randomUUID()); caseConsumptionPlan.setCaseConsumptionPlanId(IdUtil.randomUUID());
caseConsumptionPlanMapper.insert(caseConsumptionPlan); caseConsumptionPlanMapper.insert(caseConsumptionPlan);
@ -2006,7 +2006,7 @@ public class CaseServiceImpl implements CaseService {
} else { } else {
criteria.andUserIdEqualTo(userId); criteria.andUserIdEqualTo(userId);
} }
List<CaseConsumptionPlan> CaseConsumptionPlans = caseConsumptionPlanMapper.selectByExampleWithBLOBs(example); List<CaseConsumptionPlan> CaseConsumptionPlans = caseConsumptionPlanMapper.selectByExample(example);
if (CaseConsumptionPlans == null || CaseConsumptionPlans.isEmpty()) { if (CaseConsumptionPlans == null || CaseConsumptionPlans.isEmpty()) {
return null; return null;
} }

@ -12,7 +12,6 @@ import com.sztzjy.money_management.service.ObjectiveQuestionService;
import com.sztzjy.money_management.util.ResultEntity; import com.sztzjy.money_management.util.ResultEntity;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.hibernate.event.spi.SaveOrUpdateEvent;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -114,7 +113,13 @@ public class ObjectiveQuestionServiceImpl implements ObjectiveQuestionService {
} }
objectiveQuestionList.add(obj); objectiveQuestionList.add(obj);
} }
if (objectiveQuestionList.isEmpty()) {
return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "数据为空");
}
int result = objectiveQuestionMapper.insertBatch(objectiveQuestionList); int result = objectiveQuestionMapper.insertBatch(objectiveQuestionList);
if (result > 0) { if (result > 0) {
return new ResultEntity<>(HttpStatus.OK, "批量导入成功!"); return new ResultEntity<>(HttpStatus.OK, "批量导入成功!");
} else { } else {

@ -478,6 +478,9 @@
<if test="subClass !=null and subClass !=''"> <if test="subClass !=null and subClass !=''">
and subclass = #{subClass} and subclass = #{subClass}
</if> </if>
<if test="schoolId !=null and schoolId!=''">
and source in ('999999999',#{schoolId})
</if>
</where> </where>
</select> </select>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save