Ver Fonte

历史的外部订单不支持关联的乐团导出,新增了字段cooperation_id_,修复历史的数据

zouxuan há 2 anos atrás
pai
commit
f176fa1264

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentOrderExportDto.java

@@ -201,4 +201,6 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrderRouteDto {
 
     @ApiModelProperty(value = "教学点",required = true)
     private String schoolName;
+
+    private Integer cooperationId;
 }

+ 3 - 292
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.auth.api.entity.SysUser;
@@ -19,6 +20,7 @@ import org.springframework.data.annotation.Version;
 /**
  * 对应数据库表(student_payment_order):
  */
+@Data
 public class StudentPaymentOrder extends BaseEntity {
 
 	/**  */
@@ -136,296 +138,5 @@ public class StudentPaymentOrder extends BaseEntity {
 	@ApiModelProperty(value = "缴费项目编号",required = true)
 	private Long calenderId;
 
-	public Long getCalenderId() {
-		return calenderId;
-	}
-
-	public void setCalenderId(Long calenderId) {
-		this.calenderId = calenderId;
-	}
-
-	public Integer getActivityBuyNum() {
-		return activityBuyNum;
-	}
-
-	public void setActivityBuyNum(Integer activityBuyNum) {
-		this.activityBuyNum = activityBuyNum;
-	}
-
-	public String getActivityId() {
-		return activityId;
-	}
-
-	public void setActivityId(String activityId) {
-		this.activityId = activityId;
-	}
-
-	public String getCouponCodeId() {
-		return couponCodeId;
-	}
-
-	public void setCouponCodeId(String couponCodeId) {
-		this.couponCodeId = couponCodeId;
-	}
-
-	public BigDecimal getCouponRemitFee() {
-		return couponRemitFee;
-	}
-
-	public void setCouponRemitFee(BigDecimal couponRemitFee) {
-		this.couponRemitFee = couponRemitFee;
-	}
-
-	public String getReceiveStatus() {
-		return receiveStatus;
-	}
-
-	public void setReceiveStatus(String receiveStatus) {
-		this.receiveStatus = receiveStatus;
-	}
-
-	public void setId(Long id){
-		this.id = id;
-	}
-	
-	public Long getId(){
-		return this.id;
-	}
-			
-	public GroupType getGroupType() {
-		return groupType;
-	}
-
-	public void setGroupType(GroupType groupType) {
-		this.groupType = groupType;
-	}
-
-	public void setUserId(Integer userId){
-		this.userId = userId;
-	}
-	
-	public Integer getUserId(){
-		return this.userId;
-	}
-			
-	public void setTransNo(String transNo){
-		this.transNo = transNo;
-	}
-	
-	public String getTransNo(){
-		return this.transNo;
-	}
-			
-	public void setMemo(String memo){
-		this.memo = memo;
-	}
-	
-	public String getMemo(){
-		return this.memo;
-	}
-			
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-	
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-			
-	public void setPaymentChannel(String paymentChannel){
-		this.paymentChannel = paymentChannel;
-	}
-	
-	public String getPaymentChannel(){
-		return this.paymentChannel;
-	}
-			
-	public void setPaymentBusinessChannel(String paymentBusinessChannel){
-		this.paymentBusinessChannel = paymentBusinessChannel;
-	}
-	
-	public String getPaymentBusinessChannel(){
-		return this.paymentBusinessChannel;
-	}
-			
-	public void setPaymentAccountNo(String paymentAccountNo){
-		this.paymentAccountNo = paymentAccountNo;
-	}
-	
-	public String getPaymentAccountNo(){
-		return this.paymentAccountNo;
-	}
-			
-	public void setOrderNo(String orderNo){
-		this.orderNo = orderNo;
-	}
-	
-	public String getOrderNo(){
-		return this.orderNo;
-	}
-			
-	public void setMusicGroupId(String musicGroupId){
-		this.musicGroupId = musicGroupId;
-	}
-	
-	public String getMusicGroupId(){
-		return this.musicGroupId;
-	}
-			
-	public void setClassGroupId(Integer classGroupId){
-		this.classGroupId = classGroupId;
-	}
-	
-	public Integer getClassGroupId(){
-		return this.classGroupId;
-	}
-
-	public OrderTypeEnum getType() {
-		return type;
-	}
-
-	public void setType(OrderTypeEnum type) {
-		this.type = type;
-	}
-
-	public BigDecimal getExpectAmount() {
-		return expectAmount;
-	}
-
-	public void setExpectAmount(BigDecimal expectAmount) {
-		this.expectAmount = expectAmount;
-	}
-
-	public BigDecimal getActualAmount() {
-		return actualAmount;
-	}
-
-	public void setActualAmount(BigDecimal actualAmount) {
-		this.actualAmount = actualAmount;
-	}
-
-	public BigDecimal getBalancePaymentAmount() {
-		return balancePaymentAmount;
-	}
-
-	public void setBalancePaymentAmount(BigDecimal balancePaymentAmount) {
-		this.balancePaymentAmount = balancePaymentAmount;
-	}
-
-	public DealStatusEnum getStatus() {
-		return status;
-	}
-
-	public void setStatus(DealStatusEnum status) {
-		this.status = status;
-	}
-
-	public Integer getVersion() {
-		return version;
-	}
-
-	public void setVersion(Integer version) {
-		this.version = version;
-	}
-
-	public Date getPayTime() {
-		return payTime;
-	}
-
-	public void setPayTime(Date payTime) {
-		this.payTime = payTime;
-	}
-    public String getMerNos() {
-        return merNos;
-    }
-
-    public void setMerNos(String merNos) {
-        this.merNos = merNos;
-    }
-
-    public PaymentChannelTypeEnum getPaymentChannelType() {
-        return paymentChannelType;
-    }
-
-    public void setPaymentChannelType(PaymentChannelTypeEnum paymentChannelType) {
-        this.paymentChannelType = paymentChannelType;
-    }
-
-	public SysUser getUser() {
-		return user;
-	}
-
-	public void setUser(SysUser user) {
-		this.user = user;
-	}
-
-	public BigDecimal getComAmount() {
-		return comAmount;
-	}
-
-	public void setComAmount(BigDecimal comAmount) {
-		this.comAmount = comAmount;
-	}
-
-	public BigDecimal getPerAmount() {
-		return perAmount;
-	}
-
-	public void setPerAmount(BigDecimal perAmount) {
-		this.perAmount = perAmount;
-	}
-
-	public Integer getOrganId() {
-		return organId;
-	}
-
-	public void setOrganId(Integer organId) {
-		this.organId = organId;
-	}
-
-
-	public BigDecimal getRemitFee() {
-		return remitFee;
-	}
-
-	public void setRemitFee(BigDecimal remitFee) {
-		this.remitFee = remitFee;
-	}
-
-	public Integer getRoutingOrganId() {
-		return routingOrganId;
-	}
-
-	public void setRoutingOrganId(Integer routingOrganId) {
-		this.routingOrganId = routingOrganId;
-	}
-
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
-
-	public BigDecimal getCourseRemitFee() {
-		return courseRemitFee;
-	}
-
-	public void setCourseRemitFee(BigDecimal courseRemitFee) {
-		this.courseRemitFee = courseRemitFee;
-	}
-
-	public String getBatchNo() {
-		return batchNo;
-	}
-
-	public void setBatchNo(String batchNo) {
-		this.batchNo = batchNo;
-	}
+	private Integer cooperationId;
 }

+ 6 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -1885,8 +1885,8 @@ public class ExportServiceImpl implements ExportService {
         Map<Integer, String> cooperationOrganMap = new HashMap<>();
         List<Integer> cooperationOrganIds = studentPaymentOrderExportDtos.stream()
                 .filter(e -> OUTORDER == e.getType() || GroupType.OUTORDER == e.getGroupType() && (e.getType() != RENEW && e.getType() != APPLY))
-                .filter(e -> e.getMusicGroupId() != null)
-                .map(e -> Integer.valueOf(e.getMusicGroupId()))
+                .filter(e -> e.getCooperationId() != null)
+                .map(e -> e.getCooperationId())
                 .distinct()
                 .collect(Collectors.toList());
         if (cooperationOrganIds.size() > 0) {
@@ -2265,11 +2265,11 @@ public class ExportServiceImpl implements ExportService {
                     row.setEduTeacher(cooperationOrgan.getLinkman() != null ? cooperationOrgan.getLinkman() : row.getEduTeacher());
                 }
             }
-            if ((row.getType() == OUTORDER || row.getGroupType() == GroupType.OUTORDER) && StringUtils.isNotEmpty(row.getMusicGroupId())) {
+            if ((row.getType() == OUTORDER || row.getGroupType() == GroupType.OUTORDER) && row.getCooperationId() != null) {
                 if (row.getType() != RENEW && row.getType() != APPLY) {
-                    if (cooperationOrganMap.containsKey(Integer.valueOf(row.getMusicGroupId()))) {
-                        row.setCooperationOrganName(cooperationOrganMap.get(Integer.valueOf(row.getMusicGroupId())));
-                        CooperationOrgan cooperationOrganEduTeacher = musicGroupDao.findCooperationOrganEduTeacher(Integer.valueOf(row.getMusicGroupId()));
+                    if (cooperationOrganMap.containsKey(row.getCooperationId())) {
+                        row.setCooperationOrganName(cooperationOrganMap.get(row.getCooperationId()));
+                        CooperationOrgan cooperationOrganEduTeacher = musicGroupDao.findCooperationOrganEduTeacher(row.getCooperationId());
                         if (cooperationOrganEduTeacher != null) {
                             row.setEduTeacher(cooperationOrganEduTeacher.getLinkman());
                         }

+ 6 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -200,9 +200,13 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
             StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
             studentPaymentOrder.setActualAmount(studentPaymentRouteOrder.getRouteAmount());
             if(studentPaymentRouteOrder.getSchoolId() != null) {
-                studentPaymentOrder.setMusicGroupId(studentPaymentRouteOrder.getSchoolId() + "");
+                studentPaymentOrder.setCooperationId(studentPaymentRouteOrder.getSchoolId());
+            }
+            if(studentPaymentRouteOrder.getCalenderId() != null){
+                MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(studentPaymentRouteOrder.getCalenderId());
+                studentPaymentOrder.setMusicGroupId(calender.getMusicGroupId());
+                studentPaymentOrder.setCalenderId(studentPaymentRouteOrder.getCalenderId());
             }
-            studentPaymentOrder.setCalenderId(studentPaymentRouteOrder.getCalenderId());
             studentPaymentOrder.setType(studentPaymentRouteOrder.getType());
             studentPaymentOrder.setMerNos(studentPaymentRouteOrder.getMerNo());
             studentPaymentOrder.setOrderNo(studentPaymentRouteOrder.getOrderNo());

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -701,6 +701,7 @@
         <result column="routeBalance" property="routeBalance"/>
         <result column="feeFlag" property="feeFlag"/>
         <result column="orderAmount" property="orderAmount"/>
+        <result column="cooperation_id_" property="cooperationId"/>
         <collection property="orderDetailList" ofType="com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail">
             <result column="detail_id_" property="id"/>
             <result column="detail_type_" property="type"/>
@@ -740,7 +741,7 @@
     <select id="ExportQueryPage" resultMap="orderAndDetail" parameterType="map">
         SELECT spo.*,u.username_,spod.id_ detail_id_,spod.type_ detail_type_,spod.price_
         detail_price_,spod.kit_group_purchase_type_ detail_kit_group_purchase_type_,
-        sci.charge_type_,g.id_ goods_id, g.name_ goods_name,o.name_ organ_name
+        sci.charge_type_,g.id_ goods_id, g.name_ goods_name,o.name_ organ_name,spo.cooperation_id_
         FROM student_payment_order spo
         LEFT JOIN sys_user u on spo.user_id_ = u.id_
         LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml

@@ -373,7 +373,7 @@ calender_id_,create_time_,create_by_,update_time_,update_by_,tenant_id_,type_
          per_amount_,
          balance_payment_amount_, remit_fee_, course_remit_fee_, trans_no_,
          status_, memo_, create_time_, update_time_, payment_channel_, payment_business_channel_,
-         payment_account_no_, mer_nos_, order_no_, music_group_id_, class_group_id_, pay_time_,tenant_id_)
+         payment_account_no_, mer_nos_, order_no_, music_group_id_, class_group_id_, pay_time_,tenant_id_,cooperation_id_)
         VALUES (#{id}, #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
                 #{userId}, #{organId}, #{routingOrganId},
                 #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
@@ -382,7 +382,7 @@ calender_id_,create_time_,create_by_,update_time_,update_by_,tenant_id_,type_
                 #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{memo}, #{createTime}, now(),
                 #{paymentChannel}, #{paymentBusinessChannel}, #{paymentAccountNo}, #{merNos}, #{orderNo},
                 #{musicGroupId},
-                #{classGroupId}, #{payTime},#{tenantId})
+                #{classGroupId}, #{payTime},#{tenantId},#{cooperationId})
     </insert>
 
     <select id="queryAuditCount" parameterType="map" resultType="int">