Merge branch 'master' of http://1.15.4.62/r/~chenjiahe/phi_platform
| | |
| | | *.tar.gz |
| | | *.rar |
| | | *.iml |
| | | *.lst |
| | | *.json |
| | | |
| | | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
| | | hs_err_pid* |
| | | /target/ |
| | | */target/ |
| | | /.idea/ |
| | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,total = #{total},actualTotal = #{actualTotal},oriPrice = #{oriPrice},curPrice = #{curPrice},buyNum = #{buyNum},usedTotal = #{usedTotal},notUsedNum = #{notUsedNum},usedNum = #{usedNum},effectiveStatus = #{effectiveStatus},timeLimit = #{timeLimit},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},commonType = #{commonType},commonId = #{commonId},usedOne = #{usedOne},userProjectId = #{userProjectId},userId = #{userId},orderItemId = #{orderItemId},isDel = #{isDel},createTime = #{createTime} |
| | | ,total = #{total},actualTotal = #{actualTotal},oriPrice = #{oriPrice},curPrice = #{curPrice},buyNum = #{buyNum},usedTotal = #{usedTotal},notUsedNum = #{notUsedNum},usedNum = #{usedNum},shopId = #{shopId},shopName = #{shopName},departmentCode = #{departmentCode},departmentName = #{departmentName},effectiveStatus = #{effectiveStatus},timeLimit = #{timeLimit},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},commonType = #{commonType},commonId = #{commonId},usedOne = #{usedOne},userProjectId = #{userProjectId},userId = #{userId},orderItemId = #{orderItemId},isDel = #{isDel},createTime = #{createTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into user_project_item (id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime) values (#{id},#{total},#{actualTotal},#{oriPrice},#{curPrice},#{buyNum},#{usedTotal},#{notUsedNum},#{usedNum},#{effectiveStatus},#{timeLimit},#{limitStartTime},#{limitEndTime},#{commonType},#{commonId},#{usedOne},#{userProjectId},#{userId},#{orderItemId},#{isDel},#{createTime}) |
| | | insert into user_project_item (id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,shopId,shopName,departmentCode,departmentName,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime) values (#{id},#{total},#{actualTotal},#{oriPrice},#{curPrice},#{buyNum},#{usedTotal},#{notUsedNum},#{usedNum},#{shopId},#{shopName},#{departmentCode},#{departmentName},#{effectiveStatus},#{timeLimit},#{limitStartTime},#{limitEndTime},#{commonType},#{commonId},#{usedOne},#{userProjectId},#{userId},#{orderItemId},#{isDel},#{createTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phiappt.model.user.UserProjectItem" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phiappt.model.user.UserProjectItem" parameterType="java.lang.Object" > |
| | | select |
| | | id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime |
| | | id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,shopId,shopName,departmentCode,departmentName,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime |
| | | from user_project_item |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.user.UserProjectItem" parameterType="java.lang.Object" > |
| | | select |
| | | id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime |
| | | id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,shopId,shopName,departmentCode,departmentName,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime |
| | | from user_project_item |
| | | WHERE id = #{value} |
| | | </select> |
| | |
| | | package com.hx.phip.deduction.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.hx.common.BaseController; |
| | | import com.hx.phiappt.common.DeductionSingleConstants; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | |
| | | |
| | | /** |
| | | * 执行划扣控制器 |
| | | * |
| | | * @USER: Andru |
| | | * @DATE: 2021/12/10 |
| | | */ |
| | |
| | | private ComparePhotoRecordPicturesService comparePhotoRecordPicturesService; |
| | | |
| | | /** |
| | | *查看记录 |
| | | * 查看记录 |
| | | */ |
| | | @RequestMapping(value = "/see") |
| | | public Result seeData(HttpServletRequest request,String deductionSingleId){ |
| | | public Result seeData(HttpServletRequest request, String deductionSingleId) { |
| | | // 获取用户信息 |
| | | ThirtApplication thirtApplication= (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if(thirtApplication == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"登入失败,请登入后在试!"); |
| | | ThirtApplication thirtApplication = (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if (thirtApplication == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "登入失败,请登入后在试!"); |
| | | } |
| | | |
| | | Map<String,Object> mapData = new HashMap<>(); |
| | | Map<String, Object> mapData = new HashMap<>(); |
| | | DeductionSingle deductionSingle = deductionSingleService.selectOneByKey(deductionSingleId); |
| | | if(deductionSingle != null) { |
| | | if (deductionSingle != null) { |
| | | // 划扣记录 |
| | | mapData.put("deductionSingle", deductionSingle); |
| | | // 项目划扣 |
| | | DeductionProject deductionProject = deductionProjectService.selectOneByDeductionSingleId(deductionSingle.getId()); |
| | | mapData.put("deductionProject", deductionProject); |
| | | if(deductionProject != null) { |
| | | if (deductionProject != null) { |
| | | // 参与人员信息 |
| | | List<DeductionJoin> deductionJoinList = deductionJoinService.selectListByDeductionSingleId(deductionSingle.getId(), deductionProject.getId()); |
| | | mapData.put("deductionJoinList", deductionJoinList); |
| | |
| | | mapData.put("deductionSignList", deductionSignList); |
| | | // 治疗图片 |
| | | ComparePhotoRecord comparePhotoRecord = comparePhotoRecordService.selectOneByDeductionSingleId(deductionSingle.getId(), deductionProject.getId()); |
| | | if(comparePhotoRecord != null) { |
| | | if (comparePhotoRecord != null) { |
| | | List<ComparePhotoRecordPictures> comparePhotoRecordPicturesList = comparePhotoRecordPicturesService.selectListByComparePhotoRecordId(comparePhotoRecord.getId()); |
| | | mapData.put("comparePhotoRecordPicturesList", comparePhotoRecordPicturesList); |
| | | }else{ |
| | | } else { |
| | | mapData.put("comparePhotoRecordPicturesList", null); |
| | | } |
| | | } |
| | |
| | | // 校验参数 |
| | | checkParam(deductionDto); |
| | | // 获取用户信息 |
| | | ThirtApplication thirtApplication= (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if(thirtApplication == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"登入失败,请登入后在试!"); |
| | | ThirtApplication thirtApplication = (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if (thirtApplication == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "登入失败,请登入后在试!"); |
| | | } |
| | | // 填充接口登入信息 |
| | | deductionDto.setSourceCode(thirtApplication.getAppId()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 批量新增划扣记录 |
| | | */ |
| | | @RequestMapping(value = "/batch/add", method = RequestMethod.POST) |
| | | public Result batchAddData(HttpServletRequest request, String userProjectIds, DeductionDto deductionDto) { |
| | | // 获取用户信息 |
| | | ThirtApplication thirtApplication = (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if (thirtApplication == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "登入失败,请登入后在试!"); |
| | | } |
| | | // 填充接口登入信息 |
| | | deductionDto.setSourceCode(thirtApplication.getAppId()); |
| | | deductionDto.setSourceName(thirtApplication.getName()); |
| | | |
| | | // 解析批量id |
| | | List<String> userProjectIdList = JSONArray.parseArray(userProjectIds, String.class); |
| | | |
| | | // 判断是否传值 |
| | | if(userProjectIdList == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "用户项目id列表不能为空!"); |
| | | } |
| | | |
| | | // 批量划扣 |
| | | for (String userProjectId : userProjectIdList) { |
| | | deductionDto.setUserProjectId(userProjectId); |
| | | // 添加数据 |
| | | deductionSingleService.editInfo(deductionDto, BaseEntity.YES); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * 修改划扣记录 |
| | | */ |
| | | @RequestMapping(value = "/update", method = RequestMethod.POST) |
| | | public Result updateData(HttpServletRequest request, DeductionDto deductionDto) { |
| | | // 判断deductionSingleId 是否为空 |
| | | if(StringUtils.isEmpty(deductionDto.getDeductionSingleId())){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"deductionSingleId不能为空"); |
| | | if (StringUtils.isEmpty(deductionDto.getDeductionSingleId())) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "deductionSingleId不能为空"); |
| | | } |
| | | // 校验参数 |
| | | checkParam(deductionDto); |
| | | // 获取用户信息 |
| | | ThirtApplication thirtApplication = (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if(thirtApplication == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"登入失败,请登入后在试!"); |
| | | if (thirtApplication == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "登入失败,请登入后在试!"); |
| | | } |
| | | // 填充接口登入信息 |
| | | deductionDto.setSourceCode(thirtApplication.getAppId()); |
| | |
| | | * 删除记录 |
| | | */ |
| | | @RequestMapping(value = "/delete", method = RequestMethod.POST) |
| | | public Result deleteData(HttpServletRequest request,String deductionSingleId){ |
| | | if(StringUtils.isEmpty(deductionSingleId)){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"deductionSingleId不能为空"); |
| | | public Result deleteData(HttpServletRequest request, String deductionSingleId) { |
| | | if (StringUtils.isEmpty(deductionSingleId)) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "deductionSingleId不能为空"); |
| | | } |
| | | |
| | | ThirtApplication thirtApplication = (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if(thirtApplication == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"登入失败,请登入后在试!"); |
| | | if (thirtApplication == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "登入失败,请登入后在试!"); |
| | | } |
| | | |
| | | // 删除数据 |
| | | deductionSingleService.deleteOne(deductionSingleId,thirtApplication.getAppId(),thirtApplication.getName(), DeductionSingleConstants.STATUS_CANCEL); |
| | | deductionSingleService.deleteOne(deductionSingleId, thirtApplication.getAppId(), thirtApplication.getName(), DeductionSingleConstants.STATUS_CANCEL); |
| | | return Result.success(); |
| | | } |
| | | |
| | |
| | | * 撤销记录 |
| | | */ |
| | | @RequestMapping(value = "/rescinded", method = RequestMethod.POST) |
| | | public Result rescindedData(HttpServletRequest request,String deductionSingleId){ |
| | | if(StringUtils.isEmpty(deductionSingleId)){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"deductionSingleId不能为空"); |
| | | public Result rescindedData(HttpServletRequest request, String deductionSingleId) { |
| | | if (StringUtils.isEmpty(deductionSingleId)) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "deductionSingleId不能为空"); |
| | | } |
| | | |
| | | ThirtApplication thirtApplication = (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY); |
| | | if(thirtApplication == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"登入失败,请登入后在试!"); |
| | | if (thirtApplication == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "登入失败,请登入后在试!"); |
| | | } |
| | | |
| | | // 删除数据 |
| | | deductionSingleService.deleteOne(deductionSingleId,thirtApplication.getAppId(),thirtApplication.getName(), DeductionSingleConstants.STATUS_RESCINDED); |
| | | deductionSingleService.deleteOne(deductionSingleId, thirtApplication.getAppId(), thirtApplication.getName(), DeductionSingleConstants.STATUS_RESCINDED); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * 校验参数 |
| | | * |
| | | * @param deductionDto 参数对象 |
| | | */ |
| | | private void checkParam(DeductionDto deductionDto){ |
| | | if(StringUtils.isEmpty(deductionDto.getUserProjectId())){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"userProjectId不能为空"); |
| | | private void checkParam(DeductionDto deductionDto) { |
| | | if (StringUtils.isEmpty(deductionDto.getUserProjectId())) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "userProjectId不能为空"); |
| | | } |
| | | |
| | | if(deductionDto.getDeductionNum() <= 0){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"数量/划扣次数需要大于0"); |
| | | if (deductionDto.getDeductionNum() <= 0) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS, "数量/划扣次数需要大于0"); |
| | | } |
| | | |
| | | if(deductionDto.getExecuteStartTime() == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"执行开始时间不内为空!"); |
| | | if (deductionDto.getExecuteStartTime() == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "执行开始时间不内为空!"); |
| | | } |
| | | |
| | | if(deductionDto.getExecuteEndTime() == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"执行结束时间不内为空!"); |
| | | if (deductionDto.getExecuteEndTime() == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "执行结束时间不内为空!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | deductionSingle.setUserId(userProject.getUserId()); |
| | | deductionSingle.setType(DeductionSingleConstants.TYPE_SELF_ADD); |
| | | deductionSingle.setSourceCode(deductionDto.getSourceCode()); |
| | | deductionSingle.setSourceName(deductionDto.getSourceName()); |
| | | deductionSingle.setStatus(DeductionSingleConstants.STATUS_DONE_EXECUTE); |
| | |
| | | |
| | | // 是否添加数据 |
| | | if(type == BaseEntity.YES) { |
| | | // 划扣默认类型 |
| | | deductionSingle.setType(deductionDto.getType()); |
| | | int count = deductionSingleMapper.insert(deductionSingle); |
| | | if (count != 1) { |
| | | throw new TipsException("新增失败!"); |
| | |
| | | package com.hx.phip.dto; |
| | | |
| | | import com.hx.phiappt.common.DeductionSingleConstants; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | private String userProjectId; |
| | | |
| | | // 新增类型 |
| | | private String type; |
| | | private String type = DeductionSingleConstants.TYPE_SELF_ADD; |
| | | |
| | | // 科室编号 |
| | | private String departmentCode; |