|
|
@@ -4,6 +4,7 @@ import beans.brand.Brand;
|
|
|
import beans.datacontrllog.DataContrlLog;
|
|
|
import beans.datateam.DataTeam;
|
|
|
import beans.itemprice.ItemPrice;
|
|
|
+import beans.salearea.SaleArea;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
@@ -15,6 +16,7 @@ import common.annotation.CACHEING_CLEAN;
|
|
|
import common.data.*;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import restcontroller.R;
|
|
|
+import restcontroller.sale.promotion.promotion;
|
|
|
import restcontroller.webmanage.executorService.Executor;
|
|
|
import restcontroller.webmanage.sale.bom.SortByNum;
|
|
|
import restcontroller.webmanage.sale.serviceorder.serviceorder;
|
|
|
@@ -415,6 +417,22 @@ public class workorder extends Controller {
|
|
|
where.append(" and t2.sys_enterpriseid_service ='").append(sys_enterpriseid).append("'");
|
|
|
}
|
|
|
|
|
|
+ Rows usertyperows = dbConnect.runSqlQuery("select t2.usertype from sys_usersite t2 where t2.siteid = 'md' and t2.userid="+userid);
|
|
|
+ if(usertyperows.isNotEmpty()){
|
|
|
+ if(usertyperows.get(0).getString("usertype").equals("2")){
|
|
|
+ SQLFactory areasqlFactory = new SQLFactory(new promotion(content), "区域经理查询下属营销区域");
|
|
|
+ areasqlFactory.addParameter("siteid", siteid);
|
|
|
+ areasqlFactory.addParameter("hrid", hrid);
|
|
|
+ Rows arearows = dbConnect.runSqlQuery(areasqlFactory);
|
|
|
+ ArrayList<Long> arrayList = arearows.toArrayList("sa_saleareaid", new ArrayList<Long>());
|
|
|
+ arrayList.addAll(SaleArea.getSubSaleAreaIds(this, arrayList));
|
|
|
+
|
|
|
+ String sql = " and t2.sys_enterpriseid_service in (select sys_enterpriseid from sys_enterprise_tradefield where sa_saleareaid in " + arrayList + ")";
|
|
|
+ sql = sql.replace("[", "(").replace("]", ")");
|
|
|
+ where.append(sql);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|