| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | import com.zy.crm.manager.entity.Pri; |
| | | import com.zy.crm.manager.entity.PriOnline2; |
| | | import com.zy.crm.manager.service.PlanService; |
| | | import com.zy.crm.manager.service.PriOnline2Service; |
| | | import com.zy.crm.manager.service.PriService; |
| | | import com.zy.crm.manager.entity.*; |
| | | import com.zy.crm.manager.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.util.ClassUtils; |
| | |
| | | @Autowired |
| | | private PlanService planService; |
| | | |
| | | @Autowired |
| | | private PriSalesService priSalesService; |
| | | |
| | | @Autowired |
| | | private CstmrService cstmrService; |
| | | |
| | | @RequestMapping(value = "/priOnline2/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/viewCheck/{id}/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "查看询价") |
| | | public R viewCheck(@PathVariable("id") String id) { |
| | | PriOnline2 priOnline = priOnline2Service.selectById(String.valueOf(id)); |
| | | if (Cools.isEmpty(priOnline.getCheckData())) { |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/add/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "添加核价管理") |
| | | public R add(@RequestBody Map<String,Object> map) { |
| | | PriOnline2 priOnline2 = new PriOnline2(); |
| | | priOnline2.setCreateTime(new Date()); |
| | | priOnline2.setTitle(map.get("title").toString()); |
| | | priOnline2.setTemplateName(map.get("title").toString()); |
| | | // priOnline2.setTemplateName(map.get("title").toString()); |
| | | priOnline2.setSheetData(map.get("sheetData").toString()); |
| | | priOnline2.setItemId(Long.parseLong(map.get("itemId").toString())); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | |
| | | Plan plan = planService.selectById(priOnline2.getItemId()); |
| | | priOnline2.setMemberId(plan.getUserId()); |
| | | |
| | | Cstmr cstmr = cstmrService.selectById(plan.getCstmrId()); |
| | | priOnline2.setTemplateName(cstmr.getName()); //甲方单位名称 |
| | | |
| | | |
| | | //设置项目流程 |
| | | plan.setStep(2); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/addOther/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "另存核价管理") |
| | | public R addOther(@RequestBody Map<String,Object> map) { |
| | | PriOnline2 online = priOnline2Service.selectById(Long.parseLong(map.get("id").toString())); |
| | | |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/update/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "更新核价管理") |
| | | public R update(@RequestBody Map<String,Object> map){ |
| | | PriOnline2 priOnline2 = priOnline2Service.selectById(Long.parseLong(map.get("id").toString())); |
| | | if (priOnline2.getStatus() == 1) { |
| | |
| | | |
| | | //更新状态 |
| | | @RequestMapping(value = "/priOnline2/updateForm/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "更新核价管理状态") |
| | | public R updateForm(Long id,Integer status,String title,String templateName){ |
| | | PriOnline2 priOnline2 = priOnline2Service.selectById(id); |
| | | priOnline2.setStatus(status); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/uploadCheck/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "上传询价文件") |
| | | public R uploadCheck(@RequestParam("id") Integer id, |
| | | @RequestParam("checkData") String checkData, |
| | | @RequestParam("file") MultipartFile[] files){ |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/delete/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "删除核价管理") |
| | | public R delete(Long[] ids){ |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | for (Long id : ids){ |
| | | int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id)); |
| | | if (priSales!=0){ |
| | | return R.error("存在关联的产品费用明细,禁止删除!!!"); |
| | | } |
| | | } |
| | | priOnline2Service.deleteBatchIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | |
| | | for (PriOnline2 priOnline2 : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", priOnline2.getId()); |
| | | map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$()); |
| | | // map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$()); |
| | | map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getTemplateName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |