dev
youhong.ai 2023-07-06 11:11:00 +08:00
parent 301d7f4863
commit 4a31a9cb92
8 changed files with 103 additions and 13 deletions

View File

@ -916,8 +916,15 @@ $(() => {
$(() => { $(() => {
let config = { let config = {
conditions: {}, // 条件
tableName: "", conditions: {
lx: '',
bxxx: ''
},
// 表名
tableName: "uf_hgpxtz",
// 文档字段
docIdField: 'clwd'
} }
function pxlx() { function pxlx() {
@ -925,12 +932,70 @@ $(() => {
if (datas && datas.length >= 1) { if (datas && datas.length >= 1) {
let obj = datas[0]; let obj = datas[0];
let value = obj.lx let value = obj.lx
console.log(obj) Object.keys(config.conditions).forEach(key => {
config.conditions[key] = obj[key]
})
api({
url: "/api/aiyh/exam-btn/control/is-read",
type: "POST",
data: JSON.stringify(config),
contentType: "application/json"
}).then(res => {
if (res && res.code == 200) {
if (res.data) {
let url = "/spa/workflow/index_form.jsp#/main/workflow/req?iscreate=1&workflowid=306&field24498=" + value; let url = "/spa/workflow/index_form.jsp#/main/workflow/req?iscreate=1&workflowid=306&field24498=" + value;
window.open(url); window.open(url);
} else {
ModeList.showMessage("需要查看所有考试相关文档后方可考试,请先查看考试材料!", 1, 2);
} }
} else {
ModeList.showMessage("系统错误,请稍后尝试!", 2, 1.5);
} }
}) })
}
}
window.pxlx = pxlx
/**
* @author youhong.ai
* @desc 发起请求
*/
function api(requestOptions = {
url: "",
type: "GET",
data: "",
isAsync: true,
success: () => {
},
error: () => {
},
complete: () => {
},
contentType: 'application/json',
beforeSend: () => {
}
}) {
let options = Object.assign({
url: "",
type: "GET",
data: "",
isAsync: true,
success: () => {
},
error: () => {
},
complete: () => {
},
contentType: 'application/json',
beforeSend: () => {
}
}, requestOptions)
return $.ajax(options)
}
})
/* ******************* youhong.ai 限制考试按钮点击 end ******************* */ /* ******************* youhong.ai 限制考试按钮点击 end ******************* */

View File

@ -128,7 +128,6 @@ public class MapperBuilderSql {
} }
sb.append(entry.getKey()).append("}").append(" and "); sb.append(entry.getKey()).append("}").append(" and ");
} }
sb.deleteCharAt(sb.length() - 5); return sb.substring(0, sb.length() - 5);
return sb.toString();
} }
} }

View File

@ -159,9 +159,16 @@ public class RsThreadLocalManager {
public boolean commit(String className) { public boolean commit(String className) {
RecordSetTrans recordSetTrans = getRecordSetTrans(className); RecordSetTrans recordSetTrans = getRecordSetTrans(className);
removeRsOrTrans();
setRecordSetTrans(className);
return recordSetTrans.commit(); return recordSetTrans.commit();
} }
public void removeRsOrTrans() {
rsMap.remove(Thread.currentThread().getId());
}
private RecordSetTrans getRecordSetTrans(String className) { private RecordSetTrans getRecordSetTrans(String className) {
Map<String, RsThreadLocalMap> map = rsMap.get(Thread.currentThread().getId()); Map<String, RsThreadLocalMap> map = rsMap.get(Thread.currentThread().getId());
if (Objects.isNull(map)) { if (Objects.isNull(map)) {
@ -179,6 +186,8 @@ public class RsThreadLocalManager {
public boolean rollback(String className) { public boolean rollback(String className) {
RecordSetTrans recordSetTrans = getRecordSetTrans(className); RecordSetTrans recordSetTrans = getRecordSetTrans(className);
removeRsOrTrans();
setRecordSetTrans(className);
return recordSetTrans.rollback(); return recordSetTrans.rollback();
} }

View File

@ -10,7 +10,10 @@ import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*; import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context; import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.Map; import java.util.Map;
@ -32,6 +35,7 @@ public class ExamBtnControlController {
@Path("/is-read") @Path("/is-read")
@POST @POST
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String isReadDoc(@Context HttpServletRequest request, @Context HttpServletResponse response, public String isReadDoc(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody Map<String, Object> params) { @RequestBody Map<String, Object> params) {
try { try {

View File

@ -5,6 +5,7 @@ import aiyh.utils.annotation.recordset.Select;
import aiyh.utils.annotation.recordset.SqlMapper; import aiyh.utils.annotation.recordset.SqlMapper;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <h1></h1> * <h1></h1>
@ -28,7 +29,8 @@ public interface ExamBtnControlMapper {
@Select("select $t{docIdField} from $t{tableName} $t{whereSql}") @Select("select $t{docIdField} from $t{tableName} $t{whereSql}")
List<String> selectDocIds(@ParamMapper("tableName") String tableName, List<String> selectDocIds(@ParamMapper("tableName") String tableName,
@ParamMapper("docIdField") String docIdField, @ParamMapper("docIdField") String docIdField,
@ParamMapper("whereSql") String whereSql); @ParamMapper("whereSql") String whereSql,
@ParamMapper("where") Map<String, Object> conditions);
/** /**
* <h2></h2> * <h2></h2>

View File

@ -43,12 +43,12 @@ public class ExamBtnControlService {
if (CollectionUtil.isEmpty(conditions)) { if (CollectionUtil.isEmpty(conditions)) {
return false; return false;
} }
String where = MapperBuilderSql.builderNoWhereAndEn(conditions, true); String where = MapperBuilderSql.builderWhereAnd(conditions, "where", true);
if (StrUtil.isBlank(where)) { if (StrUtil.isBlank(where)) {
log.error("没有生成where条件"); log.error("没有生成where条件");
return false; return false;
} }
List<String> docIdList = mapper.selectDocIds(tableName, docIdField, where); List<String> docIdList = mapper.selectDocIds(tableName, docIdField, where, conditions);
if (CollectionUtil.isEmpty(docIdList)) { if (CollectionUtil.isEmpty(docIdList)) {
throw new CustomerException("没有查询到对应的文件ID信息请检查sql"); throw new CustomerException("没有查询到对应的文件ID信息请检查sql");
} }

View File

@ -69,6 +69,7 @@ public class BuilderPackageEcology extends Application {
clearSelections(); clearSelections();
updateTreeView(); updateTreeView();
showSuccessAlert("升级包制作成功!"); showSuccessAlert("升级包制作成功!");
System.out.println("压缩包位置: " + outputFile.getPath());
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@ -2,6 +2,7 @@ package youhong.ai.pcn;
import aiyh.utils.GenerateFileUtil; import aiyh.utils.GenerateFileUtil;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.recordset.MapperBuilderSql;
import aiyh.utils.tool.org.apache.commons.jexl3.*; import aiyh.utils.tool.org.apache.commons.jexl3.*;
import basetest.BaseTest; import basetest.BaseTest;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@ -308,4 +309,13 @@ public class UtilTest extends BaseTest {
public void testSS() { public void testSS() {
out.println(Util.getTime("yyyyMMddHHmmssSSSS")); out.println(Util.getTime("yyyyMMddHHmmssSSSS"));
} }
@Test
public void testssfss() {
Map<String, Object> map = new HashMap<>();
map.put("lx", "2");
map.put("dxxx", "2");
out.println(MapperBuilderSql.builderWhereAnd(map, "where", true));
}
} }