|
|
|
@ -6,18 +6,13 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.domain.KhItems;
|
|
|
|
import com.ruoyi.kaohe.domain.KhItems;
|
|
|
|
import com.ruoyi.kaohe.domain.KhTemItem;
|
|
|
|
import com.ruoyi.kaohe.domain.KhTemItem;
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.domain.KhVote;
|
|
|
|
import com.ruoyi.kaohe.service.IKhTemItemService;
|
|
|
|
import com.ruoyi.kaohe.service.IKhTemItemService;
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.service.IKhVoteService;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
@ -41,6 +36,8 @@ public class KhTemplateController extends BaseController
|
|
|
|
private IKhTemplateService khTemplateService;
|
|
|
|
private IKhTemplateService khTemplateService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IKhTemItemService temItemService;
|
|
|
|
private IKhTemItemService temItemService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IKhVoteService voteService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询考核模板列表
|
|
|
|
* 查询考核模板列表
|
|
|
|
@ -77,6 +74,28 @@ public class KhTemplateController extends BaseController
|
|
|
|
return success(khTemplateService.selectKhTemplateById(id));
|
|
|
|
return success(khTemplateService.selectKhTemplateById(id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据模板查询出考核项及考核项对应的投票
|
|
|
|
|
|
|
|
* @param id
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping(value = "/getItemVote")
|
|
|
|
|
|
|
|
public AjaxResult getInfo(@RequestParam("id") Long id,@RequestParam("pingceId") Long pingceId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
KhTemplate khTemplate = khTemplateService.selectKhTemplateById(id);
|
|
|
|
|
|
|
|
List<KhItems> items = khTemplate.getItems();
|
|
|
|
|
|
|
|
for(KhItems item:items){
|
|
|
|
|
|
|
|
KhVote query = new KhVote();
|
|
|
|
|
|
|
|
query.setPingceId(pingceId);
|
|
|
|
|
|
|
|
query.setKhitemId(item.getId());
|
|
|
|
|
|
|
|
List<KhVote> khVotes = voteService.selectKhVoteList(query);
|
|
|
|
|
|
|
|
if(khVotes!=null&&khVotes.size()>0){
|
|
|
|
|
|
|
|
item.setVote(khVotes.get(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return success(khTemplate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增考核模板
|
|
|
|
* 新增考核模板
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|