| | |
| | | import cn.ksource.core.util.ConvertUtil; |
| | | import cn.ksource.core.util.DateUtil; |
| | | import cn.ksource.core.util.StringUtil; |
| | | import cn.ksource.web.Constants; |
| | | |
| | | import com.lowagie.text.pdf.PRAcroForm; |
| | | |
| | | import org.apache.commons.lang.StringEscapeUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import java.sql.Struct; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by chenlong |
| | |
| | | if(StringUtil.isBlank(params.get("gmt_register"))){ |
| | | params.put("gmt_register", null); |
| | | } |
| | | |
| | | |
| | | StringBuilder sql = new StringBuilder(); |
| | | if(StringUtil.isBlank(id)){//新增 |
| | | id = StringUtil.getUUID(); |
| | |
| | | "email=:email,contacts=:contacts,contacts_tel=:contacts_tel,province=:province,province_id=:province_id,city=:city,city_id=:city_id,county=:county,county_id=:county_id," + |
| | | "address=:address,note=:note,gmt_modified=:gmt_modified where id=:id "); |
| | | } |
| | | |
| | | |
| | | //保存基本信息 |
| | | baseDao.execute(sql.toString(), params); |
| | | SUPPLIER_MODIFY_RECORD supplier_modify_record=new SUPPLIER_MODIFY_RECORD(); |
| | |
| | | |
| | | @Override |
| | | public String delSupplier(String id,String state) { |
| | | |
| | | |
| | | String sqlString="select count(*) from SPARE_PART where SUPPLIER_ID=:supplier_id and state in(1,2,3,4,5)"; |
| | | Map paramMap = new HashMap(); |
| | | paramMap.put("supplier_id", id); |
| | |
| | | " from spare_part a,spare_part_apply_entity b,cmdb_ci_base c ,spare_part_apply d,cmdb_ci_category e " + |
| | | " where a.id = b.entity_id and b.ci_id = c.id and b.order_id=d.id and b.state=2 and a.cate_id =e.id "); |
| | | |
| | | |
| | | |
| | | //项目 |
| | | if(StringUtil.isNotBlank(params.get("cus_id"))){ |
| | | sql.append(" and c.cus_id = :cus_id "); |
| | |
| | | String sql = "select count(*) from ( "+this.getCateGorySpareList(params)+ " ) t"; |
| | | return baseDao.queryForInteger(sql, params); |
| | | } |
| | | |
| | | |
| | | // 获得备件分类列表查询条件 |
| | | private String getCateGorySpareList(Map<String,String> params){ |
| | | |
| | | |
| | | StringBuilder sql = new StringBuilder("SELECT b.id,b.LV1_NAME,b.LV2_NAME,b.LV3_NAME,b.CODE,(select code from cmdb_ci_category where id=b.LV1_id) code1,(select code from cmdb_ci_category where id=b.LV2_id) code2 ,count(*) SL FROM " |
| | | +" cmdb_ci_category b left join spare_part a on b.ID = a.CATE_ID" |
| | | +" WHERE a.state = 1 and b.state = 1 and b.cate_type = 2 "); |
| | |
| | | sql.append(")"); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (StringUtil.isNotBlank(cate_id)) { |
| | | sql.append(" and b.ID =:bjfl "); |
| | | params.put("bjfl",cate_id ); |
| | | } |
| | | |
| | | |
| | | if (StringUtil.isNotBlank(code)) { |
| | | sql.append(" and b.code like :flbm "); |
| | | params.put("flbm","%"+code+"%" ); |
| | | } |
| | | sql.append(" group by b.id"); |
| | | sql.append(" group by b.id,b.LV1_id,b.LV2_id,b.LV1_NAME, b.LV2_NAME, b.LV3_NAME, b.CODE"); |
| | | return sql.toString(); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | return info; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map> getSparePartOverageSearchListData( |
| | | Map<String, String> params) { |
| | |
| | | params.put("id", params.get("id")); |
| | | return baseDao.queryForList(sql.toString(), params); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 供应商处理记录 |
| | | * @param id |