zhouxiang
2021-12-24 b3b0ed111ef1b6ab0b3cc52b4e148687e119e066
用户项目列表接口添加身体部位
7个文件已修改
46 ■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/ProjectMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/entity/user/UserProjectList.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/ProjectMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_his/src/main/java/com/hx/phip/his/tools/UserProjectUtil.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/user/ProjectController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/ProjectService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/ProjectServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/ProjectMapper.java
@@ -35,4 +35,6 @@
    int deleteById(Object object);
    /*根据项目id或者syn_project的id查询项目信息*/
    Project selectSynProject(@Param("commonId") String commonId);
    /*根据项目id获取身体部位*/
    Map<String, Object> selectBodyPart(@Param("id") String id);
}
phi_platform_common/src/main/java/com/hx/phip/entity/user/UserProjectList.java
@@ -8,6 +8,7 @@
    private Integer pageSize;
    /**用户标识*/
    private String userId;
    private String statusType;
    public Integer getPageNum() {
        return pageNum;
@@ -32,4 +33,12 @@
    public void setUserId(String userId) {
        this.userId = userId;
    }
    public String getStatusType() {
        return statusType;
    }
    public void setStatusType(String statusType) {
        this.statusType = statusType;
    }
}
phi_platform_common/src/main/resources/mapper/ProjectMapper.xml
@@ -68,6 +68,17 @@
        LEFT JOIN syn_project sp ON p.apiId=sp.projectId
        WHERE  (p.id=#{commonId} or sp.id=#{commonId}) and p.isDel =0 and p.isUp =1
    </select>
    <select id="selectBodyPart" resultType="java.util.Map">
        SELECT
            sp.projectId id,
            IFNULL( pi.bodyPartId, sp.bodyPartId ) bodyPartId,
            IFNULL( pi.bodyPartId, sp.bodyPartName ) bodyPartName
        FROM
            project p
            LEFT JOIN project_info pi ON p.id = pi.projectId
            LEFT JOIN syn_project sp ON p.apiId = sp.projectId
        WHERE (p.apiId = #{id} or sp.projectId=#{id}) and sp.isDel=0
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
phi_platform_his/src/main/java/com/hx/phip/his/tools/UserProjectUtil.java
@@ -8,6 +8,7 @@
import com.hx.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**HIS服务订单项目数据接口(用户项目)
phi_platform_user/src/main/java/com/hx/phip/controller/user/ProjectController.java
@@ -15,6 +15,7 @@
import com.hx.phip.his.entity.ResponsesData;
import com.hx.phip.his.tools.UserProjectUtil;
import com.hx.phip.his.util.ApiUtil;
import com.hx.phip.service.ProjectService;
import com.hx.util.HttpServletRequestUtil;
import com.hx.util.StringUtils;
import com.platform.exception.PlatTipsException;
@@ -29,10 +30,7 @@
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * 员工信息接口
@@ -50,6 +48,8 @@
    @Resource
    private HisParameter hisParameter;
    @Resource
    private ProjectService projectService;
    /**
     * 用户购买项目列表
@@ -83,14 +83,14 @@
        }
        if (userProjectList.getPageNum() == null || userProjectList.getPageNum() <= 0) {
            userProjectList.setPageNum(1);
            userProjectList.setPageNum(0);
        }
        if (userProjectList.getPageSize() == null || userProjectList.getPageSize() <= 0 || userProjectList.getPageSize() >=200) {
            userProjectList.setPageSize(20);
        }
        String token = ApiUtil.getPoiApiAccessToken(hisParameter.getPoiAppId(),hisParameter.getPoiCode(),hisParameter.getPoiSecret(),hisParameter.getUrlGetToken(),commonService);
        ResponsesData responsesData = UserProjectUtil.projectItems(hisParameter.getProjectItem(), user.getApiId(), null, userProjectList.getPageNum(), userProjectList.getPageSize(), "executing", null, token);
        ResponsesData responsesData = UserProjectUtil.projectItems(hisParameter.getProjectItem(), user.getApiId(), null, userProjectList.getPageNum(), userProjectList.getPageSize(), "executing,pending", null, token);
        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
        data.put("total", 0);
@@ -107,11 +107,13 @@
            for (int i = 0; i < content.size(); i++) {
                net.sf.json.JSONObject contentObj = content.getJSONObject(i);
                Map<String,Object> projectMap=projectService.selectBodyPart(contentObj.optString("id"));
                Map<String, Object> projectObj = new HashMap<>();
                projectObj.put("buyNum", contentObj.optInt("totalTimes"));
                projectObj.put("execute", contentObj.optInt("leftTimes"));
                projectObj.put("projectId", contentObj.optString("id"));
                projectObj.put("bodyPartId", projectMap==null ? "":projectMap.get("bodyPartId"));
                projectObj.put("bodyPartName", projectMap==null ? "":projectMap.get("bodyPartName"));
                net.sf.json.JSONObject itemObj = contentObj.optJSONObject("item");
                projectObj.put("name", itemObj.optString("name"));
                projectObj.put("hisId", itemObj.optString("id"));
phi_platform_user/src/main/java/com/hx/phip/service/ProjectService.java
@@ -31,4 +31,6 @@
    /*根据项目Id或者syn_project的id查询项目信息*/
    Project selectSynProject(String commonId);
    /*根据项目id获取身体部位*/
    Map<String, Object> selectBodyPart(String id);
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/ProjectServiceImpl.java
@@ -97,6 +97,11 @@
        return projectMapper.selectSynProject(commonId);
    }
    @Override
    public Map<String, Object> selectBodyPart(String id) {
        return projectMapper.selectBodyPart(id);
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {