Forráskód Böngészése

Merge branch 'dev' of yeshijie/jw2.0 into dev

yeshijie 6 éve
szülő
commit
d9774b0f1d

+ 2 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageDetailsVO.java

@ -1,5 +1,6 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -24,6 +25,7 @@ public class ServicePackageDetailsVO extends UuidIdentityVO {
    @ApiModelProperty(value = "创建时间")
    private Date createTime;//创建时间',
    @ApiModelProperty(value = "执行时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date executionTime;//执行时间',
    @ApiModelProperty(value = "执行类型", example = "1")
    private String executionType;//执行类型(1固定时间,2固定次数(不固定时间),3长期)',

+ 8 - 6
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -1,13 +1,8 @@
package com.yihu.jw.restmodel.web.endpoint;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
@ -17,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -195,6 +191,12 @@ public abstract class EnvelopRestEndpoint {
        return entity;
    }
    protected <T> T toDateEntity(String json, Class<T> target) throws IOException {
        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
        T entity = objectMapper.readValue(json, target);
        return entity;
    }
    protected <T> T convertToModel(Object source, Class<T> target, String... properties) {
        if (source == null) {
            return null;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/im/ImGetuiConfigEndpiont.java

@ -44,7 +44,7 @@ public class ImGetuiConfigEndpiont extends EnvelopRestEndpoint {
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        imGetuiConfigService.delete(ids);
        imGetuiConfigService.delete(ids.split(","));
        return success("删除成功");
    }

+ 10 - 25
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/RehabilitationEndpoint.java

@ -31,40 +31,25 @@ public class RehabilitationEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "创建")
    public Envelop create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody String jsonData) {
        try {
            RehabilitationVO rehabilitationVO = toEntity(jsonData, RehabilitationVO.class);
            ServicePackageSignRecordDO signRecordDO = convertToModel(rehabilitationVO.getSignRecordVO(), ServicePackageSignRecordDO.class);
            ServicePackageDO servicePackageDO = servicePackageService.addRehabilitation(rehabilitationVO,signRecordDO);
            return success(convertToModel(servicePackageDO, ServicePackageVO.class));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("创建失败");
        }
            @RequestBody String jsonData) throws Exception{
        RehabilitationVO rehabilitationVO = toDateEntity(jsonData, RehabilitationVO.class);
        ServicePackageSignRecordDO signRecordDO = convertToModel(rehabilitationVO.getSignRecordVO(), ServicePackageSignRecordDO.class);
        ServicePackageDO servicePackageDO = servicePackageService.addRehabilitation(rehabilitationVO,signRecordDO);
        return success(convertToModel(servicePackageDO, ServicePackageVO.class));
    }
    @PostMapping(value = BaseRequestMapping.BaseRehabilitation.CREATELOG)
    @ApiOperation(value = "新增服务包日志")
    public Envelop addRehabilitationLog(@ApiParam(name = "jsonData", value = "Json数据", required = true)
                          @RequestBody String jsonData){
        try{
            ServicePackageLogVO logVO = toEntity(jsonData,ServicePackageLogVO.class);
            return success(servicePackageService.addRehabilitationLog(logVO));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("新增失败");
        }
                          @RequestBody String jsonData) throws Exception{
        ServicePackageLogVO logVO = toEntity(jsonData,ServicePackageLogVO.class);
        return success(servicePackageService.addRehabilitationLog(logVO));
    }
    @GetMapping(value = BaseRequestMapping.BaseRehabilitation.FINDBYID)
    @ApiOperation(value = "查找完成度")
    public Envelop getFinish(@ApiParam(name = "servicePackId", value = "服务包id", required = true)
                             @RequestParam(value = "servicePackId") String servicePackId){
        try {
            return success(servicePackageService.getFinish(servicePackId));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("获取失败");
        }
                             @RequestParam(value = "servicePackId") String servicePackId) throws Exception{
        return success(servicePackageService.getFinish(servicePackId));
    }
}

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java

@ -43,7 +43,7 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
            @RequestParam(value = "ids") String ids) throws Exception{
        servicePackageService.delete(ids.split(","));
        return success("删除成功");
    }
@ -51,7 +51,7 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseRequestMapping.ServicePackage.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<ServicePackageVO> update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        ServicePackageDO servicePackageDO = toEntity(jsonData, ServicePackageDO.class);
        if (null == servicePackageDO.getId()) {