jz.kai 5 năm trước cách đây
mục cha
commit
3f5f4b5be2

+ 63 - 4
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/StudentInsuranceController.java

@@ -11,6 +11,7 @@ import com.jpsoft.picc.modules.business.entity.StudentApplication;
 import com.jpsoft.picc.modules.business.entity.StudentApplicationRecord;
 import com.jpsoft.picc.modules.business.service.StudentApplicationRecordService;
 import com.jpsoft.picc.modules.business.service.StudentApplicationService;
+import com.jpsoft.picc.modules.common.constant.StudentPolicyStatus;
 import com.jpsoft.picc.modules.common.dto.MessageResult;
 import com.jpsoft.picc.modules.common.dto.Sort;
 import com.jpsoft.picc.modules.common.utils.PojoUtils;
@@ -45,8 +46,12 @@ public class StudentInsuranceController {
     private StudentApplicationRecordService studentApplicationRecordService;
 
     @ApiOperation(value="获取信息")
-    @GetMapping("detail/{id}")
-    public MessageResult<Map> edit(@PathVariable("id") String id){
+    @PostMapping("detail")
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id",value = "险种编号", required = false, paramType = "form")
+    })
+    public MessageResult<Map> detail(String id){
         MessageResult<Map> msgResult = new MessageResult<>();
         Map<String,Object> map = new HashMap<>();
 
@@ -109,6 +114,25 @@ public class StudentInsuranceController {
 
     @ApiOperation(value="添加信息")
     @PostMapping("save")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "insuredId",value = "学生编号", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "insuredName",value = "学生姓名", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "insuredSex",value = "学生性别", required = false,paramType="form"),
+            @ApiImplicitParam(name = "insuredSchoolId",value = "学校编号", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "insuredSchoolName",value = "学校", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "companyId",value = "班级编号", required = false,paramType="form"),
+            @ApiImplicitParam(name = "companyName",value = "班级", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "insuredCard",value = "学生身份证号", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "haveMedicare",value = "有无医保", required = false,paramType="form"),
+            @ApiImplicitParam(name = "attachId",value = "家长编号", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "attachName",value = "家长姓名", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "relationship",value = "亲属关系", required = false,paramType="form"),
+            @ApiImplicitParam(name = "attachTel",value = "家长电话", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "definitionId",value = "保障方案编号", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "definitionName",value = "保障方案", required = false,paramType="form"),
+            @ApiImplicitParam(name = "startTime",value = "生效时间", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "endTime",value = "失效时间", required = false, paramType = "form")
+    })
     public MessageResult<StudentApplication> save(
             String insuredId,String insuredName,String insuredSex,String insuredSchoolId,String insuredSchoolName,String companyId,String companyName,String insuredCard,Boolean haveMedicare,
             String attachId,String attachName,String relationship,String attachTel,
@@ -136,7 +160,8 @@ public class StudentInsuranceController {
             studentApplication.setAttachTel(attachTel);
             studentApplication.setDefinitionId(definitionId);
             studentApplication.setDefinitionName(definitionName);
-            studentApplication.setPolicyNo(sdf.format(new Date()));
+            String num = sdf.format(new Date());
+            studentApplication.setPolicyNo(num + "," + (Integer.parseInt(num) + 1));
             if(definitionId.equals("b318c3ac-c460-4d93-aa92-78b57efba125")) {
                 studentApplication.setHaveAttach(true);
             }else{
@@ -147,6 +172,7 @@ public class StudentInsuranceController {
             studentApplication.setDelFlag(false);
             studentApplication.setCreateBy(subject);
             studentApplication.setCreateTime(new Date());
+            studentApplication.setStatus(String.valueOf(StudentPolicyStatus.PendingPay.getValue()));
 
             int affectCount = studentApplicationService.insert(studentApplication);
 
@@ -155,7 +181,7 @@ public class StudentInsuranceController {
                 studentApplicationRecord.setId(UUID.randomUUID().toString());
                 studentApplicationRecord.setApplicationId(studentApplication.getId());
                 studentApplicationRecord.setProcessStatus("正常");
-                studentApplicationRecord.setStatus("10");
+                studentApplicationRecord.setStatus(String.valueOf(StudentPolicyStatus.PendingPay.getValue()));
                 studentApplicationRecord.setDelFlag(false);
                 studentApplicationRecord.setCreateBy(subject);
                 studentApplicationRecord.setCreateTime(new Date());
@@ -177,4 +203,37 @@ public class StudentInsuranceController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="保单列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="name",value = "名称",paramType = "query")
+    })
+    public MessageResult<Map> list(
+            String name,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time","desc"));
+
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
+        }
+
+        Page<InsuranceDefinition> page = insuranceDefinitionService.pageSearch(searchParams,pageIndex,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
 }