Browse Source

增加投标截止时间

master
陈裕财 3 years ago
parent
commit
a23f5b9395
  1. 35
      xm-core/src/main/java/com/xm/core/service/XmTaskService.java
  2. 18
      xm-core/src/main/java/com/xm/core/service/client/SysClient.java
  3. 70
      xm-core/src/main/java/com/xm/core/vo/UserSvrVo.java

35
xm-core/src/main/java/com/xm/core/service/XmTaskService.java

@ -12,10 +12,13 @@ import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.xm.core.entity.XmMenu; import com.xm.core.entity.XmMenu;
import com.xm.core.entity.XmTask; import com.xm.core.entity.XmTask;
import com.xm.core.entity.XmTaskExecuser;
import com.xm.core.entity.XmTaskSkill; import com.xm.core.entity.XmTaskSkill;
import com.xm.core.queue.XmTaskSumParentsPushService; import com.xm.core.queue.XmTaskSumParentsPushService;
import com.xm.core.service.client.SysClient;
import com.xm.core.vo.BatchRelTasksWithMenu; import com.xm.core.vo.BatchRelTasksWithMenu;
import com.xm.core.vo.BatchRelTasksWithPhase; import com.xm.core.vo.BatchRelTasksWithPhase;
import com.xm.core.vo.UserSvrVo;
import com.xm.core.vo.XmTaskVo; import com.xm.core.vo.XmTaskVo;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -60,6 +63,10 @@ public class XmTaskService extends BaseService {
PushNotifyMsgService notifyMsgService; PushNotifyMsgService notifyMsgService;
@Autowired
SysClient sysClient;
@Autowired @Autowired
XmGroupService groupService; XmGroupService groupService;
@ -208,6 +215,28 @@ public class XmTaskService extends BaseService {
xmTaskVo.setTaskSkillNames(xmTaskVo.getSkills().stream().map(k->k.getSkillName()).collect(Collectors.joining(","))); xmTaskVo.setTaskSkillNames(xmTaskVo.getSkills().stream().map(k->k.getSkillName()).collect(Collectors.joining(",")));
xmTaskVo.setTaskSkillIds(xmTaskVo.getSkills().stream().map(k->k.getSkillId()).collect(Collectors.joining(","))); xmTaskVo.setTaskSkillIds(xmTaskVo.getSkills().stream().map(k->k.getSkillId()).collect(Collectors.joining(",")));
} }
if(StringUtils.hasText(xmTaskVo.getServiceId())){
Map<String,Object> userServiceData=sysClient.getUserSvrByServiceId(xmTaskVo.getServiceId());
if(userServiceData!=null && !userServiceData.isEmpty()){
User exeUser=BaseUtils.fromMap(userServiceData,User.class);
UserSvrVo svrVo=BaseUtils.fromMap(userServiceData,UserSvrVo.class);
XmTaskExecuser xmTaskExecuser=new XmTaskExecuser();
xmTaskExecuser.setTaskId(xmTaskVo.getId());
xmTaskExecuser.setTaskName(xmTaskVo.getName());
xmTaskExecuser.setProjectId(xmTaskVo.getProjectId());
xmTaskExecuser.setUserid(exeUser.getUserid());
xmTaskExecuser.setUsername(exeUser.getUsername());
xmTaskExecuser.setExecUserBranchId(exeUser.getBranchId());
xmTaskExecuser.setBranchId(xmTaskVo.getCbranchId());
xmTaskExecuser.setStatus("1");
xmTaskExecuser.setQuoteAmount(svrVo.getPrice());
xmTaskExecuser.setQuoteWorkload(xmTaskVo.getBudgetWorkload());
xmTaskExecuser.setSkillRemark((String)userServiceData.get("skills"));
xmTaskExecuserService.addExecuser(xmTaskExecuser);
}
}
XmTask xmTask = new XmTask(); XmTask xmTask = new XmTask();
BeanUtils.copyProperties(xmTaskVo,xmTask); BeanUtils.copyProperties(xmTaskVo,xmTask);
this.insert(xmTask); this.insert(xmTask);
@ -225,6 +254,8 @@ public class XmTaskService extends BaseService {
xmTaskSkillService.addSkill(xmTaskVo.getSkills()); xmTaskSkillService.addSkill(xmTaskVo.getSkills());
} }
//xmTaskExecuserService.updateXmTaskExeUseridsAndUsernamesByTaskId(xmTaskVo.getId()); //xmTaskExecuserService.updateXmTaskExeUseridsAndUsernamesByTaskId(xmTaskVo.getId());
//xmTaskSkillService.updateXmTaskSkillIdsAndNamesByTaskId(xmTaskVo.getId()); //xmTaskSkillService.updateXmTaskSkillIdsAndNamesByTaskId(xmTaskVo.getId());
@ -236,6 +267,10 @@ public class XmTaskService extends BaseService {
return xmTaskVo; return xmTaskVo;
} }
public XmTaskVo createByService(XmTaskVo xmTaskVo){
return xmTaskVo;
}
/** /**
* 有执行人有子任务都不允许删除 * 有执行人有子任务都不允许删除
* @param xmTask * @param xmTask

18
xm-core/src/main/java/com/xm/core/service/client/SysClient.java

@ -42,6 +42,24 @@ public class SysClient {
return user; return user;
} }
/**
* 查询用户服务明细及用户基本信息
* @param serviceId
* @return
*/
public Map<String,Object> getUserSvrByServiceId(String serviceId){
String url="/sys/sys/userSvr/detail?id={serviceId}";
Map<String,Object> re=callBizService.getForMap(url,map("serviceId",serviceId));
Map<String,Object> data= (Map<String, Object>) re.get("data");
if(data==null || data.isEmpty()){
return null;
}
return data;
}
/** /**
* 检查用户归属企业是否可以投标等等 * 检查用户归属企业是否可以投标等等
* @param branchId * @param branchId

70
xm-core/src/main/java/com/xm/core/vo/UserSvrVo.java

@ -0,0 +1,70 @@
package com.xm.core.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 组织 com 顶级模块 mdp 大模块 sys 小模块 <br>
* 实体 UserSvr所有属性名: <br>
* "id","服务编号","name","服务名称","remark","服务简介","price","服务价格","pimg","服务主图","times","服务时间范围","status","状态0初始1上架2下架","summary","简介","userid","用户编号","ctime","创建时间","ltime","最后更新时间";<br>
* 当前主键(包括多主键):<br>
* id;<br>
*/
@Data
@ApiModel(description="企业服务列表")
public class UserSvrVo implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes="服务编号,主键",allowEmptyValue=true,example="",allowableValues="")
String id;
@ApiModelProperty(notes="服务名称",allowEmptyValue=true,example="",allowableValues="")
String name;
@ApiModelProperty(notes="服务简介",allowEmptyValue=true,example="",allowableValues="")
String remark;
@ApiModelProperty(notes="服务价格",allowEmptyValue=true,example="",allowableValues="")
BigDecimal price;
@ApiModelProperty(notes="服务主图",allowEmptyValue=true,example="",allowableValues="")
String pimg;
@ApiModelProperty(notes="服务时间范围",allowEmptyValue=true,example="",allowableValues="")
String times;
@ApiModelProperty(notes="状态0初始1上架2下架",allowEmptyValue=true,example="",allowableValues="")
String status;
@ApiModelProperty(notes="简介",allowEmptyValue=true,example="",allowableValues="")
String summary;
@ApiModelProperty(notes="用户编号",allowEmptyValue=true,example="",allowableValues="")
String userid;
@ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="")
Date ctime;
@ApiModelProperty(notes="最后更新时间",allowEmptyValue=true,example="",allowableValues="")
Date ltime;
/**
*服务编号
**/
public UserSvrVo(String id) {
this.id = id;
}
/**
* 企业服务列表
**/
public UserSvrVo() {
}
}
Loading…
Cancel
Save