Commit 66d89a66 by XiaHou

查询展览纪念馆

parent de89b0fc
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.MisBlessDTO;
import com.atlgroupasia.servicecenter.dto.OshUserBlessUsingDTO;
import com.atlgroupasia.servicecenter.service.DonateOrderService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author xh
* @Date 2021/6/28
* description:
*/
@RestController
@Api(tags = "福位相关接口", description = "福位控制器")
@RequestMapping("/bless")
public class BlessController {
@Autowired
private DonateOrderService donateOrderService;
@ApiOperation("根据手机号 查询相关福位信息")
@RequestMapping(value = "/selectBlessListDonateOrderRelationPhone", method = RequestMethod.GET)
public JsonResult<MisBlessDTO> selectBlessListDonateOrderRelationPhone(@ApiParam(value = "用户手机号", required = true) @RequestParam(value = "phone", required = true) String phone) {
return this.donateOrderService.selectBlessListDonateOrderRelationPhone(phone);
}
@ApiOperation("根据blessId查询相关晋塔人员信息")
@RequestMapping(value = "/selectUserBlessUsingListByBlessId", method = RequestMethod.GET)
public JsonResult<OshUserBlessUsingDTO> selectUserBlessUsingListByBlessId(@ApiParam(value = "福位id", required = true) @RequestParam(value = "blessId", required = true) Integer blessId) {
return this.donateOrderService.selectUserBlessUsingListByBlessId(blessId);
}
}
......@@ -8,12 +8,10 @@ import com.atlgroupasia.servicecenter.operation.exhibit.service.IOshExhibitServi
import com.atlgroupasia.servicecenter.utils.JsonResult;
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.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
/**
* @Author xh
......@@ -41,7 +39,7 @@ public class OshExhibitController {
@ApiOperation("提交现场纪念馆预约申请")
@RequestMapping(value = "/InsertOshAppointmentParam", method = RequestMethod.POST)
@ResponseBody
public JsonResult InsertOshAppointmentParam(@ModelAttribute InsertOshAppointmentParam insertOshAppointmentParam) {
public JsonResult InsertOshAppointmentParam(@ApiParam(value = "传入对象") @RequestBody InsertOshAppointmentParam insertOshAppointmentParam) {
return oshAppointmentService.insertOshAppointmentParam(insertOshAppointmentParam);
}
......
package com.atlgroupasia.servicecenter.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author xh
* @Date 2021/6/28
* description:
*/
@Data
public class DrpDonateOrderDTO implements Serializable {
@ApiModelProperty(value = "捐赠单id")
private Integer id;
@ApiModelProperty(value = "捐赠单号")
private String numbers;
@ApiModelProperty(value = "捐赠人id")
private Integer donorId;
@ApiModelProperty(value = "捐赠人姓名")
private String donorName;
@ApiModelProperty(value = "捐赠人手机号")
private String donorPhone;
@ApiModelProperty(value = "支付状态 0为等待支付 1为超时 2为审核不通过 3为后台审核成功 4取消订单 5已完成")
private Integer state;
@ApiModelProperty(value = "福位ids")
private String blessIds;
}
package com.atlgroupasia.servicecenter.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author xh
* @Date 2021/6/28
* description:
*/
@Data
public class MisBlessDTO implements Serializable {
@ApiModelProperty(value = "福位id")
private Integer id;
@ApiModelProperty(value = "款式id")
private Integer fashionId;
@ApiModelProperty(value = "规格id")
private Integer specificationsId;
@ApiModelProperty(value = "福位编号")
private String codeNumber;
@ApiModelProperty(value = "序号")
private String serialNumber;
@ApiModelProperty(value = "福位规格名称")
private String specificationsName;
@ApiModelProperty(value = "福位格位数量")
private Integer specificationsNumber;
}
package com.atlgroupasia.servicecenter.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author xh
* @Date 2021/6/28
* description:
*/
@Data
public class OshUserBlessUsingDTO implements Serializable {
@ApiModelProperty(value = "福位启用申请id")
private Long id;
@ApiModelProperty(value = "对应的福位")
private Integer blessId;
@ApiModelProperty(value = "对应的福位中的哪一个")
private Integer blessIdx;
@ApiModelProperty(value = "格位名称")
private String name;
@ApiModelProperty(value = "性别 0男 1女")
private Integer sex;
@ApiModelProperty(value = "出生日期")
private Date birthday;
@ApiModelProperty(value = "死亡日期")
private Date deathDay;
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.BlessDto;
import com.atlgroupasia.servicecenter.dto.MisBlessDTO;
import com.atlgroupasia.servicecenter.dto.TempleDto;
import com.atlgroupasia.servicecenter.entity.Bless;
import org.apache.ibatis.annotations.Param;
......@@ -12,7 +13,7 @@ public interface BlessMapper {
List<TempleDto> findMyBlessList(Integer donorId);
List<BlessDto>querySimpleBlessList(List blessIds);
List<BlessDto> querySimpleBlessList(List blessIds);
List<BlessDto> selectBless1(Integer id);
......@@ -20,8 +21,15 @@ public interface BlessMapper {
BlessDto selectBless(Integer blessId);
List<Map<String, Object>> findBlessUsingList(@Param("selectText")String selectText);
List<Map<String, Object>> findBlessUsingList(@Param("selectText") String selectText);
List<Map<String, Object>> findConnectBlessUsingList(List blessIds);
/**
* 根据福位id 查询福位信息
*
* @param id
* @return
*/
MisBlessDTO selectBlessDTOById(Integer id);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.DrpDonateOrderDTO;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import java.util.List;
public interface DonateOrderMapper {
List<DonateOrder>findMyOrder(String donorIds);
List<DonateOrder> findMyOrder(String donorIds);
List<DonateOrder> findByBlessId(Integer id);
List<Integer> findMyOrder1(String donorIds);
String findOrderState5(Integer blessId);
/**
* 根据手机号 查询捐赠订单List
*
* @param phone
* @return
*/
List<DrpDonateOrderDTO> selectDonateOrderByPhone(String phone);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.OshUserBlessUsingDTO;
import com.atlgroupasia.servicecenter.dto.UserBlessUsingDto;
import com.atlgroupasia.servicecenter.entity.UserBlessUsing;
......@@ -7,11 +8,19 @@ import java.util.List;
public interface UserBlessUsingMapper {
List<UserBlessUsing>findAllNoDelcolumn(Integer blessId);
List<UserBlessUsing> findAllNoDelcolumn(Integer blessId);
UserBlessUsing findByBlessEnableId(Integer blessEnableId);
UserBlessUsingDto selectRest(Integer userBlessUsingid);
void batchNewEntity(UserBlessUsing userBlessUsing);
/**
* 根据福位id 查询晋塔人员信息
*
* @param blessId
* @return
*/
List<OshUserBlessUsingDTO> selectUserBlessUsingById(Integer blessId);
}
......@@ -33,4 +33,6 @@ public class QueryAppointmentVO implements Serializable {
private Integer dinnerPerson;
@ApiModelProperty(value = "到达时间")
private String arriveTime;
@ApiModelProperty(value = "预约状态 0 未处理 1 已处理")
private Integer isContact;
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.DrpDonateOrderDTO;
import com.atlgroupasia.servicecenter.dto.MisBlessDTO;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import com.atlgroupasia.servicecenter.mapper.BlessMapper;
import com.atlgroupasia.servicecenter.mapper.DonateOrderMapper;
import com.atlgroupasia.servicecenter.mapper.UserBlessUsingMapper;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
......@@ -13,6 +20,10 @@ public class DonateOrderService {
@Resource
private DonateOrderMapper donateOrderMapper;
@Resource
private BlessMapper blessMapper;
@Resource
private UserBlessUsingMapper userBlessUsingMapper;
public String findOrderState5(Integer blessId) {
return donateOrderMapper.findOrderState5(blessId);
......@@ -22,4 +33,49 @@ public class DonateOrderService {
public List<DonateOrder> findByBlessId(Integer blessId) {
return donateOrderMapper.findByBlessId(blessId);
}
/**
* 根据手机号 查询捐赠福位订单 关联的福位信息
*
* @param phone
* @return
*/
public JsonResult selectBlessListDonateOrderRelationPhone(String phone) {
//通过手机号查询福位订单
List<DrpDonateOrderDTO> drpDonateOrderDTOList = this.donateOrderMapper.selectDonateOrderByPhone(phone);
if (drpDonateOrderDTOList == null || drpDonateOrderDTOList.size() <= 0) {
return JsonResult.failed("相关福位订单数据为空");
}
List<MisBlessDTO> misBlessDTOList = new ArrayList<>();
drpDonateOrderDTOList.stream().map(item -> {
//拿到每个订单的bless_ids 通过逗号切割 然后返回福位数据信息
//不为空 才能进行切割查询
if (item.getBlessIds() != null && !item.getBlessIds().isEmpty()) {
String[] ids = item.getBlessIds().split(",");
for (String id : ids) {
//判断id是否为空
if (id != null && !id.isEmpty() && !id.equals("0")) {
//通过Id去查询福位信息
MisBlessDTO misBlessDTO = this.blessMapper.selectBlessDTOById(Integer.valueOf(id));
misBlessDTOList.add(misBlessDTO);
}
}
}
return item;
}).collect(Collectors.toList());
return JsonResult.success("查询成功", misBlessDTOList);
}
/**
* 根据blessId查询相关晋塔人员信息
*
* @param blessId
* @return
*/
public JsonResult selectUserBlessUsingListByBlessId(Integer blessId) {
return JsonResult.success("查询成功",this.userBlessUsingMapper.selectUserBlessUsingById(blessId));
}
}
package com.atlgroupasia.servicecenter.utils;
import com.atlgroupasia.servicecenter.common.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/**
* JsonResult
*
* @author whj
* @date 2018/7/29 22:19
*/
@Data
@ApiModel
public class JsonResult {
public class JsonResult<T> {
@ApiModelProperty(name = "success", value = "是否正常通讯")
private Boolean success = Boolean.TRUE;
@ApiModelProperty(name = "status", value = "状态码,200:OK,401:未登录,500:错误")
......@@ -61,6 +59,14 @@ public class JsonResult {
return res;
}
public static JsonResult failed(String msg, Object data) {
JsonResult res = new JsonResult();
res.setMessage(msg);
res.setStatus(Constants.RESPONSE_STATUS_500);
res.setData(data);
return res;
}
public static JsonResult notLogin() {
JsonResult res = new JsonResult();
res.setMessage("请登录");
......
......@@ -2,6 +2,7 @@ package com.atlgroupasia.servicecenter.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
......@@ -26,7 +27,7 @@ public class OshServicesOrderVo {
private Long sum;
private Long ageLimit;
@ApiModelProperty(value = "订单金额,精确到分")
private double totalPrice;
private double payPrice;
......@@ -63,7 +64,7 @@ public class OshServicesOrderVo {
private String nickName;
private String pic;
@ApiModelProperty(value = "非app时的支付,为必传",required = false)
private String openId;
private String payChooseType;
......
......@@ -10,13 +10,13 @@ spring:
#���ݿ�����
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://lmerp001w.mysql.rds.aliyuncs.com/lmerp?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: test_erp
password: Fzii591com
#url: jdbc:mysql://lmerp001w.mysql.rds.aliyuncs.com/lmerp?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
#username: test_erp
#password: Fzii591com
#url: jdbc:mysql://47.98.216.76:3306/atl-service-center?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#username: root
#password: 6just@2019
url: jdbc:mysql://47.98.216.76:3306/atl-service-center?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 6just@2019
type: com.alibaba.druid.pool.DruidDataSource
......
......@@ -130,5 +130,13 @@
</where>
</select>
<select id="selectBlessDTOById" parameterType="java.lang.Integer" resultType="com.atlgroupasia.servicecenter.dto.MisBlessDTO">
select
a.id,a.fashion_id fashionId,a.specifications_id specificationsId,a.code_number codeNumber,
a.serial_number serialNumber,
b.name specificationsName,b.number specificationsNumber
from mis_bless a
left join mis_specifications b ON a.specifications_id = b.id
where a.id=#{id}
</select>
</mapper>
......@@ -44,4 +44,14 @@
</where>
</select>
<select id="selectDonateOrderByPhone" parameterType="java.lang.String" resultType="com.atlgroupasia.servicecenter.dto.DrpDonateOrderDTO" >
select
a.id,a.donor_id donorId,a.state,a.bless_ids blessIds,a.numbers,
b.name donorName,b.phone donorPhone
from drp_donate_order a
left join drp_donor b ON a.donor_id = b.id
where state in (3,5)
and b.phone =#{phone}
</select>
</mapper>
......@@ -51,4 +51,10 @@
,#{deathDayLunar},#{usingWayAshes},#{usingWayKeepsake},#{usingTime},#{deathProve},#{cremationProve},#{isMemory},#{createTime},#{state},#{arrImg},0,0)
</insert>
<select id="selectUserBlessUsingById" parameterType="java.lang.Integer" resultType="com.atlgroupasia.servicecenter.dto.OshUserBlessUsingDTO">
select
a.id,a.bless_id blessId,a.bless_idx blessIdx ,a.name,a.sex,a.birthday,a.death_day deathDay
from osh_user_bless_using a
where a.bless_id = #{blessId}
</select>
</mapper>
......@@ -9,6 +9,7 @@
select
a.id appointmentId,a.contact_name contactName,a.contact_phone contactPhone,a.contact_identify contactIdentify,
a.end_time endTime,a.begin_time beginTime,a.have_dinner haveDinner,a.dinner_person dinnerPerson,a.arrive_time arriveTime,
a.is_contact isContact,
b.name templeName
from osh_appointment a
left join mis_temple b ON a.refer_id = b.id
......
......@@ -14,7 +14,7 @@
from osh_exhibit a
left join mis_temple b ON a.temple_id = b.id
where 1= 1
and a.is_del = 0
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment