Browse Source

任务加个状态字段

master
陈裕财 3 years ago
parent
commit
f6aff290c2
  1. 1
      xm-bootstrap/src/main/java/com/WebSecurityConfig.java
  2. 20
      xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java
  3. 5
      xm-core/src/main/java/com/xm/core/entity/XmTask.java
  4. 17
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml
  5. 2
      xm-core/src/test/java/com/WebSecurityConfig.java

1
xm-bootstrap/src/main/java/com/WebSecurityConfig.java

@ -40,6 +40,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http.authorizeRequests().antMatchers( http.authorizeRequests().antMatchers(
"/**/xm/core/xmTask/shareTaskDetail", "/**/xm/core/xmTask/shareTaskDetail",
"/**/xm/core/xmTask/getOutTask", "/**/xm/core/xmTask/getOutTask",
"/**/xm/core/xmTask/upBrowseTimes",
"/**/xm/core/xmBranchState/list/portal/allBranchSum", "/**/xm/core/xmBranchState/list/portal/allBranchSum",
"/**/xm/core/xmProjectState/list/portal", "/**/xm/core/xmProjectState/list/portal",
"/**/core/xmRecordVisit/add", "/**/core/xmRecordVisit/add",

20
xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java

@ -209,6 +209,9 @@ public class XmTaskController {
@ApiOperation("更新任务的浏览量+1") @ApiOperation("更新任务的浏览量+1")
@ApiImplicitParams({
@ApiImplicitParam(name="id",value="任务编号",required=true)
})
@RequestMapping(value="/upBrowseTimes",method=RequestMethod.POST) @RequestMapping(value="/upBrowseTimes",method=RequestMethod.POST)
public Map<String,Object> upBrowseTimes( @ApiIgnore @RequestBody XmTask xmTask){ public Map<String,Object> upBrowseTimes( @ApiIgnore @RequestBody XmTask xmTask){
User user=LoginUtils.getCurrentUserInfo(); User user=LoginUtils.getCurrentUserInfo();
@ -442,11 +445,24 @@ public class XmTaskController {
tips.setFailureMsg("任务编号id必传"); tips.setFailureMsg("任务编号id必传");
} }
if(!StringUtils.hasText(shareKey)){ if(!StringUtils.hasText(shareKey)){
tips.setFailureMsg("分享码shareKey必传");
//tips.setFailureMsg("分享码shareKey必传");
} }
//todo 检测分析妈的正确性
if(tips.isOk()){ if(tips.isOk()){
Map<String,Object> taskDb= xmTaskService.shareTaskDetail(xmTask); Map<String,Object> taskDb= xmTaskService.shareTaskDetail(xmTask);
// 检测任务是否可被查询
if(taskDb==null|| taskDb.isEmpty()){
return ResponseHelper.failed("data-0","数据不存在");
}
String toTaskCenter= (String) taskDb.get("toTaskCenter");
String crowd= (String) taskDb.get("crowd");
if( ! "1".equals(crowd) ){
return ResponseHelper.failed("crowd-0","非众包任务,无权查看");
}
if( ! "1".equals(toTaskCenter)){
return ResponseHelper.failed("toTaskCenter-0","未开放互联网访问权限");
}
m.put("data",taskDb); m.put("data",taskDb);
m.put("tips", tips); m.put("tips", tips);
} }

5
xm-core/src/main/java/com/xm/core/entity/XmTask.java
File diff suppressed because it is too large
View File

17
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml

@ -436,7 +436,7 @@
insert into xm_task( insert into xm_task(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{id},#{name},#{parentTaskid},#{parentTaskname},#{projectId},#{projectName},#{level},#{sortLevel},#{executorUserid},#{executorUsername},#{preTaskid},#{preTaskname},#{startTime},#{endTime},#{milestone},#{description},#{remarks},#{createUserid},#{createUsername},#{createTime},#{rate},#{budgetAt},#{budgetWorkload},#{actAt},#{actWorkload},#{taskState},#{taskType},#{taskClass},#{toTaskCenter},#{actStartTime},#{actEndTime},#{bizProcInstId},#{bizFlowState},#{phaseId},#{phaseName},#{taskSkillNames},#{exeUsernames},#{taskSkillIds},#{exeUserids},#{taskOut},#{planType},#{settleSchemel},#{menuId},#{menuName},#{productId},#{cbranchId},#{cdeptid},#{tagIds},#{tagNames},#{ntype},#{childrenCnt},#{ltime},#{pidPaths},#{lvl},#{isTpl},#{keyPath},#{uniInnerPrice},#{uniOutPrice},#{calcType},#{ptype},#{wtype},#{bctrl},#{initWorkload},#{shareFee},#{oshare},#{crowd},#{browseUsers},#{execUsers},#{cityId},#{cityName},#{regionType},#{browseTimes},#{capaLvls},#{tranMode},#{supRequires},#{hot},#{top},#{urgent},#{crmSup},#{bidStep},#{interestLvls},#{filePaths},#{estate},#{efunds},#{etoPlatTime},#{etoDevTime},#{ebackTime},#{topStime},#{topEtime},#{hotStime},#{hotEtime},#{urgentStime},#{urgentEtime},#{quoteFinalAt},#{provinceId},#{provinceName},#{areaId},#{areaName}
#{id},#{name},#{parentTaskid},#{parentTaskname},#{projectId},#{projectName},#{level},#{sortLevel},#{executorUserid},#{executorUsername},#{preTaskid},#{preTaskname},#{startTime},#{endTime},#{milestone},#{description},#{remarks},#{createUserid},#{createUsername},#{createTime},#{rate},#{budgetAt},#{budgetWorkload},#{actAt},#{actWorkload},#{taskState},#{taskType},#{taskClass},#{toTaskCenter},#{actStartTime},#{actEndTime},#{bizProcInstId},#{bizFlowState},#{phaseId},#{phaseName},#{taskSkillNames},#{exeUsernames},#{taskSkillIds},#{exeUserids},#{taskOut},#{planType},#{settleSchemel},#{menuId},#{menuName},#{productId},#{cbranchId},#{cdeptid},#{tagIds},#{tagNames},#{ntype},#{childrenCnt},#{ltime},#{pidPaths},#{lvl},#{isTpl},#{keyPath},#{uniInnerPrice},#{uniOutPrice},#{calcType},#{ptype},#{wtype},#{bctrl},#{initWorkload},#{shareFee},#{oshare},#{crowd},#{browseUsers},#{execUsers},#{cityId},#{cityName},#{regionType},#{browseTimes},#{capaLvls},#{tranMode},#{supRequires},#{hot},#{top},#{urgent},#{crmSup},#{bidStep},#{interestLvls},#{filePaths},#{estate},#{efunds},#{etoPlatTime},#{etoDevTime},#{ebackTime},#{topStime},#{topEtime},#{hotStime},#{hotEtime},#{urgentStime},#{urgentEtime},#{quoteFinalAt},#{provinceId},#{provinceName},#{areaId},#{areaName},#{status}
) )
</insert> </insert>
@ -492,11 +492,6 @@
update xm_task update xm_task
<set> <set>
<include refid="someFieldSet"/> <include refid="someFieldSet"/>
<if test="taskState!=null and taskState!=''">
bid_step=case when crowd='1' and #{taskState}='2' and bid_step in('5') then '6'
when crowd='1' and #{taskState} in('0','1') and bid_step in('6') then '5'
else bid_step end
</if>
</set> </set>
where (id) in where (id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > <foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
@ -516,7 +511,7 @@
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_at,budget_workload,act_at,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,phase_id,phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,product_id,cbranch_id,cdeptid,tag_ids,tag_names,ntype,children_cnt,ltime,pid_paths,lvl,is_tpl,key_path,uni_inner_price,uni_out_price,calc_type,ptype,wtype,bctrl,init_workload,share_fee,oshare,crowd,browse_users,exec_users,city_id,city_name,region_type,browse_times,capa_lvls,tran_mode,sup_requires,hot,top,urgent,crm_sup,bid_step,interest_lvls,file_paths,estate,efunds,eto_plat_time,eto_dev_time,eback_time,top_stime,top_etime,hot_stime,hot_etime,urgent_stime,urgent_etime,quote_final_at,province_id,province_name,area_id,area_name
id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_at,budget_workload,act_at,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,phase_id,phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,product_id,cbranch_id,cdeptid,tag_ids,tag_names,ntype,children_cnt,ltime,pid_paths,lvl,is_tpl,key_path,uni_inner_price,uni_out_price,calc_type,ptype,wtype,bctrl,init_workload,share_fee,oshare,crowd,browse_users,exec_users,city_id,city_name,region_type,browse_times,capa_lvls,tran_mode,sup_requires,hot,top,urgent,crm_sup,bid_step,interest_lvls,file_paths,estate,efunds,eto_plat_time,eto_dev_time,eback_time,top_stime,top_etime,hot_stime,hot_etime,urgent_stime,urgent_etime,quote_final_at,province_id,province_name,area_id,area_name,status
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -619,6 +614,7 @@
<if test="provinceName != null and provinceName != ''"> and res.province_name = #{provinceName} </if> <if test="provinceName != null and provinceName != ''"> and res.province_name = #{provinceName} </if>
<if test="areaId != null and areaId != ''"> and res.area_id = #{areaId} </if> <if test="areaId != null and areaId != ''"> and res.area_id = #{areaId} </if>
<if test="areaName != null and areaName != ''"> and res.area_name = #{areaName} </if> <if test="areaName != null and areaName != ''"> and res.area_name = #{areaName} </if>
<if test="status != null and status != ''"> and res.status = #{status} </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -718,7 +714,8 @@
province_id = #{provinceId}, province_id = #{provinceId},
province_name = #{provinceName}, province_name = #{provinceName},
area_id = #{areaId}, area_id = #{areaId},
area_name = #{areaName}
area_name = #{areaName},
status = #{status}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="name != null and name != ''"> name = #{name}, </if> <if test="name != null and name != ''"> name = #{name}, </if>
@ -818,6 +815,7 @@
<if test="provinceName != null and provinceName != ''"> province_name = #{provinceName}, </if> <if test="provinceName != null and provinceName != ''"> province_name = #{provinceName}, </if>
<if test="areaId != null and areaId != ''"> area_id = #{areaId}, </if> <if test="areaId != null and areaId != ''"> area_id = #{areaId}, </if>
<if test="areaName != null and areaName != ''"> area_name = #{areaName}, </if> <if test="areaName != null and areaName != ''"> area_name = #{areaName}, </if>
<if test="status != null and status != ''"> status = #{status}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -917,6 +915,7 @@
province_id = #{item.provinceId}, province_id = #{item.provinceId},
province_name = #{item.provinceName}, province_name = #{item.provinceName},
area_id = #{item.areaId}, area_id = #{item.areaId},
area_name = #{item.areaName}
area_name = #{item.areaName},
status = #{item.status}
</sql> </sql>
</mapper> </mapper>

2
xm-core/src/test/java/com/WebSecurityConfig.java

@ -39,6 +39,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/**/xm/core/xmTask/shareTaskDetail", http.authorizeRequests().antMatchers("/**/xm/core/xmTask/shareTaskDetail",
"/**/core/xmRecordVisit/add", "/**/core/xmRecordVisit/add",
"/**/xm/core/xmTask/upBrowseTimes",
"/**/xm/core/xmTask/getOutTask",
"/swagger-ui.html", "/swagger-ui.html",
"/webjars/**", "/webjars/**",
"/swagger-ui/**", "/swagger-ui/**",

Loading…
Cancel
Save