|  | @ -0,0 +1,102 @@
 | 
												
													
														
															|  | 
 |  | package com.yihu.jw.entrance.controller.expressage;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.entrance.service.WlyyPatientExpressageAddrService;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPatientExpressageAddrVO;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.restmodel.web.ListEnvelop;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.restmodel.web.ObjEnvelop;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.restmodel.web.PageEnvelop;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
												
													
														
															|  | 
 |  | import io.swagger.annotations.Api;
 | 
												
													
														
															|  | 
 |  | import io.swagger.annotations.ApiOperation;
 | 
												
													
														
															|  | 
 |  | import io.swagger.annotations.ApiParam;
 | 
												
													
														
															|  | 
 |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
												
													
														
															|  | 
 |  | import org.springframework.web.bind.annotation.*;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | import java.util.List;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.entity.hospital.prescription.WlyyPatientExpressageAddrDO;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | /**
 | 
												
													
														
															|  | 
 |  |  * 居民收获地址控制器
 | 
												
													
														
															|  | 
 |  |  *
 | 
												
													
														
															|  | 
 |  |  * @version <pre>
 | 
												
													
														
															|  | 
 |  |  * Author	Version		Date		Changes
 | 
												
													
														
															|  | 
 |  |  * Administrator 	1.0  		2019年06月12日 	Created
 | 
												
													
														
															|  | 
 |  |  *
 | 
												
													
														
															|  | 
 |  |  * </pre>
 | 
												
													
														
															|  | 
 |  |  * @since 1.
 | 
												
													
														
															|  | 
 |  |  */
 | 
												
													
														
															|  | 
 |  | @RestController
 | 
												
													
														
															|  | 
 |  | @RequestMapping(value = BaseHospitalRequestMapping.WlyyPatientExpressageAddr.PREFIX)
 | 
												
													
														
															|  | 
 |  | @Api(value = "居民收获地址管理", description = "居民收获地址管理服务接口", tags = {"wlyy基础服务 - 居民收获地址管理服务接口"})
 | 
												
													
														
															|  | 
 |  | public class WlyyPatientExpressageAddrEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @Autowired
 | 
												
													
														
															|  | 
 |  |     private WlyyPatientExpressageAddrService wlyyPatientExpressageAddrService;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyyPatientExpressageAddr.CREATE)
 | 
												
													
														
															|  | 
 |  |     @ApiOperation(value = "创建")
 | 
												
													
														
															|  | 
 |  |     public ObjEnvelop<WlyyPatientExpressageAddrVO> create(
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
												
													
														
															|  | 
 |  |             @RequestParam String jsonData) throws Exception {
 | 
												
													
														
															|  | 
 |  |         WlyyPatientExpressageAddrDO wlyyPatientExpressageAddr = toEntity(jsonData, WlyyPatientExpressageAddrDO.class);
 | 
												
													
														
															|  | 
 |  |         wlyyPatientExpressageAddr = wlyyPatientExpressageAddrService.save(wlyyPatientExpressageAddr);
 | 
												
													
														
															|  | 
 |  |         return success(wlyyPatientExpressageAddr, WlyyPatientExpressageAddrVO.class);
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyyPatientExpressageAddr.DELETE)
 | 
												
													
														
															|  | 
 |  |     @ApiOperation(value = "删除")
 | 
												
													
														
															|  | 
 |  |     public Envelop delete(
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "ids") String ids) {
 | 
												
													
														
															|  | 
 |  |         wlyyPatientExpressageAddrService.delete(ids.split(","));
 | 
												
													
														
															|  | 
 |  |         return success("删除成功");
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyyPatientExpressageAddr.UPDATE)
 | 
												
													
														
															|  | 
 |  |     @ApiOperation(value = "更新")
 | 
												
													
														
															|  | 
 |  |     public ObjEnvelop<WlyyPatientExpressageAddrVO> update(
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
												
													
														
															|  | 
 |  |             @RequestParam String jsonData) throws Exception {
 | 
												
													
														
															|  | 
 |  |         WlyyPatientExpressageAddrDO wlyyPatientExpressageAddr = toEntity(jsonData, WlyyPatientExpressageAddrDO.class);
 | 
												
													
														
															|  | 
 |  |         if (null == wlyyPatientExpressageAddr.getId()) {
 | 
												
													
														
															|  | 
 |  |             return failed("ID不能为空", ObjEnvelop.class);
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         wlyyPatientExpressageAddr = wlyyPatientExpressageAddrService.save(wlyyPatientExpressageAddr);
 | 
												
													
														
															|  | 
 |  |         return success(wlyyPatientExpressageAddr, WlyyPatientExpressageAddrVO.class);
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @GetMapping(value = BaseHospitalRequestMapping.WlyyPatientExpressageAddr.PAGE)
 | 
												
													
														
															|  | 
 |  |     @ApiOperation(value = "获取分页")
 | 
												
													
														
															|  | 
 |  |     public PageEnvelop<WlyyPatientExpressageAddrVO> page(
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "fields", required = false) String fields,
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "filters", required = false) String filters,
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "sorts", required = false) String sorts,
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "page") int page,
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "size") int size) throws Exception {
 | 
												
													
														
															|  | 
 |  |         List<WlyyPatientExpressageAddrDO> wlyyPatientExpressageAddrs = wlyyPatientExpressageAddrService.search(fields, filters, sorts, page, size);
 | 
												
													
														
															|  | 
 |  |         int count = (int) wlyyPatientExpressageAddrService.getCount(filters);
 | 
												
													
														
															|  | 
 |  |         return success(wlyyPatientExpressageAddrs, count, page, size, WlyyPatientExpressageAddrVO.class);
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @GetMapping(value = BaseHospitalRequestMapping.WlyyPatientExpressageAddr.LIST)
 | 
												
													
														
															|  | 
 |  |     @ApiOperation(value = "获取列表")
 | 
												
													
														
															|  | 
 |  |     public ListEnvelop<WlyyPatientExpressageAddrVO> list(
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "fields", required = false) String fields,
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "filters", required = false) String filters,
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
 | 
												
													
														
															|  | 
 |  |             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
 | 
												
													
														
															|  | 
 |  |         List<WlyyPatientExpressageAddrDO> wlyyPatientExpressageAddrs = wlyyPatientExpressageAddrService.search(fields, filters, sorts);
 | 
												
													
														
															|  | 
 |  |         return success(wlyyPatientExpressageAddrs, WlyyPatientExpressageAddrVO.class);
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | }
 |