103 lines
2.6 KiB
Plaintext
103 lines
2.6 KiB
Plaintext
|
|
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||
|
|
<%@page import="weaver.general.Util"%>
|
||
|
|
<%@ page import="java.math.BigDecimal" %>
|
||
|
|
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
|
||
|
|
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page" />
|
||
|
|
<jsp:useBean id="rss" class="weaver.conn.RecordSet" scope="page" />
|
||
|
|
<jsp:useBean id="rst" class="weaver.conn.RecordSet" scope="page" />
|
||
|
|
<%
|
||
|
|
int sub_sum = 0;
|
||
|
|
|
||
|
|
int dept_sum = 0;
|
||
|
|
|
||
|
|
String lsh = "1";
|
||
|
|
|
||
|
|
rs.executeQuery("select * from hrmsubcompany where canceled is null order by showOrderOfTree");
|
||
|
|
while(rs.next()){
|
||
|
|
String mxid = Util.null2String(rs.getString("id"));
|
||
|
|
String newlsh = "";
|
||
|
|
if(lsh.length() == 1){
|
||
|
|
newlsh = "LY000"+lsh;
|
||
|
|
}
|
||
|
|
if(lsh.length() == 2){
|
||
|
|
newlsh = "LY00"+lsh;
|
||
|
|
}
|
||
|
|
if(lsh.length() == 3){
|
||
|
|
newlsh = "LY0"+lsh;
|
||
|
|
}
|
||
|
|
if(lsh.length() == 4){
|
||
|
|
newlsh = "LY"+lsh;
|
||
|
|
}
|
||
|
|
boolean bool = rst.executeUpdate("update hrmsubcompany set subcompanycode=? where id = ?",newlsh,mxid);
|
||
|
|
if(bool){
|
||
|
|
lsh = floatAdd(lsh,"1");
|
||
|
|
sub_sum++;
|
||
|
|
}
|
||
|
|
|
||
|
|
String lshh = "1";
|
||
|
|
rs1.executeQuery("select * from hrmdepartment where canceled is null and subcompanyid1=? order by showOrderOfTree",mxid);
|
||
|
|
while(rs1.next()){
|
||
|
|
String deptid = Util.null2String(rs1.getString("id"));
|
||
|
|
String newlshh = "";
|
||
|
|
if(lshh.length() == 1){
|
||
|
|
newlshh = newlsh+"000"+lshh;
|
||
|
|
}
|
||
|
|
if(lshh.length() == 2){
|
||
|
|
newlshh = newlsh+"00"+lshh;
|
||
|
|
}
|
||
|
|
if(lshh.length() == 3){
|
||
|
|
newlshh = newlsh+"0"+lshh;
|
||
|
|
}
|
||
|
|
if(lshh.length() == 4){
|
||
|
|
newlshh = newlsh+lshh;
|
||
|
|
}
|
||
|
|
boolean booll = rss.executeUpdate("update hrmdepartment set departmentcode=? where id = ?",newlshh,deptid);
|
||
|
|
if(booll){
|
||
|
|
lshh = floatAdd(lshh,"1");
|
||
|
|
dept_sum++;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
%>
|
||
|
|
|
||
|
|
<%!
|
||
|
|
/**
|
||
|
|
* 方法描述 : 对两个字符串进行金额的相加
|
||
|
|
* @param a
|
||
|
|
* @param b
|
||
|
|
* @return
|
||
|
|
* String
|
||
|
|
*/
|
||
|
|
public static String floatAdd(String a, String b) {
|
||
|
|
a=a.equals("")?"0":a;
|
||
|
|
b=b.equals("")?"0":b;
|
||
|
|
BigDecimal bg1 = new BigDecimal(a);
|
||
|
|
BigDecimal bg2 = new BigDecimal(b);
|
||
|
|
BigDecimal bd = bg1.add(bg2);
|
||
|
|
return bd.toString();
|
||
|
|
}
|
||
|
|
|
||
|
|
%>
|
||
|
|
|
||
|
|
|
||
|
|
<HEAD>
|
||
|
|
</HEAD>
|
||
|
|
<BODY>
|
||
|
|
|
||
|
|
<h1>Congratulation Mode 666666 !</h1>
|
||
|
|
|
||
|
|
<h1> 分部的 <%=sub_sum%> </h1>
|
||
|
|
|
||
|
|
<h1> 部门的 <%=dept_sum%> </h1>
|
||
|
|
|
||
|
|
</BODY>
|