|
|
@@ -23,12 +23,21 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
|
|
|
public List<ContractInfo> contractMyLaunchList(int p, int pSize, List<String> params, ContractInfo info, IAppSession oasession) throws Exception {
|
|
|
/*String sql = "SELECT ec.universalid, ec.contract_number,ec.contract_name,ec.contract_type,ec.contract_signdate," + "ec.contract_type,tu1.name AS duty_man_name,tu2.name AS salesman_name,"
|
|
|
+ "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name, ec.au_state, ec.flow_id, ec.execute_state ,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "*/
|
|
|
- String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ /*String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
|
|
|
+ "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID " + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID "
|
|
|
+ "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue " + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.contract_type LIKE ? "
|
|
|
+ "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id=" + oasession.getUnit().getId() + ") AND ed.is_valid = '1' "
|
|
|
- + "AND ec.contract_status='0' AND ec.duty_man LIKE ? AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
|
|
|
+ + "AND ec.contract_status='0' AND ec.duty_man LIKE ? AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";*/
|
|
|
+ String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
|
|
|
+ + " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
|
|
|
+ + " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
|
|
|
+ + " tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ + " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
|
|
|
+ + " LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID " + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID "
|
|
|
+ + " LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue " + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.contract_type LIKE ? "
|
|
|
+ + " AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id=" + oasession.getUnit().getId() + ") AND ed.is_valid = '1' "
|
|
|
+ + " AND ec.contract_status='0' AND ec.duty_man LIKE ? AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
|
|
|
return getPagerService().queryForObject(p, pSize, sql, params, info);
|
|
|
}
|
|
|
|
|
|
@@ -41,14 +50,16 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
|
|
|
|
|
|
@Override
|
|
|
public List<ContractInfo> contractMyDepartmentList(int n_p, int n_pSize, List<String> params, ContractInfo info, IAppSession oasession) throws Exception {
|
|
|
- String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name,"
|
|
|
- + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
|
|
|
+ + " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
|
|
|
+ + " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
|
|
|
+ + " tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
//+" ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "
|
|
|
- + "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
|
|
|
- + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
- + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
- + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ? AND ec.contract_type LIKE ? "
|
|
|
- + "AND date_format(IFNULL(ec.contract_startdate, '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id="
|
|
|
+ + " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID "
|
|
|
+ + " LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
+ + " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
+ + " WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ? AND ec.contract_type LIKE ? "
|
|
|
+ + " AND date_format(IFNULL(ec.contract_startdate, '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id="
|
|
|
+ oasession.getUnit().getId() + ") AND ed.is_valid = '1' " + "AND ec.contract_status='0' AND ec.duty_department LIKE ? AND ec.isdraft = '0' " + "AND ec.unit_id="
|
|
|
+ oasession.getUnit().getId() + " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
|
|
|
return getPagerService().queryForObject(n_p, n_pSize, sql, params, info);
|
|
|
@@ -67,13 +78,15 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
|
|
|
|
|
|
@Override
|
|
|
public List<ContractInfo> contractMyCompanyList(int n_p, int n_pSize, List<String> params, ContractInfo info, IAppSession oasession) throws Exception {
|
|
|
- String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name,"
|
|
|
- + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
|
|
|
+ + " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
|
|
|
+ + " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
|
|
|
+ + " tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
//+ " ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "
|
|
|
- + "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
- + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
- + "WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ? AND ec.contract_type LIKE ? "
|
|
|
- + "AND date_format(IFNULL(ec.contract_startdate, '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id="
|
|
|
+ + " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
+ + " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
+ + " WHERE ec.contract_number LIKE ? AND ec.contract_name LIKE ? AND ec.firstparty_name LIKE ? AND ec.secondparty_name LIKE ? AND ec.contract_type LIKE ? "
|
|
|
+ + " AND date_format(IFNULL(ec.contract_startdate, '0000-00-00'),'%Y') LIKE ? " + "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = ? AND group_root_id="
|
|
|
+ oasession.getUnit().getId() + " ) AND ed.is_valid = '1' " + "AND ec.contract_status='0' AND ec.isdraft = '0' " + "AND ec.unit_id=" + oasession.getUnit().getId()
|
|
|
+ " AND (ec.l_form_ins_id is null or ec.is_valid = 1) ORDER BY ec.contract_entrying_date DESC ";
|
|
|
return getPagerService().queryForObject(n_p, n_pSize, sql, params, info);
|
|
|
@@ -95,10 +108,18 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
|
|
|
/*StringBuffer bf = new StringBuffer("SELECT ec.universalid, ec.contract_number,ec.contract_name,ec.contract_type,ec.contract_signdate,"
|
|
|
+ "ec.contract_type,tu1.name AS duty_man_name,tu2.name AS salesman_name," + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name, ec.au_state, ec.flow_id, ec.execute_state, "
|
|
|
+ " ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,ec.process_id,ec.contract_entrying_date "*/
|
|
|
- StringBuffer bf = new StringBuffer("SELECT ec.*, tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ /*StringBuffer bf = new StringBuffer("SELECT ec.*, tu1.name AS duty_man_name,tu2.name AS salesman_name, tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
+ "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
+ "AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = '" + ph.getParam("dic_contract_type") + "' AND group_root_id=" + ph.getParam("unit_id")
|
|
|
+ + " ) AND ed.is_valid = '1' " + "WHERE 1=1 AND ec.contract_status='0' AND ec.isdraft = '0' ");*/
|
|
|
+ StringBuffer bf = new StringBuffer("SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
|
|
|
+ + " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
|
|
|
+ + " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
|
|
|
+ + " tu1.name AS duty_man_name,tu2.name AS salesman_name,tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ + " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
+ + " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
+ + " AND ed.parentid = (SELECT universalid FROM contract_data_dictionary WHERE dvalue = '" + ph.getParam("dic_contract_type") + "' AND group_root_id=" + ph.getParam("unit_id")
|
|
|
+ " ) AND ed.is_valid = '1' " + "WHERE 1=1 AND ec.contract_status='0' AND ec.isdraft = '0' ");
|
|
|
bf.append(whereListSql(ph));
|
|
|
return getPagerService().queryForObject(n_p, n_pSize, bf.toString(), info);
|
|
|
@@ -149,10 +170,13 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
|
|
|
@Override
|
|
|
public List<ContractInfo> excelContractList(ParameterHelper ph) throws Exception {
|
|
|
StringBuffer bf = new StringBuffer();
|
|
|
- String sql = "SELECT ec.*,tu1.name AS duty_man_name,tu2.name AS salesman_name," + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
- + "FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
- + "LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
- + "WHERE 1=1 AND ec.contract_status='0' AND ec.isdraft = '0' ";
|
|
|
+ String sql = "SELECT ec.universalid, ec.contract_number,ec.firstparty_name,ec.secondparty_name,ec.contract_name,ec.contract_type,ec.contract_signdate,"
|
|
|
+ + " ec.contract_type, ec.au_state, ec.flow_id, ec.execute_state,ec.supplier_code,ec.supplier_name,ec.l_form_ins_id,ec.l_form_ins_id,ec.flow_ins_id, ec.is_valid,"
|
|
|
+ + " ec.process_id,ec.contract_entrying_date,ec.purchase_id,ec.purchase_number,ec.order_number, "
|
|
|
+ + " tu1.name AS duty_man_name,tu2.name AS salesman_name," + "tg.GROUPNAME AS duty_department_name ,ed.dname AS contract_type_name "
|
|
|
+ + " FROM contract ec LEFT JOIN t_user tu1 ON ec.duty_man=tu1.UNIVERSALID " + "LEFT JOIN t_user tu2 ON ec.salesman=tu2.UNIVERSALID "
|
|
|
+ + " LEFT JOIN t_group tg ON ec.duty_department=tg.UNIVERSALID " + "LEFT JOIN contract_data_dictionary ed ON ec.contract_type=ed.dvalue "
|
|
|
+ + " WHERE 1=1 AND ec.contract_status='0' AND ec.isdraft = '0' ";
|
|
|
bf.append(sql);
|
|
|
bf.append(this.excelWhereSql(ph));
|
|
|
bf.append(" ORDER BY ec.contract_signdate DESC ");
|
|
|
@@ -164,7 +188,7 @@ public class ContractListDaoImpl extends BaseDao implements ContractListDao {
|
|
|
info.setContract_number(rs.getString("contract_number"));
|
|
|
info.setContract_name(rs.getString("contract_name"));
|
|
|
info.setContract_signdate(rs.getDate("contract_signdate"));
|
|
|
- info.setContract_money(rs.getDouble("contract_money"));
|
|
|
+ info.setContract_money(rs.getBigDecimal("contract_money"));
|
|
|
info.setPayment_method(rs.getString("payment_method"));
|
|
|
info.setWarranty_period(rs.getString("warranty_period"));
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|