| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderQueryName/auth") |
| | | @ManagerAuth |
| | | public R queryName(String condition) { |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | wrapper.eq("user_id",getUserId()); |
| | | Page<Order> page = orderService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Order order : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", order.getId()); |
| | | map.put("value", order.getName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.crm.manager.entity.Item; |
| | | import com.zy.crm.manager.entity.Order; |
| | | import com.zy.crm.manager.entity.Pri; |
| | | import com.zy.crm.manager.entity.PriOnline; |
| | | import com.zy.crm.manager.service.ItemService; |
| | | import com.zy.crm.manager.service.OrderService; |
| | | import com.zy.crm.manager.service.PriOnlineService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | |
| | | import com.core.domain.KeyValueVo; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.service.PriService; |
| | | import com.zy.crm.system.entity.Role; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.util.ClassUtils; |
| | |
| | | private PriService priService; |
| | | |
| | | @Autowired |
| | | private ItemService itemService; |
| | | private OrderService orderService; |
| | | |
| | | @RequestMapping(value = "/priOnline/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<PriOnline> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId"); |
| | | wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId"); |
| | | wrapper.in("member_id", getUserRoleBelongsToUserId("allopen")); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | Long deptId = getDeptId(); |
| | | boolean signUserId = false; |
| | | boolean signDeptId = false; |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().equals("dept_id")){ |
| | | signDeptId = true; |
| | | } |
| | | } |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else if (entry.getKey().equals("dept_id")){ |
| | | if (!val.equals("19")){ |
| | | wrapper.eq(entry.getKey(), val); |
| | | } |
| | | } else if (entry.getKey().equals("user_id") && !signDeptId){ |
| | | signUserId = true; |
| | | wrapper.eq(entry.getKey(), val); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | if (!signUserId && !signDeptId){ |
| | | wrapper.eq("user_id", getUserId()); |
| | | } |
| | | } |
| | | |
| | |
| | | priOnline.setOrderNum(format.format(new Date())); |
| | | //创建人员 |
| | | priOnline.setUserId(getUserId()); |
| | | //创建人员部门 |
| | | priOnline.setDeptId(getDeptId()); |
| | | //更新时间 |
| | | priOnline.setUpdateTime(new Date()); |
| | | //更新人员 |
| | |
| | | //状态,未完成 |
| | | priOnline.setStatus(0); |
| | | //业务员 |
| | | Item item = itemService.selectById(priOnline.getItemId()); |
| | | priOnline.setMemberId(item.getMember()); |
| | | // Item item = itemService.selectById(priOnline.getItemId()); |
| | | Order order = orderService.selectById(priOnline.getItemId()); |
| | | priOnline.setMemberId(order.getUserId()); |
| | | |
| | | |
| | | //设置项目流程 |
| | | item.setStep(2); |
| | | itemService.updateById(item); |
| | | order.setStep(2); |
| | | orderService.updateById(order); |
| | | |
| | | priOnlineService.insert(priOnline); |
| | | return R.ok(); |
| | |
| | | //状态,未完成 |
| | | priOnline.setStatus(0); |
| | | //业务员 |
| | | Item item = itemService.selectById(priOnline.getItemId()); |
| | | priOnline.setMemberId(item.getMember()); |
| | | // Item item = itemService.selectById(priOnline.getItemId()); |
| | | Order order = orderService.selectById(priOnline.getItemId()); |
| | | priOnline.setMemberId(order.getUserId()); |
| | | |
| | | priOnlineService.insert(priOnline); |
| | | return R.ok(); |
| | |
| | | for (PriOnline priOnline : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", priOnline.getId()); |
| | | map.put("value", priOnline.getOrderNum() + "/" + priOnline.getItemId$() + "/" + priOnline.getMemberId$()); |
| | | map.put("value", priOnline.getOrderNum() + "/" + priOnline.getOrderId$() + "/" + priOnline.getMemberId$()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | |
| | | @ApiModelProperty(value= "项目进度流程{1:项目创建,2:核价处理,3:产品费用明细,4:报价预算单,5:报价单}") |
| | | @TableField("step") |
| | | private int step; |
| | | |
| | | |
| | | /** |
| | | * 注释 |
| | | */ |
| | |
| | | |
| | | public Order() {} |
| | | |
| | | public Order(Long hostId,Long deptId,Long userId,Long cstmrId,String uuid,String name,Double money,Long company,String remarks,Long director,String province,String city,String district,String town,String addr,String files,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public Order(Long hostId,Long deptId,Long userId,Long cstmrId,String uuid,String name,Double money,Long company,String remarks,Long director,String province,String city,String district,String town,String addr,String files,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,Integer step,String memo) { |
| | | this.hostId = hostId; |
| | | this.deptId = deptId; |
| | | this.userId = userId; |
| | |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.step = step; |
| | | this.memo = memo; |
| | | } |
| | | |
| | |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.crm.manager.service.ItemService; |
| | | import com.zy.crm.manager.service.OrderService; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.UserService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value= "创建人员用户部门") |
| | | @TableField("dept_id") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value= "状态{0:未完成,1:已完成}") |
| | | @TableField("status") |
| | | private Integer status; |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getItemId$() { |
| | | ItemService itemService = SpringUtils.getBean(ItemService.class); |
| | | Item item = itemService.selectById(this.itemId); |
| | | if (!Cools.isEmpty(item)){ |
| | | return String.valueOf(item.getName()); |
| | | // public String getItemId$() { |
| | | // ItemService itemService = SpringUtils.getBean(ItemService.class); |
| | | // Item item = itemService.selectById(this.itemId); |
| | | // if (!Cools.isEmpty(item)){ |
| | | // return String.valueOf(item.getName()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | |
| | | public String getOrderId$() { |
| | | OrderService orderService = SpringUtils.getBean(OrderService.class); |
| | | Order order = orderService.selectById(this.itemId); |
| | | if (!Cools.isEmpty(order)){ |
| | | return String.valueOf(order.getName()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | <result column="order_num" property="orderNum" /> |
| | | <result column="template_name" property="templateName" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="check_data" property="checkData" /> |
| | |
| | | <result column="order_num" property="orderNum" /> |
| | | <result column="template_name" property="templateName" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | |
| | | } |
| | | }); |
| | | |
| | | //演示多文件列表 |
| | | //多文件列表 |
| | | var uploadListIns = upload.render({ |
| | | elem: '#data-btn-file2' |
| | | ,elemList: $('#data-btn-file3') //列表元素对象 |
| | |
| | | ,tds = tr.children(); |
| | | tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传 |
| | | } |
| | | ,progress: function(n, elem, e, index){ //注意:index 参数为 layui 2.6.6 新增 |
| | | ,progress: function(n, elem, e, index){ |
| | | element.progress('progress-demo-'+ index, n + '%'); //执行进度条。n 即为返回的进度百分比 |
| | | } |
| | | }); |
| | |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'templateName', align: 'center',title: '模板名'} |
| | | ,{field: 'orderNum', align: 'center',title: '订单号'} |
| | | ,{field: 'itemId$', align: 'center',title: '项目名'} |
| | | ,{field: 'orderId$', align: 'center',title: '项目名'} |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间'} |
| | | ,{field: 'updateTime$', align: 'center',title: '更新时间'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | |
| | | <label class="layui-form-label layui-form-required">项目名: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="itemId" placeholder="请输入项目名" style="display: none" lay-verify="required"> |
| | | <input id="itemId$" name="itemId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入项目名" onfocus=this.blur()> |
| | | <input id="orderId$" name="orderId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入项目名" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="itemQueryBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="itemQueryBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | <input class="cool-auto-complete-window-input" data-key="orderQueryNameBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="orderQueryNameBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |