|
@@ -1,9 +1,121 @@
|
|
|
package com.jpsoft.picc.modules.auth.controller;
|
|
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
|
|
|
+import com.jpsoft.picc.modules.business.service.InsurancePolicyService;
|
|
|
+import com.jpsoft.picc.modules.common.dto.MessageResult;
|
|
|
+import com.jpsoft.picc.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.picc.modules.common.utils.PojoUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@Api(description="每月投保单")
|
|
|
@RestController
|
|
|
public class InsurancePolicyController {
|
|
|
+ private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private InsurancePolicyService insurancePolicyService;
|
|
|
+
|
|
|
+ @ApiOperation(value="每月投保单列表")
|
|
|
+ @RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "applicationId",value = "投保申请ID", required = true, paramType = "form",dataType = "String")
|
|
|
+ })
|
|
|
+ public MessageResult<Map> pageList(
|
|
|
+ @RequestParam(value="applicationId",defaultValue="") String applicationId,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize){
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("delFlag",false);
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("id_","asc"));
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(applicationId)) {
|
|
|
+ searchParams.put("applicationId",applicationId);
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<InsurancePolicy> page = insurancePolicyService.pageSearch(searchParams,pageIndex,pageSize,sortList);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="每月投保单详情")
|
|
|
+ @RequestMapping(value = "detail",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id",value = "编号", required = true, paramType = "form",dataType = "String")
|
|
|
+ })
|
|
|
+ public MessageResult<InsurancePolicy> detail(@RequestParam(value="id",defaultValue="") String id){
|
|
|
+ MessageResult<InsurancePolicy> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ InsurancePolicy insurancePolicy = insurancePolicyService.get(id);
|
|
|
+
|
|
|
+ if (insurancePolicy != null) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(insurancePolicy);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库不存在该记录!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="查看退回理由")
|
|
|
+ @RequestMapping(value = "backReason",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id",value = "编号", required = true, paramType = "form",dataType = "String")
|
|
|
+ })
|
|
|
+ public MessageResult<String> backReason(@RequestParam(value="id",defaultValue="") String id){
|
|
|
+ MessageResult<String> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ InsurancePolicy insurancePolicy = insurancePolicyService.get(id);
|
|
|
+
|
|
|
+ if (insurancePolicy != null) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData("aaa");
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库不存在该记录!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|