forked from gitee/vben-java
修改DEMO示例
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
package vboot.app.module.sa.cust.main;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import vboot.app.module.sa.agent.main.SaAgentMain;
|
||||
import vboot.app.module.sa.agent.main.SaAgentMainRepo;
|
||||
import vboot.core.xutil.lang.XstrUtil;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SaCustMainService {
|
||||
|
||||
public SaCustMain findOne(String id) {
|
||||
|
||||
return custMapper.selectById(id);
|
||||
}
|
||||
|
||||
public String insert(SaCustMain cust) {
|
||||
cust.setId(XstrUtil.getUUID());
|
||||
custMapper.insert(cust);
|
||||
return cust.getId();
|
||||
}
|
||||
|
||||
public String update(SaCustMain cust) {
|
||||
custMapper.updateById(cust);
|
||||
return cust.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
for (String id : ids) {
|
||||
custMapper.deleteById(id);
|
||||
}
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
//先通过JPA新增一个代理商
|
||||
SaAgentMain agentMain=new SaAgentMain();
|
||||
agentMain.setId(XstrUtil.getUUID());
|
||||
agentMain.setName("有事务的项目");
|
||||
agentRepo.save(agentMain);
|
||||
|
||||
//再通过mybatis-plus新增一个项目,并让它报错
|
||||
SaCustMain sdCustMain=new SaCustMain();
|
||||
sdCustMain.setId(XstrUtil.getUUID()+"XXXXXXXXXXXXXXXX");//超出长度保存出错
|
||||
sdCustMain.setNotes("有事务的客户");
|
||||
custMapper.insert(sdCustMain);
|
||||
}
|
||||
|
||||
@Resource
|
||||
private SaAgentMainRepo agentRepo;
|
||||
|
||||
@Resource
|
||||
private SaCustMainMapper custMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package vboot.app.module.sa.draw.main;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaDrawMain extends BaseMainEntity {
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;//所属分类
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String notes;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.app.module.sa.draw.main;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaDrawMainRepo extends JpaRepository<SaDrawMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.app.module.sa.prod.tem;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
||||
public interface SaProdTemRepo extends JpaRepository<SaProdTem,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package vboot.app.module.sa.proj.main;
|
||||
|
||||
import vboot.app.module.sa.prod.group.SaProdGroup;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaProjMain extends BaseMainEntity {
|
||||
|
||||
//备注
|
||||
private String notes;
|
||||
|
||||
//项目地址
|
||||
private String addre;
|
||||
|
||||
@Transient
|
||||
private List<SaProdGroup> groups = new ArrayList<>(); //产品组
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package vboot.app.module.wc.cont;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WcCont {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
private String id;
|
||||
|
||||
@Column(length = 64)
|
||||
private String name;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package vboot.app.module.wc.match.main;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import vboot.core.xutil.lang.XnumberUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Dataxx {
|
||||
|
||||
public static final String MY_URL2 = "http://match.sports.sina.com.cn/football/player.php?id=14937";
|
||||
public static final String MY_URL = "http://info.sports.sina.com.cn/api/live/opta_lineup.php?format=json&_t=0.7390982927490362&id=o_958029&callback=fun_786506334825271269";
|
||||
|
||||
public static void getRealAddressByIP() {
|
||||
String my_url="http://info.sports.sina.com.cn/api/live/opta_lineup.php?format=json&_t=0.7390982927490362&id=o_"+"958029"+"&callback=fun_786506334825271269";
|
||||
String str = HttpUtil.createGet(my_url).execute().body();
|
||||
String xx = str.split("fun_786506334825271269")[1];
|
||||
xx = xx.substring(1, xx.length() - 13);
|
||||
JSONObject json = JSONObject.parseObject(xx);
|
||||
|
||||
// JsonObject returnData = new JsonParser().parse(xx).getAsJsonObject();
|
||||
JSONObject json2 = (JSONObject) json.get("result");
|
||||
JSONObject json3 = (JSONObject) json2.get("data");
|
||||
System.out.println(json3);
|
||||
// JSONArray array = (JSONArray) json3.get("event");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
// getRealAddressByIP();
|
||||
// get2();
|
||||
System.out.println(XnumberUtil.getRandomBigDecimal(new BigDecimal(10),new BigDecimal(50)));
|
||||
System.out.println(XnumberUtil.getRandomBigDecimal(new BigDecimal(30),new BigDecimal(100)));
|
||||
System.out.println(XnumberUtil.getRandomBigDecimal(new BigDecimal(30),new BigDecimal(100)));
|
||||
System.out.println(XnumberUtil.getRandomBigDecimal(new BigDecimal(30),new BigDecimal(100)));
|
||||
// System.out.println((int)(Math.random()*50) + 50);
|
||||
// System.out.println((int)(Math.random()*50) + 50);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package vboot.app.module.wc.match.main;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WcMatch {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
private String id;
|
||||
|
||||
@Column(length = 128)
|
||||
private String name;//round_cn
|
||||
|
||||
@Column(length = 32)
|
||||
private String homeId;
|
||||
|
||||
private Integer homeScore;
|
||||
|
||||
@Column(length = 32)
|
||||
private String awayId;
|
||||
|
||||
private Integer awayScore;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// @ManyToMany
|
||||
// @JoinTable(name = "wc_match_link_team", joinColumns = {@JoinColumn(name = "match_id")},
|
||||
// inverseJoinColumns = {@JoinColumn(name = "team_id")})
|
||||
// private List<WcTeamMain> teams;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.app.module.wc.match.main;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface WcMatchRepo extends JpaRepository<WcMatch,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package vboot.app.module.wc.palyer.main;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WcPlayer {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
private String id;//主键
|
||||
|
||||
@Column(length = 64)
|
||||
private String name;//中文名称
|
||||
|
||||
@Column(length = 64)
|
||||
private String enName;//英文名称
|
||||
|
||||
private String enFullName;//英文全称
|
||||
|
||||
private Date birthday;//出生日期
|
||||
|
||||
private Integer height;//身高(cm)
|
||||
|
||||
private Integer weight;//体重(kg)
|
||||
|
||||
private String position;//场上位置
|
||||
|
||||
private String shirtNumber;//球衣号
|
||||
|
||||
private String teamId;//球队ID
|
||||
|
||||
private String club;//俱乐部
|
||||
|
||||
private BigDecimal weekly;//周薪 可以改成 salary
|
||||
|
||||
private BigDecimal adrate;//每年广告费
|
||||
|
||||
private String idolId;//偶像的ID
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.app.module.wc.palyer.main;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface WcPlayerRepo extends JpaRepository<WcPlayer,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,203 +0,0 @@
|
||||
package vboot.app.module.wc.palyer.main;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import vboot.app.module.wc.match.main.WcMatch;
|
||||
import vboot.app.module.wc.match.main.WcMatchRepo;
|
||||
import vboot.app.module.wc.stat.WcStat;
|
||||
import vboot.app.module.wc.stat.WcStatRepo;
|
||||
import vboot.app.module.wc.team.main.WcTeam;
|
||||
import vboot.app.module.wc.team.main.WcTeamRepo;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import vboot.core.xutil.lang.XdateUtil;
|
||||
import vboot.core.xutil.lang.XnumberUtil;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WcPlayerService {
|
||||
|
||||
public void crawlData(String id){
|
||||
String my_url="http://info.sports.sina.com.cn/api/live/opta_lineup.php?format=json&_t=0.7390982927490362&id=o_"+id+"&callback=fun_786506334825271269";
|
||||
String str = HttpUtil.createGet(my_url).execute().body();
|
||||
String xx = str.split("fun_786506334825271269")[1];
|
||||
xx = xx.substring(1, xx.length() - 13);
|
||||
JSONObject json = JSONObject.parseObject(xx);
|
||||
|
||||
// JsonObject returnData = new JsonParser().parse(xx).getAsJsonObject();
|
||||
JSONObject json2 = (JSONObject) json.get("result");
|
||||
JSONObject json3 = (JSONObject) json2.get("data");
|
||||
JSONObject matchJson = (JSONObject) json3.get("match");
|
||||
//第一步 保存球队
|
||||
WcTeam team1 = new WcTeam();
|
||||
team1.setId(""+matchJson.get("home_id"));
|
||||
team1.setName(""+matchJson.get("home_name_cn"));
|
||||
team1.setCoach(""+matchJson.get("home_trainer_cn"));
|
||||
teamRepo.save(team1);
|
||||
|
||||
WcTeam team2 = new WcTeam();
|
||||
team2.setId(""+matchJson.get("away_id"));
|
||||
team2.setName(""+matchJson.get("away_name_cn"));
|
||||
team2.setCoach(""+matchJson.get("away_trainer_cn"));
|
||||
teamRepo.save(team2);
|
||||
|
||||
//第二步 保存比赛
|
||||
WcMatch match = new WcMatch();
|
||||
match.setId(""+matchJson.get("id"));
|
||||
match.setHomeId(team1.getId());
|
||||
match.setHomeScore(Integer.parseInt(matchJson.get("home_score")+""));
|
||||
match.setAwayId(team2.getId());
|
||||
match.setAwayScore(Integer.parseInt(matchJson.get("away_score")+""));
|
||||
match.setName(""+matchJson.get("round_cn")+":"+team1.getName()+"VS"+team2.getName());
|
||||
matchRepo.save(match);
|
||||
|
||||
|
||||
//第三步 保存球员
|
||||
JSONArray array = (JSONArray) json3.get("event");
|
||||
List<WcPlayer> playerList = new ArrayList<>();
|
||||
for (Object obj : array) {
|
||||
WcPlayer player = new WcPlayer();
|
||||
JSONObject playerJson = (JSONObject) obj;
|
||||
System.out.println(playerJson);
|
||||
System.out.println(playerJson.get("id"));
|
||||
Optional<WcStat> id1 = playerStatRepo.findById("" + playerJson.get("id"));
|
||||
if(id1.isPresent()){
|
||||
continue;
|
||||
}
|
||||
System.out.println(playerJson.get("l_name_cn"));
|
||||
player.setId("" + playerJson.get("id"));
|
||||
player.setName("" + playerJson.get("l_name_cn"));
|
||||
player.setShirtNumber("" + playerJson.get("shirt_number"));
|
||||
player.setPosition("" + playerJson.get("position_long_cn"));
|
||||
String url = "http://match.sports.sina.com.cn/football/player.php?id=" + player.getId();
|
||||
Document doc = null;
|
||||
try {
|
||||
doc = Jsoup.connect(url).get();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Elements elements = doc.select(".txt .t dd");
|
||||
player.setEnName(elements.get(1).html());
|
||||
player.setEnFullName(elements.get(2).html());
|
||||
player.setBirthday(XdateUtil.strToDate(elements.get(3).html()));
|
||||
player.setHeight(Integer.parseInt(elements.get(4).html().replaceAll("[^0-9.]", "")));
|
||||
player.setWeight(Integer.parseInt(elements.get(5).html().replaceAll("[^0-9.]", "")));
|
||||
player.setWeekly(XnumberUtil.getRandomBigDecimal(new BigDecimal(10),new BigDecimal(50)));
|
||||
if("替补".equals(player.getPosition())){
|
||||
player.setPosition(elements.get(7).html());
|
||||
}
|
||||
if("0".equals(""+playerJson.get("lr_position"))){
|
||||
player.setTeamId(team1.getId());
|
||||
}else{
|
||||
player.setTeamId(team2.getId());
|
||||
}
|
||||
// player.setCountry(elements.get(8).html());
|
||||
player.setClub(elements.get(9).html());
|
||||
playerList.add(player);
|
||||
}
|
||||
repo.saveAll(playerList);
|
||||
|
||||
//保存该比赛的球员技术统计
|
||||
playerStat(id);
|
||||
}
|
||||
|
||||
private void playerStat(String id){
|
||||
String url = "http://info.sports.sina.com.cn/api/live/opta_player_stats.php?format=json&_t=0.46432963703738617&id=o_"+id+"&callback=fun_718625181803029488";
|
||||
|
||||
String str = HttpUtil.createGet(url).execute().body();
|
||||
String xx = str.split("fun_718625181803029488")[1];
|
||||
xx = xx.substring(1, xx.length() - 13);
|
||||
JSONObject json = JSONObject.parseObject(xx);
|
||||
JSONObject json2 = (JSONObject) json.get("result");
|
||||
JSONObject json3 = (JSONObject) json2.get("data");
|
||||
JSONObject json4 = (JSONObject) json3.get("stats");
|
||||
JSONArray homeArray = (JSONArray) json4.get("home");
|
||||
JSONArray awayArray = (JSONArray) json4.get("away");
|
||||
List<WcStat> stats = new ArrayList<>();
|
||||
|
||||
for (Object obj : homeArray) {
|
||||
WcStat stat = new WcStat();
|
||||
JSONObject statJson = (JSONObject) obj;
|
||||
System.out.println(statJson);
|
||||
stat.setId("" + statJson.get("id"));
|
||||
stat.setMatchId(id);
|
||||
stat.setPalyerId("" + statJson.get("player_id"));
|
||||
stat.setTotalScoringAtt(Integer.parseInt("" + statJson.get("total_scoring_att")));
|
||||
stat.setOntargetScoringAtt(Integer.parseInt("" + statJson.get("ontarget_scoring_att")));
|
||||
stat.setGoals(Integer.parseInt("" + statJson.get("goals")));
|
||||
stat.setGoalAssist(Integer.parseInt("" + statJson.get("goal_assist")));
|
||||
stat.setMinsPlayed(Integer.parseInt("" + statJson.get("mins_played")));
|
||||
stat.setFouls(Integer.parseInt("" + statJson.get("fouls")));
|
||||
stat.setWasFouled(Integer.parseInt("" + statJson.get("was_fouled")));
|
||||
stat.setTotalPass(Integer.parseInt("" + statJson.get("total_pass")));
|
||||
stat.setAccuratePass(Integer.parseInt("" + statJson.get("accurate_pass")));
|
||||
stat.setSaves(Integer.parseInt("" + statJson.get("saves")));
|
||||
if("z".equals("" + statJson.get("status")) ){
|
||||
stat.setStatus(true);
|
||||
}else{
|
||||
stat.setStatus(false);
|
||||
}
|
||||
stat.setIsHome(true);
|
||||
stats.add(stat);
|
||||
}
|
||||
|
||||
for (Object obj : awayArray) {
|
||||
WcStat stat = new WcStat();
|
||||
JSONObject statJson = (JSONObject) obj;
|
||||
System.out.println(statJson);
|
||||
stat.setId("" + statJson.get("id"));
|
||||
stat.setMatchId(id);
|
||||
stat.setPalyerId("" + statJson.get("player_id"));
|
||||
stat.setTotalScoringAtt(Integer.parseInt("" + statJson.get("total_scoring_att")));
|
||||
stat.setOntargetScoringAtt(Integer.parseInt("" + statJson.get("ontarget_scoring_att")));
|
||||
stat.setGoals(Integer.parseInt("" + statJson.get("goals")));
|
||||
stat.setGoalAssist(Integer.parseInt("" + statJson.get("goal_assist")));
|
||||
stat.setMinsPlayed(Integer.parseInt("" + statJson.get("mins_played")));
|
||||
stat.setFouls(Integer.parseInt("" + statJson.get("fouls")));
|
||||
stat.setWasFouled(Integer.parseInt("" + statJson.get("was_fouled")));
|
||||
stat.setTotalPass(Integer.parseInt("" + statJson.get("total_pass")));
|
||||
stat.setAccuratePass(Integer.parseInt("" + statJson.get("accurate_pass")));
|
||||
stat.setSaves(Integer.parseInt("" + statJson.get("saves")));
|
||||
if("z".equals("" + statJson.get("status")) ){
|
||||
stat.setStatus(true);
|
||||
}else{
|
||||
stat.setStatus(false);
|
||||
}
|
||||
stat.setIsHome(false);
|
||||
stats.add(stat);
|
||||
}
|
||||
playerStatRepo.saveAll(stats);
|
||||
}
|
||||
|
||||
public void test(){
|
||||
Optional<WcPlayer> id1 = repo.findById("109888");
|
||||
System.out.println(id1);
|
||||
System.out.println(id1.isPresent());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private WcStatRepo playerStatRepo;
|
||||
|
||||
@Autowired
|
||||
private WcTeamRepo teamRepo;
|
||||
|
||||
@Autowired
|
||||
private WcMatchRepo matchRepo;
|
||||
|
||||
@Autowired
|
||||
private WcPlayerRepo repo;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package vboot.app.module.wc.stat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WcStat {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
private String id;
|
||||
|
||||
@Column(length = 32)
|
||||
private String palyerId;//球员ID
|
||||
|
||||
@Column(length = 32)
|
||||
private String matchId;//比赛ID
|
||||
|
||||
private Integer totalScoringAtt;//射门次数
|
||||
|
||||
private Integer ontargetScoringAtt;//射正次数
|
||||
|
||||
private Integer goals;//进球数
|
||||
|
||||
private Integer goalAssist;//助攻
|
||||
|
||||
private Integer minsPlayed;//出场时间
|
||||
|
||||
private Integer fouls;//犯规
|
||||
|
||||
private Integer wasFouled;//被犯规
|
||||
|
||||
private Integer totalPass;//总传球数
|
||||
|
||||
private Integer accuratePass;//成功传球数
|
||||
|
||||
private Integer saves;//扑救数
|
||||
|
||||
private Boolean status;//是否首发
|
||||
|
||||
private Boolean isHome;//是否为主队
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.app.module.wc.stat;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface WcStatRepo extends JpaRepository<WcStat,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package vboot.app.module.wc.team.main;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WcTeam {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
private String id;
|
||||
|
||||
@Column(length = 32)
|
||||
private String name;
|
||||
|
||||
// @Column(length = 64)
|
||||
// private String enName;
|
||||
|
||||
@Column(length = 32)
|
||||
private String coach;//主教练
|
||||
|
||||
@Column(length = 32)
|
||||
private String contId;//大洲的ID
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package vboot.app.module.wc.team.main;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface WcTeamRepo extends JpaRepository<WcTeam,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package vboot.app.module.wc.team.main;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WcTeamService {
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private WcTeamRepo repo;
|
||||
|
||||
|
||||
}
|
||||
@@ -457,7 +457,7 @@ public class SysPortalInit {
|
||||
|
||||
SysPortalMenu menu223 = new SysPortalMenu();
|
||||
menu223.setId("MonLogError");
|
||||
menu223.setName("操作日志");
|
||||
menu223.setName("错误日志");
|
||||
menu223.setCode("MonLogError");
|
||||
menu223.setPath("/mon/log/error");
|
||||
menu223.setComp("/mon/log/error/index");
|
||||
|
||||
@@ -53,7 +53,7 @@ public abstract class BaseMainService<T extends BaseMainEntity> {
|
||||
}
|
||||
|
||||
//---------------------------------------增删改-------------------------------------
|
||||
public T insert(T main) {
|
||||
public String insert(T main) {
|
||||
if (main.getId() == null || "".equals(main.getId())) {
|
||||
main.setId(XstrUtil.getUUID());
|
||||
}
|
||||
@@ -61,7 +61,8 @@ public abstract class BaseMainService<T extends BaseMainEntity> {
|
||||
if (main.getCrman() == null) {
|
||||
main.setCrman(XuserUtil.getUser());
|
||||
}
|
||||
return repo.save(main);
|
||||
repo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
@@ -71,12 +72,13 @@ public abstract class BaseMainService<T extends BaseMainEntity> {
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
public T update(T main) {
|
||||
public String update(T main) {
|
||||
main.setUptim(new Date());
|
||||
if (main.getUpman() == null) {
|
||||
main.setUpman(XuserUtil.getUser());
|
||||
}
|
||||
return repo.save(main);
|
||||
repo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public T save(T t) {
|
||||
|
||||
@@ -48,11 +48,12 @@ public abstract class BaseService<T extends BaseEntity> {
|
||||
|
||||
|
||||
//---------------------------------------增删改-------------------------------------
|
||||
public T insert(T main) {
|
||||
public String insert(T main) {
|
||||
if (main.getId() == null||"".equals(main.getId())) {
|
||||
main.setId(XstrUtil.getUUID());
|
||||
}
|
||||
return repo.save(main);
|
||||
repo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
@@ -62,8 +63,9 @@ public abstract class BaseService<T extends BaseEntity> {
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
public T update(T main) {
|
||||
return repo.save(main);
|
||||
public String update(T main) {
|
||||
repo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public T save(T t) {
|
||||
|
||||
@@ -46,12 +46,12 @@ public class AssAddrMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody AssAddrMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody AssAddrMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -25,12 +25,12 @@ public class AssCogeFormApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody AssCogeForm main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody AssCogeForm main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -54,12 +54,12 @@ public class AssCogeTableApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody AssCogeTable main) throws DocumentException {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody AssCogeTable main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -42,12 +42,12 @@ public class AssDictDataApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody AssDictData main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody AssDictData main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -38,12 +38,12 @@ public class AssDictMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody AssDictMain main) throws DocumentException {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody AssDictMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -191,12 +191,12 @@ public class BpmProcMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BpmProcMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BpmProcMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -31,6 +31,7 @@ public class MonLogError implements Serializable {
|
||||
private String method;
|
||||
|
||||
/** 参数 */
|
||||
@Lob
|
||||
private String params;
|
||||
|
||||
/** 日志类型 */
|
||||
|
||||
@@ -16,6 +16,7 @@ public class MonLogErrorApi {
|
||||
@GetMapping
|
||||
public R get() {
|
||||
Sqler sqler = new Sqler("t.*", "mon_log_error");
|
||||
sqler.addOrder("t.crtim desc");
|
||||
sqler.addLeftJoin("u.name as usena,u.usnam","sys_org_user u","u.id=t.useid");
|
||||
return R.ok(jdbcDao.findPageData(sqler));
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class MonLogOper implements Serializable {
|
||||
private String method;
|
||||
|
||||
/** 参数 */
|
||||
@Lob
|
||||
private String params;
|
||||
|
||||
/** 日志类型 */
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MonLogOperApi {
|
||||
@GetMapping
|
||||
public R get() {
|
||||
Sqler sqler = new Sqler("t.*", "mon_log_oper");
|
||||
sqler.addOrder("t.crtim desc");
|
||||
sqler.addLeftJoin("u.name as usena,u.usnam","sys_org_user u","u.id=t.useid");
|
||||
return R.ok(jdbcDao.findPageData(sqler));
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ public class SysOrgGroupApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SysOrgGroup main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SysOrgGroup main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -27,21 +27,23 @@ public class SysOrgGroupService {
|
||||
return jdbcDao.findPageData(sqler);
|
||||
}
|
||||
|
||||
public SysOrgGroup insert(SysOrgGroup main) {
|
||||
public String insert(SysOrgGroup main) {
|
||||
if (main.getId() == null || "".equals(main.getId())) {
|
||||
main.setId(XstrUtil.getUUID());
|
||||
}
|
||||
SysOrg sysOrg = new SysOrg(main.getId(), main.getName());
|
||||
orgRepo.save(sysOrg);
|
||||
return groupRepo.save(main);
|
||||
groupRepo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
|
||||
public SysOrgGroup update(SysOrgGroup main) {
|
||||
public String update(SysOrgGroup main) {
|
||||
main.setUptim(new Date());
|
||||
SysOrg sysOrg = new SysOrg(main.getId(), main.getName());
|
||||
orgRepo.save(sysOrg);
|
||||
return groupRepo.save(main);
|
||||
groupRepo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
|
||||
@@ -29,12 +29,12 @@ public class SysOrgPostApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SysOrgPost main) throws InterruptedException {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SysOrgPost main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -22,7 +22,7 @@ public class SysOrgPostService {
|
||||
}
|
||||
|
||||
|
||||
public SysOrgPost insert(SysOrgPost main) {
|
||||
public String insert(SysOrgPost main) {
|
||||
if (main.getId() == null || "".equals(main.getId())) {
|
||||
main.setId(XstrUtil.getUUID());
|
||||
}
|
||||
@@ -34,10 +34,11 @@ public class SysOrgPostService {
|
||||
}
|
||||
SysOrg sysOrg = new SysOrg(main.getId(), main.getName());
|
||||
orgRepo.save(sysOrg);
|
||||
return postRepo.save(main);
|
||||
postRepo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public SysOrgPost update(SysOrgPost main) {
|
||||
public String update(SysOrgPost main) {
|
||||
main.setUptim(new Date());
|
||||
SysOrg sysOrg = new SysOrg(main.getId(), main.getName());
|
||||
if (main.getDept() == null || StrUtil.isBlank(main.getDept().getId())) {
|
||||
@@ -48,7 +49,7 @@ public class SysOrgPostService {
|
||||
}
|
||||
SysOrgPost backPost = postRepo.save(main);
|
||||
orgRepo.save(sysOrg);
|
||||
return backPost;
|
||||
return backPost.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
|
||||
@@ -37,12 +37,12 @@ public class SysOrgUserApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SysOrgUser main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SysOrgUser main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SysOrgUserService {
|
||||
}
|
||||
|
||||
|
||||
public SysOrgUser insert(SysOrgUser main) {
|
||||
public String insert(SysOrgUser main) {
|
||||
if (main.getId() == null || "".equals(main.getId())) {
|
||||
main.setId(XstrUtil.getUUID());
|
||||
}
|
||||
@@ -60,11 +60,12 @@ public class SysOrgUserService {
|
||||
main.setPacod(DigestUtils.md5DigestAsHex(("abc" + main.getPacod() + "xyz").getBytes()));
|
||||
SysOrg sysOrg = new SysOrg(main.getId(), main.getName());
|
||||
orgRepo.save(sysOrg);
|
||||
return userRepo.save(main);
|
||||
userRepo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
|
||||
public SysOrgUser update(SysOrgUser main) {
|
||||
public String update(SysOrgUser main) {
|
||||
main.setUptim(new Date());
|
||||
SysOrg sysOrg = new SysOrg(main.getId(), main.getName());
|
||||
if (main.getDept() == null || StrUtil.isBlank(main.getDept().getId())) {
|
||||
@@ -73,9 +74,9 @@ public class SysOrgUserService {
|
||||
String tier = jdbcDao.findOneString("select tier from sys_org_dept where id=?", main.getDept().getId());
|
||||
main.setTier(tier + main.getId() + "x");
|
||||
}
|
||||
SysOrgUser backUser = userRepo.save(main);
|
||||
userRepo.save(main);
|
||||
orgRepo.save(sysOrg);
|
||||
return backUser;
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
|
||||
@@ -31,12 +31,12 @@ public class SysPortalMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SysPortalMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SysPortalMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -46,13 +46,13 @@ public class SysPortalMenuApi {
|
||||
@PostMapping
|
||||
public R post(@RequestBody SysPortalMenu main) {
|
||||
System.out.println("插入");
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SysPortalMenu main) {
|
||||
System.out.println("修改");
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
+3
-2
@@ -22,11 +22,12 @@ public class SysPortalMenuService {
|
||||
return repo.findById(id).get();
|
||||
}
|
||||
|
||||
public SysPortalMenu insert(SysPortalMenu main) {
|
||||
public String insert(SysPortalMenu main) {
|
||||
if (main.getId() == null || "".equals(main.getId())) {
|
||||
main.setId(XstrUtil.getUUID());
|
||||
}
|
||||
return repo.save(main);
|
||||
repo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,12 +31,12 @@ public class SysTodoMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SysTodoMain main) throws DocumentException {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SysTodoMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -20,11 +20,11 @@ import java.util.Map;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SysTodoMainService {
|
||||
|
||||
public void sendTodo(Zbpm zbpm, Znode znode) {
|
||||
public void sendTodo(Zbpm zbpm, Znode znode) {
|
||||
SysTodoMain todo = new SysTodoMain();
|
||||
todo.setId(XstrUtil.getUUID());
|
||||
todo.setName(zbpm.getProna());
|
||||
todo.setLink("/#/page/ofmv?id="+zbpm.getProid());
|
||||
todo.setLink("/#/page/ofmv?id=" + zbpm.getProid());
|
||||
todo.setModid(zbpm.getProid());
|
||||
|
||||
|
||||
@@ -36,33 +36,34 @@ public class SysTodoMainService {
|
||||
targetRepo.save(todoTarget);
|
||||
}
|
||||
|
||||
public void doneTodo(Zbpm zbpm) {
|
||||
String sql="select m.id,t.id as tid from sys_todo_main m inner join sys_todo_user t on t.tid=m.id " +
|
||||
public void doneTodo(Zbpm zbpm) {
|
||||
String sql = "select m.id,t.id as tid from sys_todo_main m inner join sys_todo_user t on t.tid=m.id " +
|
||||
"where t.uid=? and m.modid=?";
|
||||
Map<String, Object> map = jdbcDao.findMap(sql, zbpm.getHaman(), zbpm.getProid());
|
||||
String delsql = "delete from sys_todo_user where id=?";
|
||||
jdbcDao.update(delsql,map.get("tid"));
|
||||
jdbcDao.update(delsql, map.get("tid"));
|
||||
|
||||
SysTodoDone done = new SysTodoDone();
|
||||
done.setId(XstrUtil.getUUID());
|
||||
done.setTid(""+map.get("id"));
|
||||
done.setTid("" + map.get("id"));
|
||||
done.setUid(zbpm.getHaman());
|
||||
doneRepo.save(done);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public SysTodoMain insert(SysTodoMain main) {
|
||||
public String insert(SysTodoMain main) {
|
||||
if (main.getId() == null || "".equals(main.getId())) {
|
||||
main.setId(XstrUtil.getUUID());
|
||||
}
|
||||
main.setCrtim(new Date());
|
||||
return repo.save(main);
|
||||
repo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
|
||||
public SysTodoMain update(SysTodoMain main) {
|
||||
return repo.save(main);
|
||||
public String update(SysTodoMain main) {
|
||||
repo.save(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
|
||||
@@ -29,12 +29,12 @@ public class BiConnMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -39,12 +39,12 @@ public class BiDemoBoyApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiDemoBoy main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiDemoBoy main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -27,12 +27,12 @@ public class BiDemoGirlApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiDemoGirl main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiDemoGirl main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
+2
-2
@@ -27,12 +27,12 @@ public class BiDemoStudentApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiDemoStudent main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiDemoStudent main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -40,7 +40,7 @@ public class BiEtlMainApi {
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiEtlMain main) {
|
||||
main.setAvtag(false);
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@@ -48,7 +48,7 @@ public class BiEtlMainApi {
|
||||
if (main.getAvtag()) {
|
||||
handler.startEtlJob(main);
|
||||
}
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@PostMapping("start")
|
||||
|
||||
@@ -26,12 +26,12 @@ public class BiFieldMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiFieldMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiFieldMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -26,12 +26,12 @@ public class BiTableMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody BiTableMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package vboot.extend.module.oa.demo.one;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class OaDemoOne extends BaseMainEntity {
|
||||
|
||||
private String notes;//备注
|
||||
|
||||
}
|
||||
+28
-40
@@ -1,22 +1,25 @@
|
||||
package vboot.app.module.sa.agent.main;
|
||||
package vboot.extend.module.oa.demo.one;
|
||||
|
||||
import cn.hutool.script.ScriptRuntimeException;
|
||||
import cn.hutool.script.ScriptUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
|
||||
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
|
||||
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
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 vboot.core.xutil.file.FileUtils;
|
||||
import vboot.core.xutil.file.excel.ExcelResult;
|
||||
import vboot.core.xutil.lang.XnumberUtil;
|
||||
|
||||
import javax.script.CompiledScript;
|
||||
import javax.script.ScriptException;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -24,12 +27,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/agent/main")
|
||||
public class SaAgentMainApi {
|
||||
@RequestMapping("oa/demo/one")
|
||||
public class OaDemoOneApi {
|
||||
|
||||
@Oplog("查询代理商")
|
||||
@Oplog("查询DEMO")
|
||||
@GetMapping
|
||||
public R get(String name, String catid) {
|
||||
public R get(String name, String catid) throws Exception {
|
||||
CompiledScript script = ScriptUtil.compile("var map={};var a=1;var b=2;map.xx="
|
||||
+ XnumberUtil.getRandom6() +"+a+b;map");
|
||||
try {
|
||||
@@ -42,7 +45,7 @@ public class SaAgentMainApi {
|
||||
// if(true){
|
||||
// throw new Exception("错误了");
|
||||
// }
|
||||
Sqler sqler = new Sqler("sa_agent_main");
|
||||
Sqler sqler = new Sqler("oa_demo_one");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.addre,t.senum");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
@@ -59,24 +62,16 @@ public class SaAgentMainApi {
|
||||
|
||||
@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);
|
||||
|
||||
// response.setContentType("application/vnd.ms-excel");
|
||||
// response.setCharacterEncoding("utf-8");
|
||||
// String fileName = "测试1ss.xlsx";
|
||||
// FileUtils.setAttachmentResponseHeader(response, fileName);
|
||||
// response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
||||
// ServletOutputStream outputStream = response.getOutputStream();
|
||||
// ExcelWriterBuilder writeWorkBook = EasyExcel.write(outputStream, Student.class)
|
||||
// .registerWriteHandler((new LongestMatchColumnWidthStyleStrategy()));
|
||||
// ExcelWriterSheetBuilder sheet = writeWorkBook.sheet();
|
||||
// sheet.doWrite(initData());
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = "测试1ss.xlsx";
|
||||
FileUtils.setAttachmentResponseHeader(response, fileName);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
ExcelWriterBuilder writeWorkBook = EasyExcel.write(outputStream, Student.class)
|
||||
.registerWriteHandler((new LongestMatchColumnWidthStyleStrategy()));
|
||||
ExcelWriterSheetBuilder sheet = writeWorkBook.sheet();
|
||||
sheet.doWrite(initData());
|
||||
}
|
||||
|
||||
private static List<Student> initData(){
|
||||
@@ -94,20 +89,18 @@ public class SaAgentMainApi {
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
|
||||
SaAgentMain main = service.findOne(id);
|
||||
OaDemoOne 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).getId());
|
||||
public R post(@RequestBody OaDemoOne main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaAgentMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
public R put(@RequestBody OaDemoOne main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
@@ -115,13 +108,8 @@ public class SaAgentMainApi {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private AssNumMainService numService;
|
||||
|
||||
@Autowired
|
||||
private SaAgentMainService service;
|
||||
|
||||
@Autowired
|
||||
private JdbcDao jdbcDao;
|
||||
private OaDemoOneService service;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package vboot.extend.module.oa.demo.one;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface OaDemoOneRepo extends JpaRepository<OaDemoOne,String> {
|
||||
|
||||
|
||||
}
|
||||
+5
-5
@@ -1,18 +1,18 @@
|
||||
package vboot.app.module.sa.prod.tem;
|
||||
package vboot.extend.module.oa.demo.one;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
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 SaProdTemService extends BaseMainService<SaProdTem> {
|
||||
public class OaDemoOneService extends BaseMainService<OaDemoOne> {
|
||||
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private SaProdTemRepo repo;
|
||||
private OaDemoOneRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.agent.main;
|
||||
package vboot.extend.module.oa.demo.one;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import lombok.Data;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.agent.main;
|
||||
package vboot.extend.module.oa.demo.one;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import vboot.core.xutil.file.excel.ExcelListener;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.cust.main;
|
||||
package vboot.extend.module.oa.demo.two;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -9,7 +9,7 @@ import javax.persistence.Entity;
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaCustMain extends BaseMainEntity {
|
||||
public class OaDemoTwo extends BaseMainEntity {
|
||||
|
||||
//备注
|
||||
private String notes;
|
||||
+13
-8
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.cust.main;
|
||||
package vboot.extend.module.oa.demo.two;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -7,13 +7,18 @@ import vboot.core.common.dao.JdbcDao;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/cust/main")
|
||||
public class SaCustMainApi {
|
||||
@RequestMapping("oa/demo/two")
|
||||
public class OaDemoTwoApi {
|
||||
|
||||
@GetMapping("list")
|
||||
public R getList() {
|
||||
return R.ok(service.findAll());
|
||||
}
|
||||
|
||||
//分页查询项目清单
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_cust_main");
|
||||
Sqler sqler = new Sqler("oa_demo_two");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.notes");
|
||||
return R.ok(jdbcDao.findPageData(sqler));
|
||||
@@ -22,19 +27,19 @@ public class SaCustMainApi {
|
||||
//查询单个项目
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaCustMain main = service.findOne(id);
|
||||
OaDemoTwo main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
//新增项目
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaCustMain main) {
|
||||
public R post(@RequestBody OaDemoTwo main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
//修改项目
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaCustMain main) {
|
||||
public R put(@RequestBody OaDemoTwo main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@@ -53,7 +58,7 @@ public class SaCustMainApi {
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private SaCustMainService service;
|
||||
private OaDemoTwoService service;
|
||||
|
||||
@Autowired
|
||||
private JdbcDao jdbcDao;
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package vboot.app.module.sa.cust.main;
|
||||
package vboot.extend.module.oa.demo.two;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SaCustMainMapper extends BaseMapper<SaCustMain>
|
||||
public interface OaDemoTwoMapper extends BaseMapper<OaDemoTwo>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package vboot.extend.module.oa.demo.two;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import vboot.extend.module.oa.demo.one.OaDemoOne;
|
||||
import vboot.extend.module.oa.demo.one.OaDemoOneRepo;
|
||||
import vboot.core.xutil.lang.XstrUtil;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class OaDemoTwoService {
|
||||
|
||||
public OaDemoTwo findOne(String id) {
|
||||
return demoTwoMapper.selectById(id);
|
||||
}
|
||||
|
||||
public List<OaDemoTwo> findAll() {
|
||||
return demoTwoMapper.selectList(null);
|
||||
}
|
||||
|
||||
public String insert(OaDemoTwo cust) {
|
||||
cust.setId(XstrUtil.getUUID());
|
||||
demoTwoMapper.insert(cust);
|
||||
return cust.getId();
|
||||
}
|
||||
|
||||
public String update(OaDemoTwo cust) {
|
||||
demoTwoMapper.updateById(cust);
|
||||
return cust.getId();
|
||||
}
|
||||
|
||||
public int delete(String[] ids) {
|
||||
for (String id : ids) {
|
||||
demoTwoMapper.deleteById(id);
|
||||
}
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
//先通过JPA新增一个代理商
|
||||
OaDemoOne demoMain=new OaDemoOne();
|
||||
demoMain.setId(XstrUtil.getUUID());
|
||||
demoMain.setName("有事务的项目");
|
||||
demoOneRepo.save(demoMain);
|
||||
|
||||
//再通过mybatis-plus新增一个项目,并让它报错
|
||||
OaDemoTwo demoMain2=new OaDemoTwo();
|
||||
demoMain2.setId(XstrUtil.getUUID()+"XXXXXXXXXXXXXXXX");//超出长度保存出错
|
||||
demoMain2.setNotes("有事务的客户");
|
||||
demoTwoMapper.insert(demoMain2);
|
||||
}
|
||||
|
||||
@Resource
|
||||
private OaDemoOneRepo demoOneRepo;
|
||||
|
||||
@Resource
|
||||
private OaDemoTwoMapper demoTwoMapper;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ public class OaDocMainApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody OaDocMain main) throws DocumentException {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody OaDocMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
|
||||
@@ -10,11 +10,10 @@ import javax.annotation.PostConstruct;
|
||||
@Service
|
||||
public class OaDocMainService extends BaseMainService<OaDocMain> {
|
||||
|
||||
public OaDocMain insert(OaDocMain OaDocMain) {
|
||||
OaDocMain dbMain = super.insert(OaDocMain);
|
||||
public String insert(OaDocMain OaDocMain) {
|
||||
// BpmProcMain wfFlowMain = new BpmProcMain(dbMain);
|
||||
// flowService.start(wfFlowMain);
|
||||
return dbMain;
|
||||
return super.insert(OaDocMain);
|
||||
}
|
||||
|
||||
//----------bean注入------------
|
||||
|
||||
@@ -6,6 +6,7 @@ import vboot.core.module.bpm.proc.main.Zbpm;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vboot.core.module.bpm.proc.main.Znode;
|
||||
import vboot.core.xutil.web.XuserUtil;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.Date;
|
||||
@@ -16,7 +17,10 @@ public class OaFlowMainService extends BaseMainService<OaFlowMain> {
|
||||
public void insertx(OaFlowMain oaFlowMain) {
|
||||
oaFlowMain.setState("20");
|
||||
oaFlowMain.setUptim(new Date());
|
||||
OaFlowMain dbMain = super.insert(oaFlowMain);
|
||||
if (oaFlowMain.getCrman() == null) {
|
||||
oaFlowMain.setCrman(XuserUtil.getUser());
|
||||
}
|
||||
OaFlowMain dbMain = repo.save(oaFlowMain);
|
||||
|
||||
Zbpm zbpm = oaFlowMain.getZbpm();
|
||||
zbpm.setProid(dbMain.getId());
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
@Service
|
||||
public class OaFlowTempService extends BaseMainService<OaFlowTemp> {
|
||||
|
||||
public OaFlowTemp insertx(OaFlowTemp oaFlowTemp) {
|
||||
public String insertx(OaFlowTemp oaFlowTemp) {
|
||||
BpmProcTemp bpmProcTemp = new BpmProcTemp(oaFlowTemp);
|
||||
bpmProcTemp.setOrxml(oaFlowTemp.getPrxml());
|
||||
String chxml = "<?xml version=\"1.0\" encoding=\"gb2312\"?>"
|
||||
@@ -22,12 +22,12 @@ public class OaFlowTempService extends BaseMainService<OaFlowTemp> {
|
||||
.replaceAll("bpmn2:", "")
|
||||
.replaceAll("activiti:", "") + "process>";
|
||||
bpmProcTemp.setChxml(chxml);
|
||||
BpmProcTemp dbProcTemp = bpmProcTempService.insert(bpmProcTemp);
|
||||
oaFlowTemp.setProtd(dbProcTemp.getId());
|
||||
String temid = bpmProcTempService.insert(bpmProcTemp);
|
||||
oaFlowTemp.setProtd(temid);
|
||||
return super.insert(oaFlowTemp);
|
||||
}
|
||||
|
||||
public OaFlowTemp updatex(OaFlowTemp oaFlowTemp) {
|
||||
public String updatex(OaFlowTemp oaFlowTemp) {
|
||||
BpmProcTemp bpmProcTemp = bpmProcTempService.findOne(oaFlowTemp.getProtd());
|
||||
bpmProcTemp.setOrxml(oaFlowTemp.getPrxml());
|
||||
String chxml = "<?xml version=\"1.0\" encoding=\"gb2312\"?>"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
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; //备注
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package vboot.extend.module.sa.agent.cate;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaAgentCateRepo extends JpaRepository<SaAgentCate,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
+12
-10
@@ -1,6 +1,5 @@
|
||||
package vboot.app.module.sa.agent.main;
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
@@ -39,18 +38,21 @@ public class SaAgentMain extends BaseMainEntity {
|
||||
@Column(length = 32)
|
||||
private String level;//代理商资质
|
||||
|
||||
@Column(length = 32)
|
||||
private String catid;//代理商分类
|
||||
|
||||
@Column(length = 32)
|
||||
private String senum;//流水号
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String notes;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "opman")
|
||||
private SysOrg opman;//创建人
|
||||
private String notes;//备注
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_agent_main_viewer", joinColumns = {@JoinColumn(name = "mid")},
|
||||
@JoinTable(name = "sa_agent_viewer", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> viewers;
|
||||
private List<SysOrg> viewers;//可查看者
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "sa_agent_editor", joinColumns = {@JoinColumn(name = "mid")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "oid")})
|
||||
private List<SysOrg> editors;//可编辑者
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
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
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.agent.main;
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.agent.main;
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.agent.main;
|
||||
package vboot.extend.module.sa.agent.main;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -0,0 +1,18 @@
|
||||
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; //备注
|
||||
|
||||
}
|
||||
+20
-16
@@ -1,37 +1,39 @@
|
||||
package vboot.app.module.sa.draw.main;
|
||||
package vboot.extend.module.sa.cust.cate;
|
||||
|
||||
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.*;
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/draw/main")
|
||||
public class SaDrawMainApi {
|
||||
@RequestMapping("sa/cust/cate")
|
||||
public class SaCustCateApi {
|
||||
|
||||
@GetMapping("list")
|
||||
public R getList() {
|
||||
return R.ok(service.findAll());
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public R get(String name,String catid) {
|
||||
Sqler sqler = new Sqler("sa_draw_main");
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_cust_cate");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addEqual("t.catid", catid);
|
||||
sqler.addOrder("t.ornum").addSelect("t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaDrawMain main = service.findOne(id);
|
||||
SaCustCate main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaDrawMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
}
|
||||
public R post(@RequestBody SaCustCate main) { return R.ok(service.insert(main)); }
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaDrawMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
public R put(@RequestBody SaCustCate main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
@@ -39,7 +41,9 @@ public class SaDrawMainApi {
|
||||
return R.ok(service.delete(ids));
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private SaDrawMainService service;
|
||||
private SaCustCateService service;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package vboot.extend.module.sa.cust.cate;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaCustCateRepo extends JpaRepository<SaCustCate,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
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;//可编辑者
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package vboot.extend.module.sa.cust.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SaCustMainRepo extends JpaRepository<SaCustMain,String> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.prod.feat;
|
||||
package vboot.extend.module.sa.prod.feat;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
+2
-7
@@ -1,6 +1,6 @@
|
||||
package vboot.app.module.sa.prod.group;
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import vboot.app.module.sa.prod.main.SaProdMain;
|
||||
import vboot.extend.module.sa.prod.main.SaProdMain;
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -14,9 +14,6 @@ import java.util.List;
|
||||
@Setter
|
||||
public class SaProdGroup extends BaseMainEntity {
|
||||
|
||||
|
||||
|
||||
|
||||
//备注
|
||||
private String notes;
|
||||
|
||||
@@ -29,6 +26,4 @@ public class SaProdGroup extends BaseMainEntity {
|
||||
private List<SaProdMain> prods = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.prod.group;
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
@@ -36,13 +36,13 @@ public class SaProdGroupApi {
|
||||
//新增项目
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaProdGroup main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
//修改项目
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaProdGroup main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
//删除项目
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.prod.group;
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.prod.group;
|
||||
package vboot.extend.module.sa.prod.group;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.prod.main;
|
||||
package vboot.extend.module.sa.prod.main;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.prod.tem;
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
@@ -10,7 +10,7 @@ import javax.persistence.Entity;
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class SaProdTem extends BaseMainEntity {
|
||||
public class SaProdTemp extends BaseMainEntity {
|
||||
|
||||
private Integer ornum;
|
||||
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.prod.tem;
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
@@ -6,12 +6,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/prod/tem")
|
||||
public class SaProdTemApi {
|
||||
@RequestMapping("sa/prod/temp")
|
||||
public class SaProdTempApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_prod_tem");
|
||||
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");
|
||||
@@ -20,18 +20,18 @@ public class SaProdTemApi {
|
||||
|
||||
@GetMapping("one/{id}")
|
||||
public R getOne(@PathVariable String id) {
|
||||
SaProdTem main = service.findOne(id);
|
||||
SaProdTemp main = service.findOne(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaProdTem main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
public R post(@RequestBody SaProdTemp main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaProdTem main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
public R put(@RequestBody SaProdTemp main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
@@ -40,6 +40,6 @@ public class SaProdTemApi {
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private SaProdTemService service;
|
||||
private SaProdTempService service;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
||||
public interface SaProdTempRepo extends JpaRepository<SaProdTemp,String> {
|
||||
|
||||
|
||||
}
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.draw.main;
|
||||
package vboot.extend.module.sa.prod.temp;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -7,13 +7,12 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Service
|
||||
public class SaDrawMainService extends BaseMainService<SaDrawMain> {
|
||||
|
||||
public class SaProdTempService extends BaseMainService<SaProdTemp> {
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private SaDrawMainRepo repo;
|
||||
private SaProdTempRepo repo;
|
||||
|
||||
@PostConstruct
|
||||
public void initDao() {
|
||||
@@ -0,0 +1,77 @@
|
||||
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
|
||||
private List<SaProdGroup> groups = new ArrayList<>(); //产品组
|
||||
|
||||
}
|
||||
+22
-26
@@ -1,44 +1,26 @@
|
||||
package vboot.app.module.sa.proj.main;
|
||||
package vboot.extend.module.sa.proj.main;
|
||||
|
||||
import vboot.app.module.sa.prod.group.SaProdGroup;
|
||||
import vboot.app.module.sa.prod.group.SaProdGroupService;
|
||||
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 vboot.core.common.pojo.Zinp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import vboot.core.module.ass.num.main.AssNumMainService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sa/proj/main")
|
||||
public class SaProjMainApi {
|
||||
|
||||
@GetMapping("tree")
|
||||
public R getTree(String name) {
|
||||
List<Zinp> list = new ArrayList<>();
|
||||
Zinp zinp = new Zinp();
|
||||
zinp.setId("11");
|
||||
zinp.setName("测试1");
|
||||
|
||||
Zinp zinp2 = new Zinp();
|
||||
zinp2.setId("22");
|
||||
zinp2.setName("测试2");
|
||||
list.add(zinp);
|
||||
list.add(zinp2);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
//分页查询项目清单
|
||||
@GetMapping
|
||||
public R get(String name) {
|
||||
Sqler sqler = new Sqler("sa_proj_main");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.addre,t.notes");
|
||||
System.out.println(new Date());
|
||||
sqler.addSelect("t.addre,t.notes,t.senum");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
}
|
||||
|
||||
@@ -46,6 +28,8 @@ public class SaProjMainApi {
|
||||
@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.findAllByProjid(id);
|
||||
main.setGroups(groups);
|
||||
return R.ok(main);
|
||||
@@ -54,13 +38,14 @@ public class SaProjMainApi {
|
||||
//新增项目
|
||||
@PostMapping
|
||||
public R post(@RequestBody SaProjMain main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
main.setSenum(numService.getNum("PROJ"));
|
||||
return R.ok(service.insertx(main));
|
||||
}
|
||||
|
||||
//修改项目
|
||||
@PutMapping
|
||||
public R put(@RequestBody SaProjMain main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
//删除项目
|
||||
@@ -69,6 +54,17 @@ public class SaProjMainApi {
|
||||
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;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.proj.main;
|
||||
package vboot.extend.module.sa.proj.main;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
+11
-3
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.sa.proj.main;
|
||||
package vboot.extend.module.sa.proj.main;
|
||||
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -10,8 +10,17 @@ import javax.annotation.PostConstruct;
|
||||
@Service
|
||||
public class SaProjMainService extends BaseMainService<SaProjMain> {
|
||||
|
||||
public String insertx(SaProjMain main){
|
||||
|
||||
return super.insert(main);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//----------bean注入------------
|
||||
@Autowired
|
||||
private SaProjMainRepo repo;
|
||||
|
||||
@@ -20,6 +29,5 @@ public class SaProjMainService extends BaseMainService<SaProjMain> {
|
||||
super.setRepo(repo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.te.allot.check;
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.te.allot.check;
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import vboot.core.common.api.R;
|
||||
import vboot.core.common.dao.Sqler;
|
||||
@@ -30,12 +30,12 @@ public class TeAllotCheckApi {
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody TeAllotCheck main) {
|
||||
return R.ok(service.insert(main).getId());
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody TeAllotCheck main) {
|
||||
return R.ok(service.update(main).getId());
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.te.allot.check;
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.te.allot.check;
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.te.allot.check;
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import vboot.core.common.dao.Sqler;
|
||||
import vboot.core.common.service.BaseMainService;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.te.allot.check;
|
||||
package vboot.extend.module.te.allot.check;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vboot.app.module.te.allot.drive;
|
||||
package vboot.extend.module.te.allot.drive;
|
||||
|
||||
import vboot.core.common.entity.BaseMainEntity;
|
||||
import lombok.Getter;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user