Browse Source

导出链接增加,分部字段

周箭河 4 years ago
parent
commit
e9c51567c9

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ReplacementInstrumentActivityStatDto.java

@@ -11,6 +11,8 @@ import java.math.BigDecimal;
  */
 public class ReplacementInstrumentActivityStatDto extends ReplacementInstrumentActivity {
 
+    private String organName;
+
     private String subjectName;
 
     /** 品牌 */
@@ -93,4 +95,12 @@ public class ReplacementInstrumentActivityStatDto extends ReplacementInstrumentA
     public void setParam(String param) {
         this.param = param;
     }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
 }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ReplacementInstrumentActivity.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
@@ -48,6 +49,12 @@ public class ReplacementInstrumentActivity {
 
 	@ApiModelProperty(value = "缴费状态 0-未缴费 1-缴费中 2-已缴费")
 	private Integer payStatus = 0;
+
+	/**
+	 * 是否有问卷 0-没有 1-有
+	 */
+	@ApiModelProperty(value = "是否有问卷 0-没有 1-有")
+	private YesOrNoEnum showQuestion = YesOrNoEnum.YES;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -187,4 +194,12 @@ public class ReplacementInstrumentActivity {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 	}
+
+	public YesOrNoEnum getShowQuestion() {
+		return showQuestion;
+	}
+
+	public void setShowQuestion(YesOrNoEnum showQuestion) {
+		this.showQuestion = showQuestion;
+	}
 }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ReplacementInstrumentCooperation.java

@@ -30,6 +30,13 @@ public class ReplacementInstrumentCooperation {
     @ApiModelProperty(value = "是否开启缴费 0-未开启 1-已开启")
     private YesOrNoEnum openPay = YesOrNoEnum.NO;
 
+
+    /**
+     * 是否有问卷 0-没有 1-有
+     */
+    @ApiModelProperty(value = "是否有问卷 0-没有 1-有")
+    private YesOrNoEnum showQuestion = YesOrNoEnum.YES;
+
     /**
      * 创建时间
      */
@@ -182,4 +189,12 @@ public class ReplacementInstrumentCooperation {
     public void setPayScale(BigDecimal payScale) {
         this.payScale = payScale;
     }
+
+    public YesOrNoEnum getShowQuestion() {
+        return showQuestion;
+    }
+
+    public void setShowQuestion(YesOrNoEnum showQuestion) {
+        this.showQuestion = showQuestion;
+    }
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ReplacementInstrumentActivityQueryInfo.java

@@ -25,6 +25,9 @@ public class ReplacementInstrumentActivityQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "缴费状态 0-未缴费 1-缴费中 2-已缴费")
     private Integer payStatus;
 
+    @ApiModelProperty(value = "是否参与校赛")
+    private Boolean hasYesFirstAnswer;
+
     public Integer getPayStatus() {
         return payStatus;
     }
@@ -88,4 +91,12 @@ public class ReplacementInstrumentActivityQueryInfo extends QueryInfo {
     public void setCooperationOrganIdOrName(String cooperationOrganIdOrName) {
         this.cooperationOrganIdOrName = cooperationOrganIdOrName;
     }
+
+    public Boolean getHasYesFirstAnswer() {
+        return hasYesFirstAnswer;
+    }
+
+    public void setHasYesFirstAnswer(Boolean hasYesFirstAnswer) {
+        this.hasYesFirstAnswer = hasYesFirstAnswer;
+    }
 }

+ 8 - 1
mec-biz/src/main/resources/config/mybatis/ReplacementInstrumentActivityMapper.xml

@@ -28,6 +28,7 @@
     <resultMap id="ReplacementInstrumentActivityStatDto"
                type="com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatDto"
                extends="ReplacementInstrumentActivity">
+        <result property="organName" column="organ_name_"/>
         <result property="subjectName" column="subject_name_"/>
         <result property="brand" column="brand_"/>
         <result property="specification" column="specification_"/>
@@ -142,6 +143,12 @@
             <if test="hasInstrumentsId!=null and hasInstrumentsId==true">
                 AND ria.instruments_id_ >=1
             </if>
+            <if test="hasYesFirstAnswer!=null and hasYesFirstAnswer==true">
+                AND ria.question_result_ LIKE CONCAT('1', '%')
+            </if>
+            <if test="hasYesFirstAnswer!=null and hasYesFirstAnswer==false ">
+                AND ria.question_result_ LIKE CONCAT('0', '%')
+            </if>
             <if test="brand!=null and brand!=''">
                 AND ri.brand_ = #{brand}
             </if>
@@ -250,7 +257,7 @@
 
     <!-- 获取问卷分页数据 -->
     <select id="getPageList" resultMap="ReplacementInstrumentActivityStatDto" parameterType="map">
-        SELECT ria.*,ri.brand_,ri.specification_,ri.param_,ri.market_price_,ri.discount_price_,ri.depreciation_price_,
+        SELECT ria.*,o.name_,ri.brand_,ri.specification_,ri.param_,ri.market_price_,ri.discount_price_,ri.depreciation_price_,
         ri.sale_price_,s.name_ subject_name_,co.name_ cooperationOrganName FROM replacement_instrument_activity ria
         LEFT JOIN replacement_instrument ri ON ri.id_ = ria.instruments_id_
         LEFT JOIN subject s on s.id_ = ri.subject_id_

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

@@ -8,6 +8,7 @@
         <result column="organ_id_" property="organId"/>
         <result column="cooperation_organ_id_" property="cooperationOrganId"/>
         <result column="open_pay_" property="openPay" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="show_question_" property="showQuestion" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="organName" property="organName"/>
         <result column="cooperationOrganName" property="cooperationOrganName"/>
         <result column="create_time_" property="createTime"/>
@@ -23,11 +24,11 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ReplacementInstrumentCooperation"
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         <!--@mbg.generated-->
-        insert into replacement_instrument_cooperation (id_, organ_id_, cooperation_organ_id_, open_pay_, create_time_,
+        insert into replacement_instrument_cooperation (id_, organ_id_, cooperation_organ_id_, open_pay_,show_question_, create_time_,
         update_time_
         )
         values (#{id}, #{organId}, #{cooperationOrganId},
-        #{openPay,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{createTime}, #{updateTime}
+        #{openPay,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{showQuestion,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{createTime}, #{updateTime}
         )
     </insert>
 
@@ -75,6 +76,9 @@
             <if test="openPay != null">
                 AND ric.open_pay_ = #{openPay,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="showQuestion != null">
+                AND ric.show_question_ = #{showQuestion,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
             <if test="search != null and search != ''">
                 AND (ric.cooperation_organ_id_ = #{search} OR co.name_ LIKE CONCAT('%',#{search},'%'))
             </if>

+ 7 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ReplacementInstrumentActivityController.java

@@ -2,13 +2,16 @@ package com.ym.mec.student.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.ReplacementInstrumentCooperationDao;
 import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatDto;
 import com.ym.mec.biz.dal.dto.ReplacementPayDto;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity;
+import com.ym.mec.biz.dal.entity.ReplacementInstrumentCooperation;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.service.CooperationOrganService;
 import com.ym.mec.biz.service.ReplacementInstrumentActivityService;
+import com.ym.mec.biz.service.ReplacementInstrumentCooperationService;
 import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -38,6 +41,8 @@ public class ReplacementInstrumentActivityController extends BaseController {
     private StudentService studentService;
     @Autowired
     private CooperationOrganService cooperationOrganService;
+    @Autowired
+    private ReplacementInstrumentCooperationService replacementInstrumentCooperationService;
 
     @ApiOperation(value = "新增调查问卷")
     @PostMapping("/insert")
@@ -73,6 +78,8 @@ public class ReplacementInstrumentActivityController extends BaseController {
         if (cooperationOrgan != null) {
             replacementInstrumentActivity.setCooperationOrganName(cooperationOrgan.getName());
         }
+        ReplacementInstrumentCooperation replacementInstrumentCooperation = replacementInstrumentCooperationService.getByCooperationId(cooperationOrganId);
+        replacementInstrumentActivity.setShowQuestion(replacementInstrumentCooperation.getShowQuestion());
         return succeed(replacementInstrumentActivity);
     }
 

+ 2 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentActivityController.java

@@ -67,7 +67,6 @@ public class ReplacementInstrumentActivityController extends BaseController {
                 return failed("非法请求");
             }
         }
-        queryInfo.setHasInstrumentsId(true);
         return succeed(replacementInstrumentActivityService.getPageList(queryInfo));
     }
 
@@ -114,7 +113,6 @@ public class ReplacementInstrumentActivityController extends BaseController {
                 throw new BizException("非法请求");
             }
         }
-        queryInfo.setHasInstrumentsId(true);
         queryInfo.setRows(99999);
         PageInfo<ReplacementInstrumentActivityStatDto> pageList = replacementInstrumentActivityService.getPageList(queryInfo);
 
@@ -125,8 +123,8 @@ public class ReplacementInstrumentActivityController extends BaseController {
         OutputStream outputStream = response.getOutputStream();
         HSSFWorkbook workbook = null;
         try {
-            String[] header = {"合作单位编号", "合作单位", "学员编号", "学员姓名", "联系电话", "声部", "品牌", "型号"};
-            String[] body = {"cooperationOrganId", "cooperationOrganName", "userId", "userName", "mobileNo", "subjectName", "brand", "specification"};
+            String[] header = {"分部","合作单位编号", "合作单位", "学员编号", "学员姓名", "联系电话", "声部", "品牌", "型号"};
+            String[] body = {"organName","cooperationOrganId", "cooperationOrganName", "userId", "userName", "mobileNo", "subjectName", "brand", "specification"};
             workbook = POIUtil.exportExcel(header, body, pageList.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=replacement-" + DateUtil.getDate(new Date()) + ".xls");