sugangqiang 1 an în urmă
părinte
comite
8600241f03
1 a modificat fișierele cu 90 adăugiri și 3 ștergeri
  1. 90 3
      app/admin/controller/TalentTypeChange.php

+ 90 - 3
app/admin/controller/TalentTypeChange.php

@@ -18,6 +18,7 @@ class TalentTypeChange extends AdminController {
     public function gotoIndex() {
         $tpl = null;
         $process = $this->request->param('process');
+        $assigns = [];
         switch ($process) {
             case -1:
                 $tpl = "dept_before"; //移除部门初审
@@ -33,14 +34,31 @@ class TalentTypeChange extends AdminController {
                 break;
             case 4:
                 $tpl = "prepare"; //预备库
-
+                $msgBody = [];
+                switch ($this->user["type"]) {
+                    case 1:
+                        $msgBody["typeName"] = "晋江市优秀人才层次变更";
+                        $msgBody["address"] = "聚才网/人才晋江微信公众号";
+                        $msgBody["dep"] = "中共晋江市委人才办、晋江市纪委监委驻市人力资源和社会保障局纪检监察组或晋江市公共就业和人才服务中心";
+                        $msgBody["phone"] = "0595-85633128";
+                        $msgBody["email"] = "jjrc85661234@163.com";
+                        break;
+                    case 2:
+                        $msgBody["typeName"] = "晋江市集成电路产业优秀人才层次变更";
+                        $msgBody["address"] = "福建(晋江)集成电路产业园官方网站及微信公众号";
+                        $msgBody["dep"] = "集成电路产业园区";
+                        $msgBody["phone"] = "0595-82250007、0595-82250001";
+                        $msgBody["email"] = "jjjcdr@163.com";
+                        break;
+                }
+                $assigns["message"] = $msgBody;
                 break;
             case 5:
                 $tpl = "library"; //正式库
                 break;
         }
 
-        return view($tpl);
+        return view($tpl, $assigns);
     }
 
     public function list() {
@@ -56,6 +74,7 @@ class TalentTypeChange extends AdminController {
         if (in_array($this->user["type"], [1, 2, 5, 6])) {
             $where[] = ["type", "=", $this->user["type"]];
         }
+        $where[] = ["delete", "=", 0];
         switch ($process) {
             case -1:
                 $company = \app\common\api\CompanyApi::getOne($this->user["companyId"]);
@@ -595,7 +614,6 @@ class TalentTypeChange extends AdminController {
         $list = ttcModel::where($where)->select()->toArray();
         Db::startTrans();
         try {
-            $updList = [];
             $logList = [];
             foreach ($list as $key => $item) {
                 $data = ["id" => $item["id"], "isPublic" => 2, "outMsg" => ""];
@@ -671,6 +689,75 @@ class TalentTypeChange extends AdminController {
         }
     }
 
+    /**
+     * 公示
+     */
+    public function publicBatch() {
+        //查询需要公示的数据(勾选)
+        $params = $this->request->param();
+        $ids = array_filter(implode(",", $params["ids"]));
+        $list = ttcModel::where(["id", "in", $ids])->select()->toArray();
+        $logList = [];
+        $recordList = [];
+        for ($i = 0; $i < count($list); $i++) {
+            $obj = $list[$i];
+            
+        }
+        /* StringBuilder sb = new StringBuilder();
+          MessageRecord sendRecord = new MessageRecord(null, 2, 2, null, null, null, SmsProperties . CHECK_PUBLIC);
+          sendRecord . setId(IdWorker . getIdStr());
+          for (int i = 0;
+          i < list.size();
+          i++) {
+          TalentTypeChange obj = list.get(i);
+          obj . setPublicBatch(batch);
+          obj . setIsPublic(3);
+          //添加日志
+          TalentChecklog log = new TalentChecklog(Integer . parseInt(ProjectConst . LEVELCHANGE), obj . getId(), null,
+          StateConst . ACTIVE_YES, BasicStateEnum . RCRD_BASIC_PASS . getCode(), StepEnum . RCRD_STEP_PUBLIC . getCode(),
+          "<span class='label label-success'>待公示</span>-><span class='label label-primary'>公示中</span>",
+          null, DateUtil . getTime(), ShiroKit . getUser() . getAccount() + "(" + company . getName() + ")");
+          logList . add(log);
+          sb . append(obj . getPhone() + "," + typeName + "," + address + "," + publicStartTime + "," + publicEndTime + "," + dep + "," + phone + "," + email + ";");
+
+          String param = obj . getPhone() + "," + typeName + "," + address + "," + publicStartTime + "," + publicEndTime + "," + dep + "," + phone + "," + email + ";";
+          sb . append(param);
+          MessageRecord record = new MessageRecord(null, 2, 2, obj . getTalentName(), obj . getPhone(), param . substring(0, param . length() - 1), SmsProperties . CHECK_PUBLIC);
+          record . setState(1);
+          record . setBizId(sendRecord . getId());
+          record . setSendingDate(DateUtil . getTime());
+          record . setCreateTime(DateUtil . getTime());
+          recordList . add(record);
+          }
+          if (isMessage != null && isMessage == 1) {
+          if (list.size() > 1000) {
+          return new ResponseObj(ResponseObj . FAILD, "需要发送短信时公示量不能超过1000个");
+          }
+          //发送短信
+          Map map = new HashMap();
+          map . put("account", smsProperties . getAccount());
+          map . put("password", smsProperties . getPassword());
+          map . put("msg", sendRecord . getTemplateCode());
+          map . put("params", sb . substring(0, sb . length() - 1));
+          map . put("report", "true");
+          map . put("uid", sendRecord . getId());
+          String sendUrl = smsProperties . getBaseUrl() + "variable/json";
+          JSONObject js = (JSONObject) JSONObject . toJSON(map);
+          String res = HttpUtil . sendSmsByPost(sendUrl, js . toString());
+          JSONObject jsonObject = JSONObject . parseObject(res);
+          String code = jsonObject . getString("code");
+          String errorMsg = jsonObject . getString("errorMsg");
+          if (!"0" . equals(code)) {
+          return new ResponseObj(ResponseObj . FAILD, "短信发送失败,原因为:" + errorMsg);
+          }
+          this . messageRecordService . insertBatch(recordList);
+          }
+          this.talentTypeChangeService.updateBatchById(list);
+          this . talentChecklogService . insertBatch(logList);
+          return new ResponseObj(ResponseObj . SUCCESS, "公示成功");
+         */
+    }
+
     private function setTalentTypeChange(&$where, $data) {
         if (\StrUtil::isNotEmpAndNull($data["talentName"])) {
             $where[] = ["talentName", "like", "%{$data["talentName"]}%"];