jingwei
ic_excellent 2023-05-06 15:15:28 +08:00
parent e3a1a7060e
commit a5f477ad9d
35 changed files with 934 additions and 1450 deletions

View File

@ -6,6 +6,7 @@ import com.api.bokang.xiao.zscq.service.ReserveService;
import com.api.bokang.xiao.zscq.service.impl.ReserveServiceImpl;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.log4j.Logger;
import weaver.bokang.xiao.zscq.store.TableNameStore;
import weaver.file.ImageFileManager;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
@ -17,7 +18,9 @@ import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -48,77 +51,68 @@ public class ReserveSelectController {
@Produces(MediaType.APPLICATION_JSON)
public String reserveSelect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String,Object> param) {
try{
log.info("====== into getReportData success =======");
log.info("====== into reserveSelect success =======");
log.info("param:"+param);
User loginUser = HrmUserVarify.getUser(request, response);
List<Map<String, Object>> result = reserveService.reserveSelect(param);
List<Map<String, Object>> result = reserveService.reserveTrigger(param);
return ApiResult.success(result);
}catch (Exception e){
log.error("获取搜索组件信息 ==> "+ Util.getErrString(e));
log.error("反选执行出现异常 reserveSelect execute error ==> "+ Util.getErrString(e));
return ApiResult.error(e.getMessage());
}
}
//@GET
//@Path("/batch")
//@Produces(MediaType.APPLICATION_OCTET_STREAM)
//public void downloadFiles(@QueryParam("ids") String ids, @Context HttpServletResponse response) {
// try {
// log.info("Start downloading files: {}"+ids);
// // 解析文件ID列表
// List<Long> idList = Arrays.stream(ids.split(","))
// .map(Long::parseLong)
// .collect(Collectors.toList());
//
// // 生成压缩文件名
// String zipFileName = "attachments.zip";
//
// // 设置响应头,告诉浏览器该响应体是一个附件,浏览器会自动下载该响应体
// response.setContentType(MediaType.APPLICATION_OCTET_STREAM);
// response.setHeader("Content-Disposition", "attachment; filename=\"" + zipFileName + "\"");
//
// // 创建压缩输出流
// try (ZipOutputStream zipOutputStream = new ZipOutputStream(response.getOutputStream())) {
//
// // 遍历文件ID列表将对应的文件加入到压缩文件中
// for (Long id : idList) {
// // 通过ID获取文件信息
// WeaverFile file = WeaverFileUtil.getFileMsgById(id);
//
// // 获取文件名和后缀名
// String fileName = file.getName();
// String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
//
// // 创建一个ZipEntry表示压缩文件中的一个文件
// ZipEntry zipEntry = new ZipEntry(fileName);
// zipEntry.setSize(file.getSize());
// zipEntry.setTime(System.currentTimeMillis());
//
// // 将ZipEntry添加到压缩输出流中
// zipOutputStream.putNextEntry(zipEntry);
//
// // 将文件内容写入到压缩输出流中
// byte[] buffer = new byte[BUFFER_SIZE];
// int len;
// try (InputStream inputStream = file.getInputStream()) {
// while ((len = inputStream.read(buffer)) > 0) {
// zipOutputStream.write(buffer, 0, len);
// }
// }
// zipOutputStream.closeEntry();
// }
//
// // 刷新压缩输出流
// zipOutputStream.flush();
// }
// log.info("Finish downloading files: {}"+ids);
// } catch (Exception e) {
// log.error("下载附件异常: {}"+Util.getErrString(e));
// // 如果出现异常,返回一个空的响应体
// response.reset();
// response.setContentType(MediaType.APPLICATION_OCTET_STREAM);
// response.setContentLength(0);
// }
//}
@GET
@Path("/batchDownload")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response downloadBatchFiles(@QueryParam("datePicker") String datePicker,
@QueryParam("checkResult") String checkResult,
@QueryParam("checkResultShow") String checkResultShow) {
log.info("====== into downloadBatchFiles success =======");
log.info(String.format("====== datePicker:[%s] checkResult:[%s] checkResultShow:[%s] =======",datePicker,checkResult,checkResultShow));
Map<String,Object> param = new HashMap<>(8);
param.put("datePicker",datePicker);
param.put("checkResult",checkResult);
param.put("checkResultShow",checkResultShow);
String zipFileName = reserveService.getFileName(param) + ".zip";
StreamingOutput streamingOutput = outputStream -> {
try {
reserveService.batchDownload(param, outputStream);
} catch (Exception e) {
log.error("下载文件异常 download zip error ==>"+Util.getErrString(e));
}
};
log.info("zip file name ==>"+zipFileName);
return Response.ok(streamingOutput, MediaType.APPLICATION_OCTET_STREAM)
.header("Content-Disposition", "attachment; filename=\"" + zipFileName + "\"")
.build();
}
@GET
@Path("/refreshStore")
public String refreshStore(@Context HttpServletRequest request, @Context HttpServletResponse response){
try{
log.info("====== into refreshStore success =======");
TableNameStore.getInstance().refresh();
return ApiResult.successNoData();
}catch (Exception e){
log.error("refreshStore execute error ==> "+ Util.getErrString(e));
return ApiResult.error(e.getMessage());
}
}
@GET
@Path("/doRepossessedSign")
public String doRepossessedSign(@QueryParam("requestId") String requestId){
try{
log.info("====== into doRepossessedSign success =======");
log.info("requestId =>"+requestId);
new ReserveServiceImpl().doRepossessedSign(Util.getIntValue(requestId),new User(1));
return ApiResult.successNoData();
}catch (Exception e){
log.error("refreshStore execute error ==> "+ Util.getErrString(e));
return ApiResult.error(e.getMessage());
}
}
}

View File

@ -1,8 +1,28 @@
package com.api.bokang.xiao.zscq.entity;/**
package com.api.bokang.xiao.zscq.entity;
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
import lombok.Data;
/**
* @ClassName SendFileEntity
* @Author
* @Date 2023/4/23 10:10
* @Description <h1></h1>
**/
@Data
public class SendFileEntity {
@SqlOracleDbFieldAnn(value = "ID")
private Integer id;
@SqlOracleDbFieldAnn(value = "DEPART_ID")
private Integer departId;
@SqlOracleDbFieldAnn(value = "DEPART_NAME")
private String departName;
@SqlOracleDbFieldAnn(value = "SQH")
private String requestNumber;
private WeaverFile weaverFile;
}

View File

@ -1,8 +1,26 @@
package com.api.bokang.xiao.zscq.entity;/**
package com.api.bokang.xiao.zscq.entity;
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
import lombok.Data;
/**
* @ClassName WeaverFile
* @Author
* @Date 2023/4/23 10:09
* @Description <h1></h1>
**/
@Data
public class WeaverFile {
@SqlOracleDbFieldAnn(value = "IMAGEFILEID")
private Integer imageFileId;
@SqlOracleDbFieldAnn(value = "DOCID")
private Integer docId;
@SqlOracleDbFieldAnn(value = "FILESIZE")
private Integer fileSize;
@SqlOracleDbFieldAnn(value = "IMAGEFILENAME")
private String fileName;
}

View File

@ -1,8 +1,56 @@
package com.api.bokang.xiao.zscq.mapper;/**
package com.api.bokang.xiao.zscq.mapper;
import aiyh.utils.annotation.recordset.*;
import com.api.bokang.xiao.zscq.entity.SendFileEntity;
import com.api.bokang.xiao.zscq.entity.WeaverFile;
import java.util.List;
import java.util.Map;
/**
* @ClassName QueryMapper
* @Author
* @Date 2023/4/23 10:14
* @Description <h1></h1>
**/
@SqlMapper
public interface QueryMapper {
/**
* <h2></h2>
* @param param
* @return
*/
@Select("select gjj.id as id,depart.id as depart_id,depart.DEPARTMENTNAME as depart_name,xgfj,sqh " +
" from uf_gjjtb gjj " +
" inner join hrmdepartment depart on gjj.xfqj = depart.id " +
" where concat(',',concat(sjpcdxk,',')) like concat('%,',concat(#{datePicker},',%')) " +
" and hcqkdx = #{checkResult} and gjj.xgfj is not null ")
@Associations( @Association(property = "weaverFile",column = "xgfj",id = @Id(value = Integer.class,methodId = 1)))
List<SendFileEntity> queryDownloadList(Map<String,Object> param);
/**
* <h2></h2>
* @param docId docId
* @return
*/
@AssociationMethod(value = 1)
@Select("select dm.docid,dm.imagefileid,dm.imagefilename,file.filesize " +
" from docimagefile dm inner join imagefile file on dm.imagefileid = file.imagefileid" +
" where docid = #{docId}")
WeaverFile queryFile(@ParamMapper("id")Integer docId);
/**
* <h2></h2>
* @param tableName
* @param fieldName
* @return
*/
@Select("select selectvalue,selectname " +
" from workflow_selectitem se " +
" inner join workflow_billfield bf on se.fieldid = bf.id " +
" inner join workflow_bill bi on bf.billid = bi.id " +
" where tablename = #{tableName} and bf.fieldname = #{fieldName} ")
List<Map<String,Object>> querySelectItem(@ParamMapper("tableName") String tableName,@ParamMapper("fieldName") String fieldName);
}

View File

@ -19,7 +19,7 @@ public interface ReserveSelectMapper {
* @param requestId id
* @return
*/
@Select("select operator userId,operatortype userType from workflow_requestlog where requestid=#{requestId}" +
@Select("select operator userid,operatortype usertype from workflow_requestlog where requestid=#{requestId}" +
" and (logtype='2' or logtype='0' or logtype='3' or logtype='e') " +
" and exists(select 1 from workflow_currentoperator where requestid=workflow_requestlog.requestid and userid=workflow_requestlog.operator and usertype=workflow_requestlog.operatortype and isremark='2' and preisremark='0' and operatedate is not null and operatedate>' ') " +
" group by operator,operatortype order by max(logid) desc")
@ -30,7 +30,7 @@ public interface ReserveSelectMapper {
* @param requestId id
* @return
*/
@Select("select userid userId,usertype userType from workflow_currentoperator where requestid = #{requestId} and isremark = '2' and preisremark='0' and operatedate is not null and operatedate>' ' order by operatedate desc ,operatetime desc")
@Select("select userid,usertype from workflow_currentoperator where requestid = #{requestId} and isremark = '2' and preisremark='0' and operatedate is not null and operatedate>' ' order by operatedate desc ,operatetime desc")
Map<String,Integer> queryOperator(@ParamMapper("requestId")String requestId);
/**
@ -38,17 +38,26 @@ public interface ReserveSelectMapper {
* @param param
* @return
*/
@Select("select id, $t{applicationNoField}, $t{workflowInfoField}, $t{checkResultField} from $t{modeTableName} where $t{dateField} = #{datePicker}")
@Select("select id, $t{applicationNoField}, $t{workflowInfoField}, $t{checkResultField} from $t{modeTableName} where concat(',',concat($t{dateField},',')) like #{datePicker} and ($t{markField} <> 0 or $t{markField} is not null)")
@CaseConversion(value = false)
List<Map<String, Object>> queryModeList(Map<String, Object> param);
/**
* <h2></h2>
* @param param
* @return
*/
@Update("update $t{modeTableName} set $t{markField} = 1 " +
" where concat(',',concat($t{dateField},',')) like #{datePicker}")
boolean updateModeDataStatus(@ParamMapper("param") Map<String, Object> param);
/**
* <h2></h2>
* @param forceOverList id
* @param param
* @return
*/
@Update("update $t{param.modeTableName} set $t{param.checkResultField} = #{param.repossessedValue} " +
@Update("update $t{param.modeTableName} set $t{param.markField} = #{param.repossessedValue} " +
" where $t{param.workflowInfoField} in (${doRepossessedList})")
boolean updateRepossessed(@ParamMapper("doRepossessedList") List<String> forceOverList,
@ParamMapper("param") Map<String, Object> param);

View File

@ -3,6 +3,7 @@ package com.api.bokang.xiao.zscq.service;
import aiyh.utils.Util;
import org.apache.log4j.Logger;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
@ -22,4 +23,26 @@ public interface ReserveService {
* @return
*/
List<Map<String,Object>> reserveSelect(Map<String,Object> param);
/**
* <h2></h2>
* @param param
* @return
*/
List<Map<String,Object>> reserveTrigger(Map<String,Object> param);
/**
* <h2></h2>
* @param param
* @param outputStream
* @throws Exception
*/
void batchDownload(Map<String,Object> param, OutputStream outputStream) throws Exception;
/**
* <h2></h2>
* @param param
* @return
*/
String getFileName(Map<String,Object> param);
}

View File

@ -1,16 +1,27 @@
package com.api.bokang.xiao.zscq.service.impl;
import aiyh.utils.Util;
import com.alibaba.fastjson.JSON;
import com.api.bokang.xiao.zscq.entity.SendFileEntity;
import com.api.bokang.xiao.zscq.entity.WeaverFile;
import com.api.bokang.xiao.zscq.mapper.QueryMapper;
import com.api.bokang.xiao.zscq.mapper.ReserveSelectMapper;
import com.api.bokang.xiao.zscq.service.ReserveService;
import weaver.bokang.xiao.zscq.config.service.ModeChangeService;
import weaver.conn.RecordSet;
import weaver.file.ImageFileManager;
import weaver.hrm.User;
import weaver.workflow.workflow.RequestForceDrawBack;
import weaver.workflow.workflow.WfForceDrawBack;
import weaver.workflow.workflow.WfForceOver;
import weaver.workflow.workflow.WfFunctionManageUtil;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
@ -23,6 +34,8 @@ public class ReserveServiceImpl implements ReserveService {
private final ReserveSelectMapper reserveSelectMapper = Util.getMapper(ReserveSelectMapper.class);
private final QueryMapper queryMapper = Util.getMapper(QueryMapper.class);
private final WfForceOver wfForceOver = new WfForceOver();
private final WfFunctionManageUtil wfFunctionManageUtil = new WfFunctionManageUtil();
@ -30,6 +43,11 @@ public class ReserveServiceImpl implements ReserveService {
private final WfForceDrawBack wfForceDrawBack = new WfForceDrawBack();
private final RequestForceDrawBack requestForceDrawBack = new RequestForceDrawBack();
private final ModeChangeService modeChangeService = new ModeChangeService();
private static final int BUFFER_SIZE = 4096;
/**
* <h2></>
* @param requestIdList id
@ -51,15 +69,19 @@ public class ReserveServiceImpl implements ReserveService {
* @param user
* @return
*/
private boolean doRepossessedSign(int requestId,User user){
public boolean doRepossessedSign(int requestId,User user){
//查询最后一个操作者
Map<String, Integer> operateInfo = reserveSelectMapper.queryRequestMsg(String.valueOf(requestId));
log.info(" doRepossessedSign operateInfo ==>"+operateInfo);
if(Objects.isNull(operateInfo)){
operateInfo = reserveSelectMapper.queryOperator(String.valueOf(requestId));
}
int tempUser = operateInfo.get("userId");
int tempUserType = operateInfo.get("userType");
log.info(" doRepossessedSign operateInfo ==>"+operateInfo);
if(Objects.isNull(operateInfo)){
log.error(String.format("流程 requestId:[%s] 操作者 operateInfo no find 流程可能未归档 !!!",requestId));
return false;
}
int tempUser = operateInfo.get("userid");
int tempUserType = operateInfo.get("usertype");
boolean canForceDrawBack = false;
if(RequestForceDrawBack.isOldRequest(requestId) == RequestForceDrawBack.OLDDATA){
canForceDrawBack = wfForceDrawBack.isHavePurview(requestId, user.getUID(), Integer.parseInt(user.getLogintype()), tempUser, tempUserType);
@ -68,6 +90,7 @@ public class ReserveServiceImpl implements ReserveService {
}
if (canForceDrawBack && wfFunctionManageUtil.haveOtherOperationRight(requestId)) {
int result = requestForceDrawBack.foreceDrawBack(user, requestId, true, tempUser, tempUserType);
log.info(String.format("流程 requestId:[%s] 撤回结果 drawBack result:[%d] message:[%s]",requestId,result,requestForceDrawBack.getMessage()));
return requestForceDrawBack.isAddInOperateSuccess();
}else{
return false;
@ -97,9 +120,9 @@ public class ReserveServiceImpl implements ReserveService {
String checkResult = Util.null2String(modeInfo.get(checkResultField));
int requestId = Util.getIntValue(Util.null2String(modeInfo.get(workflowInfoField)));
if(checkResult.equals(checkResultValue)){
forceOverList.add(requestId+"");
}else {
doRepossessedList.add(requestId);
}else {
forceOverList.add(requestId+"");
}
}
log.info(String.format("doRepossessedList ==> %s forceOverList ==> %s",doRepossessedList,forceOverList));
@ -111,4 +134,91 @@ public class ReserveServiceImpl implements ReserveService {
}
return result;
}
@Override
public List<Map<String, Object>> reserveTrigger(Map<String, Object> param) {
List<Map<String, Object>> result = new ArrayList<>();
String applicationNoField = Util.null2String(param.get("applicationNoField"));
String workflowInfoField = Util.null2String(param.get("workflowInfoField"));
String formId = Util.null2String(param.get("formId"));
List<Map<String, Object>> modeList = reserveSelectMapper.queryModeList(param);
if(Objects.nonNull(modeList) && !modeList.isEmpty()){
for (Map<String, Object> modeMap : modeList) {
Map<String,Object> dealResult = new HashMap<>();
try{
modeChangeService.changeOtherMode(modeMap,formId,2);
dealResult.put(Util.null2String(modeMap.get(applicationNoField)),true);
}catch (Exception e){
log.error("执行异常 reserveTrigger error ==>"+modeMap);
dealResult.put(Util.null2String(modeMap.get(applicationNoField)),false);
}
result.add(dealResult);
}
reserveSelectMapper.updateModeDataStatus(param);
}
return result;
}
@Override
public void batchDownload(Map<String,Object> param, OutputStream outputStream) throws IOException {
List<SendFileEntity> sendList = queryMapper.queryDownloadList(param);
if(Objects.isNull(sendList) || sendList.isEmpty()){
log.info("附件列表为空 attachment empty !!!");
//throw new CustomerException("附件列表查询为空");
return;
}
log.info("查询到的附件信息 query fileList ==>"+ JSON.toJSONString(sendList));
// 1. 将 SendFileEntity 按照 departName 分组
Map<String, List<SendFileEntity>> sendMap = sendList.stream().collect(Collectors.groupingBy(SendFileEntity::getDepartName));
// 2. 创建 ZipOutputStream
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(outputStream));
// 3. 遍历 SendFileEntity
for (Map.Entry<String, List<SendFileEntity>> entry : sendMap.entrySet()) {
String departName = entry.getKey();
List<SendFileEntity> fileList = entry.getValue();
// 4. 创建目录
ZipEntry dirEntry = new ZipEntry(departName + File.separator);
zipOutputStream.putNextEntry(dirEntry);
// 5. 将附件信息合并成一个压缩包
for (SendFileEntity sendFileEntity : fileList) {
WeaverFile fileMsg = sendFileEntity.getWeaverFile();
int imageFileId = fileMsg.getImageFileId();
String fileName = fileMsg.getFileName();
String fileType = fileName.substring(fileName.lastIndexOf("."));
String tempFileName = sendFileEntity.getRequestNumber() + fileType;
InputStream inputStream = ImageFileManager.getInputStreamById(imageFileId);
// 6. 将单个附件写入 ZipOutputStream
ZipEntry fileEntry = new ZipEntry(departName + File.separator + tempFileName);
zipOutputStream.putNextEntry(fileEntry);
byte[] buffer = new byte[BUFFER_SIZE];
int bytesRead = -1;
while ((bytesRead = inputStream.read(buffer)) != -1) {
zipOutputStream.write(buffer, 0, bytesRead);
}
inputStream.close();
}
}
// 7. 关闭 ZipOutputStream
zipOutputStream.close();
}
@Override
public String getFileName(Map<String, Object> param) {
String fileName = "";
List<Map<String, Object>> selectItems = queryMapper.querySelectItem("uf_gjjtb", "sjpcdxk");
if(Objects.nonNull(selectItems) && !selectItems.isEmpty()){
Map<String, String> map = selectItems.stream().collect(Collectors
.toMap(
item -> Util.null2String(item.get("selectvalue")),
item -> Util.null2String(item.get("selectname"))
)
);
String datePicker = Util.null2String(param.get("datePicker"));
String checkResultShow = new String(Util.null2String(param.get("checkResultShow")).getBytes(), StandardCharsets.UTF_8);
String datePickerShow = Util.null2String(map.get(datePicker));
fileName = datePickerShow + checkResultShow;
}
return fileName;
}
}

View File

@ -103,6 +103,40 @@ public class DataCenterApi extends BaseBean {
String tbr = rs.getString("field048");
String sfty = rs.getString("field069");
/* update by bokang.xiao */
//现居住地址
String residentialAddress = rs.getString("field045");
//现居地址邮编
String residentialPostcode = rs.getString("field104");
//家庭住址
String familyAddress = rs.getString("field105");
//法定联系地址
String contactAddress = rs.getString("field106");
//法定联系地址邮编
String contactPostcode = rs.getString("field107");
//紧急联系人地址
String emergencyContactAddress = rs.getString("field108");
//一寸照片
String headPicture = rs.getString("field109");
//公积金账户及所在城市
String providentFundAccount = rs.getString("field110");
//开户行
String openingBank = rs.getString("field111");
//银行卡号
String bankCardNo = rs.getString("field112");
comMap.put("residentialAddress",residentialAddress);
comMap.put("residentialPostcode",residentialPostcode);
comMap.put("familyAddress",familyAddress);
comMap.put("contactAddress",contactAddress);
comMap.put("contactPostcode",contactPostcode);
comMap.put("emergencyContactAddress",emergencyContactAddress);
comMap.put("providentFundAccount",providentFundAccount);
comMap.put("openingBank",openingBank);
comMap.put("bankCardNo",bankCardNo);
comMap.put("headPicture",headPicture);
/* update by bokang.xiao */
comMap.put("ypgw",ypgw);
comMap.put("ypgw_xz",ypgw_xz);
comMap.put("djrq",djrq);

View File

@ -1,6 +1,5 @@
package com.api.nonstandardext.zenner.utils;
import com.api.nonstandardext.allist.utils.DefaultTmForAllist;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.httpclient.HttpClient;
@ -178,49 +177,6 @@ public class ZennerUtil {
return result;
}
public static String httpsGet(String baseUrl,String encoderNum) {
BufferedReader in = null;
BaseBean baseBean = new BaseBean();
try {
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
javax.net.ssl.TrustManager[] truset = new javax.net.ssl.TrustManager[1];
javax.net.ssl.TrustManager tm = new DefaultTmForAllist();
truset[0] = tm;
sslContext.init(null, truset, null);
SSLSocketFactory factory = sslContext.getSocketFactory();
URL u = new URL(baseUrl);
HttpsURLConnection huconn = (HttpsURLConnection) u.openConnection();
huconn.setSSLSocketFactory(factory);
huconn.setRequestProperty("Authorization","Basic " + encoderNum);
StringBuilder result = new StringBuilder();
huconn.connect();
// baseBean.writeLog("httpsGet execute baseUrl..1." + baseUrl);
in = new BufferedReader(new InputStreamReader(huconn.getInputStream(), "UTF-8"));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
}
if (in != null) {
in.close();
}
// baseBean.writeLog("httpsGet execute result..1." + result.toString());
// 打印返回结果
return result.toString();
} catch (Exception e) {
baseBean.writeLog("httpsGet execute exception...message:" + e.getMessage());
if (in != null) {
try {
in.close();
} catch (IOException ioException) {
ioException.printStackTrace();
baseBean.writeLog("关闭报错");
baseBean.writeLog(ioException.getMessage());
}
}
return "";
}
}
public static String httpGet(String baseUrl){
String url = baseUrl;
@ -244,38 +200,6 @@ public class ZennerUtil {
}
}
public static String httpsPost(String httpUrl, String content) throws Exception {
BufferedReader in = null;
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
javax.net.ssl.TrustManager [] truset = new javax.net.ssl.TrustManager[1];
javax.net.ssl.TrustManager tm = new DefaultTmForAllist();
truset[0] = tm;
sslContext.init(null,truset,null);
SSLSocketFactory factory = sslContext.getSocketFactory();
//https://blog.csdn.net/pk5454754/article/details/80092974?utm_medium=distribute.pc_relevant_download.none-task-blog-baidujs-1.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-baidujs-1.nonecase
URL u = new URL(httpUrl);
HttpsURLConnection conn = (HttpsURLConnection) u.openConnection();
conn.setDoOutput(true);
conn.addRequestProperty("connection", "Keep-Alive");
conn.setRequestMethod("POST");
conn.setSSLSocketFactory(factory);
StringBuilder result = new StringBuilder();
conn.connect();
DataOutputStream out = new DataOutputStream(conn.getOutputStream());
out.write(content.getBytes("utf-8"));
// 刷新、关闭
out.flush();
out.close();
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
}
if (in != null) {
in.close();
}
return result.toString();
}
public static String httpPostForXwwwForm(String httpUrl, Map<String, String> headParams, Map<String, String> paramsMap){
String result = "";
@ -312,7 +236,7 @@ public class ZennerUtil {
*/
public static int getQuarter() {
Calendar c = Calendar.getInstance();
int month = c.get(c.MONTH) + 1;
int month = c.get(Calendar.MONTH) + 1;
int quarter = 0;
if (month >= 1 && month <= 3) {
quarter = 1;

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.cloudstore.dev.api.util.TextUtil;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.biz.EncryptConfigBiz;
@ -12,6 +13,8 @@ import com.engine.common.entity.BizLogContext;
import com.engine.common.entity.EncryptFieldEntity;
import com.engine.common.enums.EncryptMould;
import com.engine.core.interceptor.CommandContext;
import org.apache.log4j.Logger;
import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper;
import weaver.conn.RecordSet;
import weaver.general.LabelUtil;
import weaver.general.Util;
@ -31,6 +34,10 @@ import weaver.workflow.field.BrowserComInfo;
public class GetFieldDefinedCmd extends AbstractCommonCommand<Map<String, Object>> {
private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class);
private final Logger log = aiyh.utils.Util.getLogger();
public GetFieldDefinedCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
@ -190,6 +197,14 @@ public class GetFieldDefinedCmd extends AbstractCommonCommand<Map<String, Object
recordInfo.put("required", isMand);
recordInfo.put("viewAttr", isUsed || issystem.equals("1") ? 1 : 2);
recordInfo.put("key", dsporder);
//分部或部门时查询对应是否可编辑字段 update by bokang.xiao
log.info(String.format("查询对应字段信息 ==> groupId:%s fieldId:%s",groupId,fieldid));
if(groupId == 6 || groupId == 7) {
recordInfo.put("isEdit", formFieldMapper.queryIsEdit(fieldid, groupId));
}
log.info("recordInfo ==>"+ JSON.toJSONString(recordInfo));
if (encryptEnable && ((fieldhtmltype.equals("1")||fieldhtmltype.equals("2")) && !issystem.equals("1")) ) {
//只支持单行文本,多行文本
String tablename = "hrmdepartmentdefined";

View File

@ -17,6 +17,8 @@ import com.engine.core.interceptor.CommandContext;
import com.engine.hrm.entity.FieldBean;
import com.engine.hrm.entity.FieldSelectOptionBean;
import com.engine.hrm.util.HrmUtil;
import org.apache.log4j.Logger;
import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper;
import weaver.conn.RecordSet;
import weaver.docs.docs.FieldParam;
import weaver.general.LabelUtil;
@ -38,6 +40,10 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand<Map<String, Objec
private SimpleBizLogger logger;
private final Logger log = aiyh.utils.Util.getLogger();
private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class);
public SaveFieldDefinedCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
@ -121,8 +127,14 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand<Map<String, Objec
for(int i=0; i<records.size();i++){
FieldBean fieldBean = (FieldBean) JSONObject.toJavaObject((JSONObject)records.get(i), FieldBean.class);
fieldBean.initFieldType("department");
//部门和分部添加自定义字段时多一个列属性 update by bokang.xiao
log.info("save department groupId ==>"+groupId);
if("6".equals(groupId) || "7".equals(groupId)){
this.save(fieldBean,groupId,records.getJSONObject(i));
}else {
this.save(fieldBean, groupId);
}
}
HrmFieldComInfo.removeFieldCache();
//同步部门数据到矩阵
@ -136,6 +148,83 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand<Map<String, Objec
return retmap;
}
/**
* <h2></h2>
* @author bokang.xiao
* @param fieldBean
* @param groupId id
* @param fieldJson JSON
*/
private void save(FieldBean fieldBean, String groupId,JSONObject fieldJson){
try {
HrmUtil hrmUtil = new HrmUtil();
HrmDeptFieldManagerE9 hfm = new HrmDeptFieldManagerE9(5);
String fieldId = Util.null2String(fieldBean.getId());
String fieldLabel = Util.null2String(fieldBean.getFieldlabel());
String fieldName = Util.null2String(fieldBean.getFieldname());
String fieldHtmlType = "";
String type = "";
String typeDetial = "";
String dmlUrl = "";
if(fieldBean.getFieldTypeBean()!=null){
fieldHtmlType = Util.null2String(fieldBean.getFieldTypeBean().getFieldHtmlType());
type = Util.null2String(fieldBean.getFieldTypeBean().getFieldType());
if(fieldHtmlType.equals("1")||fieldHtmlType.equals("2")){
typeDetial = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam());
}else if(fieldHtmlType.equals("66") || fieldHtmlType.equals("67")){
dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam());
} else if (type.equals("161") || type.equals("162") || type.equals("256")|| type.equals("257")) {
dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam());
}
}
String isUse = Util.null2String(fieldBean.getEnable(),"0");
String isMand = Util.null2String(fieldBean.getRequired(),"0");
String fieldOrder = Util.null2String(fieldBean.getKey());
int temId = Util.getIntValue(fieldId,-1);
//int lableid = hrmUtil.getFieldLabelId(fieldLabel);
int lableid = new LabelUtil().getLabelId(fieldLabel);
if(Util.null2String(fieldId).length()==0){
FieldParam fp = new FieldParam();
if(fieldHtmlType.equals("1")){
fp.setSimpleText(Util.getIntValue(type,-1),typeDetial);
}else if(fieldHtmlType.equals("2")){
fp.setText();
}else if(fieldHtmlType.equals("3")){
fp.setBrowser(Util.getIntValue(type,-1));
}else if(fieldHtmlType.equals("4")){
fp.setCheck();
}else if(fieldHtmlType.equals("5")){
fp.setSelect();
}else if(fieldHtmlType.equals("6")){
fp.setAttach();
}
temId = hfm.addField(fieldName, fp.getFielddbtype(), fieldHtmlType, type, ""+lableid, fieldOrder, isMand, isUse, groupId, dmlUrl);
//添加字段值isEdit
String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1");
formFieldMapper.updateHrmFormField(isEdit,temId+"",groupId);
}else{
//只允许更改显示属性,数据库层面的不允许修改
hfm.editField(fieldId, ""+lableid, fieldOrder, isMand, isUse, groupId);
//添加字段值isEdit
String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1");
formFieldMapper.updateHrmFormField(isEdit,fieldId,groupId);
}
if(fieldHtmlType.equals("5")){
List<FieldSelectOptionBean> lsSelectOption = fieldBean.getFieldTypeBean().getLsSelectOption();
hfm.checkSelectField(temId, lsSelectOption);
}
}catch (Exception e) {
writeLog(e);
}
}
private void save(FieldBean fieldBean, String groupId){
try {
HrmUtil hrmUtil = new HrmUtil();

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.company.DepartmentComInfo;
@ -24,6 +25,8 @@ import com.engine.hrm.util.HrmOrganizationUtil;
public class GetDepartmentFormFieldCmd extends AbstractCommonCommand<Map<String, Object>> {
private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class);
public GetDepartmentFormFieldCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
@ -84,6 +87,13 @@ public class GetDepartmentFormFieldCmd extends AbstractCommonCommand<Map<String,
groupitem.put("defaultshow", true);
for (int j = 0; lsField != null && j < lsField.size(); j++) {
String fieldid = (String) lsField.get(j);
//分部或部门时查询对应是否可编辑字段,若不可编辑则直接不展示此字段 update by bokang.xiao
String isEdit = formFieldMapper.queryIsEdit(fieldid, Util.getIntValue(groupid));
if("0".equals(isEdit) || "".equals(isEdit)){
continue;
}
String fieldname = HrmFieldComInfo.getFieldname(fieldid);
String isuse = HrmFieldComInfo.getIsused(fieldid);
if (!isuse.equals("1"))continue;

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.company.SubCompanyComInfo;
@ -22,6 +24,8 @@ import com.engine.hrm.util.HrmOrganizationUtil;
public class GetSubCompanyFormFieldCmd extends AbstractCommonCommand<Map<String, Object>> {
private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class);
public GetSubCompanyFormFieldCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
@ -74,7 +78,15 @@ public class GetSubCompanyFormFieldCmd extends AbstractCommonCommand<Map<String,
groupitem.put("hide", groupHide);
groupitem.put("defaultshow", true);
for (int j = 0; lsField != null && j < lsField.size(); j++) {
String fieldid = (String) lsField.get(j);
//分部或部门时查询对应是否可编辑字段,若不可编辑则直接不展示此字段 update by bokang.xiao
String isEdit = formFieldMapper.queryIsEdit(fieldid, Util.getIntValue(groupid));
if("0".equals(isEdit) || "".equals(isEdit)){
continue;
}
String fieldname = HrmFieldComInfo.getFieldname(fieldid);
String isuse = HrmFieldComInfo.getIsused(fieldid);
if (!isuse.equals("1"))continue;

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.cloudstore.dev.api.util.TextUtil;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.biz.EncryptConfigBiz;
@ -12,6 +13,8 @@ import com.engine.common.entity.BizLogContext;
import com.engine.common.entity.EncryptFieldEntity;
import com.engine.common.enums.EncryptMould;
import com.engine.core.interceptor.CommandContext;
import org.apache.log4j.Logger;
import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper;
import weaver.conn.RecordSet;
import weaver.general.LabelUtil;
import weaver.general.Util;
@ -31,6 +34,10 @@ import weaver.workflow.field.BrowserComInfo;
public class GetFieldDefinedCmd extends AbstractCommonCommand<Map<String, Object>> {
private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class);
private final Logger log = aiyh.utils.Util.getLogger();
public GetFieldDefinedCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
@ -191,6 +198,14 @@ public class GetFieldDefinedCmd extends AbstractCommonCommand<Map<String, Object
recordInfo.put("required", isMand);
recordInfo.put("viewAttr", isUsed || issystem.equals("1") ? 1 : 2);
recordInfo.put("key", dsporder);
//分部或部门时查询对应是否可编辑字段 update by bokang.xiao
log.info(String.format("查询对应字段信息 ==> groupId:%s fieldId:%s",groupId,fieldid));
if(groupId == 6 || groupId == 7) {
recordInfo.put("isEdit", formFieldMapper.queryIsEdit(fieldid, groupId));
}
log.info("recordInfo ==>"+ JSON.toJSONString(recordInfo));
if (encryptEnable && ((fieldhtmltype.equals("1")||fieldhtmltype.equals("2")) && !issystem.equals("1")) ) {
//只支持单行文本,多行文本
String tablename = "hrmsubcompanydefined";

View File

@ -17,6 +17,8 @@ import com.engine.core.interceptor.CommandContext;
import com.engine.hrm.entity.FieldBean;
import com.engine.hrm.entity.FieldSelectOptionBean;
import com.engine.hrm.util.HrmUtil;
import org.apache.log4j.Logger;
import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper;
import weaver.conn.RecordSet;
import weaver.docs.docs.FieldParam;
import weaver.general.LabelUtil;
@ -36,6 +38,10 @@ import weaver.systeminfo.SystemEnv;
*/
public class SaveFieldDefinedCmd extends AbstractCommonCommand<Map<String, Object>>{
private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class);
private final Logger log = aiyh.utils.Util.getLogger();
private SimpleBizLogger logger;
public SaveFieldDefinedCmd(Map<String, Object> params, User user) {
@ -120,8 +126,14 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand<Map<String, Objec
for(int i=0; i<records.size();i++){
FieldBean fieldBean = (FieldBean) JSONObject.toJavaObject((JSONObject)records.get(i), FieldBean.class);
fieldBean.initFieldType("subcompany");
//部门和分部添加自定义字段时多一个列属性 update by bokang.xiao
log.info("save subCompany groupId ==>"+groupId);
if("6".equals(groupId) || "7".equals(groupId)){
this.save(fieldBean,groupId,records.getJSONObject(i));
}else {
this.save(fieldBean, groupId);
}
}
HrmFieldComInfo.removeFieldCache();
//同步分部数据到矩阵
MatrixUtil.sysSubcompayData();
@ -134,6 +146,83 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand<Map<String, Objec
return retmap;
}
/**
* <h2></h2>
* @author bokang.xiao
* @param fieldBean
* @param groupId id
* @param fieldJson JSON
*/
private void save(FieldBean fieldBean, String groupId,JSONObject fieldJson){
try {
HrmUtil hrmUtil = new HrmUtil();
HrmDeptFieldManagerE9 hfm = new HrmDeptFieldManagerE9(4);
String fieldId = Util.null2String(fieldBean.getId());
String fieldLabel = Util.null2String(fieldBean.getFieldlabel());
String fieldName = Util.null2String(fieldBean.getFieldname());
String fieldHtmlType = "";
String type = "";
String typeDetial = "";
String dmlUrl = "";
if(fieldBean.getFieldTypeBean()!=null){
fieldHtmlType = Util.null2String(fieldBean.getFieldTypeBean().getFieldHtmlType());
type = Util.null2String(fieldBean.getFieldTypeBean().getFieldType());
if(fieldHtmlType.equals("1")||fieldHtmlType.equals("2")){
typeDetial = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam());
} else if(fieldHtmlType.equals("66") || fieldHtmlType.equals("67")){
dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam());
} else if (type.equals("161") || type.equals("162") || type.equals("256")|| type.equals("257")) {
dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam());
}
}
String isUse = Util.null2String(fieldBean.getEnable(),"0");
String isMand = Util.null2String(fieldBean.getRequired(),"0");
String fieldOrder = Util.null2String(fieldBean.getKey());
int temId = Util.getIntValue(fieldId,-1);
//int lableid = hrmUtil.getFieldLabelId(fieldLabel);
int lableid = new LabelUtil().getLabelId(fieldLabel);
if(Util.null2String(fieldId).length()==0){
FieldParam fp = new FieldParam();
if(fieldHtmlType.equals("1")){
fp.setSimpleText(Util.getIntValue(type,-1),typeDetial);
}else if(fieldHtmlType.equals("2")){
fp.setText();
}else if(fieldHtmlType.equals("3")){
fp.setBrowser(Util.getIntValue(type,-1));
}else if(fieldHtmlType.equals("4")){
fp.setCheck();
}else if(fieldHtmlType.equals("5")){
fp.setSelect();
}else if(fieldHtmlType.equals("6")){
fp.setAttach();
}
temId = hfm.addField(fieldName, fp.getFielddbtype(), fieldHtmlType, type, ""+lableid, fieldOrder, isMand, isUse, groupId, dmlUrl);
//添加字段值isEdit
String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1");
formFieldMapper.updateHrmFormField(isEdit,temId+"",groupId);
}else{
//只允许更改显示属性,数据库层面的不允许修改
hfm.editField(fieldId, ""+lableid, fieldOrder, isMand, isUse, groupId);
//添加字段值isEdit
String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1");
formFieldMapper.updateHrmFormField(isEdit,fieldId,groupId);
}
if(fieldHtmlType.equals("5")){
List<FieldSelectOptionBean> lsSelectOption = fieldBean.getFieldTypeBean().getLsSelectOption();
hfm.checkSelectField(temId, lsSelectOption);
}
}catch (Exception e) {
writeLog(e);
}
}
private void save(FieldBean fieldBean, String groupId){
try {
HrmUtil hrmUtil = new HrmUtil();

View File

@ -1,8 +1,38 @@
package weaver.bokang.xiao.tbxc.mapper;/**
package weaver.bokang.xiao.tbxc.mapper;
import aiyh.utils.annotation.recordset.ParamMapper;
import aiyh.utils.annotation.recordset.Select;
import aiyh.utils.annotation.recordset.SqlMapper;
import aiyh.utils.annotation.recordset.Update;
/**
* @ClassName FormFieldMapper
* @Author
* @Date 2023/4/26 17:22
* @Description <h1></h1>
**/
public class FormFieldMapper {
@SqlMapper
public interface FormFieldMapper {
/**
* <h2></h2>
* @param isEdit
* @param formFieldId id
* @param groupId id
* @return
*/
@Update("update hrm_formfield set is_edit = #{isEdit} where fieldid = #{formFieldId} and groupid = #{groupId}")
boolean updateHrmFormField(@ParamMapper("isEdit") String isEdit,
@ParamMapper("formFieldId") String formFieldId,
@ParamMapper("groupId") String groupId);
/**
* <h2>isEdit</h2>
* @param formFieldId id
* @param groupId id
* @return
*/
@Select("select is_edit from hrm_formfield where fieldid = #{formFieldId} and groupid = #{groupId}")
String queryIsEdit(@ParamMapper("formFieldId") String formFieldId,
@ParamMapper("groupId") int groupId);
}

View File

@ -1,5 +1,6 @@
package weaver.bokang.xiao.zscq.config.entity;
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
import lombok.Data;
/**
@ -12,20 +13,26 @@ import lombok.Data;
public class AssignmentEntity {
/** 赋值字段 */
@SqlOracleDbFieldAnn("ASSIGNMENT_FIELD")
private String assignmentField;
/** 值选择 */
@SqlOracleDbFieldAnn("VALUE_SELECT")
private Integer valueSelect;
/** 源字段 */
@SqlOracleDbFieldAnn("SOURCE_FIELD")
private String sourceField;
/** 赋值字段名 */
@SqlOracleDbFieldAnn("ASSIGNMENT_FIELD_NAME")
private String assignmentFieldName;
/** 源字段名 */
@SqlOracleDbFieldAnn("SOURCE_FIELD_NAME")
private String sourceFieldName;
/** 文本框 */
private String context;
@SqlOracleDbFieldAnn("CUS_CONTEXT")
private String cusContext;
}

View File

@ -1,5 +1,6 @@
package weaver.bokang.xiao.zscq.config.entity;
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
import lombok.Data;
/**
@ -12,26 +13,34 @@ import lombok.Data;
public class ConditionEntity {
/** 条件类型 */
@SqlOracleDbFieldAnn("CONDITION_TYPE")
private Integer conditionType;
/** 条件 */
@SqlOracleDbFieldAnn("CONDITION_VALUE")
private Integer conditionValue;
/** 源字段 */
@SqlOracleDbFieldAnn("CONDITION_SOURCE_FIELD")
private String conditionSourceField;
/** 值类型 */
@SqlOracleDbFieldAnn("VALUE_TYPE")
private Integer valueType;
/** 目标字段 */
@SqlOracleDbFieldAnn("CONDITION_TARGET_FIELD")
private String conditionTargetField;
/** 源字段名 */
@SqlOracleDbFieldAnn("CONDITION_SOURCE_FIELD_NAME")
private String conditionSourceFieldName;
/** 目标字段名 */
@SqlOracleDbFieldAnn("CONDITION_TARGET_FIELD_NAME")
private String conditionTargetFieldName;
/** 文本框 */
@SqlOracleDbFieldAnn("CUS_TEXT")
private String cusText;
}

View File

@ -1,5 +1,6 @@
package weaver.bokang.xiao.zscq.config.entity;
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
import lombok.Data;
import java.util.List;
@ -14,30 +15,39 @@ import java.util.List;
public class UpdateModeConf {
/** 源建模 */
@SqlOracleDbFieldAnn("SOURCE_MODE")
private String sourceMode;
/** 触发建模 */
@SqlOracleDbFieldAnn("TARGET_MODE")
private String targetMode;
/** 说明 */
@SqlOracleDbFieldAnn("DESCRIPTION")
private String description;
/** 唯一标识 */
@SqlOracleDbFieldAnn("UNIQUE_CODE")
private String uniqueCode;
/** 源表名 */
@SqlOracleDbFieldAnn("SOURCE_TABLE_NAME")
private String sourceTableName;
/** 触发表名 */
@SqlOracleDbFieldAnn("TARGET_TABLE_NAME")
private String targetTableName;
/** 数据写入方式 */
@SqlOracleDbFieldAnn("DATA_IN_TYPE")
private Integer dataInType;
/** 自定义操作类全路径 */
@SqlOracleDbFieldAnn("OPERATE_PATH")
private String operatePath;
/** 无条件触发 */
@SqlOracleDbFieldAnn("NO_RULE")
private Integer noRule;
/** 条件列表 */

View File

@ -29,6 +29,17 @@ public interface UpdateModeMapper {
})
List<UpdateModeConf> queryUpdateModeConfByFormId(@ParamMapper("formId")String formId);
/**
* <h2>formId</h2>
* @return
*/
@Select("select * from uf_update_mode_conf")
@CollectionMappings({
@CollectionMapping(property = "conditionList", column = "id", id = @Id(value = Integer.class, methodId = 1)),
@CollectionMapping(property = "assignmentList", column = "id", id = @Id(value = Integer.class, methodId = 2)),
})
List<UpdateModeConf> queryUpdateModeConf();
/**
* <h2></h2>
* @param mainId id

View File

@ -71,13 +71,61 @@ public class ConditionTargetProcess {
*/
@MethodRuleNo(value = 1, desc = "不等于")
public static String noEquals(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
String sourceFieldName = Util.null2String(param.get("sourceValue"));
String conditionValue = Util.null2String(param.get("conditionValue"));
String targetFieldName = Util.null2String(param.get("targetFieldName"));
String targetStr = " and "+sourceFieldName+" <> #{whereParam."+targetFieldName+"}";
String targetStr = " and "+targetFieldName+" <> #{whereParam."+targetFieldName+"}";
whereSql += targetStr;
whereParam.put(targetFieldName,conditionValue);
return whereSql;
}
/**
* <h2></h2>
* @param whereParam
* @param param
* @param whereSql sql
* @return sql
*/
@MethodRuleNo(value = 6, desc = "in")
public static String in(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
String conditionValue = Util.null2String(param.get("conditionValue"));
String targetFieldName = Util.null2String(param.get("targetFieldName"));
String targetStr = " and "+targetFieldName+" in ( $t{whereParam."+targetFieldName+"})";
whereSql += targetStr;
whereParam.put(targetFieldName,conditionValue);
return whereSql;
}
/**
* <h2></h2>
* @param whereParam
* @param param
* @param whereSql sql
* @return sql
*/
@MethodRuleNo(value = 7, desc = "not in")
public static String notIn(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
String conditionValue = Util.null2String(param.get("conditionValue"));
String targetFieldName = Util.null2String(param.get("targetFieldName"));
String targetStr = " and "+targetFieldName+" not in ( $t{whereParam."+targetFieldName+"})";
whereSql += targetStr;
whereParam.put(targetFieldName,conditionValue);
return whereSql;
}
/**
* <h2></h2>
* @param whereParam
* @param param
* @param whereSql sql
* @return sql
*/
@MethodRuleNo(value = 8, desc = "自定义sql")
public static String cusSql(Map<String,Object> whereParam,Map<String,Object> param,String whereSql) {
String conditionValue = Util.null2String(param.get("conditionValue"));
String targetStr = " and "+Util.sbc2dbcCase(conditionValue);
whereSql += targetStr;
return whereSql;
}
}

View File

@ -67,5 +67,32 @@ public class ConditionValueProcess {
return !sourceValue.equals(value);
}
/**
* <h2></h2>
* @param sourceValue
* @param value
* @return
*/
@MethodRuleNo(value = 6, desc = "in")
public static boolean in(String sourceValue, String value) {
if("".equals(sourceValue) || "".equals(value)){
return false;
}
String tempStr = ","+value+",";
sourceValue = "," + sourceValue + ",";
return tempStr.contains(sourceValue);
}
/**
* <h2></h2>
* @param sourceValue
* @param value
* @return
*/
@MethodRuleNo(value = 7, desc = "not in")
public static boolean notIn(String sourceValue, String value) {
return !in(sourceValue, value);
}
}

View File

@ -69,7 +69,7 @@ public class DataTypeProcess {
whereSql = whereSql.replaceFirst(" and "," where ");
}
updateSql = updateSql + whereSql;
logger.info("updateSql ==>"+updateSql);
logger.info(String.format("updateSql ==> %s updateParam ==> %s whereParam ==> %s",updateSql,updateParam,whereParam));
return UPDATE_MODE_MAPPER.executeUpdateCusSql(updateSql, updateParam, whereParam);
}
@ -90,7 +90,7 @@ public class DataTypeProcess {
String updateSql = buildUpdateSql(tableName, updateParam);
String whereSql = DataTypeProcess.buildWhereSql(whereParam);
updateSql = updateSql + " " + whereSql;
logger.info("updateSql ==>"+updateSql);
logger.info(String.format("updateSql ==> %s updateParam ==> %s whereParam ==> %s",updateSql,updateParam,whereParam));
return UPDATE_MODE_MAPPER.executeUpdateCusSql(updateSql,updateParam,whereParam);
}
@ -142,6 +142,30 @@ public class DataTypeProcess {
return insert(updateParam,whereParam,param) && cusOperate(updateParam,whereParam,param);
}
/**
* <h2></h2>
* @param updateParam
* @param whereParam
* @param param
* @return
*/
@MethodRuleNo(value = 5,desc = "执行自定义操作并更新")
public static boolean updateAndCus(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
return cusOperate(updateParam,whereParam,param) && update(updateParam,whereParam,param);
}
/**
* <h2></h2>
* @param updateParam
* @param whereParam
* @param param
* @return
*/
@MethodRuleNo(value = 6,desc = "执行自定义操作并插入")
public static boolean insertAndCus(Map<String,Object> updateParam, Map<String,Object> whereParam,Map<String,String> param) {
return cusOperate(updateParam,whereParam,param) && insert(updateParam,whereParam,param);
}
/**
* <h2>sql</h2>
* @param tableName

View File

@ -60,7 +60,7 @@ public class ValueSelectProcess {
*/
@MethodRuleNo(value = 0, desc = "默认值")
public static String defaultValue(Map<String,Object> modeMap,AssignmentEntity assignment) {
return assignment.getContext();
return assignment.getCusContext();
}
/**
@ -82,7 +82,7 @@ public class ValueSelectProcess {
*/
@MethodRuleNo(value = 2, desc = "自定义sql")
public static String cusSql(Map<String,Object> modeMap,AssignmentEntity assignment) {
String cusSqlStr = Util.null2String(assignment.getContext());
String cusSqlStr = Util.null2String(assignment.getCusContext());
cusSqlStr = Util.dbc2sbcCase(cusSqlStr);
if(StringUtils.isBlank(cusSqlStr)){
throw new CustomerException("选择自定义sql时sql字符串不能为空");

View File

@ -9,6 +9,7 @@ import weaver.bokang.xiao.zscq.config.entity.UpdateModeConf;
import weaver.bokang.xiao.zscq.config.function.ConditionFunction;
import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper;
import weaver.bokang.xiao.zscq.config.process.*;
import weaver.bokang.xiao.zscq.store.TableNameStore;
import java.util.HashMap;
import java.util.List;
@ -33,23 +34,39 @@ public class ModeChangeService {
* <h2></h2>
* @param modeMap
* @param formId id
* @param triggerType 0:; 1:; 2:
*/
public void changeOtherMode(Map<String,Object> modeMap, String formId){
List<UpdateModeConf> updateModeConfList = updateModeMapper.queryUpdateModeConfByFormId(formId);
public void changeOtherMode(Map<String,Object> modeMap, String formId,int triggerType){
Map<String, List<UpdateModeConf>> triggerStore = TableNameStore.getInstance().getTriggerStore();
List<UpdateModeConf> updateModeConfList = triggerStore.get(formId);
if(Objects.isNull(updateModeConfList) || updateModeConfList.isEmpty()){
logger.error(String.format("此表单建模[%s] 未配置相关更新信息,请检查!!!",formId));
return;
}
logger.info("配置信息 updateModeConfList==>"+ JSON.toJSONString(updateModeConfList));
List<UpdateModeConf> collect = updateModeConfList.stream().filter(item -> item.getNoRule() == triggerType).collect(Collectors.toList());
if(collect.isEmpty()){
logger.error(String.format("此表单建模[%s] 未配置相关更新信息,请检查!!!",formId));
return;
}
doChange(modeMap,collect);
}
/**
* <h2></h2>
* @param modeMap
* @param updateModeConfList
*/
private void doChange(Map<String,Object> modeMap,List<UpdateModeConf> updateModeConfList){
for (UpdateModeConf updateModeConf : updateModeConfList) {
List<ConditionEntity> conditionList = updateModeConf.getConditionList();
List<AssignmentEntity> assignmentList = updateModeConf.getAssignmentList();
Integer dataInType = updateModeConf.getDataInType();
Integer noRule = updateModeConf.getNoRule();
if(noRule == 0 && conditionList.isEmpty()){
if(noRule == 1 && conditionList.isEmpty()){
logger.error(String.format("没有条件设置,不允许建模 %s 更新",updateModeConf.getTargetTableName()));
continue;
}
logger.info(String.format("处理配置 deal config [%s - %s]",updateModeConf.getUniqueCode(),updateModeConf.getDescription()));
//条件sql
String whereSql = "";
//条件数据
@ -71,12 +88,13 @@ public class ModeChangeService {
String sourceValue = Util.null2String(modeMap.get(sourceCondition.getConditionSourceFieldName()));
String conditionValue = valueFunction.apply(modeMap, sourceCondition);
Boolean result = conditionFunction.apply(sourceValue, conditionValue);
if (result) {
if (!result) {
flag = true;
break;
}
}
if (flag) {
logger.info("源建模条件判断不通过,此条数据跳过 sourceMode condition fail !!! "+JSON.toJSONString(modeMap));
continue;
}
}
@ -113,4 +131,6 @@ public class ModeChangeService {
logger.info("更新结果 executeFlag ==>"+executeFlag);
}
}
}

View File

@ -97,7 +97,7 @@ public class DataControlExpand extends AbstractModeExpandJavaCodeNew {
queryParam.put("fieldValue",dataId);
Map<String, Object> modeData = modeMapper.queryModeDataInfo(tableName, queryParam);
if(Objects.nonNull(modeData)){
modeChangeService.changeOtherMode(modeData,formId);
modeChangeService.changeOtherMode(modeData,formId,1);
}
}

View File

@ -3,6 +3,7 @@ package weaver.bokang.xiao.zscq.fun;
import aiyh.utils.Util;
import weaver.bokang.xiao.zscq.config.function.CusOperateInterface;
import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper;
import weaver.bokang.xiao.zscq.mapper.StatusMapper;
import weaver.hrm.User;
import weaver.workflow.workflow.WfForceOver;
@ -21,6 +22,8 @@ public class WorkflowOverOperate implements CusOperateInterface {
private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class);
private final StatusMapper statusMapper = Util.getMapper(StatusMapper.class);
@Override
public void execute(Map<String, Object> whereParam, Map<String, String> param, Map<String, String> pathParam) {
logger.info(String.format("WorkflowOverOperate 自定义处理 whereParam[%s],param:[%s],pathParam:[%s]",whereParam,param,pathParam));
@ -35,6 +38,11 @@ public class WorkflowOverOperate implements CusOperateInterface {
if(Objects.nonNull(modeData)){
String workflowField = Util.null2String(pathParam.get("workflowField"));
String requestId = Util.null2String(modeData.get(workflowField));
int status = statusMapper.queryWorkflowStatus(requestId);
if(status == 3){
logger.error(String.format("此流程已归档,不再执行强制归档操作 this workflow is over!!! requestId:%s ",requestId));
return;
}
logger.info("流程强制归档 ==>"+requestId);
//流程强制归档
WfForceOver wfForceOver = new WfForceOver();

View File

@ -1,8 +1,100 @@
package weaver.bokang.xiao.zscq.fun;/**
package weaver.bokang.xiao.zscq.fun;
import aiyh.utils.Util;
import com.api.bokang.xiao.zscq.service.impl.ReserveServiceImpl;
import weaver.bokang.xiao.zscq.config.function.CusOperateInterface;
import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper;
import weaver.conn.RecordSet;
import weaver.hrm.User;
import weaver.workflow.workflow.RequestForceDrawBack;
import weaver.workflow.workflow.WfForceDrawBack;
import weaver.workflow.workflow.WfFunctionManageUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* @ClassName WorkflowRepossessedSign
* @Author
* @Date 2023/4/24 11:11
* @Description <h1></h1>
**/
public class WorkflowRepossessedSign {
public class WorkflowRepossessedSign implements CusOperateInterface {
private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class);
private final ReserveServiceImpl reserveService = new ReserveServiceImpl();
@Override
public void execute(Map<String, Object> whereParam, Map<String, String> param, Map<String, String> pathParam) {
logger.info(String.format("WorkflowRepossessedSign 自定义处理 whereParam[%s],param:[%s],pathParam:[%s]",whereParam,param,pathParam));
String tableName = Util.null2String(param.get("tableName"));
String whereSql = Util.null2String(param.get("whereSql"));
if(!"".equals(whereSql)){
whereSql = whereSql.replaceFirst(" and "," where ");
}
String querySql = "select * from " + tableName +whereSql;
Map<String, Object> modeData = updateModeMapper.executeCusSqlMap(querySql, whereParam,new HashMap<>());
logger.info("modeData ==>"+modeData);
if(Objects.nonNull(modeData)){
String workflowField = Util.null2String(pathParam.get("workflowField"));
String requestId = Util.null2String(modeData.get(workflowField));
logger.info("流程强制收回 ==>"+requestId);
//流程强制收回
reserveService.doRepossessedSign(Util.getIntValue(requestId),new User(1));
//this.doRepossessedSign2(Util.getIntValue(requestId),new User(1));
}
}
/**
* <h2></>
* @param requestId id
* @param user
* @return
*/
public boolean doRepossessedSign2(int requestId,User user){
WfFunctionManageUtil wfFunctionManageUtil = new WfFunctionManageUtil();
//初始化
RequestForceDrawBack requestForceDrawBack = new RequestForceDrawBack();
WfForceDrawBack wfForceDrawBack = new WfForceDrawBack();
if(requestId != -1){
RecordSet recordSet = new RecordSet();
//从日志中去找最后一个操作者
recordSet.executeSql("select max(logid), operator,operatortype from workflow_requestlog where requestId=" + requestId + " and (logtype='2' or logtype='0' or logtype='3' or logtype='e') and exists(select 1 from workflow_currentoperator where requestId=workflow_requestlog.requestId and userid=workflow_requestlog.operator and usertype=workflow_requestlog.operatortype and isremark='2' and preisremark='0' and operatedate is not null and operatedate>' ') group by operator,operatortype order by max(logid) desc");
int tempUser = -1;
int tempUserType = -1;
if (recordSet.next()) {
tempUser = Util.getIntValue(recordSet.getString("operator"));
tempUserType = Util.getIntValue(recordSet.getString("operatortype"), 0);
}else{
recordSet.executeSql("select userid,usertype from workflow_currentoperator where requestId = " + requestId + " and isremark = '2' and preisremark='0' and operatedate is not null and operatedate>' ' order by operatedate desc ,operatetime desc");
if (recordSet.next()) {
tempUser = recordSet.getInt("userid");
tempUserType = recordSet.getInt("usertype");
}
}
if(tempUser == -1 && tempUserType == -1){
logger.error(String.format("流程 requestId:[%s] 操作者 operateInfo no find 流程可能未归档 !!!",requestId));
return false;
}
//提交时针对流程再作一次权限判断
boolean canForceDrawBack = RequestForceDrawBack.isHavePurview(user.getUID(), requestId, true);
if (canForceDrawBack && wfFunctionManageUtil.haveOtherOperationRight(requestId)) {
//int result = requestForceDrawBack.foreceDrawBack(user, requestId, true, tempUser, tempUserType);
ArrayList<String> requestIds = new ArrayList<>();
requestIds.add(requestId+"");
wfForceDrawBack.doForceDrawBack(requestIds,new User(1),-1,-1);
logger.info(String.format("流程 requestId:[%s] 撤回结果 drawBack result:[%d] message:[%s]",requestId,111,requestForceDrawBack.getMessage()));
//return result == 1;
return true;
}else{
return false;
}
}else{
return false;
}
}
}

View File

@ -1,6 +1,7 @@
package weaver.bokang.xiao.zscq.mapper;
import aiyh.utils.annotation.recordset.ParamMapper;
import aiyh.utils.annotation.recordset.Select;
import aiyh.utils.annotation.recordset.SqlMapper;
import aiyh.utils.annotation.recordset.Update;
@ -19,8 +20,16 @@ public interface StatusMapper {
* @param userIds id
* @return
*/
@Update("update workflow_currentoperator set viewtype = -2,isremark = 2 " +
@Update("update workflow_currentoperator set isremark = 2 " +
"where REQUESTID = #{requestId} and userid in ($t{userIds}) and isremark = 8")
boolean changeWorkflowStatus(@ParamMapper("requestId")String requestId,@ParamMapper("userIds") String userIds);
/**
* <h2></h2>
* @param requestId id
* @return
*/
@Select("select currentnodetype from workflow_requestbase where requestid = #{requestId}")
int queryWorkflowStatus(@ParamMapper("requestId")String requestId);
}

View File

@ -6,6 +6,8 @@ import lombok.Getter;
import org.apache.log4j.Logger;
import weaver.bokang.xiao.xhny_report.entity.pojo.CompanyEntity;
import weaver.bokang.xiao.xhny_report.mapper.VendorMapper;
import weaver.bokang.xiao.zscq.config.entity.UpdateModeConf;
import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper;
import weaver.general.StaticObj;
import weaver.interfaces.datasource.DataSource;
@ -30,9 +32,31 @@ public class TableNameStore {
private final Map<String,String> tableNameStore = new HashMap<>();
private final Map<String,List<UpdateModeConf>> triggerStore = new HashMap<>();
private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class);
private static final Logger logger = Util.getLogger();
private TableNameStore(){}
private TableNameStore(){init();}
private void init(){
try {
triggerStore.clear();
List<UpdateModeConf> updateModeConfList = updateModeMapper.queryUpdateModeConf();
if (Objects.nonNull(updateModeConfList) && !updateModeConfList.isEmpty()) {
Map<String, List<UpdateModeConf>> collect = updateModeConfList.stream().collect(Collectors.groupingBy(UpdateModeConf::getSourceMode));
triggerStore.putAll(collect);
}
logger.info(String.format("TableNameStore init success!!! triggerStore:%s updateModeConfList:%s", JSON.toJSONString(triggerStore), JSON.toJSONString(updateModeConfList)));
}catch (Exception e){
logger.error("TableNameStore init error "+Util.getErrString(e));
}
}
public void refresh(){
this.init();
}
public static TableNameStore getInstance(){
return VendorStoreHolder.VENDOR_STORE;

View File

@ -1,499 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/WEB-INF/tld/browser.tld" prefix="brow"%>
<%@ page import="weaver.file.Prop" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="weaver.systeminfo.SystemEnv" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="RecordSet_count" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page" />
<jsp:useBean id="CrmSupplierComInfo" class="weaver.crm.supplierinfo.CrmSupplierComInfo" scope="page" />
<jsp:useBean id="RecordSet_Dep" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" /><!--zl-->
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<style>
td * {font-size:9px !important;}
</style>
</head>
<%
String sqlwhere = " where 1=1 ";
String subcompanyid1 = ResourceComInfo.getSubCompanyID(String.valueOf(user.getUID()));
//是否采购部
boolean isDep = false;
//是否是流程接收人
boolean isShow = false;
//采购部的同事可以选择所有合同卡片;而本部门的人员(非采购部)只能选择本部门的合同卡片
RecordSet_Dep.executeSql("select * from HrmDepartment where departmentname like '%采购%' and id="+user.getUserDepartment());
if(RecordSet_Dep.next()) isDep = true;
//是否合同流程接收人
String sqlwhere_workflow = "";
RecordSet_Dep.executeSql("select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID());
if(RecordSet_Dep.next()) isShow = true;
if(!HrmUserVarify.checkUserRight("ContactInfo:Manager", user) && !HrmUserVarify.checkUserRight("ContactInfo:User", user) && !isShow && !isDep){
response.sendRedirect("/notice/noright.jsp");
}
//如果是合同管理权限则直接1=1
if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){
sqlwhere += " and 1=1";
}else if(isShow && HrmUserVarify.checkUserRight("ContactInfo:User", user)){
//如果是流程接收人,并且有合同查看权限
sqlwhere += " and (requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+") or reqDeptId = '"+user.getUserDepartment()+"')";
}else if(HrmUserVarify.checkUserRight("ContactInfo:User", user)){
//如果只有合同查看权限
sqlwhere += " and reqDeptId = '"+user.getUserDepartment()+"'";
}else if(isShow){
//如果只是流程接收人
sqlwhere += " and requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+")";
}
//如果没有查看全部的权限,加分部条件
if(!HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){
if (!subcompanyid1.equals("0")) {sqlwhere += " and CrmContractInfo.subcompanyid1 = '"+subcompanyid1+"' ";}
}
String imagefilename = "/images/hdReport.gif";
String titlename = SystemEnv.getHtmlLabelName(614, user.getLanguage()) + SystemEnv.getHtmlLabelName(527, user.getLanguage());
String needfav = "1";
String needhelp = "";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp"%>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%>
<%
RCMenu += "{" + SystemEnv.getHtmlLabelName(197, user.getLanguage()) + ",javascript:OnSearch(),_top} ";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + "Excel,javascript:ContractExport(),_top} ";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(18363, user.getLanguage()) + ",javascript:_table.firstPage(),_self}";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(1258, user.getLanguage()) + ",javascript:_table.prePage(),_self}";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(1259, user.getLanguage()) + ",javascript:_table.nextPage(),_self}";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(18362, user.getLanguage()) + ",javascript:_table.lastPage(),_self}";
RCMenuHeight += RCMenuHeightStep;
%>
<%
int pagenum = Util.getIntValue(request.getParameter("pagenum"), 1);
int perpage = Util.getPerpageLog();
if (perpage <= 1) perpage = 10;
String creator = Util.fromScreen(request.getParameter("creator"), user.getLanguage());
String fromdate = Util.fromScreen(request.getParameter("fromdate"), user.getLanguage());
String fromdate2 = Util.fromScreen(request.getParameter("fromdate2"), user.getLanguage());
String enddate = Util.fromScreen(request.getParameter("enddate"), user.getLanguage());
String enddate2 = Util.fromScreen(request.getParameter("enddate2"), user.getLanguage());
String status_temp = Util.null2String(request.getParameter("status_temp"));
String conNo = Util.fromScreen(request.getParameter("conNo"), user.getLanguage());
String prNo = Util.fromScreen(request.getParameter("prNo"), user.getLanguage());
String jpcNo = Util.fromScreen(request.getParameter("jpcNo"), user.getLanguage());
String suppliersId = Util.fromScreen(request.getParameter("suppliersId"), user.getLanguage());
String isOneSuppliers = Util.fromScreen(request.getParameter("isOneSuppliers"), user.getLanguage());
// String reqDeptId = String.valueOf(user.getUserDepartment());
String reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage());;
//管理员组或采购部才能查询所有部门下合同,合同接收人查看接收的合同
// if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user) || isShow) reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage());
String isOverdue = Util.fromScreen(request.getParameter("isOverdue"), user.getLanguage());
String status = Util.fromScreen(request.getParameter("status"), user.getLanguage());
String isOverdueNext = Util.fromScreen(request.getParameter("isOverdueNext"), user.getLanguage());
String conType = Util.fromScreen(request.getParameter("conType"), user.getLanguage());
String name = Util.fromScreen(request.getParameter("name"), user.getLanguage());
String subCompanyId = Util.fromScreen(request.getParameter("subCompanyId"), user.getLanguage());
String reNewStatus = Util.fromScreen(request.getParameter("reNewStatus"), user.getLanguage());
String conStatus = Util.fromScreen(request.getParameter("conStatus"), user.getLanguage());
String contractName = Util.fromScreen(request.getParameter("contractName"), user.getLanguage());
String csstatus = Util.fromScreen(request.getParameter("csstatus"), user.getLanguage());
int opentype = Util.getIntValue(request.getParameter("opentype"),-1);
//String sqlwhere = " where status = '' ";
//if(!"".equals(status_temp)) sqlwhere += " and status in ("+status_temp+") ";
if (!fromdate.equals("")) sqlwhere += " and startDate>='" + fromdate + "'";
if (!fromdate2.equals("")) sqlwhere += " and startDate<='" + fromdate2 + "'";
if (!enddate.equals("")) sqlwhere += " and enddate>='" + enddate + "'";
if (!enddate2.equals("")) sqlwhere += " and enddate<='" + enddate2 + "'";
if (!conNo.equals("")) sqlwhere += " and conNo like '%" + conNo + "%'";
if (!prNo.equals("")) sqlwhere += " and prNo='" + prNo + "'";
if (!jpcNo.equals("")) sqlwhere += " and jpcNo='" + jpcNo + "'";
if(!"".equals(suppliersId)) sqlwhere += " and suppliersId=" + suppliersId;
if (!isOneSuppliers.equals("")) sqlwhere += " and isOneSuppliers='" + isOneSuppliers + "'";
if (!"".equals(creator) && !"0".equals(creator)) sqlwhere += " and CrmContractInfo.creator=" + creator;
if (!reqDeptId.equals("")) sqlwhere += " and reqDeptId=" + reqDeptId;
if (!isOverdue.equals("")) sqlwhere += " and isOverdue='" + isOverdue + "'";
if (!status.equals("")) sqlwhere += " and CrmContractInfo.status='" + status + "'";
if (!isOverdueNext.equals("")) sqlwhere += " and isOverdueNext='" + isOverdueNext + "'";
if (!conType.equals("")) sqlwhere += " and conType='" + conType + "'";
if (!csstatus.equals("")) sqlwhere += " and CrmSalesContractInfo.status='" + csstatus + "'";
if (!name.equals("")) sqlwhere += " and name like '%" + name + "%'";
if (!subCompanyId.equals("")) sqlwhere += " and CrmContractInfo.subcompanyid1 = '" + subCompanyId + "'";
if (!reNewStatus.equals("")) sqlwhere += " and conStatus = '" + reNewStatus + "'";
if (!contractName.equals("")) sqlwhere += " and contractName like '%" + contractName + "%'";
//if (reNewStatus2.equals("待续签")) sqlwhere += " and dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0";
//else if (reNewStatus2.equals("已续签")) sqlwhere += " and dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0";
//else if (reNewStatus2.equals("无需续签")) sqlwhere += " and dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0";
//System.out.println("sqlwhere:"+sqlwhere);
if(opentype > -1){
sqlwhere += " and isnull(CrmContractInfo.opentype,0) = " + opentype;
}
String orderStr = " order by startDate desc, CrmContractInfo.id desc ";
// out.println("sqlwhere:" + sqlwhere);
// out.println("orderStr:" + orderStr);
// session.setAttribute("sqlwhere", sqlwhere);
// session.setAttribute("orderStr", orderStr);
%>
<form id=frmmain name=frmmain method=post action="ContractList.jsp">
<input type=hidden id=pagenum name=pagenum value="<%=pagenum%>">
<input type=hidden id=status_temp name=status_temp value="">
<table class=ViewForm>
<tbody>
<COLGROUP>
<COL width="13%">
<COL width="20%">
<COL width="14%">
<COL width="20%">
<COL width="13%">
<COL width="20%">
<TR class=Title>
<TH colSpan=6><%=SystemEnv.getHtmlLabelName(15774, user.getLanguage())%></TH>
</TR>
<tr style="height: 1px">
<td class=Line1 colspan=6></td>
</tr>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<tr>
<TD>合同状态</TD>
<TD class=Field>
<select id="reNewStatus" name="reNewStatus">
<option value="" <%="".equals(reNewStatus)?"selected":""%>></option>
<option value="0" <%="0".equals(reNewStatus)?"selected":""%>>执行</option>
<option value="1" <%="1".equals(reNewStatus)?"selected":""%>>待续签</option>
<option value="2" <%="2".equals(reNewStatus)?"selected":""%>>已续签</option>
<option value="3" <%="3".equals(reNewStatus)?"selected":""%>>关闭</option>
</select>
</TD>
<td><%=SystemEnv.getHtmlLabelName(1970, user.getLanguage())%></td>
<td class=field>
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('fromdatespan','fromdate')></BUTTON>&nbsp;
<SPAN id=fromdatespan><%=Util.toScreen(fromdate, user.getLanguage())%></SPAN>&nbsp;-&nbsp;
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('fromdate2span','fromdate2')></BUTTON>&nbsp;
<SPAN id=fromdate2span><%=Util.toScreen(fromdate2, user.getLanguage())%></SPAN>
<input type="hidden" name="fromdate" value=<%=fromdate%>>
<input type="hidden" name="fromdate2" value=<%=fromdate2%>>
</td>
<td><%=SystemEnv.getHtmlLabelName(15236, user.getLanguage())%></td>
<td class=field>
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('enddatespan','enddate')></BUTTON>&nbsp;
<SPAN id=enddatespan><%=Util.toScreen(enddate, user.getLanguage())%></SPAN>&nbsp;-&nbsp;
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('enddate2span','enddate2')></BUTTON>&nbsp;
<SPAN id=enddate2span><%=Util.toScreen(enddate2, user.getLanguage())%></SPAN>
<input type="hidden" name="enddate" value=<%=enddate%>>
<input type="hidden" name="enddate2" value=<%=enddate2%>>
</td>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(21282, user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=100 id="conNo" name="conNo" STYLE="width:150" value="<%=conNo%>">
</TD>
<TD>PR<%=SystemEnv.getHtmlLabelName(403,user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=100 id="prNo" name="prNo" STYLE="width:150" value="<%=prNo%>">
</TD>
<TD>JPC<%=SystemEnv.getHtmlLabelName(2171,user.getLanguage())%><%=SystemEnv.getHtmlLabelName(16992,user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=100 id="jpcNo" name="jpcNo" STYLE="width:150" value="<%=jpcNo%>">
</TD>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(613002, user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="suppliersId"
name="suppliersId"
browserValue="<%=suppliersId %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/interface/CommonBrowser.jsp?type=browser.gys"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=CrmSupplierComInfo.getSuppliername(suppliersId) %>">
</brow:browser>
</TD>
<TD></TD>
<TD class=Field>
</TD>
<TD><%=SystemEnv.getHtmlLabelName(913, user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="creator"
name="creator"
browserValue="<%=creator %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=ResourceComInfo.getResourcename(creator) %>">
</brow:browser>
</TD>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(620002, user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="reqDeptId"
name="reqDeptId"
browserValue="<%=reqDeptId %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage())%>">
</brow:browser>
<%-- <%--%>
<%-- //管理员组才能查询所有部门下合同--%>
<%-- if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){--%>
<%-- %>--%>
<%-- <brow:browser viewType="0"--%>
<%-- id="reqDeptId"--%>
<%-- name="reqDeptId"--%>
<%-- browserValue="<%=reqDeptId %>"--%>
<%-- browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp"--%>
<%-- hasInput="true"--%>
<%-- isSingle="true"--%>
<%-- hasBrowser = "true"--%>
<%-- isMustInput='1'--%>
<%-- width="165px"--%>
<%-- browserSpanValue="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage())%>">--%>
<%-- </brow:browser>--%>
<%-- &lt;%&ndash;<INPUT type=hidden class="wuiBrowser" _required="no" _displayTemplate="#b{name}" _displayText="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage()) %>" _url="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp" name="reqDeptId" value="<%=reqDeptId%>">&ndash;%&gt;--%>
<%-- <%}else{ %>--%>
<%-- <%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage()) %>--%>
<%-- <%} %>--%>
</TD>
<TD>付款状态</TD>
<TD class=Field>
<select id="status" name="status">
<option value="" <%="".equals(status)?"selected":""%>></option>
<option value="0" <%="0".equals(status)?"selected":""%>>执行中</option>
<option value="1" <%="1".equals(status)?"selected":""%>>已结清</option>
</select>
</TD>
<TD><%=SystemEnv.getHtmlLabelName(620017, user.getLanguage())%></TD>
<TD class=Field>
<select id="isOverdueNext" name="isOverdueNext">
<option value="" <%="".equals(isOverdueNext)?"selected":""%>></option>
<option value="Y" <%="Y".equals(isOverdueNext)?"selected":""%>><%=SystemEnv.getHtmlLabelName(163,user.getLanguage())%></option>
<option value="N" <%="N".equals(isOverdueNext)?"selected":""%>><%=SystemEnv.getHtmlLabelName(161,user.getLanguage())%></option>
</select>
</TD>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(15775, user.getLanguage())%></TD>
<TD class=Field>
<select id="conType" name="conType">
<option value="" <%="".equals(conType)?"selected":""%>></option>
<option value="0" <%="0".equals(conType)?"selected":""%>>业务型</option>
<option value="1" <%="1".equals(conType)?"selected":""%>>资本型</option>
<option value="2" <%="2".equals(conType)?"selected":""%>>费用型</option>
</select>
</TD>
<TD><%=SystemEnv.getHtmlLabelName(15142, user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=200 id="name" name="name" STYLE="width:150" value="<%=name%>">
</TD>
<%if(HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){%>
<TD><%=SystemEnv.getHtmlLabelName(141,user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="subCompanyId"
name="subCompanyId"
browserValue="<%=subCompanyId %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=SubCompanyComInfo.getSubCompanyname(subCompanyId+"")%>">
</brow:browser>
<%--<input class=wuiBrowser class=inputStyle id=subCompanyId type=hidden name=subCompanyId value="<%=subCompanyId%>"--%>
<%--_url="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp"--%>
<%--_displayText="<%=SubCompanyComInfo.getSubCompanyname(subCompanyId+"")%>"--%>
<%-->--%>
</TD>
<%}%>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(16404, user.getLanguage())%><%=SystemEnv.getHtmlLabelName(195, user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=200 id="contractName" name="contractName" STYLE="width:150" value="<%=contractName%>">
</TD>
<TD>销售合同状态</TD>
<TD class=Field>
<select id="csstatus" name="csstatus">
<option value="" <%="".equals(csstatus)?"selected":""%>></option>
<option value="0" <%="0".equals(csstatus)?"selected":""%>>已签署</option>
<option value="1" <%="1".equals(csstatus)?"selected":""%>>未签署</option>
<option value="2" <%="2".equals(csstatus)?"selected":""%>>已续签</option>
<option value="3" <%="3".equals(csstatus)?"selected":""%>>关闭</option>
</select>
</TD>
<td>开闭口类型</td>
<td class="Field">
<select name="opentype">
<option value="-1" <%=(opentype == -1) ?"selected":"" %>>--请选择--</option>
<option value="0" <%=(opentype == 0) ?"selected":"" %>>闭口</option>
<option value="1" <%=(opentype == 1) ?"selected":"" %>>开口</option>
<option value="2" <%=(opentype == 2) ?"selected":"" %>>周期性</option>
</select>
</td>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
</tbody>
</table>
</form>
<div id="" style="overflow-x:scroll;width:100%;">
<table width="2500px" style="table-Layout:fixed">
<tr>
<td>
<%
String tableString = "";
String backfields = " CrmContractInfo.id,case CrmContractInfo.opentype when '0' then '闭口' when '1' then '开口' when '2' then '周期性' end opentype, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, ',' as str_temp, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, CrmContractInfo.creator, CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus, contractName, saleContract, case when dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0 then '已续签' when dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0 then '待续签' when dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0 then '无需续签' end as reNewStatus2,case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as csstatus ";
String fromSql = " CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract ";
//out.print("select"+backfields+"from"+fromSql +sqlwhere);
String str_content = "content"+"str_temp";
tableString = " <table instanceid=\"crmContractInfoTable\" tabletype=\"none\" pageId=\"perpage\" pagesize=\"" +PageIdConst.getPageSize("perpage",user.getUID())+"\" >" + "<sql backfields=\"" + backfields + "\" sqlform=\"" + fromSql + "\" sqlwhere=\"" + Util.toHtmlForSplitPage(sqlwhere) + "\" sqlprimarykey=\"CrmContractInfo.id\" sqlsortway=\"Desc\" sqlisdistinct=\"false\" />" + "<head>";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(15142, user.getLanguage()) + "\" column=\"name\" orderkey=\"name\" linkkey=\"id\" linkvaluecolumn=\"id\" href=\"/CRM/contractinfo/ContractEdit.jsp\" target=\"_fullwindow\" />";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(21282, user.getLanguage()) + "\" column=\"conNo\" orderkey=\"conNo\" />";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(620002, user.getLanguage()) + "\" column=\"reqDeptId\" orderkey=\"reqDeptId\" transmethod=\"weaver.hrm.company.DepartmentComInfo.getDepartmentname\" linkkey=\"id\" href=\"/hrm/company/HrmDepartmentDsp.jsp\" target=\"_fullwindow\" />";
tableString += "<col width=\"10%\" text=\""+ SystemEnv.getHtmlLabelName(613002, user.getLanguage()) + "\" column=\"suppliersId\" orderkey=\"suppliersId\" linkkey=\"id\" transmethod=\"weaver.crm.supplierinfo.CrmSupplierComInfo.getSuppliername\" href=\"/CRM/supplierinfo/SuppliersEdit.jsp?1=1\" target=\"_fullwindow\" />";
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(1970, user.getLanguage()) + "\" column=\"startDate\" orderkey=\"startDate\" />";
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(15236, user.getLanguage()) + "\" column=\"endDate\" orderkey=\"endDate\" />";
//tableString += "<col width=\"3%\" text=\"" + SystemEnv.getHtmlLabelName(620016, user.getLanguage()) + "\" column=\"isOverdue\" orderkey=\"isOverdue\" />";
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(6146, user.getLanguage()) + "\" column=\"conAmount\" orderkey=\"conAmount\" />";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(620015, user.getLanguage()) + "\" column=\"content\" orderkey=\""+str_content+"\" transmethod=\"weaver.splitepage.transform.SptmForDoc.getDocNames\" />";
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(620017, user.getLanguage()) + "\" column=\"isOverdueNext\" orderkey=\"isOverdueNext\" />";
tableString += "<col width=\"4%\" text=\"付款状态\" column=\"status\" orderkey=\"status\" />";
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(913, user.getLanguage()) + "\" column=\"creator\" orderkey=\"creator\" linkkey=\"id\" transmethod=\"weaver.hrm.resource.ResourceComInfo.getResourcename\" href=\"/hrm/resource/HrmResource.jsp?1=1\" target=\"_fullwindow\" />";
//tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(104, user.getLanguage()) + "\" column=\"id\" orderkey=\"id\" transmethod=\"weaver.crm.contractinfo.CrmContractTool.getLinkButtons\" />";
tableString += "<col width=\"4%\" text=\"合同状态\" column=\"reNewStatus\" orderkey=\"reNewStatus\" />";
tableString += "<col width=\"4%\" text=\"销售合同\" column=\"contractName\" orderkey=\"contractName\" linkkey=\"id\" linkvaluecolumn=\"saleContract\" href=\"/CRM/salecontractinfo/SaleContractEdits.jsp?metherid=search\" target=\"_fullwindow\" />";
tableString += "<col width=\"4%\" text=\"销售合同状态\" column=\"csstatus\" orderkey=\"csstatus\" />";
tableString += "<col width=\"4%\" text=\"开闭口类型\" column=\"opentype\" orderkey=\"opentype\" />";
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(141,user.getLanguage()) + "\" column=\"subcompanyid1\" orderkey=\"subcompanyid1\" transmethod=\"weaver.hrm.company.SubCompanyComInfo.getSubCompanyname\" />";
tableString += "</head>";
tableString += "</table>";
%>
<input type="hidden" name="pageId" id="pageId" value="crmContractInfoTable" />
<wea:SplitPageTag tableString="<%=tableString%>" mode="run" />
</td>
</tr>
</table>
</div>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%>
</body>
<iframe id="searchexport" style="display: none"></iframe>
<script language=javascript>
function ContractExport() {
var sqlwhere = encodeURI("<%=sqlwhere%>");
var orderStr = encodeURI("<%=orderStr%>");
jQuery("#searchexport").attr("src", "ContractReportExport.jsp?sqlwhere="+sqlwhere+"&orderStr=" + orderStr);
}
function OnSubmit(pagenum) {
document.frmmain.pagenum.value = pagenum;
document.frmmain.submit();
}
function OnSearch(){
var chkInTableTags = document.getElementsByName("status");
var status_temp = "";
for(var i=0;i<chkInTableTags.length;i++){
if(chkInTableTags[i].checked && chkInTableTags[i].value != ''){
if(status_temp == "") status_temp = "'" + chkInTableTags[i].value + "'";
else status_temp = status_temp + ",'" + chkInTableTags[i].value + "'";
}
}
jQuery("#status_temp").val(status_temp);
document.frmmain.submit();
}
//续签
function newWorkflowByContract4(key){
location.href = "ContractNewWorkflow.jsp?status=4&id="+key;
}
//试运作
function newWorkflowByContract3(key){
location.href = "ContractNewWorkflow.jsp?status=3&id="+key;
}
</script>
<SCRIPT language="javascript" src="/js/datetime_wev8.js"></script>
<SCRIPT language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
</html>

View File

@ -1,127 +0,0 @@
<%@ page language="java" contentType="text/html; charset=GBK" %>
<%@ include file="/systeminfo/init.jsp" %>
<%@ page import="weaver.general.Util, weaver.file.ExcelSheet, weaver.file.ExcelRow" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="SptmForDoc" class="weaver.splitepage.transform.SptmForDoc" scope="page"/>
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page"/>
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="CrmSupplierComInfo" class="weaver.crm.supplierinfo.CrmSupplierComInfo" scope="page"/>
<jsp:useBean id="RequestComInfo" class="weaver.workflow.request.RequestComInfo" scope="page"/>
<jsp:useBean id="DocComInfo" class="weaver.docs.docs.DocComInfo" scope="page"/>
<jsp:useBean id="ExcelFile" class="weaver.file.ExcelFile" scope="session"/>
<%!
public static String ToDBC(String input) {
char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == 12288) {
//全角空格为12288半角空格为32
c[i] = (char) 32;
continue;
}
if (c[i] > 65280 && c[i] < 65375)
//其他字符半角(33-126)与全角(65281-65374)的对应关系是均相差65248
c[i] = (char) (c[i] - 65248);
}
return new String(c);
}
%>
<%
// String sqlwhere=(String)session.getAttribute("sqlwhere");
// String orderStr=(String)session.getAttribute("orderStr");
String sqlwhere = request.getParameter("sqlwhere");
sqlwhere = ToDBC(sqlwhere);
String orderStr = request.getParameter("orderStr");
orderStr = ToDBC(orderStr);
String sqlstr = "";
if (RecordSet.getDBType().equals("oracle")) {
sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, case isOneSuppliers when 'Y' then '是' when 'N' then '否' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr;
} else {
sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, case isOneSuppliers when 'Y' then '是' when 'N' then '否' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr;
}
new BaseBean().writeLog(">>>>>>>>"+sqlstr);
RecordSet.executeQuery(sqlstr);
ExcelSheet es = new ExcelSheet();
ExcelRow er = es.newExcelRow();
er.addStringValue(SystemEnv.getHtmlLabelName(141,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620002,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(613002,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(21282,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(15142,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(1970,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(15236,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620016,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(6146,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620017,user.getLanguage()));
er.addStringValue("付款状态");
er.addStringValue(SystemEnv.getHtmlLabelName(913,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620009,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620003,user.getLanguage()));
er.addStringValue("JPC"+SystemEnv.getHtmlLabelName(16992,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620004,user.getLanguage()));
er.addStringValue("PR"+SystemEnv.getHtmlLabelName(403,user.getLanguage()));
er.addStringValue("PR"+SystemEnv.getHtmlLabelName(856,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620010,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620011,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620006,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620012,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620013,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620014,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(614,user.getLanguage())+SystemEnv.getHtmlLabelName(722,user.getLanguage()));
er.addStringValue("合同状态");
er.addStringValue("销售合同");
er.addStringValue("销售合同状态");
while (RecordSet.next()) {
ExcelRow erdetail = es.newExcelRow();
erdetail.addStringValue(SubCompanyComInfo.getSubCompanyname(RecordSet.getString("subcompanyid1")));
erdetail.addStringValue(DepartmentComInfo.getDepartmentname(RecordSet.getString("reqDeptId")));
erdetail.addStringValue(CrmSupplierComInfo.getSuppliername(RecordSet.getString("suppliersId")));
erdetail.addStringValue(RecordSet.getString("conNo"));
erdetail.addStringValue(RecordSet.getString("name"));
erdetail.addStringValue(RecordSet.getString("startDate"));
erdetail.addStringValue(RecordSet.getString("endDate"));
erdetail.addStringValue(RecordSet.getString("isOverdue"));
erdetail.addStringValue(RecordSet.getString("conAmount"));
erdetail.addStringValue(Util.toScreen(SptmForDoc.getDocName(RecordSet.getString("content")), user.getLanguage()));
erdetail.addStringValue(RecordSet.getString("isOverdueNext"));
erdetail.addStringValue(RecordSet.getString("status"));
erdetail.addStringValue(Util.toScreen(ResourceComInfo.getResourcename(RecordSet.getString("creator")), user.getLanguage()));
erdetail.addStringValue(RecordSet.getString("isOneSuppliers"));
erdetail.addStringValue(RequestComInfo.getRequestname(RecordSet.getString("prRequestId")));
erdetail.addStringValue(RecordSet.getString("jpcNo"));
erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("jpcFile")));
erdetail.addStringValue(RecordSet.getString("prNo"));
erdetail.addStringValue(RecordSet.getString("prAmount"));
erdetail.addStringValue(RecordSet.getString("prAmountSum"));
erdetail.addStringValue(ResourceComInfo.getResourcename(RecordSet.getString("managerId")));
erdetail.addStringValue(RecordSet.getString("subject"));
erdetail.addStringValue(RecordSet.getString("giveDate"));
erdetail.addStringValue(RecordSet.getString("giveRemark"));
erdetail.addStringValue(RecordSet.getString("payRemark"));
erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("content")));
erdetail.addStringValue(RecordSet.getString("createDate"));
erdetail.addStringValue(RecordSet.getString("reNewStatus"));
erdetail.addStringValue(RecordSet.getString("contractName"));
erdetail.addStringValue(RecordSet.getString("reNewStatus2"));
}
ExcelFile.init();
ExcelFile.setFilename("合同报表");
ExcelFile.addSheet("合同", es);
%>
<iframe name="ExcelOut" id="ExcelOut" src="/weaver/weaver.file.ExcelOut" style="display:none" ></iframe>
<%--<script language="javascript">--%>
<%-- window.location = "/weaver/weaver.file.ExcelOut";--%>
<%--</script>--%>

View File

@ -1,499 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/WEB-INF/tld/browser.tld" prefix="brow"%>
<%@ page import="weaver.file.Prop" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="weaver.systeminfo.SystemEnv" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="RecordSet_count" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page" />
<jsp:useBean id="CrmSupplierComInfo" class="weaver.crm.supplierinfo.CrmSupplierComInfo" scope="page" />
<jsp:useBean id="RecordSet_Dep" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" /><!--zl-->
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<style>
td * {font-size:9px !important;}
</style>
</head>
<%
String sqlwhere = " where 1=1 ";
String subcompanyid1 = ResourceComInfo.getSubCompanyID(String.valueOf(user.getUID()));
//是否采购部
boolean isDep = false;
//是否是流程接收人
boolean isShow = false;
//采购部的同事可以选择所有合同卡片;而本部门的人员(非采购部)只能选择本部门的合同卡片
RecordSet_Dep.executeSql("select * from HrmDepartment where departmentname like '%采购%' and id="+user.getUserDepartment());
if(RecordSet_Dep.next()) isDep = true;
//是否合同流程接收人
String sqlwhere_workflow = "";
RecordSet_Dep.executeSql("select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID());
if(RecordSet_Dep.next()) isShow = true;
if(!HrmUserVarify.checkUserRight("ContactInfo:Manager", user) && !HrmUserVarify.checkUserRight("ContactInfo:User", user) && !isShow && !isDep){
response.sendRedirect("/notice/noright.jsp");
}
//如果是合同管理权限则直接1=1
if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){
sqlwhere += " and 1=1";
}else if(isShow && HrmUserVarify.checkUserRight("ContactInfo:User", user)){
//如果是流程接收人,并且有合同查看权限
sqlwhere += " and (requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+") or reqDeptId = '"+user.getUserDepartment()+"')";
}else if(HrmUserVarify.checkUserRight("ContactInfo:User", user)){
//如果只有合同查看权限
sqlwhere += " and reqDeptId = '"+user.getUserDepartment()+"'";
}else if(isShow){
//如果只是流程接收人
sqlwhere += " and requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+")";
}
//如果没有查看全部的权限,加分部条件
if(!HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){
if (!subcompanyid1.equals("0")) {sqlwhere += " and CrmContractInfo.subcompanyid1 = '"+subcompanyid1+"' ";}
}
String imagefilename = "/images/hdReport.gif";
String titlename = SystemEnv.getHtmlLabelName(614, user.getLanguage()) + SystemEnv.getHtmlLabelName(527, user.getLanguage());
String needfav = "1";
String needhelp = "";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp"%>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%>
<%
RCMenu += "{" + SystemEnv.getHtmlLabelName(197, user.getLanguage()) + ",javascript:OnSearch(),_top} ";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + "Excel,javascript:ContractExport(),_top} ";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(18363, user.getLanguage()) + ",javascript:_table.firstPage(),_self}";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(1258, user.getLanguage()) + ",javascript:_table.prePage(),_self}";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(1259, user.getLanguage()) + ",javascript:_table.nextPage(),_self}";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{" + SystemEnv.getHtmlLabelName(18362, user.getLanguage()) + ",javascript:_table.lastPage(),_self}";
RCMenuHeight += RCMenuHeightStep;
%>
<%
int pagenum = Util.getIntValue(request.getParameter("pagenum"), 1);
int perpage = Util.getPerpageLog();
if (perpage <= 1) perpage = 10;
String creator = Util.fromScreen(request.getParameter("creator"), user.getLanguage());
String fromdate = Util.fromScreen(request.getParameter("fromdate"), user.getLanguage());
String fromdate2 = Util.fromScreen(request.getParameter("fromdate2"), user.getLanguage());
String enddate = Util.fromScreen(request.getParameter("enddate"), user.getLanguage());
String enddate2 = Util.fromScreen(request.getParameter("enddate2"), user.getLanguage());
String status_temp = Util.null2String(request.getParameter("status_temp"));
String conNo = Util.fromScreen(request.getParameter("conNo"), user.getLanguage());
String prNo = Util.fromScreen(request.getParameter("prNo"), user.getLanguage());
String jpcNo = Util.fromScreen(request.getParameter("jpcNo"), user.getLanguage());
String suppliersId = Util.fromScreen(request.getParameter("suppliersId"), user.getLanguage());
String isOneSuppliers = Util.fromScreen(request.getParameter("isOneSuppliers"), user.getLanguage());
// String reqDeptId = String.valueOf(user.getUserDepartment());
String reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage());;
//管理员组或采购部才能查询所有部门下合同,合同接收人查看接收的合同
// if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user) || isShow) reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage());
String isOverdue = Util.fromScreen(request.getParameter("isOverdue"), user.getLanguage());
String status = Util.fromScreen(request.getParameter("status"), user.getLanguage());
String isOverdueNext = Util.fromScreen(request.getParameter("isOverdueNext"), user.getLanguage());
String conType = Util.fromScreen(request.getParameter("conType"), user.getLanguage());
String name = Util.fromScreen(request.getParameter("name"), user.getLanguage());
String subCompanyId = Util.fromScreen(request.getParameter("subCompanyId"), user.getLanguage());
String reNewStatus = Util.fromScreen(request.getParameter("reNewStatus"), user.getLanguage());
String conStatus = Util.fromScreen(request.getParameter("conStatus"), user.getLanguage());
String contractName = Util.fromScreen(request.getParameter("contractName"), user.getLanguage());
String csstatus = Util.fromScreen(request.getParameter("csstatus"), user.getLanguage());
int opentype = Util.getIntValue(request.getParameter("opentype"),-1);
//String sqlwhere = " where status = '' ";
//if(!"".equals(status_temp)) sqlwhere += " and status in ("+status_temp+") ";
if (!fromdate.equals("")) sqlwhere += " and startDate>='" + fromdate + "'";
if (!fromdate2.equals("")) sqlwhere += " and startDate<='" + fromdate2 + "'";
if (!enddate.equals("")) sqlwhere += " and enddate>='" + enddate + "'";
if (!enddate2.equals("")) sqlwhere += " and enddate<='" + enddate2 + "'";
if (!conNo.equals("")) sqlwhere += " and conNo like '%" + conNo + "%'";
if (!prNo.equals("")) sqlwhere += " and prNo='" + prNo + "'";
if (!jpcNo.equals("")) sqlwhere += " and jpcNo='" + jpcNo + "'";
if(!"".equals(suppliersId)) sqlwhere += " and suppliersId=" + suppliersId;
if (!isOneSuppliers.equals("")) sqlwhere += " and isOneSuppliers='" + isOneSuppliers + "'";
if (!"".equals(creator) && !"0".equals(creator)) sqlwhere += " and CrmContractInfo.creator=" + creator;
if (!reqDeptId.equals("")) sqlwhere += " and reqDeptId=" + reqDeptId;
if (!isOverdue.equals("")) sqlwhere += " and isOverdue='" + isOverdue + "'";
if (!status.equals("")) sqlwhere += " and CrmContractInfo.status='" + status + "'";
if (!isOverdueNext.equals("")) sqlwhere += " and isOverdueNext='" + isOverdueNext + "'";
if (!conType.equals("")) sqlwhere += " and conType='" + conType + "'";
if (!csstatus.equals("")) sqlwhere += " and CrmSalesContractInfo.status='" + csstatus + "'";
if (!name.equals("")) sqlwhere += " and name like '%" + name + "%'";
if (!subCompanyId.equals("")) sqlwhere += " and CrmContractInfo.subcompanyid1 = '" + subCompanyId + "'";
if (!reNewStatus.equals("")) sqlwhere += " and conStatus = '" + reNewStatus + "'";
if (!contractName.equals("")) sqlwhere += " and contractName like '%" + contractName + "%'";
//if (reNewStatus2.equals("待续签")) sqlwhere += " and dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0";
//else if (reNewStatus2.equals("已续签")) sqlwhere += " and dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0";
//else if (reNewStatus2.equals("无需续签")) sqlwhere += " and dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0";
//System.out.println("sqlwhere:"+sqlwhere);
if(opentype > -1){
sqlwhere += " and isnull(CrmContractInfo.opentype,0) = " + opentype;
}
String orderStr = " order by startDate desc, CrmContractInfo.id desc ";
// out.println("sqlwhere:" + sqlwhere);
// out.println("orderStr:" + orderStr);
// session.setAttribute("sqlwhere", sqlwhere);
// session.setAttribute("orderStr", orderStr);
%>
<form id=frmmain name=frmmain method=post action="ContractList.jsp">
<input type=hidden id=pagenum name=pagenum value="<%=pagenum%>">
<input type=hidden id=status_temp name=status_temp value="">
<table class=ViewForm>
<tbody>
<COLGROUP>
<COL width="13%">
<COL width="20%">
<COL width="14%">
<COL width="20%">
<COL width="13%">
<COL width="20%">
<TR class=Title>
<TH colSpan=6><%=SystemEnv.getHtmlLabelName(15774, user.getLanguage())%></TH>
</TR>
<tr style="height: 1px">
<td class=Line1 colspan=6></td>
</tr>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<tr>
<TD>合同状态</TD>
<TD class=Field>
<select id="reNewStatus" name="reNewStatus">
<option value="" <%="".equals(reNewStatus)?"selected":""%>></option>
<option value="0" <%="0".equals(reNewStatus)?"selected":""%>>执行</option>
<option value="1" <%="1".equals(reNewStatus)?"selected":""%>>待续签</option>
<option value="2" <%="2".equals(reNewStatus)?"selected":""%>>已续签</option>
<option value="3" <%="3".equals(reNewStatus)?"selected":""%>>关闭</option>
</select>
</TD>
<td><%=SystemEnv.getHtmlLabelName(1970, user.getLanguage())%></td>
<td class=field>
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('fromdatespan','fromdate')></BUTTON>&nbsp;
<SPAN id=fromdatespan><%=Util.toScreen(fromdate, user.getLanguage())%></SPAN>&nbsp;-&nbsp;
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('fromdate2span','fromdate2')></BUTTON>&nbsp;
<SPAN id=fromdate2span><%=Util.toScreen(fromdate2, user.getLanguage())%></SPAN>
<input type="hidden" name="fromdate" value=<%=fromdate%>>
<input type="hidden" name="fromdate2" value=<%=fromdate2%>>
</td>
<td><%=SystemEnv.getHtmlLabelName(15236, user.getLanguage())%></td>
<td class=field>
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('enddatespan','enddate')></BUTTON>&nbsp;
<SPAN id=enddatespan><%=Util.toScreen(enddate, user.getLanguage())%></SPAN>&nbsp;-&nbsp;
<BUTTON type="button" class=calendar id=SelectDate onclick=getDate('enddate2span','enddate2')></BUTTON>&nbsp;
<SPAN id=enddate2span><%=Util.toScreen(enddate2, user.getLanguage())%></SPAN>
<input type="hidden" name="enddate" value=<%=enddate%>>
<input type="hidden" name="enddate2" value=<%=enddate2%>>
</td>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(21282, user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=100 id="conNo" name="conNo" STYLE="width:150" value="<%=conNo%>">
</TD>
<TD>PR<%=SystemEnv.getHtmlLabelName(403,user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=100 id="prNo" name="prNo" STYLE="width:150" value="<%=prNo%>">
</TD>
<TD>JPC<%=SystemEnv.getHtmlLabelName(2171,user.getLanguage())%><%=SystemEnv.getHtmlLabelName(16992,user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=100 id="jpcNo" name="jpcNo" STYLE="width:150" value="<%=jpcNo%>">
</TD>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(613002, user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="suppliersId"
name="suppliersId"
browserValue="<%=suppliersId %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/interface/CommonBrowser.jsp?type=browser.gys"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=CrmSupplierComInfo.getSuppliername(suppliersId) %>">
</brow:browser>
</TD>
<TD></TD>
<TD class=Field>
</TD>
<TD><%=SystemEnv.getHtmlLabelName(913, user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="creator"
name="creator"
browserValue="<%=creator %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=ResourceComInfo.getResourcename(creator) %>">
</brow:browser>
</TD>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(620002, user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="reqDeptId"
name="reqDeptId"
browserValue="<%=reqDeptId %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage())%>">
</brow:browser>
<%-- <%--%>
<%-- //管理员组才能查询所有部门下合同--%>
<%-- if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){--%>
<%-- %>--%>
<%-- <brow:browser viewType="0"--%>
<%-- id="reqDeptId"--%>
<%-- name="reqDeptId"--%>
<%-- browserValue="<%=reqDeptId %>"--%>
<%-- browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp"--%>
<%-- hasInput="true"--%>
<%-- isSingle="true"--%>
<%-- hasBrowser = "true"--%>
<%-- isMustInput='1'--%>
<%-- width="165px"--%>
<%-- browserSpanValue="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage())%>">--%>
<%-- </brow:browser>--%>
<%-- &lt;%&ndash;<INPUT type=hidden class="wuiBrowser" _required="no" _displayTemplate="#b{name}" _displayText="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage()) %>" _url="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp" name="reqDeptId" value="<%=reqDeptId%>">&ndash;%&gt;--%>
<%-- <%}else{ %>--%>
<%-- <%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage()) %>--%>
<%-- <%} %>--%>
</TD>
<TD>付款状态</TD>
<TD class=Field>
<select id="status" name="status">
<option value="" <%="".equals(status)?"selected":""%>></option>
<option value="0" <%="0".equals(status)?"selected":""%>>执行中</option>
<option value="1" <%="1".equals(status)?"selected":""%>>已结清</option>
</select>
</TD>
<TD><%=SystemEnv.getHtmlLabelName(620017, user.getLanguage())%></TD>
<TD class=Field>
<select id="isOverdueNext" name="isOverdueNext">
<option value="" <%="".equals(isOverdueNext)?"selected":""%>></option>
<option value="Y" <%="Y".equals(isOverdueNext)?"selected":""%>><%=SystemEnv.getHtmlLabelName(163,user.getLanguage())%></option>
<option value="N" <%="N".equals(isOverdueNext)?"selected":""%>><%=SystemEnv.getHtmlLabelName(161,user.getLanguage())%></option>
</select>
</TD>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(15775, user.getLanguage())%></TD>
<TD class=Field>
<select id="conType" name="conType">
<option value="" <%="".equals(conType)?"selected":""%>></option>
<option value="0" <%="0".equals(conType)?"selected":""%>>业务型</option>
<option value="1" <%="1".equals(conType)?"selected":""%>>资本型</option>
<option value="2" <%="2".equals(conType)?"selected":""%>>费用型</option>
</select>
</TD>
<TD><%=SystemEnv.getHtmlLabelName(15142, user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=200 id="name" name="name" STYLE="width:150" value="<%=name%>">
</TD>
<%if(HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){%>
<TD><%=SystemEnv.getHtmlLabelName(141,user.getLanguage())%></TD>
<TD class=Field>
<brow:browser viewType="0"
id="subCompanyId"
name="subCompanyId"
browserValue="<%=subCompanyId %>"
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp"
hasInput="true"
isSingle="true"
hasBrowser = "true"
isMustInput='1'
width="165px"
browserSpanValue="<%=SubCompanyComInfo.getSubCompanyname(subCompanyId+"")%>">
</brow:browser>
<%--<input class=wuiBrowser class=inputStyle id=subCompanyId type=hidden name=subCompanyId value="<%=subCompanyId%>"--%>
<%--_url="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp"--%>
<%--_displayText="<%=SubCompanyComInfo.getSubCompanyname(subCompanyId+"")%>"--%>
<%-->--%>
</TD>
<%}%>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(16404, user.getLanguage())%><%=SystemEnv.getHtmlLabelName(195, user.getLanguage())%></TD>
<TD class=Field>
<INPUT class=InputStyle maxLength=200 id="contractName" name="contractName" STYLE="width:150" value="<%=contractName%>">
</TD>
<TD>销售合同状态</TD>
<TD class=Field>
<select id="csstatus" name="csstatus">
<option value="" <%="".equals(csstatus)?"selected":""%>></option>
<option value="0" <%="0".equals(csstatus)?"selected":""%>>已签署</option>
<option value="1" <%="1".equals(csstatus)?"selected":""%>>未签署</option>
<option value="2" <%="2".equals(csstatus)?"selected":""%>>已续签</option>
<option value="3" <%="3".equals(csstatus)?"selected":""%>>关闭</option>
</select>
</TD>
<td>开闭口类型</td>
<td class="Field">
<select name="opentype">
<option value="-1" <%=(opentype == -1) ?"selected":"" %>>--请选择--</option>
<option value="0" <%=(opentype == 0) ?"selected":"" %>>闭口</option>
<option value="1" <%=(opentype == 1) ?"selected":"" %>>开口</option>
<option value="2" <%=(opentype == 2) ?"selected":"" %>>周期性</option>
</select>
</td>
</TR>
<tr style="height: 1px">
<td class=Line colspan=6></td>
</tr>
</tbody>
</table>
</form>
<div id="" style="overflow-x:scroll;width:100%;">
<table width="2500px" style="table-Layout:fixed">
<tr>
<td>
<%
String tableString = "";
String backfields = " CrmContractInfo.id,case CrmContractInfo.opentype when '0' then '闭口' when '1' then '开口' when '2' then '周期性' end opentype, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, ',' as str_temp, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, CrmContractInfo.creator, CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus, contractName, saleContract, case when dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0 then '已续签' when dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0 then '待续签' when dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0 then '无需续签' end as reNewStatus2,case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as csstatus ";
String fromSql = " CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract ";
//out.print("select"+backfields+"from"+fromSql +sqlwhere);
String str_content = "content"+"str_temp";
tableString = " <table instanceid=\"crmContractInfoTable\" tabletype=\"none\" pageId=\"perpage\" pagesize=\"" +PageIdConst.getPageSize("perpage",user.getUID())+"\" >" + "<sql backfields=\"" + backfields + "\" sqlform=\"" + fromSql + "\" sqlwhere=\"" + Util.toHtmlForSplitPage(sqlwhere) + "\" sqlprimarykey=\"CrmContractInfo.id\" sqlsortway=\"Desc\" sqlisdistinct=\"false\" />" + "<head>";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(15142, user.getLanguage()) + "\" column=\"name\" orderkey=\"name\" linkkey=\"id\" linkvaluecolumn=\"id\" href=\"/CRM/contractinfo/ContractEdit.jsp\" target=\"_fullwindow\" />";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(21282, user.getLanguage()) + "\" column=\"conNo\" orderkey=\"conNo\" />";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(620002, user.getLanguage()) + "\" column=\"reqDeptId\" orderkey=\"reqDeptId\" transmethod=\"weaver.hrm.company.DepartmentComInfo.getDepartmentname\" linkkey=\"id\" href=\"/hrm/company/HrmDepartmentDsp.jsp\" target=\"_fullwindow\" />";
tableString += "<col width=\"10%\" text=\""+ SystemEnv.getHtmlLabelName(613002, user.getLanguage()) + "\" column=\"suppliersId\" orderkey=\"suppliersId\" linkkey=\"id\" transmethod=\"weaver.crm.supplierinfo.CrmSupplierComInfo.getSuppliername\" href=\"/CRM/supplierinfo/SuppliersEdit.jsp?1=1\" target=\"_fullwindow\" />";
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(1970, user.getLanguage()) + "\" column=\"startDate\" orderkey=\"startDate\" />";
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(15236, user.getLanguage()) + "\" column=\"endDate\" orderkey=\"endDate\" />";
//tableString += "<col width=\"3%\" text=\"" + SystemEnv.getHtmlLabelName(620016, user.getLanguage()) + "\" column=\"isOverdue\" orderkey=\"isOverdue\" />";
tableString += "<col width=\"6%\" text=\"" + SystemEnv.getHtmlLabelName(6146, user.getLanguage()) + "\" column=\"conAmount\" orderkey=\"conAmount\" />";
tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(620015, user.getLanguage()) + "\" column=\"content\" orderkey=\""+str_content+"\" transmethod=\"weaver.splitepage.transform.SptmForDoc.getDocNames\" />";
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(620017, user.getLanguage()) + "\" column=\"isOverdueNext\" orderkey=\"isOverdueNext\" />";
tableString += "<col width=\"4%\" text=\"付款状态\" column=\"status\" orderkey=\"status\" />";
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(913, user.getLanguage()) + "\" column=\"creator\" orderkey=\"creator\" linkkey=\"id\" transmethod=\"weaver.hrm.resource.ResourceComInfo.getResourcename\" href=\"/hrm/resource/HrmResource.jsp?1=1\" target=\"_fullwindow\" />";
//tableString += "<col width=\"10%\" text=\"" + SystemEnv.getHtmlLabelName(104, user.getLanguage()) + "\" column=\"id\" orderkey=\"id\" transmethod=\"weaver.crm.contractinfo.CrmContractTool.getLinkButtons\" />";
tableString += "<col width=\"4%\" text=\"合同状态\" column=\"reNewStatus\" orderkey=\"reNewStatus\" />";
tableString += "<col width=\"4%\" text=\"销售合同\" column=\"contractName\" orderkey=\"contractName\" linkkey=\"id\" linkvaluecolumn=\"saleContract\" href=\"/CRM/salecontractinfo/SaleContractEdits.jsp?metherid=search\" target=\"_fullwindow\" />";
tableString += "<col width=\"4%\" text=\"销售合同状态\" column=\"csstatus\" orderkey=\"csstatus\" />";
tableString += "<col width=\"4%\" text=\"开闭口类型\" column=\"opentype\" orderkey=\"opentype\" />";
tableString += "<col width=\"4%\" text=\"" + SystemEnv.getHtmlLabelName(141,user.getLanguage()) + "\" column=\"subcompanyid1\" orderkey=\"subcompanyid1\" transmethod=\"weaver.hrm.company.SubCompanyComInfo.getSubCompanyname\" />";
tableString += "</head>";
tableString += "</table>";
%>
<input type="hidden" name="pageId" id="pageId" value="crmContractInfoTable" />
<wea:SplitPageTag tableString="<%=tableString%>" mode="run" />
</td>
</tr>
</table>
</div>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%>
</body>
<iframe id="searchexport" style="display: none"></iframe>
<script language=javascript>
function ContractExport() {
var sqlwhere = encodeURI("<%=sqlwhere%>");
var orderStr = encodeURI("<%=orderStr%>");
jQuery("#searchexport").attr("src", "ContractReportExport.jsp?sqlwhere="+sqlwhere+"&orderStr=" + orderStr);
}
function OnSubmit(pagenum) {
document.frmmain.pagenum.value = pagenum;
document.frmmain.submit();
}
function OnSearch(){
var chkInTableTags = document.getElementsByName("status");
var status_temp = "";
for(var i=0;i<chkInTableTags.length;i++){
if(chkInTableTags[i].checked && chkInTableTags[i].value != ''){
if(status_temp == "") status_temp = "'" + chkInTableTags[i].value + "'";
else status_temp = status_temp + ",'" + chkInTableTags[i].value + "'";
}
}
jQuery("#status_temp").val(status_temp);
document.frmmain.submit();
}
//续签
function newWorkflowByContract4(key){
location.href = "ContractNewWorkflow.jsp?status=4&id="+key;
}
//试运作
function newWorkflowByContract3(key){
location.href = "ContractNewWorkflow.jsp?status=3&id="+key;
}
</script>
<SCRIPT language="javascript" src="/js/datetime_wev8.js"></script>
<SCRIPT language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
</html>

View File

@ -1,127 +0,0 @@
<%@ page language="java" contentType="text/html; charset=GBK" %>
<%@ include file="/systeminfo/init.jsp" %>
<%@ page import="weaver.general.Util, weaver.file.ExcelSheet, weaver.file.ExcelRow" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="SptmForDoc" class="weaver.splitepage.transform.SptmForDoc" scope="page"/>
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page"/>
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="CrmSupplierComInfo" class="weaver.crm.supplierinfo.CrmSupplierComInfo" scope="page"/>
<jsp:useBean id="RequestComInfo" class="weaver.workflow.request.RequestComInfo" scope="page"/>
<jsp:useBean id="DocComInfo" class="weaver.docs.docs.DocComInfo" scope="page"/>
<jsp:useBean id="ExcelFile" class="weaver.file.ExcelFile" scope="session"/>
<%!
public static String ToDBC(String input) {
char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == 12288) {
//全角空格为12288半角空格为32
c[i] = (char) 32;
continue;
}
if (c[i] > 65280 && c[i] < 65375)
//其他字符半角(33-126)与全角(65281-65374)的对应关系是均相差65248
c[i] = (char) (c[i] - 65248);
}
return new String(c);
}
%>
<%
// String sqlwhere=(String)session.getAttribute("sqlwhere");
// String orderStr=(String)session.getAttribute("orderStr");
String sqlwhere = request.getParameter("sqlwhere");
sqlwhere = ToDBC(sqlwhere);
String orderStr = request.getParameter("orderStr");
orderStr = ToDBC(orderStr);
String sqlstr = "";
if (RecordSet.getDBType().equals("oracle")) {
sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, case isOneSuppliers when 'Y' then '是' when 'N' then '否' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr;
} else {
sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, case isOneSuppliers when 'Y' then '是' when 'N' then '否' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr;
}
new BaseBean().writeLog(">>>>>>>>"+sqlstr);
RecordSet.executeQuery(sqlstr);
ExcelSheet es = new ExcelSheet();
ExcelRow er = es.newExcelRow();
er.addStringValue(SystemEnv.getHtmlLabelName(141,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620002,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(613002,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(21282,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(15142,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(1970,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(15236,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620016,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(6146,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620017,user.getLanguage()));
er.addStringValue("付款状态");
er.addStringValue(SystemEnv.getHtmlLabelName(913,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620009,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620003,user.getLanguage()));
er.addStringValue("JPC"+SystemEnv.getHtmlLabelName(16992,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620004,user.getLanguage()));
er.addStringValue("PR"+SystemEnv.getHtmlLabelName(403,user.getLanguage()));
er.addStringValue("PR"+SystemEnv.getHtmlLabelName(856,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620010,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620011,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620006,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620012,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620013,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620014,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage()));
er.addStringValue(SystemEnv.getHtmlLabelName(614,user.getLanguage())+SystemEnv.getHtmlLabelName(722,user.getLanguage()));
er.addStringValue("合同状态");
er.addStringValue("销售合同");
er.addStringValue("销售合同状态");
while (RecordSet.next()) {
ExcelRow erdetail = es.newExcelRow();
erdetail.addStringValue(SubCompanyComInfo.getSubCompanyname(RecordSet.getString("subcompanyid1")));
erdetail.addStringValue(DepartmentComInfo.getDepartmentname(RecordSet.getString("reqDeptId")));
erdetail.addStringValue(CrmSupplierComInfo.getSuppliername(RecordSet.getString("suppliersId")));
erdetail.addStringValue(RecordSet.getString("conNo"));
erdetail.addStringValue(RecordSet.getString("name"));
erdetail.addStringValue(RecordSet.getString("startDate"));
erdetail.addStringValue(RecordSet.getString("endDate"));
erdetail.addStringValue(RecordSet.getString("isOverdue"));
erdetail.addStringValue(RecordSet.getString("conAmount"));
erdetail.addStringValue(Util.toScreen(SptmForDoc.getDocName(RecordSet.getString("content")), user.getLanguage()));
erdetail.addStringValue(RecordSet.getString("isOverdueNext"));
erdetail.addStringValue(RecordSet.getString("status"));
erdetail.addStringValue(Util.toScreen(ResourceComInfo.getResourcename(RecordSet.getString("creator")), user.getLanguage()));
erdetail.addStringValue(RecordSet.getString("isOneSuppliers"));
erdetail.addStringValue(RequestComInfo.getRequestname(RecordSet.getString("prRequestId")));
erdetail.addStringValue(RecordSet.getString("jpcNo"));
erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("jpcFile")));
erdetail.addStringValue(RecordSet.getString("prNo"));
erdetail.addStringValue(RecordSet.getString("prAmount"));
erdetail.addStringValue(RecordSet.getString("prAmountSum"));
erdetail.addStringValue(ResourceComInfo.getResourcename(RecordSet.getString("managerId")));
erdetail.addStringValue(RecordSet.getString("subject"));
erdetail.addStringValue(RecordSet.getString("giveDate"));
erdetail.addStringValue(RecordSet.getString("giveRemark"));
erdetail.addStringValue(RecordSet.getString("payRemark"));
erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("content")));
erdetail.addStringValue(RecordSet.getString("createDate"));
erdetail.addStringValue(RecordSet.getString("reNewStatus"));
erdetail.addStringValue(RecordSet.getString("contractName"));
erdetail.addStringValue(RecordSet.getString("reNewStatus2"));
}
ExcelFile.init();
ExcelFile.setFilename("合同报表");
ExcelFile.addSheet("合同", es);
%>
<iframe name="ExcelOut" id="ExcelOut" src="/weaver/weaver.file.ExcelOut" style="display:none" ></iframe>
<%--<script language="javascript">--%>
<%-- window.location = "/weaver/weaver.file.ExcelOut";--%>
<%--</script>--%>

View File

@ -305,7 +305,7 @@ public class NormalTest extends BaseTest {
queryParam.put("fieldValue","mqErrorLogModelId");
ModeMapper mapper = Util.getMapper(ModeMapper.class);
Map<String, Object> modeData = mapper.queryModeDataInfo("uf_systemconfig", queryParam);
modeChangeService.changeOtherMode(modeData,"-18");
modeChangeService.changeOtherMode(modeData,"-18",1);
}
@Test
@ -341,4 +341,11 @@ public class NormalTest extends BaseTest {
String s = customSearchDepart.generateSqlCondition(param);
}
@Test
public void testSub(){
String sourceStr = ",0,1,2,";
String value = ",0,";
System.out.println(sourceStr.contains(value));
}
}