脚手架v6
This commit is contained in:
parent
474222c9a0
commit
99dc9c02ef
|
|
@ -31,7 +31,7 @@ configure(allprojects) { project ->
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
apply plugin:'war'
|
// apply plugin:'war'
|
||||||
from sourceSets.main.allJava
|
from sourceSets.main.allJava
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'weaver-ecode-seconddev-id': rootProject.group + '-' + rootProject.name,
|
attributes 'weaver-ecode-seconddev-id': rootProject.group + '-' + rootProject.name,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.weaver.seconddev.qt.config;
|
package com.weaver.seconddev.qt.browser;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
@ -108,7 +108,7 @@ public class OrderTypeBrowser extends AbstractWeaBrowserBaseService {
|
||||||
Map<String, Object> browserData = getBrowserData(params);
|
Map<String, Object> browserData = getBrowserData(params);
|
||||||
if (MapUtils.isNotEmpty(browserData)) {
|
if (MapUtils.isNotEmpty(browserData)) {
|
||||||
List<Object> list = (List<Object>) browserData.get(WeaBrowserConstant.BROWSER_RESULT_DATA);
|
List<Object> list = (List<Object>) browserData.get(WeaBrowserConstant.BROWSER_RESULT_DATA);
|
||||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
BrowserEntity browserEntity = new BrowserEntity();
|
BrowserEntity browserEntity = new BrowserEntity();
|
||||||
Map<String, Object> userMap = (Map<String, Object>) list.get(i);
|
Map<String, Object> userMap = (Map<String, Object>) list.get(i);
|
||||||
|
|
@ -15,4 +15,10 @@ public class Constant {
|
||||||
*/
|
*/
|
||||||
public static final String MODULE = "qt";
|
public static final String MODULE = "qt";
|
||||||
|
|
||||||
|
/**
|
||||||
|
*租户
|
||||||
|
*/
|
||||||
|
public static final String TENANT_KEY = "tma3ktp1q7";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,7 @@ public class DemoFormDTO {
|
||||||
labelId = 0,
|
labelId = 0,
|
||||||
items = {
|
items = {
|
||||||
@FormItem(itemType = WeaFormItemType.INPUT, required = true)
|
@FormItem(itemType = WeaFormItemType.INPUT, required = true)
|
||||||
},
|
}
|
||||||
group = "baseInfo",
|
|
||||||
layout = "one",
|
|
||||||
labelSpan = 10
|
|
||||||
)
|
)
|
||||||
private String bt;
|
private String bt;
|
||||||
|
|
||||||
|
|
@ -46,8 +43,7 @@ public class DemoFormDTO {
|
||||||
label = "发起人",
|
label = "发起人",
|
||||||
labelId = 0,
|
labelId = 0,
|
||||||
items = {
|
items = {
|
||||||
@FormItem(itemType = WeaFormItemType.BROWSER, browserModule = Constant.MODULE,
|
@FormItem(itemType = WeaFormItemType.BROWSER, browserType = "resource", required = true)
|
||||||
browserType = "resource", required = true)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
private BaseDTO fqr;
|
private BaseDTO fqr;
|
||||||
|
|
@ -56,8 +52,7 @@ public class DemoFormDTO {
|
||||||
label = "部门",
|
label = "部门",
|
||||||
labelId = 0,
|
labelId = 0,
|
||||||
items = {
|
items = {
|
||||||
@FormItem(itemType = WeaFormItemType.BROWSER, browserModule = Constant.MODULE,
|
@FormItem(itemType = WeaFormItemType.BROWSER, browserType = "department", required = true)
|
||||||
browserType = "department", required = true)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
private BaseDTO bm;
|
private BaseDTO bm;
|
||||||
|
|
@ -73,16 +68,6 @@ public class DemoFormDTO {
|
||||||
private String gdlx;
|
private String gdlx;
|
||||||
|
|
||||||
|
|
||||||
@Form(
|
|
||||||
label = "EB浏览框",
|
|
||||||
labelId = 0,
|
|
||||||
items = {
|
|
||||||
@FormItem(itemType = WeaFormItemType.BROWSER, browserModule = Constant.MODULE,
|
|
||||||
browserType = "performance_grade_detail", required = true)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
private String ebllk;
|
|
||||||
|
|
||||||
@Form(
|
@Form(
|
||||||
label = "创建日期",
|
label = "创建日期",
|
||||||
labelId = 0,
|
labelId = 0,
|
||||||
|
|
@ -98,7 +83,7 @@ public class DemoFormDTO {
|
||||||
label = "文档",
|
label = "文档",
|
||||||
labelId = 0,
|
labelId = 0,
|
||||||
items = {
|
items = {
|
||||||
@FormItem(itemType = WeaFormItemType.UPLOAD, browserModule = Constant.MODULE)
|
@FormItem(itemType = WeaFormItemType.UPLOAD)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
private String wd;
|
private String wd;
|
||||||
|
|
|
||||||
|
|
@ -70,25 +70,6 @@ public class DemoQueryParam {
|
||||||
@ApiModelProperty("身份证号码")
|
@ApiModelProperty("身份证号码")
|
||||||
private String idNo;
|
private String idNo;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否允许查询身份证号码
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
private boolean isSearchIdNo;
|
|
||||||
|
|
||||||
@ApiModelProperty("入职日期")
|
|
||||||
private List<LocalDate> hiredate;
|
|
||||||
|
|
||||||
@ApiModelProperty("手机号")
|
|
||||||
private String mobile;
|
|
||||||
|
|
||||||
@ApiModelProperty("导入校验字段 1.工号 2.身份证号码")
|
|
||||||
private Integer importCheckType;
|
|
||||||
|
|
||||||
@ApiModelProperty("excel密码")
|
|
||||||
private String sharePassword;
|
|
||||||
|
|
||||||
@ApiModelProperty("自定义列")
|
|
||||||
private List<String> customColumns;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
package com.weaver.seconddev.qt.mapper;
|
package com.weaver.seconddev.qt.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.weaver.seconddev.qt.entity.dto.DemoFormDTO;
|
||||||
import com.weaver.seconddev.qt.entity.po.DemoPO;
|
import com.weaver.seconddev.qt.entity.po.DemoPO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DemoMapper extends BaseMapper<DemoPO> {
|
public interface DemoMapper extends BaseMapper<DemoPO> {
|
||||||
|
DemoFormDTO getDemoListDTO(@Param("id") Long id, @Param("tenantKey") String tenantKey);
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,6 @@ import com.weaver.ebuilder.datasource.api.entity.ExecuteSqlEntity;
|
||||||
import com.weaver.ebuilder.datasource.api.enums.SourceType;
|
import com.weaver.ebuilder.datasource.api.enums.SourceType;
|
||||||
import com.weaver.ebuilder.datasource.api.service.DataSetService;
|
import com.weaver.ebuilder.datasource.api.service.DataSetService;
|
||||||
import com.weaver.framework.spring.annotation.AopClass;
|
import com.weaver.framework.spring.annotation.AopClass;
|
||||||
import com.weaver.seconddev.qt.common.BaseDTO;
|
|
||||||
import com.weaver.seconddev.qt.common.SqlResponse;
|
import com.weaver.seconddev.qt.common.SqlResponse;
|
||||||
import com.weaver.seconddev.qt.entity.dto.DemoFormDTO;
|
import com.weaver.seconddev.qt.entity.dto.DemoFormDTO;
|
||||||
import com.weaver.seconddev.qt.entity.dto.DemoListDTO;
|
import com.weaver.seconddev.qt.entity.dto.DemoListDTO;
|
||||||
|
|
@ -19,10 +18,12 @@ import com.weaver.seconddev.qt.entity.param.DemoQueryParam;
|
||||||
import com.weaver.seconddev.qt.entity.param.OrderTypeQueryParam;
|
import com.weaver.seconddev.qt.entity.param.OrderTypeQueryParam;
|
||||||
import com.weaver.seconddev.qt.enums.SQLStatusEnum;
|
import com.weaver.seconddev.qt.enums.SQLStatusEnum;
|
||||||
import com.weaver.seconddev.qt.exception.SqlRunTimeException;
|
import com.weaver.seconddev.qt.exception.SqlRunTimeException;
|
||||||
|
import com.weaver.seconddev.qt.mapper.DemoMapper;
|
||||||
import com.weaver.seconddev.qt.service.PageDemoService;
|
import com.weaver.seconddev.qt.service.PageDemoService;
|
||||||
import com.weaver.seconddev.qt.util.EntityUtil;
|
import com.weaver.seconddev.qt.util.EntityUtil;
|
||||||
import com.weaver.seconddev.qt.util.FormatUtil;
|
import com.weaver.seconddev.qt.util.FormatUtil;
|
||||||
import com.weaver.seconddev.qt.util.PageUtil;
|
import com.weaver.seconddev.qt.util.PageUtil;
|
||||||
|
import com.weaver.teams.security.context.TenantContext;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -36,6 +37,9 @@ public class PageDemoServiceImpl implements PageDemoService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DataSetService dataSetService;
|
private DataSetService dataSetService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DemoMapper demoMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaSearchCondition getSearchCondition() {
|
public WeaSearchCondition getSearchCondition() {
|
||||||
|
|
@ -47,7 +51,7 @@ public class PageDemoServiceImpl implements PageDemoService {
|
||||||
@Override
|
@Override
|
||||||
public WeaTable<DemoListDTO> list(DemoQueryParam queryParam) {
|
public WeaTable<DemoListDTO> list(DemoQueryParam queryParam) {
|
||||||
|
|
||||||
String sql = "select t.id,t.bt,cjrq,fqr,bm,wtms,wd,ebllk,e.username,d.shortname as bmName from uf_gdjcxx t " +
|
String sql = "select t.id,t.bt,cjrq,fqr,bm,wtms,wd,ebllk,e.username,d.name as bmName from uf_gdjcxx t " +
|
||||||
"LEFT JOIN eteams.EMPLOYEE e ON e.id = t.fqr " +
|
"LEFT JOIN eteams.EMPLOYEE e ON e.id = t.fqr " +
|
||||||
"LEFT JOIN eteams.DEPARTMENT d ON d.id = e.department " +
|
"LEFT JOIN eteams.DEPARTMENT d ON d.id = e.department " +
|
||||||
"where t.TENANT_KEY = 'tma3ktp1q7' ";
|
"where t.TENANT_KEY = 'tma3ktp1q7' ";
|
||||||
|
|
@ -94,32 +98,7 @@ public class PageDemoServiceImpl implements PageDemoService {
|
||||||
public WeaForm getForm(Long id) {
|
public WeaForm getForm(Long id) {
|
||||||
DemoFormDTO dataFormDTO = new DemoFormDTO();
|
DemoFormDTO dataFormDTO = new DemoFormDTO();
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
String sql = "select t.id,t.bt,cjrq,fqr,bm,wtms,wd,ebllk,e.username,d.shortname as bmName from uf_gdjcxx t " +
|
dataFormDTO = demoMapper.getDemoListDTO(id, TenantContext.getCurrentTenantKey());
|
||||||
"LEFT JOIN eteams.EMPLOYEE e ON e.id = t.fqr " +
|
|
||||||
"LEFT JOIN eteams.DEPARTMENT d ON d.id = e.department " +
|
|
||||||
"where t.TENANT_KEY = 'tma3ktp1q7' and t.id= " + id;
|
|
||||||
ExecuteSqlEntity executeSqlEntity = new ExecuteSqlEntity();
|
|
||||||
executeSqlEntity.setSql(Base64.encode(sql));
|
|
||||||
executeSqlEntity.setGroupId("weaver-ebuilder-app-service");
|
|
||||||
executeSqlEntity.setSourceType(SourceType.LOGIC);
|
|
||||||
|
|
||||||
Map<String, Object> map = dataSetService.executeSql(executeSqlEntity);
|
|
||||||
SqlResponse<DemoListDTO> sqlResponse = EntityUtil.map2Entity(map, DemoListDTO.class);
|
|
||||||
if (SQLStatusEnum.FAIL.getValue().equals(sqlResponse.getStatus())) {
|
|
||||||
throw new SqlRunTimeException(sqlResponse.getMessage());
|
|
||||||
}
|
|
||||||
List<DemoListDTO> list = sqlResponse.getRecords();
|
|
||||||
DemoListDTO demoListDTO = list.get(0);
|
|
||||||
dataFormDTO.setBm(new BaseDTO(demoListDTO.getBm(), demoListDTO.getBmName()));
|
|
||||||
dataFormDTO.setBt(demoListDTO.getBt());
|
|
||||||
dataFormDTO.setCjrq(demoListDTO.getCjrq());
|
|
||||||
dataFormDTO.setFqr(new BaseDTO(demoListDTO.getFqr(), demoListDTO.getUsername()));
|
|
||||||
dataFormDTO.setGdlx(demoListDTO.getGdlx());
|
|
||||||
dataFormDTO.setWd(demoListDTO.getWd());
|
|
||||||
dataFormDTO.setWtms(demoListDTO.getWtms());
|
|
||||||
dataFormDTO.setId(demoListDTO.getId());
|
|
||||||
dataFormDTO.setLc(demoListDTO.getLc());
|
|
||||||
dataFormDTO.setEbllk(demoListDTO.getLc());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WeaForm weaForm = FormatUtil.<DemoFormDTO>getInstance().buildForm(DemoFormDTO.class, dataFormDTO);
|
WeaForm weaForm = FormatUtil.<DemoFormDTO>getInstance().buildForm(DemoFormDTO.class, dataFormDTO);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.weaver.seconddev.qt.mapper.DemoMapper">
|
||||||
|
|
||||||
|
<resultMap id="baseMap" type="com.weaver.seconddev.qt.entity.dto.DemoFormDTO">
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<id column="bt" property="bt"/>
|
||||||
|
<id column="gdlx" property="gdlx"/>
|
||||||
|
<id column="cjrq" property="cjrq"/>
|
||||||
|
<id column="lc" property="lc"/>
|
||||||
|
<id column="wtms" property="wtms"/>
|
||||||
|
<id column="wd" property="wd"/>
|
||||||
|
<id column="lc" property="lc"/>
|
||||||
|
<association property="fqr" javaType="com.weaver.seconddev.qt.common.BaseDTO">
|
||||||
|
<id column="cjrq" property="id"/>
|
||||||
|
<id column="username" property="name"/>
|
||||||
|
</association>
|
||||||
|
<association property="bm" javaType="com.weaver.seconddev.qt.common.BaseDTO">
|
||||||
|
<id column="bm" property="id"/>
|
||||||
|
<id column="name" property="name"/>
|
||||||
|
</association>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="BaseColumn">
|
||||||
|
t.id,t.bt,t.cjrq,t.fqr,t.bm,t.wtms,t.wd,t.ebllk,e.username,d.name
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getDemoListDTO" resultMap="baseMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="BaseColumn"/>
|
||||||
|
FROM
|
||||||
|
uf_gdjcxx t
|
||||||
|
LEFT JOIN {$publicdb}.EMPLOYEE e ON e.id = t.fqr
|
||||||
|
LEFT JOIN {$publicdb}.DEPARTMENT d ON d.id = e.department
|
||||||
|
WHERE t.delete_type = 0
|
||||||
|
and t.tenant_key = #{tenantKey}
|
||||||
|
and t.id=#{id}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue