mirror of
https://gitee.com/vben/vben-java.git
synced 2026-10-06 14:13:12 +08:00
~
This commit is contained in:
@@ -6,3 +6,6 @@
|
||||
/.idea/
|
||||
/vboot-web/src/main/resources/application.properties
|
||||
/vboot-web/src/main/resources/application.yml
|
||||
/vboot-extend/src/main/java/vboot/extend/module/bi/
|
||||
/vboot-extend/src/main/java/vboot/extend/module/sa/
|
||||
/vboot-extend/src/main/java/vboot/extend/module/te/
|
||||
|
||||
@@ -5,11 +5,6 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.common.service.BaseCateService;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import vboot.core.common.service.BaseService;
|
||||
import vboot.core.module.sys.portal.menu.SysPortalMenu;
|
||||
import vboot.extend.module.sa.cust.cate.SaCustCate;
|
||||
import vboot.extend.module.sa.cust.cate.SaCustCateRepo;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
@@ -4,7 +4,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import vboot.core.module.sys.org.root.SysOrg;
|
||||
import vboot.extend.module.sa.prod.main.SaProdMain;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -935,195 +935,6 @@ public class SysPortalInit {
|
||||
menu11.setPorid("sa");
|
||||
menuService.insert(menu11);
|
||||
|
||||
SysPortalMenu menu2 = new SysPortalMenu();
|
||||
menu2.setId("Sa-SaProj");
|
||||
menu2.setName("项目管理");
|
||||
menu2.setCode("SaProj");
|
||||
menu2.setComp("LAYOUT");
|
||||
menu2.setPath("/sa/proj");
|
||||
menu2.setRedirect("/sa/proj/main");
|
||||
menu2.setOrnum(2);
|
||||
menu2.setIcon("ele-Postcard");
|
||||
menu2.setAvtag(true);
|
||||
menu2.setShtag(true);
|
||||
menu2.setType("D");
|
||||
menu2.setPorid("sa");
|
||||
menuService.insert(menu2);
|
||||
|
||||
SysPortalMenu menu21 = new SysPortalMenu();
|
||||
menu21.setId("Sa-SaProjMain");
|
||||
menu21.setName("项目清单");
|
||||
menu21.setCode("SaProjMain");
|
||||
menu21.setPath("/sa/proj/main");
|
||||
menu21.setComp("/sa/proj/main/index");
|
||||
menu21.setOrnum(21);
|
||||
menu21.setIcon("ele-Tickets");
|
||||
menu21.setPid("Sa-SaProj");
|
||||
menu21.setCatag(true);
|
||||
menu21.setAvtag(true);
|
||||
menu21.setShtag(true);
|
||||
menu21.setType("M");
|
||||
menu21.setPorid("sa");
|
||||
menuService.insert(menu21);
|
||||
|
||||
SysPortalMenu menu22 = new SysPortalMenu();
|
||||
menu22.setId("Sa-SaProjMainEdit");
|
||||
menu22.setName("项目编辑");
|
||||
menu22.setCode("SaProjMainEdit");
|
||||
menu22.setPath("/sa/proj/main/edit");
|
||||
menu22.setComp("/sa/proj/main/edit");
|
||||
menu22.setOrnum(22);
|
||||
menu22.setIcon("ele-Tickets");
|
||||
menu22.setPid("Sa-SaProj");
|
||||
menu22.setCatag(true);
|
||||
menu22.setAvtag(true);
|
||||
menu22.setShtag(false);
|
||||
menu22.setType("M");
|
||||
menu22.setPorid("sa");
|
||||
menuService.insert(menu22);
|
||||
|
||||
SysPortalMenu menu23 = new SysPortalMenu();
|
||||
menu23.setId("Sa-SaProjMainView");
|
||||
menu23.setName("项目编辑");
|
||||
menu23.setCode("SaProjMainView");
|
||||
menu23.setPath("/sa/proj/main/view");
|
||||
menu23.setComp("/sa/proj/main/view");
|
||||
menu23.setOrnum(23);
|
||||
menu23.setIcon("ele-Tickets");
|
||||
menu23.setPid("Sa-SaProj");
|
||||
menu23.setCatag(true);
|
||||
menu23.setAvtag(true);
|
||||
menu23.setShtag(false);
|
||||
menu23.setType("M");
|
||||
menu23.setPorid("sa");
|
||||
menuService.insert(menu23);
|
||||
|
||||
SysPortalMenu menu3 = new SysPortalMenu();
|
||||
menu3.setId("Sa-SaAgent");
|
||||
menu3.setName("代理商管理");
|
||||
menu3.setCode("SaAgent");
|
||||
menu3.setComp("LAYOUT");
|
||||
menu3.setPath("/sa/agent");
|
||||
menu3.setRedirect("/sa/agent/main");
|
||||
menu3.setOrnum(3);
|
||||
menu3.setIcon("ele-Postcard");
|
||||
menu3.setAvtag(true);
|
||||
menu3.setShtag(true);
|
||||
menu3.setType("D");
|
||||
menu3.setPorid("sa");
|
||||
menuService.insert(menu3);
|
||||
|
||||
SysPortalMenu menu31 = new SysPortalMenu();
|
||||
menu31.setId("Sa-SaAgentCate");
|
||||
menu31.setName("代理商分类");
|
||||
menu31.setCode("SaAgentCate");
|
||||
menu31.setPath("/sa/agent/cate");
|
||||
menu31.setComp("/sa/agent/cate/index");
|
||||
menu31.setOrnum(31);
|
||||
menu31.setIcon("ele-Tickets");
|
||||
menu31.setPid("Sa-SaAgent");
|
||||
menu31.setCatag(true);
|
||||
menu31.setAvtag(true);
|
||||
menu31.setShtag(true);
|
||||
menu31.setType("M");
|
||||
menu31.setPorid("sa");
|
||||
menuService.insert(menu31);
|
||||
|
||||
SysPortalMenu menu32 = new SysPortalMenu();
|
||||
menu32.setId("Sa-SaAgentMain");
|
||||
menu32.setName("代理商清单");
|
||||
menu32.setCode("SaAgentMain");
|
||||
menu32.setPath("/sa/agent/main");
|
||||
menu32.setComp("/sa/agent/main/index");
|
||||
menu32.setOrnum(32);
|
||||
menu32.setIcon("ele-Tickets");
|
||||
menu32.setPid("Sa-SaAgent");
|
||||
menu32.setCatag(true);
|
||||
menu32.setAvtag(true);
|
||||
menu32.setShtag(true);
|
||||
menu32.setType("M");
|
||||
menu32.setPorid("sa");
|
||||
menuService.insert(menu32);
|
||||
|
||||
SysPortalMenu menu33 = new SysPortalMenu();
|
||||
menu33.setId("Sa-SaAgentMainEdit");
|
||||
menu33.setName("代理商编辑");
|
||||
menu33.setCode("SaAgentMainEdit");
|
||||
menu33.setPath("/sa/agent/main/edit");
|
||||
menu33.setComp("/sa/agent/main/edit");
|
||||
menu33.setOrnum(33);
|
||||
menu33.setIcon("ele-Tickets");
|
||||
menu33.setPid("Sa-SaAgent");
|
||||
menu33.setCatag(true);
|
||||
menu33.setAvtag(true);
|
||||
menu33.setShtag(false);
|
||||
menu33.setType("M");
|
||||
menu33.setPorid("sa");
|
||||
menuService.insert(menu33);
|
||||
|
||||
SysPortalMenu menu4 = new SysPortalMenu();
|
||||
menu4.setId("Sa-SaCust");
|
||||
menu4.setName("客户管理");
|
||||
menu4.setCode("SaCust");
|
||||
menu4.setComp("LAYOUT");
|
||||
menu4.setPath("/sa/cust");
|
||||
menu4.setRedirect("/sa/cust/main");
|
||||
menu4.setOrnum(4);
|
||||
menu4.setIcon("ele-Postcard");
|
||||
menu4.setAvtag(true);
|
||||
menu4.setShtag(true);
|
||||
menu4.setType("D");
|
||||
menu4.setPorid("sa");
|
||||
menuService.insert(menu4);
|
||||
|
||||
SysPortalMenu menu41 = new SysPortalMenu();
|
||||
menu41.setId("Sa-SaCustCate");
|
||||
menu41.setName("客户分类");
|
||||
menu41.setCode("SaCustCate");
|
||||
menu41.setPath("/sa/cust/cate");
|
||||
menu41.setComp("/sa/cust/cate/index");
|
||||
menu41.setOrnum(41);
|
||||
menu41.setIcon("ele-Tickets");
|
||||
menu41.setPid("Sa-SaCust");
|
||||
menu41.setCatag(true);
|
||||
menu41.setAvtag(true);
|
||||
menu41.setShtag(true);
|
||||
menu41.setType("M");
|
||||
menu41.setPorid("sa");
|
||||
menuService.insert(menu41);
|
||||
|
||||
SysPortalMenu menu42 = new SysPortalMenu();
|
||||
menu42.setId("Sa-SaCustMain");
|
||||
menu42.setName("客户分类");
|
||||
menu42.setCode("SaCustMain");
|
||||
menu42.setPath("/sa/cust/main");
|
||||
menu42.setComp("/sa/cust/main/index");
|
||||
menu42.setOrnum(42);
|
||||
menu42.setIcon("ele-Tickets");
|
||||
menu42.setPid("Sa-SaCust");
|
||||
menu42.setCatag(true);
|
||||
menu42.setAvtag(true);
|
||||
menu42.setShtag(true);
|
||||
menu42.setType("M");
|
||||
menu42.setPorid("sa");
|
||||
menuService.insert(menu42);
|
||||
|
||||
SysPortalMenu menu43 = new SysPortalMenu();
|
||||
menu43.setId("Sa-SaCustMainEdit");
|
||||
menu43.setName("客户编辑");
|
||||
menu43.setCode("SaCustMainEdit");
|
||||
menu43.setPath("/sa/cust/main/edit");
|
||||
menu43.setComp("/sa/cust/main/edit");
|
||||
menu43.setOrnum(43);
|
||||
menu43.setIcon("ele-Tickets");
|
||||
menu43.setPid("Sa-SaCust");
|
||||
menu43.setCatag(true);
|
||||
menu43.setAvtag(true);
|
||||
menu43.setShtag(false);
|
||||
menu43.setType("M");
|
||||
menu43.setPorid("sa");
|
||||
menuService.insert(menu43);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package vboot.extend.module.bi.conn.main;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiConnMain extends BaseMainEntity {
|
||||
|
||||
@Column(length = 64)
|
||||
private String comet;//注释
|
||||
|
||||
@Column(length = 64)
|
||||
private String notes;//备注
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package vboot.extend.module.bi.conn.main;
|
||||
|
||||
import vboot.extend.module.bi.table.main.BiTableMain;
|
||||
import vboot.extend.module.bi.table.main.BiTableMainService;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/conn/main")
|
||||
public class BiConnMainApi {
|
||||
|
||||
private String table = "bi_conn_main";
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler(table);
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.comet,t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
BiTableMain main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BiTableMainService service;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.bi.conn.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BiConnMainRepo extends JpaRepository<BiConnMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package vboot.extend.module.bi.conn.main;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class BiConnMainService extends BaseMainService<BiConnMain> {
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private BiConnMainRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.boy;
|
||||
|
||||
import vboot.core.common.entity.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiDemoBoy extends BaseEntity
|
||||
{
|
||||
private String notes;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.boy;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.xutil.lang.XstrUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/demo/boy")
|
||||
public class BiDemoBoyApi {
|
||||
|
||||
private String table = "bi_demo_boy";
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
List<BiDemoBoy> boys = new ArrayList<>();
|
||||
for (int i = 1; i <= 100; i++) {
|
||||
BiDemoBoy boy=new BiDemoBoy();
|
||||
boy.setId(XstrUtil.getUUID());
|
||||
boy.setName(XstrUtil.getRSID8());
|
||||
boys.add(boy);
|
||||
}
|
||||
repo.saveAll(boys);
|
||||
Sqler sqler = new Sqler(table);
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
BiDemoBoy main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiDemoBoy main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiDemoBoy main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BiDemoBoyService service;
|
||||
|
||||
@Autowired
|
||||
private BiDemoBoyRepo repo;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.boy;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BiDemoBoyRepo extends JpaRepository<BiDemoBoy,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.boy;
|
||||
|
||||
import vboot.core.common.service.BaseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BiDemoBoyService extends BaseService<BiDemoBoy> {
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private BiDemoBoyRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.girl;
|
||||
|
||||
import vboot.core.common.entity.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiDemoGirl extends BaseEntity
|
||||
{
|
||||
private String notes;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.girl;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/demo/girl")
|
||||
public class BiDemoGirlApi {
|
||||
|
||||
private String table = "bi_demo_girl";
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler(table);
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
BiDemoGirl main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiDemoGirl main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiDemoGirl main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BiDemoGirlService service;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.girl;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BiDemoGirlRepo extends JpaRepository<BiDemoGirl,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.girl;
|
||||
|
||||
import vboot.core.common.service.BaseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BiDemoGirlService extends BaseService<BiDemoGirl> {
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private BiDemoGirlRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.student;
|
||||
|
||||
import vboot.core.common.entity.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiDemoStudent extends BaseEntity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.student;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/demo/student")
|
||||
public class BiDemoStudentApi {
|
||||
|
||||
private String table = "bi_demo_student";
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler(table);
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
BiDemoStudent main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiDemoStudent main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiDemoStudent main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BiDemoStudentService service;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.student;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BiDemoStudentRepo extends JpaRepository<BiDemoStudent,String> {
|
||||
|
||||
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.bi.demo.student;
|
||||
|
||||
import vboot.core.common.service.BaseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BiDemoStudentService extends BaseService<BiDemoStudent> {
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private BiDemoStudentRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.log;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiEtlLog {
|
||||
|
||||
@Id
|
||||
private Integer ID_BATCH;
|
||||
|
||||
private String CHANNEL_ID;
|
||||
|
||||
private String TRANSNAME;
|
||||
|
||||
@Column(length = 15)
|
||||
private String STATUS;
|
||||
|
||||
private Long LINES_READ;
|
||||
|
||||
private Long LINES_WRITTEN;
|
||||
|
||||
private Long LINES_UPDATED;
|
||||
|
||||
private Long LINES_INPUT;
|
||||
|
||||
private Long LINES_OUTPUT;
|
||||
|
||||
private Long LINES_REJECTED;
|
||||
|
||||
private Long ERRORS;
|
||||
|
||||
private Date STARTDATE;
|
||||
|
||||
private Date ENDDATE;
|
||||
|
||||
private Date LOGDATE;
|
||||
|
||||
private Date DEPDATE;
|
||||
|
||||
private Date REPLAYDATE;
|
||||
|
||||
@Column(length = 5000)
|
||||
private String LOG_FIELD;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.log;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.JdbcDao;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/etl/log")
|
||||
public class BiEtlLogApi {
|
||||
private String table="bi_etl_log";
|
||||
|
||||
|
||||
@GetMapping
|
||||
public R list(Integer panum, Integer pasiz, String name, String id) {
|
||||
Sqler sqler = new Sqler("t.ID_BATCH as id,t.TRANSNAME as name,t.STARTDATE as sttim,t.ENDDATE as entim," +
|
||||
"t.STATUS as state,t.LOGDATE as lotim,t.DEPDATE as detim,t.REPLAYDATE as retim",
|
||||
table,panum,pasiz);
|
||||
sqler.addLike("t.TRANSNAME", name);
|
||||
sqler.addEqual("t.ID_BATCH", id);
|
||||
sqler.addOrder("t.LOGDATE desc");
|
||||
return R.ok(jdbcDao.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R get(@PathVariable String id) {
|
||||
String sql = "select t.ID_BATCH as id,t.STARTDATE sttim,t.ENDDATE entim,t.LOGDATE lotim,t.log_field msg,t.status state," +
|
||||
"t.transname name from "+table+" t where t.ID_BATCH=?";
|
||||
return R.ok(jdbcDao.findMap(sql, id));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
String sql = "delete from "+table+" where ID_BATCH=?";
|
||||
for (String id : ids) {
|
||||
jdbcDao.update(sql, id);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private JdbcDao jdbcDao;
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.pentaho.di.core.KettleEnvironment;
|
||||
import org.pentaho.di.core.exception.KettleException;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class BiEtlJobListener implements ApplicationListener<ContextRefreshedEvent> {
|
||||
@Autowired
|
||||
private BiEtlMainHandler handler;
|
||||
|
||||
@Autowired
|
||||
private BiEtlMainService etlService;
|
||||
|
||||
//初始启动quartz
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
List<BiEtlMain> kettleList = etlService.findAll();
|
||||
try {
|
||||
KettleEnvironment.init();
|
||||
} catch (KettleException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
handler.startAllEtlJobs(kettleList);
|
||||
} catch (SchedulerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// log.info("----ETL定时调度任务开启----");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiEtlMain extends BaseMainEntity
|
||||
{
|
||||
@Column(length = 32)
|
||||
private String code;
|
||||
|
||||
@Column(length = 32)
|
||||
private String cron;
|
||||
|
||||
private String notes;
|
||||
|
||||
@Column(length = 128)
|
||||
private String zpath;
|
||||
|
||||
@Column(length = 128)
|
||||
private String zname;
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/etl/main")
|
||||
public class BiEtlMainApi {
|
||||
|
||||
@Value("${app.att.path}")
|
||||
private String ATT_PATH;
|
||||
|
||||
private String table = "bi_etl_main";
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("t.id,t.name,t.code,t.cron,t.avtag", table);
|
||||
sqler.addLeftJoin("o.name as crman", "sys_org o", "o.id=t.crman");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addOrder("t.crtim desc");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
return R.ok(service.findOne(id));
|
||||
}
|
||||
|
||||
@PostMapping("once")
|
||||
public R edit_startOnce(String id) throws Exception {
|
||||
BiEtlMain kettle = service.findOne(id);
|
||||
KetUtil.runTran(ATT_PATH + "/" + kettle.getZpath(), null, true);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiEtlMain main) {
|
||||
main.setAvtag(false);
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiEtlMain main) throws SchedulerException {
|
||||
if (main.getAvtag()) {
|
||||
handler.startEtlJob(main);
|
||||
}
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@PostMapping("start")
|
||||
public R startJob(String ids) throws SchedulerException {
|
||||
String[] idArr = ids.split(",");
|
||||
for (int i = 0; i < idArr.length; i++) {
|
||||
BiEtlMain kettle =service.findOne(idArr[i]);
|
||||
handler.startEtlJob(kettle);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("stop")
|
||||
public R stopJob(String ids) throws SchedulerException {
|
||||
String[] idArr = ids.split(",");
|
||||
for (int i = 0; i < idArr.length; i++) {
|
||||
BiEtlMain kettle = service.findOne(idArr[i]);
|
||||
handler.stopEtlJob(kettle);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) throws SchedulerException {
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
BiEtlMain kettle = service.findOne(ids[i]);
|
||||
handler.stopEtlJob(kettle);
|
||||
}
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BiEtlMainHandler handler;
|
||||
|
||||
@Autowired
|
||||
private BiEtlMainService service;
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import org.quartz.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class BiEtlMainHandler {
|
||||
|
||||
|
||||
|
||||
//开始执行所有任务
|
||||
public void startAllEtlJobs(List<BiEtlMain> kettleList) throws SchedulerException {
|
||||
for (int i = 0; i < kettleList.size(); i++) {
|
||||
if(kettleList.get(i).getAvtag()){
|
||||
initEtlJob(scheduler,kettleList.get(i));
|
||||
}
|
||||
}
|
||||
//scheduler.start();
|
||||
}
|
||||
|
||||
private void initEtlJob(Scheduler scheduler, BiEtlMain kettle) throws SchedulerException {
|
||||
// 通过JobBuilder构建JobDetail实例,JobDetail规定只能是实现Job接口的实例
|
||||
// JobDetail 是具体Job实例
|
||||
JobDetail jobDetail = JobBuilder.newJob(KetJobFactory.class).withIdentity(kettle.getId(), "etl").build();
|
||||
// 基于表达式构建触发器
|
||||
jobDetail.getJobDataMap().put("etl", kettle.getId());
|
||||
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(kettle.getCron());
|
||||
// CronTrigger表达式触发器 继承于Trigger
|
||||
// TriggerBuilder 用于构建触发器实例
|
||||
CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity(kettle.getId(), "etl")
|
||||
.withSchedule(cronScheduleBuilder).build();
|
||||
scheduler.scheduleJob(jobDetail, cronTrigger);
|
||||
}
|
||||
|
||||
//禁用任务
|
||||
public void stopEtlJob(BiEtlMain kettle) throws SchedulerException {
|
||||
JobKey jobKey = JobKey.jobKey(kettle.getId(), "etl");
|
||||
scheduler.deleteJob(jobKey);
|
||||
kettle.setAvtag(false);
|
||||
biEtlMainRepo.save(kettle);
|
||||
}
|
||||
|
||||
//启用任务
|
||||
public void startEtlJob(BiEtlMain kettle) throws SchedulerException {
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(kettle.getId(), "etl");
|
||||
CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
|
||||
if (null == trigger) {
|
||||
JobDetail jobDetail = JobBuilder.newJob(KetJobFactory.class)
|
||||
.withIdentity(kettle.getId(), "etl").build();
|
||||
jobDetail.getJobDataMap().put("etl", kettle.getId());
|
||||
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(kettle.getCron());
|
||||
trigger = TriggerBuilder.newTrigger().withIdentity(kettle.getId(), "etl")
|
||||
.withSchedule(scheduleBuilder).build();
|
||||
scheduler.scheduleJob(jobDetail, trigger);
|
||||
} else {
|
||||
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(kettle.getCron());
|
||||
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
|
||||
scheduler.rescheduleJob(triggerKey, trigger);
|
||||
}
|
||||
kettle.setAvtag(true);
|
||||
biEtlMainRepo.save(kettle);
|
||||
}
|
||||
|
||||
// 任务调度
|
||||
@Autowired
|
||||
private Scheduler scheduler;
|
||||
|
||||
@Autowired
|
||||
private BiEtlMainRepo biEtlMainRepo;
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BiEtlMainRepo extends JpaRepository<BiEtlMain,String> {
|
||||
|
||||
BiEtlMain findByCode(String code);
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BiEtlMainService extends BaseMainService<BiEtlMain> {
|
||||
|
||||
@Value("${app.att.path}")
|
||||
private String ATT_PATH;
|
||||
|
||||
public void runByNum(String kettleId,String num) throws Exception
|
||||
{
|
||||
BiEtlMain kettle=repo.findById(kettleId).get();
|
||||
try
|
||||
{
|
||||
KetUtil.runTran(ATT_PATH + "/" + kettle.getZpath(),null ,true);
|
||||
} catch (Exception e)
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(sw, true));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public long runById(String id, Map<String,String> map) throws Exception {
|
||||
BiEtlMain main=repo.findById(id).get();
|
||||
return KetUtil.runTran(ATT_PATH+"/"+main.getZpath(),map,false);
|
||||
}
|
||||
|
||||
|
||||
//bean注入------------------------------
|
||||
@Autowired
|
||||
private BiEtlMainRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import vboot.core.xutil.web.XspringUtil;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
public class KetJobFactory implements Job {
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) {
|
||||
String kettleId = (String) context.getMergedJobDataMap().get("etl");
|
||||
try {
|
||||
BiEtlMainService service= XspringUtil.getBean(BiEtlMainService.class);
|
||||
service.runById(kettleId,null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package vboot.extend.module.bi.etl.main;
|
||||
|
||||
import org.pentaho.di.core.database.DatabaseMeta;
|
||||
import org.pentaho.di.core.logging.KettleLogStore;
|
||||
import org.pentaho.di.core.logging.TransLogTable;
|
||||
import org.pentaho.di.core.variables.VariableSpace;
|
||||
import org.pentaho.di.core.variables.Variables;
|
||||
import org.pentaho.di.job.Job;
|
||||
import org.pentaho.di.job.JobMeta;
|
||||
import org.pentaho.di.trans.Trans;
|
||||
import org.pentaho.di.trans.TransMeta;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class KetUtil {
|
||||
public static void runJob(String jobPath) {
|
||||
try {
|
||||
JobMeta jobMeta = new JobMeta(jobPath, null);
|
||||
Job job = new Job(null, jobMeta);
|
||||
job.start();
|
||||
job.waitUntilFinished();
|
||||
if (job.getErrors() > 0) {
|
||||
throw new Exception(
|
||||
"There are errors during job exception!(执行job发生异常)");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static long runTran(String ktrPath, Map<String, String> map, Boolean waitFlag) throws Exception {
|
||||
TransMeta transMeta = new TransMeta(ktrPath);
|
||||
|
||||
DatabaseMeta databaseMeta = new DatabaseMeta();
|
||||
databaseMeta.setName("ket");
|
||||
databaseMeta.setDatabaseType("MYSQL");
|
||||
databaseMeta.setAccessType(DatabaseMeta.TYPE_ACCESS_NATIVE);
|
||||
|
||||
|
||||
databaseMeta.setDBPort("3306");
|
||||
databaseMeta.setUsername("root");
|
||||
databaseMeta.setHostname("localhost");
|
||||
databaseMeta.setDBName("vboot-java");
|
||||
databaseMeta.setPassword("123456");
|
||||
|
||||
databaseMeta.getAttributes().setProperty("EXTRA_OPTION_MYSQL.useSSL", "false");
|
||||
transMeta.addDatabase(databaseMeta);
|
||||
VariableSpace space = new Variables();
|
||||
TransLogTable transLogTable = TransLogTable.getDefault(space, transMeta, transMeta.getSteps());
|
||||
transLogTable.setConnectionName("ket");
|
||||
transLogTable.setTableName("bi_etl_log");
|
||||
transMeta.setTransLogTable(transLogTable);
|
||||
|
||||
transMeta.setCapturingStepPerformanceSnapShots(true);
|
||||
Trans trans = new Trans(transMeta);
|
||||
|
||||
// trans.setLogLevel(LogLevel.DEBUG);
|
||||
trans.setMonitored(true);
|
||||
trans.setInitializing(true);
|
||||
trans.setPreparing(true);
|
||||
trans.setRunning(true);
|
||||
trans.setSafeModeEnabled(true);
|
||||
if (map != null) {
|
||||
for (String s : map.keySet()) {
|
||||
trans.setVariable(s, map.get(s));
|
||||
}
|
||||
}
|
||||
trans.execute(null);
|
||||
if (waitFlag) {
|
||||
trans.waitUntilFinished();
|
||||
}
|
||||
|
||||
// if (trans.isFinished()) {
|
||||
// Map<String, List<StepPerformanceSnapShot>> stepPerformanceSnapShots = trans.getStepPerformanceSnapShots();
|
||||
// stepPerformanceSnapShots.forEach((str, StepPerformanceSnapShotList) -> {
|
||||
// for (StepPerformanceSnapShot stepPerformanceSnapShot : StepPerformanceSnapShotList) {
|
||||
// System.out.println(JSONObject.fromObject(stepPerformanceSnapShot).toString());
|
||||
// }
|
||||
// });
|
||||
// System.out.println("执行成功");
|
||||
// } else {
|
||||
// Map<String, List<StepPerformanceSnapShot>> stepPerformanceSnapShots = trans.getStepPerformanceSnapShots();
|
||||
// stepPerformanceSnapShots.forEach((str, StepPerformanceSnapShotList) -> {
|
||||
// for (StepPerformanceSnapShot stepPerformanceSnapShot : StepPerformanceSnapShotList) {
|
||||
// System.err.println(JSONObject.fromObject(stepPerformanceSnapShot).toString());
|
||||
// }
|
||||
// });
|
||||
// System.out.println("执行失败");
|
||||
// }
|
||||
KettleLogStore.discardLines(trans.getLogChannelId(), true);
|
||||
return trans.getBatchId();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package vboot.extend.module.bi.field.main;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiFieldMain extends BaseMainEntity {
|
||||
|
||||
@Column(length = 64)
|
||||
private String comet;
|
||||
|
||||
@Column(length = 64)
|
||||
private String notes;
|
||||
|
||||
@Column(length = 32)
|
||||
private String tableid;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package vboot.extend.module.bi.field.main;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/field/main")
|
||||
public class BiFieldMainApi {
|
||||
|
||||
private String table = "bi_field_main";
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler(table);
|
||||
sqler.addLike("t.name" , name);
|
||||
sqler.addSelect("t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
return R.ok(service.findOne(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiFieldMain main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiFieldMain main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BiFieldMainService service;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.bi.field.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BiFieldMainRepo extends JpaRepository<BiFieldMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.bi.field.main;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class BiFieldMainService extends BaseMainService<BiFieldMain> {
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private BiFieldMainRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.bi.table.main;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class BiTableMain extends BaseMainEntity {
|
||||
|
||||
@Column(length = 64)
|
||||
private String comet;//注释
|
||||
|
||||
@Column(length = 64)
|
||||
private String notes;//备注
|
||||
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package vboot.extend.module.bi.table.main;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("bi/table/main")
|
||||
public class BiTableMainApi {
|
||||
|
||||
private String table = "bi_table_main";
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler(table);
|
||||
sqler.addLike("t.name" , name);
|
||||
sqler.addSelect("t.comet,t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
return R.ok(service.findOne(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BiTableMainService service;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.bi.table.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BiTableMainRepo extends JpaRepository<BiTableMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.bi.table.main;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class BiTableMainService extends BaseMainService<BiTableMain> {
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private BiTableMainRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.cate;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaAgentCate extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;//排序号
|
||||
|
||||
private String notes; //备注
|
||||
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.cate;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/agent/cate")
|
||||
public class SaAgentCateApi {
|
||||
|
||||
@GetMapping("list")
|
||||
public R getList() {
|
||||
return R.ok(service.findAll());
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_agent_cate");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addOrder("t.ornum").addSelect("t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaAgentCate main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaAgentCate main) { return R.ok(service.insert(main)); }
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaAgentCate main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private SaAgentCateService service;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.cate;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaAgentCateRepo extends JpaRepository<SaAgentCate,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.cate;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class SaAgentCateService extends BaseMainService<SaAgentCate> {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SaAgentCateRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import vboot.core.module.sys.org.root.SysOrg;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaAgentMain extends BaseMainEntity {
|
||||
|
||||
//--------地址相关信息------<<<
|
||||
private String addre;//完整地址
|
||||
|
||||
@Column(length = 64)
|
||||
private String adreg;//省市区
|
||||
|
||||
@Column(length = 128)
|
||||
private String addet;//省市区以外的详细信息
|
||||
|
||||
@Column(length = 32)
|
||||
private String adcoo;//经纬度
|
||||
|
||||
@Column(length = 32)
|
||||
private String adpro;//省
|
||||
|
||||
@Column(length = 32)
|
||||
private String adcit;//市
|
||||
|
||||
@Column(length = 32)
|
||||
private String addis;//区
|
||||
//--------地址相关信息------>>>
|
||||
|
||||
@Column(length = 32)
|
||||
private String level;//代理商资质
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;//代理商分类
|
||||
|
||||
@Column(length = 32)
|
||||
private String senum;//流水号
|
||||
|
||||
private String notes;//备注
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_agent_viewer", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> viewers;//可查看者
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_agent_editor", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> editors;//可编辑者
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.JdbcDao;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.module.ass.num.main.AssNumMainService;
|
||||
import vboot.core.module.mon.log.oper.Oplog;
|
||||
import vboot.core.xutil.file.ExcelUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/agent/main")
|
||||
public class SaAgentMainApi {
|
||||
|
||||
|
||||
@GetMapping("list")
|
||||
public R getList() {
|
||||
return R.ok(service.findAll());
|
||||
}
|
||||
|
||||
@Oplog("查询代理商")
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_agent_main");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.addre,t.senum");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("exp")
|
||||
public void getExp(HttpServletResponse response) throws Exception {
|
||||
Sqler sqler=new Sqler("t.id,t.name,t.crtim,t.uptim","sa_agent_main");
|
||||
sqler.addLeftJoin("o1.name as crman","sys_org o1","o1.id=t.crman");
|
||||
sqler.addLeftJoin("o2.name as upman","sys_org o2","o2.id=t.upman");
|
||||
sqler.addSelect("t.addre,t.adcoo,t.notes,t.senum");
|
||||
List<SaAgentMainExp> list = jdbcDao.getTp().query(sqler.getSql(),
|
||||
sqler.getParams(), new BeanPropertyRowMapper<>(SaAgentMainExp.class));
|
||||
ExcelUtil.exportExcel(list, "代理商清单", SaAgentMainExp.class, response);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaAgentMain main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaAgentMain main) {
|
||||
main.setSenum(numService.getNum("AGENT"));
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaAgentMain main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private AssNumMainService numService;
|
||||
|
||||
@Autowired
|
||||
private SaAgentMainService service;
|
||||
|
||||
@Autowired
|
||||
private JdbcDao jdbcDao;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SaAgentMainExp {
|
||||
|
||||
private String id;
|
||||
|
||||
private String senum;
|
||||
|
||||
private String name;
|
||||
|
||||
private String addre;
|
||||
|
||||
private String adcoo;
|
||||
|
||||
private String crman;
|
||||
|
||||
private String crtim;
|
||||
|
||||
private String upman;
|
||||
|
||||
private String uptim;
|
||||
|
||||
private String notes;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaAgentMainRepo extends JpaRepository<SaAgentMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class SaAgentMainService extends BaseMainService<SaAgentMain> {
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private SaAgentMainRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.cate;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaCustCate extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;//排序号
|
||||
|
||||
private String notes; //备注
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.cate;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/cust/cate")
|
||||
public class SaCustCateApi {
|
||||
|
||||
@GetMapping("list")
|
||||
public R getList() {
|
||||
return R.ok(service.findAll());
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_cust_cate");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addOrder("t.ornum").addSelect("t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaCustCate main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaCustCate main) { return R.ok(service.insert(main)); }
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaCustCate main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private SaCustCateService service;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.cate;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaCustCateRepo extends JpaRepository<SaCustCate,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.cate;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class SaCustCateService extends BaseMainService<SaCustCate> {
|
||||
|
||||
@Autowired
|
||||
private SaCustCateRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.main;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import vboot.core.module.sys.org.root.SysOrg;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaCustMain extends BaseMainEntity {
|
||||
|
||||
//--------地址相关信息------<<<
|
||||
private String addre;//完整地址
|
||||
|
||||
@Column(length = 64)
|
||||
private String adreg;//省市区
|
||||
|
||||
@Column(length = 128)
|
||||
private String addet;//省市区以外的详细信息
|
||||
|
||||
@Column(length = 32)
|
||||
private String adcoo;//经纬度
|
||||
|
||||
@Column(length = 32)
|
||||
private String adpro;//省
|
||||
|
||||
@Column(length = 32)
|
||||
private String adcit;//市
|
||||
|
||||
@Column(length = 32)
|
||||
private String addis;//区
|
||||
//--------地址相关信息------>>>
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;//客户分类
|
||||
|
||||
@Column(length = 32)
|
||||
private String senum;//流水号
|
||||
|
||||
private String notes;//备注
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_cust_viewer", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> viewers;//可查看者
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_cust_editor", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> editors;//可编辑者
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.main;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.module.ass.num.main.AssNumMainService;
|
||||
import vboot.core.module.mon.log.oper.Oplog;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/cust/main")
|
||||
public class SaCustMainApi {
|
||||
|
||||
|
||||
@GetMapping("list")
|
||||
public R getList() {
|
||||
return R.ok(service.findAll());
|
||||
}
|
||||
|
||||
@Oplog("查询客户")
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_cust_main");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.addre,t.senum");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaCustMain main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@Oplog("新增客户")
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaCustMain main) {
|
||||
main.setSenum(numService.getNum("CUST"));
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@Oplog("修改客户")
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaCustMain main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private AssNumMainService numService;
|
||||
|
||||
@Autowired
|
||||
private SaCustMainService service;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaCustMainRepo extends JpaRepository<SaCustMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package vboot.extend.module.sa.cust.main;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class SaCustMainService extends BaseMainService<SaCustMain> {
|
||||
|
||||
@Autowired
|
||||
private SaCustMainRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.feat;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaProdFeat {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@GeneratedValue(generator = "jpa-uuid")
|
||||
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
|
||||
private String id;//ID
|
||||
|
||||
@Column(length = 100)
|
||||
private String name;//选项名称
|
||||
|
||||
private Integer ornum;//排序号
|
||||
|
||||
private String notes;//备注
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import vboot.extend.module.sa.prod.main.SaProdMain;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaProdGroup extends BaseMainEntity {
|
||||
|
||||
private Integer ornum; //排序
|
||||
|
||||
@Column(length = 32)
|
||||
private String cate; //产品分类
|
||||
|
||||
@Column(length = 32)
|
||||
private String layout; //布局方式
|
||||
|
||||
private Integer gramo; //组数
|
||||
|
||||
private Integer seamo; //台数
|
||||
|
||||
private String notes; //备注
|
||||
|
||||
@Column(length = 32)
|
||||
private String prjid;//项目
|
||||
|
||||
@Transient
|
||||
private Boolean edtag=false;//可编辑标记
|
||||
|
||||
@Transient
|
||||
private Boolean chtag=false;//已变更标记 用户减少后台交互
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JoinColumn(name = "groid")
|
||||
@OrderBy("ornum ASC")
|
||||
private List<SaProdMain> prods = new ArrayList<>();
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/prod/group")
|
||||
public class SaProdGroupApi {
|
||||
|
||||
//分页查询项目清单
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_prod_group");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.addre,t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
//查询单个项目
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaProdGroup main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
// //查询单个项目
|
||||
// @GetMapping("proj/{id}")
|
||||
// public R getOneByProj(@PathVariable String id) {
|
||||
// List<SaProdGroup> groups = service.findAllByPrjid(id);
|
||||
// return R.ok(groups);
|
||||
// }
|
||||
|
||||
|
||||
//新增项目
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaProdGroup main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
//修改项目
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaProdGroup main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
//删除项目
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private SaProdGroupService service;
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SaProdGroupRepo extends JpaRepository<SaProdGroup,String> {
|
||||
|
||||
List<SaProdGroup> findAllByPrjid(String prjid);
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class SaProdGroupService extends BaseMainService<SaProdGroup> {
|
||||
|
||||
public List<SaProdGroup> findAllByPrjid(String prjid){
|
||||
return repo.findAllByPrjid(prjid);
|
||||
}
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private SaProdGroupRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.main;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaProdMain {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@GeneratedValue(generator = "jpa-uuid")
|
||||
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
|
||||
private String id;//ID
|
||||
|
||||
@Column(length = 100)
|
||||
private String name;//选项名称
|
||||
|
||||
@Column(length = 64)
|
||||
private String itnum;//梯号
|
||||
|
||||
private Integer ornum;//排序号
|
||||
|
||||
private String notes;//备注
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaProdTemp extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
private String notes;
|
||||
|
||||
@Column(length = 32)
|
||||
private String modid;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/prod/temp")
|
||||
public class SaProdTempApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_prod_temp");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addLeftJoin("m.name as modna", "te_prod_model m", "m.id=t.modid");
|
||||
sqler.addOrder("t.ornum");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaProdTemp main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaProdTemp main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaProdTemp main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private SaProdTempService service;
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
||||
public interface SaProdTempRepo extends JpaRepository<SaProdTemp,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class SaProdTempService extends BaseMainService<SaProdTemp> {
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private SaProdTempRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package vboot.extend.module.sa.proj.main;
|
||||
|
||||
import vboot.extend.module.sa.prod.group.SaProdGroup;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.module.sys.org.root.SysOrg;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaProjMain extends BaseMainEntity {
|
||||
|
||||
//--------地址相关信息------<<<
|
||||
private String addre;//完整地址
|
||||
|
||||
@Column(length = 64)
|
||||
private String adreg;//省市区
|
||||
|
||||
@Column(length = 128)
|
||||
private String addet;//省市区以外的详细信息
|
||||
|
||||
@Column(length = 32)
|
||||
private String adcoo;//经纬度
|
||||
|
||||
@Column(length = 32)
|
||||
private String adpro;//省
|
||||
|
||||
@Column(length = 32)
|
||||
private String adcit;//市
|
||||
|
||||
@Column(length = 32)
|
||||
private String addis;//区
|
||||
//--------地址相关信息------>>>
|
||||
|
||||
@Column(length = 32)
|
||||
private String senum;//流水号
|
||||
|
||||
|
||||
private String notes; //备注
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_proj_viewer", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> viewers;//可查看者
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_proj_editor", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> editors;//可编辑者
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "opman")
|
||||
private SysOrg opman;//经办人
|
||||
|
||||
private String type; //项目类型
|
||||
|
||||
@Column(length = 32)
|
||||
private String ageid; //代理商ID
|
||||
|
||||
@Transient
|
||||
private String agena; //代理商名称
|
||||
|
||||
@Column(length = 32)
|
||||
private String cusid; //客户ID
|
||||
|
||||
@Transient
|
||||
private String cusna; //客户名称
|
||||
|
||||
// @Transient
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JoinColumn(name = "prjid")
|
||||
@OrderBy("ornum ASC")
|
||||
private List<SaProdGroup> groups = new ArrayList<>(); //产品组
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package vboot.extend.module.sa.proj.main;
|
||||
|
||||
import vboot.extend.module.sa.prod.group.SaProdGroup;
|
||||
import vboot.extend.module.sa.prod.group.SaProdGroupService;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.JdbcDao;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import vboot.core.module.ass.num.main.AssNumMainService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/proj/main")
|
||||
public class SaProjMainApi {
|
||||
|
||||
//分页查询项目清单
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_proj_main");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.addre,t.notes,t.senum");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
//查询单个项目
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaProjMain main = service.findOne(id);
|
||||
main.setAgena(jdbcDao.findOneName("sa_agent_main",main.getAgeid()));
|
||||
main.setCusna(jdbcDao.findOneName("sa_cust_main",main.getCusna()));
|
||||
// List<SaProdGroup> groups = groupService.findAllByPrjid(id);
|
||||
// main.setGroups(groups);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
//新增项目
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaProjMain main) {
|
||||
main.setSenum(numService.getNum("PROJ"));
|
||||
return R.ok(service.insertx(main));
|
||||
}
|
||||
|
||||
//修改项目
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaProjMain main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
//删除项目
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
// @Autowired
|
||||
// private SaAgentMainService agentService;
|
||||
//
|
||||
// @Autowired
|
||||
// private SaCustMainService custService;
|
||||
@Autowired
|
||||
private JdbcDao jdbcDao;
|
||||
|
||||
@Autowired
|
||||
private AssNumMainService numService;
|
||||
|
||||
@Autowired
|
||||
private SaProjMainService service;
|
||||
|
||||
@Autowired
|
||||
private SaProdGroupService groupService;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.sa.proj.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaProjMainRepo extends JpaRepository<SaProjMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package vboot.extend.module.sa.proj.main;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
|
||||
@Service
|
||||
public class SaProjMainService extends BaseMainService<SaProjMain> {
|
||||
|
||||
public String insertx(SaProjMain main){
|
||||
|
||||
return super.insert(main);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private SaProjMainRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotCheck extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
private Integer venum;//版本号
|
||||
|
||||
private String notes;
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;//分类id
|
||||
|
||||
@Column(length = 32)
|
||||
private String serid;//系列id
|
||||
|
||||
@Column(length = 32)
|
||||
private String modid;//型号id
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JoinColumn(name = "allid")
|
||||
private List<TeAllotCheckItem> items = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("te/allot/check")
|
||||
public class TeAllotCheckApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name,String modid) {
|
||||
Sqler sqler = new Sqler("te_allot_check");
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
TeAllotCheck main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("checks")
|
||||
public R checks(String id) {
|
||||
return R.ok(service.findData(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody TeAllotCheck main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody TeAllotCheck main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private TeAllotCheckService service;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotCheckItem {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@GeneratedValue(generator = "jpa-uuid")
|
||||
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
|
||||
private String id;//ID
|
||||
|
||||
@Column(length = 32)
|
||||
private String cheid;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TeAllotCheckRepo extends JpaRepository<TeAllotCheck,String> {
|
||||
|
||||
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class TeAllotCheckService extends BaseMainService<TeAllotCheck> {
|
||||
|
||||
public List<Zcheck> findData(String catid) {
|
||||
Sqler sqler = new Sqler("te_feat_check");
|
||||
sqler.addEqual("t.catid", catid);
|
||||
sqler.addOrder("t.ornum");
|
||||
List<Zcheck> list = jdbcDao.getTp().query(sqler.getSql(), sqler.getParams(), new BeanPropertyRowMapper<>(Zcheck.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private TeAllotCheckRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Zcheck {
|
||||
|
||||
private String id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package vboot.extend.module.te.allot.drive;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotDrive extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
private Integer venum;//版本号
|
||||
|
||||
private String notes;
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;
|
||||
|
||||
@Column(length = 32)
|
||||
private String serid;//系列id
|
||||
|
||||
@Column(length = 32)
|
||||
private String modid;//型号id
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JoinColumn(name = "allid")
|
||||
private List<TeAllotDriveItem> items = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package vboot.extend.module.te.allot.drive;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("te/allot/drive")
|
||||
public class TeAllotDriveApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name, String modid) {
|
||||
Sqler sqler = new Sqler("te_allot_drive");
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
TeAllotDrive main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("drives")
|
||||
public R drives(String id) {
|
||||
return R.ok(service.findData(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody TeAllotDrive main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody TeAllotDrive main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private TeAllotDriveService service;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package vboot.extend.module.te.allot.drive;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotDriveItem {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@GeneratedValue(generator = "jpa-uuid")
|
||||
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
|
||||
private String id;//ID
|
||||
|
||||
@Column(length = 32)
|
||||
private String driid;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.te.allot.drive;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TeAllotDriveRepo extends JpaRepository<TeAllotDrive,String> {
|
||||
|
||||
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
package vboot.extend.module.te.allot.drive;
|
||||
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class TeAllotDriveService extends BaseMainService<TeAllotDrive> {
|
||||
|
||||
public List<Zdrive> findData(String catid) {
|
||||
Sqler sqler = new Sqler("te_feat_drive");
|
||||
sqler.addEqual("t.catid", catid);
|
||||
sqler.addOrder("t.ornum");
|
||||
List<Zdrive> list = jdbcDao.getTp().query(sqler.getSql(), sqler.getParams(), new BeanPropertyRowMapper<>(Zdrive.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private TeAllotDriveRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package vboot.extend.module.te.allot.drive;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Zdrive {
|
||||
|
||||
private String id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package vboot.extend.module.te.allot.link;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotLink extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
private Integer venum;//版本号
|
||||
|
||||
private String notes;
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;
|
||||
|
||||
@Column(length = 32)
|
||||
private String serid;//系列id
|
||||
|
||||
@Column(length = 32)
|
||||
private String modid;//型号id
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JoinColumn(name = "allid")
|
||||
private List<TeAllotLinkItem> items = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package vboot.extend.module.te.allot.link;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("te/allot/link")
|
||||
public class TeAllotLinkApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name,String modid) {
|
||||
Sqler sqler = new Sqler("te_allot_link");
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
TeAllotLink main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@GetMapping("links")
|
||||
public R links(String id) {
|
||||
return R.ok(service.findData(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody TeAllotLink main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody TeAllotLink main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private TeAllotLinkService service;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package vboot.extend.module.te.allot.link;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotLinkItem {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@GeneratedValue(generator = "jpa-uuid")
|
||||
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
|
||||
private String id;//ID
|
||||
|
||||
@Column(length = 32)
|
||||
private String linid;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.te.allot.link;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TeAllotLinkRepo extends JpaRepository<TeAllotLink,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package vboot.extend.module.te.allot.link;
|
||||
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class TeAllotLinkService extends BaseMainService<TeAllotLink> {
|
||||
|
||||
public List<Zlink> findData(String catid) {
|
||||
Sqler sqler = new Sqler("te_feat_link");
|
||||
sqler.addEqual("t.catid", catid);
|
||||
sqler.addOrder("t.ornum");
|
||||
List<Zlink> list = jdbcDao.getTp().query(sqler.getSql(), sqler.getParams(), new BeanPropertyRowMapper<>(Zlink.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private TeAllotLinkRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package vboot.extend.module.te.allot.link;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Zlink {
|
||||
|
||||
private String id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package vboot.extend.module.te.allot.param;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotParam extends BaseMainEntity {
|
||||
|
||||
private Boolean ornum;
|
||||
|
||||
private Boolean sptag;//专用标记
|
||||
|
||||
private Integer venum;//版本号
|
||||
|
||||
private String notes;
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;
|
||||
|
||||
@Column(length = 32)
|
||||
private String serid;//系列id
|
||||
|
||||
@Column(length = 32)
|
||||
private String modid;//型号id
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JoinColumn(name = "allid")
|
||||
private List<TeAllotParamItem> items = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package vboot.extend.module.te.allot.param;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("te/allot/param")
|
||||
public class TeAllotParamApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name, String modid) {
|
||||
Sqler sqler = new Sqler("te_allot_param");
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
TeAllotParam main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@GetMapping("screens")
|
||||
public R screens(String id) {
|
||||
return R.ok(service.findData(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody TeAllotParam main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody TeAllotParam main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private TeAllotParamService service;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package vboot.extend.module.te.allot.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeAllotParamItem {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@GeneratedValue(generator = "jpa-uuid")
|
||||
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
|
||||
private String id;//ID
|
||||
|
||||
@Column(length = 32)
|
||||
private String parid;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.te.allot.param;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TeAllotParamRepo extends JpaRepository<TeAllotParam,String> {
|
||||
|
||||
|
||||
}
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
package vboot.extend.module.te.allot.param;
|
||||
|
||||
import vboot.extend.module.te.prod.model.Zparam;
|
||||
import vboot.extend.module.te.prod.model.Zscreen;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class TeAllotParamService extends BaseMainService<TeAllotParam> {
|
||||
|
||||
public List<Zscreen> findData(String catid){
|
||||
Sqler sqler2=new Sqler("te_feat_screen");
|
||||
sqler2.addEqual("t.catid", catid);
|
||||
sqler2.addOrder("t.ornum");
|
||||
List<Zscreen> zscreens=jdbcDao.getTp().query(sqler2.getSql(),sqler2.getParams(), new BeanPropertyRowMapper<>(Zscreen.class));
|
||||
|
||||
List<Zparam> zparams = new ArrayList<>();
|
||||
String sql3 = "select id,name,code,scrid,ornum from te_feat_param where scrid in (";
|
||||
String ins = "";
|
||||
for (Zscreen zscreen : zscreens) {
|
||||
ins += "'" + zscreen.getId() + "',";
|
||||
}
|
||||
if (!"".equals(ins)) {
|
||||
ins = ins.substring(0, ins.length() - 1);
|
||||
sql3 += ins + ") order by scrid,ornum";
|
||||
zparams=jdbcDao.getTp().query(sql3, new BeanPropertyRowMapper<>(Zparam.class));
|
||||
}
|
||||
|
||||
for (Zscreen zscreen : zscreens) {
|
||||
for (Zparam zparam : zparams) {
|
||||
if(zparam.getScrid().equals(zscreen.getId())){
|
||||
zscreen.getParams().add(zparam);
|
||||
}
|
||||
}
|
||||
}
|
||||
return zscreens;
|
||||
}
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private TeAllotParamRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package vboot.extend.module.te.feat.check;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeFeatCheck extends BaseMainEntity {
|
||||
|
||||
//te_feat_check
|
||||
@Column(length = 32)
|
||||
private String catid;//所属分类
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
private String notes;
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package vboot.extend.module.te.feat.check;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("te/feat/check")
|
||||
public class TeFeatCheckApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name, String catid) {
|
||||
Sqler sqler = new Sqler("te_feat_check");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addEqual("t.catid", catid);
|
||||
sqler.addLeftJoin("c.name as catna", "te_prod_cate c", "c.id=t.catid");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
TeFeatCheck main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody TeFeatCheck main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody TeFeatCheck main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private TeFeatCheckService service;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.te.feat.check;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TeFeatCheckRepo extends JpaRepository<TeFeatCheck,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.extend.module.te.feat.check;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class TeFeatCheckService extends BaseMainService<TeFeatCheck> {
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private TeFeatCheckRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package vboot.extend.module.te.feat.comp;
|
||||
|
||||
import vboot.extend.module.te.allot.check.TeAllotCheck;
|
||||
import vboot.extend.module.te.allot.drive.TeAllotDrive;
|
||||
import vboot.extend.module.te.allot.param.TeAllotParam;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class TeFeatComp extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;//排序号
|
||||
|
||||
@Column(length = 32)
|
||||
private String paway;//参数分配方式
|
||||
|
||||
@Column(length = 32)
|
||||
private String patid;//参数分配模板id
|
||||
|
||||
@Transient
|
||||
private TeAllotParam patem;//参数分配模板引用
|
||||
|
||||
@Column(length = 32)
|
||||
private String laway;//联动分配方式
|
||||
|
||||
// @Column(length = 32)
|
||||
// private String latid;//联动分配模板id
|
||||
|
||||
// @Transient
|
||||
// private TeAllotParam latem;//联动分配模板引用
|
||||
|
||||
@Column(length = 32)
|
||||
private String caway;//校验分配方式
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;//校验分配模板id
|
||||
|
||||
@Transient
|
||||
private TeAllotCheck catem;//校验分配模板引用
|
||||
|
||||
@Column(length = 32)
|
||||
private String daway;//驱动分配方式
|
||||
|
||||
@Column(length = 32)
|
||||
private String datid;//驱动分配模板id
|
||||
|
||||
@Transient
|
||||
private TeAllotDrive datem;//驱动分配模板引用
|
||||
|
||||
private String notes;
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package vboot.extend.module.te.feat.comp;
|
||||
|
||||
import vboot.extend.module.te.allot.param.TeAllotParamService;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.JdbcDao;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.xutil.lang.XstrUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("te/feat/comp")
|
||||
public class TeFeatCompApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("te_feat_comp");
|
||||
sqler.addLike("t.name", name);
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
TeFeatComp main = service.findOne(id);
|
||||
if (XstrUtil.isNotBlank(main.getPatid())) {
|
||||
main.setPatem(apService.findOne(main.getPatid()));
|
||||
}
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody TeFeatComp main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody TeFeatComp main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
public R delete(@PathVariable String[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private TeFeatCompService service;
|
||||
|
||||
@Autowired
|
||||
private TeAllotParamService apService;
|
||||
|
||||
@Autowired
|
||||
private JdbcDao jdbcDao;
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vboot.extend.module.te.feat.comp;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TeFeatCompRepo extends JpaRepository<TeFeatComp,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package vboot.extend.module.te.feat.comp;
|
||||
|
||||
import vboot.extend.module.te.allot.param.TeAllotParamRepo;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import vboot.core.xutil.lang.XstrUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class TeFeatCompService extends BaseMainService<TeFeatComp> {
|
||||
|
||||
public String insert(TeFeatComp main){
|
||||
if(main.getPatem()!=null){
|
||||
String puuid = XstrUtil.getUUID();
|
||||
main.getPatem().setId(puuid);
|
||||
main.getPatem().setName(main.getName()+"专用");
|
||||
main.getPatem().setSptag(true);
|
||||
apRepo.save(main.getPatem());
|
||||
main.setPatid(puuid);
|
||||
}
|
||||
return super.insert(main);
|
||||
}
|
||||
|
||||
public String update(TeFeatComp main){
|
||||
if(main.getPatem()!=null){
|
||||
apRepo.save(main.getPatem());
|
||||
}
|
||||
return super.update(main);
|
||||
}
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private TeAllotParamRepo apRepo;
|
||||
|
||||
@Autowired
|
||||
private TeFeatCompRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user