Commit dcef69f4 by 张祺

修改填报值的显示页面

parent 2ad5338c
......@@ -30,7 +30,10 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Api(tags={"数据填报-在线填报、excel导入"})
@RestController
......@@ -55,9 +58,6 @@ public class DataEnterCtrl {
public List<TaskIndValue> findToEdit(@RequestParam("taskId") String taskId) throws Exception {
List<TaskIndValue> list = new ArrayList<>();
Task task = taskService.getById(taskId, true, false);
String userId = SystemUserUtil.getCurrentUserId();
String orgId = SystemUserUtil.getCurrentUserOrgId();
String orgName = SystemUserUtil.getCurrentUserOrgName();
List<TaskIndicator> taskIndicators = task.getIndicators();
if (CollectionUtils.isNotEmpty(taskIndicators)) {
TaskRuleGroupObj groupObj = taskRuleGroupObjService.getById(task.getGroupId());
......@@ -88,6 +88,7 @@ public class DataEnterCtrl {
}
String valueTime = task.getValueTime();
String sameTermValutTime = DateUtils.getSameTermValueTime(valueTime);
// 2020-09 转成成 202009
List<TaskIndValue> defaultValues =
taskService.findDefaultValues(valueTime.replace("-", ""), indIds);
List<TaskIndValue> defaultLastValueValues =
......
......@@ -88,6 +88,10 @@ public class TaskIndValue extends BaseModel {
@ApiModelProperty("备注")
private String description;
@ApiModelProperty("数据项归属部门")
@Transient
private String indDept;
/**
* excel导入对应的excel模板id
*/
......
......@@ -11,6 +11,10 @@ import java.util.List;
public interface NoticeInfoMapper extends BaseMapper<NoticeInfo> {
/**
* 批量创建
*/
void batchInsert(@Param("notices") List<NoticeInfo> notices);
/**
* 根据id获取
* @param id
* @return
......
......@@ -7,6 +7,18 @@ import java.util.List;
public interface NoticeInfoService {
/**
* 单个创建消息通知
* @param noticeInfo
*/
void insertNotice(NoticeInfo noticeInfo);
/**
* 批量创建消息通知(异步)
* @param notices
*/
void createNotices(List<NoticeInfo> notices);
/**
* 根据id获取
* @param id
* @return
......
......@@ -4,6 +4,7 @@ import com.keymobile.indicators.model.entity.NoticeInfo;
import com.keymobile.indicators.model.mapper.indicators.NoticeInfoMapper;
import com.keymobile.indicators.service.NoticeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -15,6 +16,17 @@ public class NoticeInfoServiceImpl implements NoticeInfoService {
private NoticeInfoMapper noticeInfoMapper;
@Override
public void insertNotice(NoticeInfo noticeInfo) {
noticeInfoMapper.insert(noticeInfo);
}
@Override
@Async
public void createNotices(List<NoticeInfo> notices) {
noticeInfoMapper.batchInsert(notices);
}
@Override
public NoticeInfo getById(Integer id) {
return noticeInfoMapper.getById(id);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.keymobile.indicators.model.mapper.indicators.NoticeInfoMapper">
<insert id="batchInsert" parameterType="list">
insert into notice_info
(title, detail, is_read, to_user,state,
creator,updater,create_time,update_time)
values
<foreach collection="notices" item="nt" separator=",">
(
#{nt.titile}, #{nt.detail}, #{nt.isRead}, #{nt.toUser}, #{nt.state},
#{nt.creator},#{nt.updater}, #{nt.createTime}, #{nt.updateTime}
)
</foreach>
</insert>
<select id="getById" resultType="com.keymobile.indicators.model.entity.NoticeInfo" >
select *
from notice_info
......
......@@ -24,14 +24,15 @@
</select>
<select id="findByPageAndTaskId" resultType="com.keymobile.indicators.model.entity.dataenter.TaskIndValue" >
select val.*
select val.*, def.ind_dept
from data_enter_task_ind_val val left join data_enter_task_ind ind on
val.ind_id = ind.ind_id and val.task_id = ind.task_id and val.state = 1 and ind.state = 1
left join base_ind_def def on val.ind_id = def.ind_id
where val.task_id = #{taskId}
<if test="!includeFormula">
and (ind.ind_formula is null or ind.ind_formula = '')
</if>
order by val.ind_id asc
order by val.ind_id asc,val.obj_id asc
limit #{start}, #{pageSize}
</select>
......@@ -58,13 +59,13 @@
</delete>
<select id="findValuesByTaskAndSource" parameterType="object" resultType="com.keymobile.indicators.model.entity.dataenter.TaskIndValue" >
select *
from data_enter_task_ind_val
where task_id = #{taskId} and state = 1
select val.*, def.ind_dept
from data_enter_task_ind_val val left join base_ind_def def on val.ind_id = def.ind_id
where val.task_id = #{taskId} and val.state = 1
<if test="indSource != null">
and ind_source = #{indSource}
and val.ind_source = #{indSource}
</if>
order by ind_id asc
order by val.ind_id asc
</select>
<select id="findDefaultValues" parameterType="object"
......@@ -83,7 +84,7 @@
</foreach>
)
</if>
order by ind_id desc
order by ind_id desc, dim1 asc
</select>
<update id="updateTaskValueToPass" parameterType="java.lang.String">
......
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