Browse Source

20201118v1.1合并冲突

tiaosheng
zy_Java 5 years ago
parent
commit
bc6cc3d15f
  1. 6
      mt/src/main/java/com/ccsens/mt/api/ExcelController.java
  2. 30
      mt/src/main/java/com/ccsens/mt/bean/vo/TableVo.java
  3. 87
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java
  4. 2
      mt/src/main/java/com/ccsens/mt/service/IExcelService.java
  5. 46
      mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml

6
mt/src/main/java/com/ccsens/mt/api/ExcelController.java

@ -117,9 +117,9 @@ public class ExcelController {
@MustLogin
@ApiOperation(value = "日程安排(导出)", notes = "")
@RequestMapping(value = "/schedulePlanning", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<TableVo.SchedulePlanDetailAllIn> schedulePlanning(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteTime> params) {
public JsonResponse<TableVo.SchedulePlanDetail> schedulePlanning(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteTime> params) {
log.info("日程安排更新:{}",params);
TableVo.SchedulePlan schedulePlanDetailAllInList = excelService.schedulePlanning(params.getParam());
return JsonResponse.newInstance().ok(schedulePlanDetailAllInList);
List<TableVo.SchedulePlanDetail> schedulePlanDetailList = excelService.schedulePlanning(params.getParam());
return JsonResponse.newInstance().ok(schedulePlanDetailList);
}
}

30
mt/src/main/java/com/ccsens/mt/bean/vo/TableVo.java

@ -180,13 +180,25 @@ public class TableVo {
}
@Data
@ApiModel("日程安排上下午")
public static class SchedulePlanAll{
@ApiModelProperty("项目所属日期")
private List<SchedulePlan> schedulePlanList;
}
@Data
@ApiModel("日程安排上下午")
public static class SchedulePlan{
@ApiModelProperty("项目所属日期")
private String date;
@ApiModelProperty("安排详情上午")
private List<SchedulePlanDetailAllIn> schedulePlanDetailListUp;
private List<SchedulePlanDetail> schedulePlanDetailListMorning;
@ApiModelProperty("安排详情下午")
private List<SchedulePlanDetailAllIn> schedulePlanDetailListDown;
private List<SchedulePlanDetail> schedulePlanDetailListAfternoon;
@ApiModelProperty("安排详情晚上")
private List<SchedulePlanDetail> schedulePlanDetailListNight;
}
@Data
@ -194,21 +206,13 @@ public class TableVo {
public static class SchedulePlanDetail{
@ApiModelProperty("参赛项目")
private String projectName;
@ApiModelProperty("项目开始时间")
@ApiModelProperty("上午项目开始时间")
private Long startTime;
@ApiModelProperty("项目结束时间")
private Long endTime;
@ApiModelProperty("项目所属日期")
private Long data;
}
@Data
@ApiModel("日程安排组合")
public static class SchedulePlanDetailAllIn{
@ApiModelProperty("字符拼接")
private String string;
@ApiModelProperty("项目所属日期")
private String data;
}
}

87
mt/src/main/java/com/ccsens/mt/service/ExcelService.java

@ -1292,50 +1292,55 @@ public class ExcelService implements IExcelService {
}
@Override
public TableVo.SchedulePlan schedulePlanning(CompeteDto.CompeteTime params) {
List<TableVo.SchedulePlanDetailAllIn> schedulePlanDetailListUp = new ArrayList<>();
List<TableVo.SchedulePlanDetailAllIn> schedulePlanDetailListDown = new ArrayList<>();
public List<TableVo.SchedulePlanDetail> schedulePlanning(CompeteDto.CompeteTime params) {
List<TableVo.SchedulePlanDetail> schedulePlanDetailListMorning = new ArrayList<>();
List<TableVo.SchedulePlanDetail> schedulePlanDetailListAfternoon = new ArrayList<>();
List<TableVo.SchedulePlanDetail> schedulePlanDetailListNight = new ArrayList<>();
// List<TableVo.SchedulePlan> schedulePlanList = new ArrayList<>();
//关联查询项目名,该项目在config和project中都存在
List<TableVo.SchedulePlanDetail> schedulePlanDetailList = competeProjectConfigDao.selectDetail();
TableVo.SchedulePlan schedulePlan = new TableVo.SchedulePlan();
if (CollectionUtil.isNotEmpty(schedulePlanDetailList)) {
for (TableVo.SchedulePlanDetail schedulePlanDetail : schedulePlanDetailList) {
//项目名
String projectName = schedulePlanDetail.getProjectName();
//开始时间yyyy-MM-dd HH:mm:ss
long startTime = schedulePlanDetail.getStartTime();
Date date = new Date(startTime);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
String sm = simpleDateFormat.format(date);
//结束时间
long endTime = schedulePlanDetail.getEndTime();
Date date1 = new Date(endTime);
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("HH:mm");
String em = simpleDateFormat1.format(date1);
//拼接
String string = projectName + "(" + sm + "-" + em + ")";
//项目开始日期
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("MM-dd");
String md = simpleDateFormat2.format(date);
//上午项目
if (Integer.parseInt(sm.substring(0, 2)) >= 6 && Integer.parseInt(sm.substring(0, 2)) <= 12) {
TableVo.SchedulePlanDetailAllIn schedulePlanDetailAllIn = new TableVo.SchedulePlanDetailAllIn();
schedulePlanDetailAllIn.setData(md);
schedulePlanDetailAllIn.setString(string);
schedulePlanDetailListUp.add(schedulePlanDetailAllIn);
}//下午项目
else if (Integer.parseInt(sm.substring(0, 2)) > 12 && Integer.parseInt(sm.substring(0, 2)) <= 18) {
TableVo.SchedulePlanDetailAllIn schedulePlanDetailAllIn1 = new TableVo.SchedulePlanDetailAllIn();
schedulePlanDetailAllIn1.setData(md);
schedulePlanDetailAllIn1.setString(string);
schedulePlanDetailListDown.add(schedulePlanDetailAllIn1);
}
}
schedulePlan.setSchedulePlanDetailListDown(schedulePlanDetailListDown);
schedulePlan.setSchedulePlanDetailListUp(schedulePlanDetailListUp);
}
return schedulePlan;
// TableVo.SchedulePlanAll schedulePlanAll = new TableVo.SchedulePlanAll();
// Set set = new HashSet();
// if (CollectionUtil.isNotEmpty(schedulePlanDetailList)) {
// for (TableVo.SchedulePlanDetail schedulePlanDetail : schedulePlanDetailList) {
// //开始时间yyyy-MM-dd HH:mm:ss
// long startTime = schedulePlanDetail.getStartTime();
// Date date = new Date(startTime);
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
// String sm = simpleDateFormat.format(date);
// set.add(sm);
// //结束时间
// long endTime = schedulePlanDetail.getEndTime();
// Date date1 = new Date(endTime);
// SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("HH:mm");
// String em = simpleDateFormat1.format(date1);
//当前项目开始日期
// SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("MM-dd");
// String sd = simpleDateFormat2.format(date);
// //上个项目开始日期
// TableVo.SchedulePlanDetail schedulePlanDetail1 = schedulePlanDetailList.get(1);
// long startTime1 = schedulePlanDetail.getStartTime();
// Date date1 = new Date(startTime);
// String sd1 = simpleDateFormat2.format(date1);
//上午项目
// if (Integer.parseInt(sm.substring(0, 2)) >= 6 && Integer.parseInt(sm.substring(0, 2)) <= 12) {
// schedulePlanDetailListMorning.add(schedulePlanDetail);
// for (TableVo.SchedulePlanDetail schedulePlanDetail1 :schedulePlanDetailListMorning){
//
// }
// }//下午项目
// else if (Integer.parseInt(sm.substring(0, 2)) > 12 && Integer.parseInt(sm.substring(0, 2)) <= 18) {
// schedulePlanDetailListAfternoon.add(schedulePlanDetail);
// }//晚上
// else if (Integer.parseInt(sm.substring(0, 2)) > 18 && Integer.parseInt(sm.substring(0, 2)) <= 24){
// schedulePlanDetailListNight.add(schedulePlanDetail);
// }
// }
//
//
// }
return schedulePlanDetailList;
}
}

2
mt/src/main/java/com/ccsens/mt/service/IExcelService.java

@ -82,6 +82,6 @@ public interface IExcelService {
* @param params 大赛id
* @return 返回失败的信息
*/
TableVo.SchedulePlan schedulePlanning(CompeteDto.CompeteTime params);
List<TableVo.SchedulePlanDetail> schedulePlanning(CompeteDto.CompeteTime params);
}

46
mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml

@ -31,17 +31,47 @@
</collection>
</resultMap>
<resultMap id="qwe" type="com.ccsens.mt.bean.vo.TableVo$SchedulePlan">
<id column="startDate" property="date" />
<collection property="schedulePlanDetailListMorning" ofType="com.ccsens.mt.bean.vo.TableVo$SchedulePlanDetail">
<id column="projectName" property="projectName" />
<result column="start_time" property="startTime" />
<result column="endTime" property="endTime" />
</collection>
<collection property="schedulePlanDetailListAfternoon" ofType="com.ccsens.mt.bean.vo.TableVo$SchedulePlanDetail">
<id column="projectNameP" property="projectName" />
<result column="start_timeP" property="startTime" />
<result column="endTimeP" property="endTime" />
</collection>
</resultMap>
<select id="selectByProjectId" resultMap="BaseResultMap" parameterType="java.util.Map">
select * from t_compete_project_config
where project_id = #{projectId}
and rec_status = 0
</select>
<select id="selectDetail" resultType="com.ccsens.mt.bean.vo.TableVo$SchedulePlanDetail" parameterType="java.util.Map">
SELECT a.start_time as startTime,
a.end_time as endTime,
b.name as projectName
FROM t_compete_project_config a , t_compete_project b
where a.project_id = b.id
<select id="selectDetail" resultMap="qwe" parameterType="java.util.Map">
SELECT
FROM_UNIXTIME(start_time/1000,'%y-%m-%d') as startDate,
if(a.aa = 1,p.`name`,null) as projectName,
if(a.aa = 0,p.`name`,null) as projectNamep,
if(a.aa = 1,c.start_time,null) as start_time,
if(a.aa = 0,c.start_time,null) as start_timeP,
if(a.aa = 1,c.end_time,null) as endTime,
if(a.aa = 0,c.end_time,null) as endTimeP
FROM
`t_compete_project_config` c
LEFT JOIN t_compete_project p on c.project_id = p.id
LEFT JOIN (
SELECT
id,
if(FROM_UNIXTIME(start_time/1000,'%h') &lt;= 5,1 ,0) as aa
FROM
t_compete_project_config
)a on c.id = a.id
where c.project_id = p.id
ORDER BY c.start_time
</select>
<select id="selectStartTime" resultType="com.ccsens.mt.bean.po.CompeteProjectConfig" parameterType="java.util.Map">
SELECT
@ -84,7 +114,7 @@
<if test="companyId != null">
and tcc.id = #{companyId}
</if>
<if test="name != null and name != ''"> concat('%',#{name, jdbcType=VARCHAR},'%')
<if test="name != null and name != ''">
and tcp.name like concat('%',#{name, jdbcType=VARCHAR},'%')
</if>
<if test="idCard != null and idCard != ''">
@ -132,7 +162,7 @@
and tcc.id = #{companyId}
</if>
<if test="name != null and name != ''">
and tcp.name = #{name}
and tcp.name like concat('%',#{name, jdbcType=VARCHAR},'%')
</if>
<if test="idCard != null and idCard != ''">
and tcp.id_card = #{idCard}

Loading…
Cancel
Save