瀏覽代碼

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 年之前
父節點
當前提交
3152ae2f7d

+ 15 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -6,6 +6,9 @@ import com.yihu.wlyy.service.service.prescription.PrescriptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -20,6 +23,8 @@ import org.springframework.web.bind.annotation.*;
@Api(description = "长处方接口")
public class PrescriptionController extends BaseController{
	private static Logger logger = LoggerFactory.getLogger(PrescriptionController.class);
	@Autowired
	PrescriptionCAService caService;
@ -183,7 +188,16 @@ public class PrescriptionController extends BaseController{
			return Result.success("挂号开处方接口!",re);
		} catch (Exception ex) {
			ex.printStackTrace();
			return Result.error(ex.getMessage());
			logger.info("智业接口请求失败");
			//异常处理
			String message = ex.getMessage();
			if(StringUtils.isNotBlank(message)){
				if(message.contains("System.Exception:")){
					message = message.substring(message.indexOf("System.Exception:")+18,message.indexOf("\\n"));
					return Result.error(message);
				}
			}
			return Result.error("请求失败");
		}
	}

+ 6 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

@ -119,7 +119,8 @@ public class CommonUtil {
    }
    /**
     * double*100转int
     * double转字符串,在转int
     * double*100转int 有bug 34.3会会变成3429
     * @param d
     * @return
     */
@ -135,9 +136,10 @@ public class CommonUtil {
            amLong = Integer.valueOf(currency+"00");
        }else if(length - index >= 3){
            amLong = Integer.valueOf((currency.substring(0, index+3)).replace(".", ""));
            Integer i = Integer.valueOf(currency.substring(index+3,index+4));
            if(i>=5){
                amLong++;
            if(length-index>3){
                if(Integer.valueOf(currency.substring(index+3,index+4))>=5){
                    amLong++;
                }
            }
        }else if(length - index == 2){
            amLong = Integer.valueOf((currency.substring(0, index+2)).replace(".", "")+0);