Commit 95009f9977b8869240ded87fa0800756b2b8265e

Authored by youxiw2000
1 parent 7d80695e

m

trash-activiti/src/main/java/com/trash/activiti/service/impl/FormHistoryDataServiceImpl.java
... ... @@ -32,8 +32,32 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService {
32 32  
33 33 @Override
34 34 public List<ActWorkflowFormData> historyDataShow(String businessKey) {
35   - List<HistoryDataDTO> returnHistoryFromDataDTOS=new ArrayList<>();
  35 + List<ActWorkflowFormData> returnHistoryFromDataDTOS=new ArrayList<>();
  36 +
  37 +
36 38 List<ActWorkflowFormData> actWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey);
  39 +
  40 + for(int i =0;i<actWorkflowFormData.size();i++){
  41 + if(i == actWorkflowFormData.size()-1){
  42 + returnHistoryFromDataDTOS.add(actWorkflowFormData.get(i));
  43 + continue;
  44 + }
  45 +
  46 + ActWorkflowFormData one = actWorkflowFormData.get(i);
  47 + ActWorkflowFormData two = actWorkflowFormData.get(i+1);
  48 +
  49 + if(one.getCreateBy().equals(two.getCreateBy()) && one.getCreateTime().getTime() == two.getCreateTime().getTime()){
  50 +
  51 + one.setControlValue(one.getControlValue() + " " + two.getControlValue());
  52 +
  53 + returnHistoryFromDataDTOS.add(one);
  54 + i+=1;
  55 + continue;
  56 + }
  57 +
  58 + returnHistoryFromDataDTOS.add(one);
  59 + }
  60 +
37 61 // Map<String, List<ActWorkflowFormData>> collect = actWorkflowFormData.stream().collect(Collectors.groupingBy(ActWorkflowFormData::getTaskNodeName));
38 62 // collect.entrySet().forEach(
39 63 // entry -> {
... ... @@ -47,7 +71,7 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService {
47 71 // );
48 72 // List<HistoryDataDTO> collect1 = returnHistoryFromDataDTOS.stream().sorted((x, y) -> x.getCreatedDate().compareTo(y.getCreatedDate())).collect(Collectors.toList());
49 73  
50   - return actWorkflowFormData;
  74 + return returnHistoryFromDataDTOS;
51 75 }
52 76  
53 77  
... ...
trash-ui/src/api/three_step.js
... ... @@ -618,12 +618,13 @@ export default {
618 618 this.$refs["form"].validate(valid => {
619 619 if (valid) {
620 620  
621   - if(this.form.type == 0){
622 621 let racts = [];
623 622 let ractsName = [];
624 623 let earthIds = [];
625 624 let earthNames = [];
626 625  
  626 + if(this.form.type == 0){
  627 +
627 628 for(let i in this.contractList){
628 629 if(this.contractList[i].constructionSiteID == this.form.objectId){
629 630 racts.push(this.contractList[i].id);
... ... @@ -638,18 +639,21 @@ export default {
638 639 this.form.contract = ractsName + "";
639 640 this.form.contractId = racts + "";
640 641 }
641   - // else{
642   - // for(let i in this.contractList){
643   - // if(this.contractList[i].earthSiteID == this.form.objectId){
644   - // let item = this.contractList[i];
645   - // this.form.contract = item.contractNo;
646   - // this.form.contractId = item.id;
647   - // this.form.earthsitesId = item.constructionSiteID;
648   - // this.form.earthsitesName = item.constructionSiteName;
649   - // break;
650   - // }
651   - // }
652   - // }
  642 + else{
  643 + for(let i in this.contractList){
  644 + if(this.contractList[i].earthSiteID == this.form.objectId){
  645 + racts.push(this.contractList[i].id);
  646 + ractsName.push(this.contractList[i].contractNo);
  647 + earthIds.push(this.contractList[i].constructionSiteID);
  648 + earthNames.push(this.contractList[i].constructionSiteName);
  649 + }
  650 + }
  651 +
  652 + this.form.earthsitesId = earthIds + "";
  653 + this.form.earthsitesName = earthNames + "";
  654 + this.form.contract = ractsName + "";
  655 + this.form.contractId = racts + "";
  656 + }
653 657  
654 658 this.loading = true;
655 659  
... ...
trash-ui/src/layout/index1.vue renamed to trash-ui/src/layout/index3.vue
trash-ui/src/views/activiti/task/index.vue
... ... @@ -723,7 +723,8 @@ export default {
723 723 names:null,
724 724 hisfromData:[],
725 725 slides:[],
726   - slidesArys:[]
  726 + slidesArys:[],
  727 + prev:[]
727 728 };
728 729 },
729 730 created() {
... ... @@ -731,6 +732,16 @@ export default {
731 732  
732 733 getDict(dep).then(res => {
733 734 this.depts = res.result;
  735 +
  736 + // for(let i in depts){
  737 +
  738 + // if(depts[i].indexOf("渣土办") ==){
  739 +
  740 + // }
  741 +
  742 + // }
  743 +
  744 +
734 745 });
735 746  
736 747 let role = {type: "CSUserPostType"};
... ... @@ -989,7 +1000,7 @@ export default {
989 1000 }
990 1001 }
991 1002  
992   - if (this.form.status == 1 && this.taskName == "巡查") {
  1003 + if (this.form.status == 1) {
993 1004 activeThreestep(this.form).then(res => {
994 1005 formDataSave(this.id, this.form.formData).then(response => {
995 1006 this.msgSuccess("审批成功");
... ...
trash-ui/src/views/h5/task/index.vue
... ... @@ -768,7 +768,7 @@ export default {
768 768 }
769 769 }
770 770  
771   - if (this.form.status == 1 && this.taskName == "巡查") {
  771 + if (this.form.status == 1 ) {
772 772 activeThreestep(this.form).then(res => {
773 773 formDataSave(this.id, this.form.formData).then(response => {
774 774 this.msgSuccess("审批成功");
... ...
trash-workFlow/src/main/java/com/trash/business/controller/TruckActivateController.java
... ... @@ -141,6 +141,8 @@ public class TruckActivateController extends BaseController
141 141 public AjaxResult getConractByObjectId(@PathVariable("id") String id)
142 142 {
143 143  
  144 +
  145 +
144 146 AjaxResult ajaxResult = AjaxResult.success();
145 147  
146 148 ajaxResult.put("result", truckActivateService.getConractByObjectId(id));
... ...
trash-workFlow/src/main/java/com/trash/business/mapper/TruckActivateMapper.java
1 1 package com.trash.business.mapper;
2 2  
3 3 import java.util.List;
  4 +import java.util.Map;
  5 +
4 6 import com.trash.business.domain.TruckActivate;
5 7  
6 8 /**
... ... @@ -65,7 +67,7 @@ public interface TruckActivateMapper
65 67  
66 68 public TruckActivate selectTodayTruckByObjId(String objId);
67 69  
68   - public String getConractByObjectId(TruckActivate turck);
  70 + public Map<String,String> getConractByObjectId(TruckActivate turck);
69 71  
70 72 public List<TruckActivate> getActivedTruckList(TruckActivate truckActivate);
71 73 }
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckActivateServiceImpl.java
... ... @@ -4,6 +4,8 @@ import java.text.DateFormat;
4 4 import java.text.SimpleDateFormat;
5 5 import java.util.Date;
6 6 import java.util.List;
  7 +import java.util.Map;
  8 +
7 9 import com.trash.common.utils.DateUtils;
8 10 import org.apache.commons.lang3.time.DateFormatUtils;
9 11 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -50,6 +52,7 @@ public class TruckActivateServiceImpl implements ITruckActivateService
50 52 */
51 53  
52 54 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
  55 + SimpleDateFormat dateTimeFomat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
53 56  
54 57 @Override
55 58 public List<TruckActivate> selectTruckActivateList(TruckActivate truckActivate)
... ... @@ -246,6 +249,10 @@ public class TruckActivateServiceImpl implements ITruckActivateService
246 249 public String getConractByObjectId(String id){
247 250  
248 251 TruckActivate turck = new TruckActivate();
  252 + SupervisionThreestep threestep = new SupervisionThreestep();
  253 +
  254 + String conractIds = "";
  255 +
249 256  
250 257 turck.setObjectId(id);
251 258  
... ... @@ -264,20 +271,55 @@ public class TruckActivateServiceImpl implements ITruckActivateService
264 271 end = yearFomat.format(date);
265 272 }
266 273  
267   - end += " 4:00:00";
268   - start += " 8:00:00";
  274 + end += " 04:00:00";
  275 + start += " 08:00:00";
269 276  
270 277 try {
271 278 turck.setStartTime(start);
272 279 turck.setEndTime(end);
  280 + threestep.setWorkStartTime(dateTimeFomat.parse(start));
  281 + threestep.setWorkEndTime(dateTimeFomat.parse(end));
273 282 } catch (Exception e) {
274 283 // TODO Auto-generated catch block
275 284 e.printStackTrace();
276 285 }
277 286 }
278 287  
  288 + Map<String,String> m = truckActivateMapper.getConractByObjectId(turck);
  289 +
  290 + if(m == null || m.get("earthsites_id") == null || m.get("earthsites_id").isEmpty()){
  291 + return null;
  292 + }
  293 +
  294 + for(String str:m.get("earthsites_id").split(",")){
  295 + threestep.setObjectId(str);
  296 + threestep.setType(1L);
  297 + threestep.setStatus(1L);
  298 + List<SupervisionThreestep> list = threestepMapper.selectSupervisionThreestepList(threestep);
  299 +
  300 +
  301 +
  302 + if(list.size() == 1){
  303 +
  304 + String[] objs = list.get(0).getEarthsitesId().split(",");
  305 +
  306 + for(int j = 0 ; j<objs.length;j++){
  307 + SupervisionThreestep construction = new SupervisionThreestep();
  308 + construction.setWorkStartTime(threestep.getWorkStartTime());
  309 + construction.setWorkEndTime(threestep.getWorkEndTime());
  310 + construction.setObjectId(objs[j]);
  311 + construction.setType(0L);
  312 + construction.setStatus(1L);
  313 + if(threestepMapper.selectSupervisionThreestepList(construction).size() == 1){
  314 + conractIds += list.get(0).getContractId().split(",")[j] + ",";
  315 + }
  316 +
  317 + }
  318 + }
  319 + }
  320 +
279 321  
280   - return truckActivateMapper.getConractByObjectId(turck);
  322 + return conractIds.substring(0,conractIds.length()-1);
281 323 }
282 324  
283 325 @Override
... ...
trash-workFlow/src/main/java/com/trash/workflow/listener/SupervisionStateListener.java
... ... @@ -29,9 +29,5 @@ public class SupervisionStateListener implements ExecutionListener {
29 29  
30 30 workflowUtils.sendDataToHisTory(delegateExecution, state);
31 31  
32   - if("2".equals(state.getValue(delegateExecution))){
33   - SpringUtils.getBean(IActTaskService.class).deleteProcessById(delegateExecution.getProcessInstanceId());
34   - }
35   -
36 32 }
37 33 }
... ...
trash-workFlow/src/main/java/com/trash/workflow/service/impl/WorkflowServiceImpl.java
... ... @@ -209,14 +209,14 @@ public class WorkflowServiceImpl implements IWorkflowService {
209 209 ProcessInstance processInstance = null;
210 210 try {
211 211 processInstance = processRuntime.start(ProcessPayloadBuilder.start()
212   - .withProcessDefinitionKey("workflow_threestep").withName("报工自查:" + supervision.getContract())
  212 + .withProcessDefinitionKey("workflow_threestep").withName("报工自查:" + supervision.getName())
213 213 .withBusinessKey("workflow_threestep:" + supervision.getId()).build());
214 214  
215 215 PorcThreeStepTask(processInstance, supervision.getPlace());
216 216  
217 217 Workflow workflow = new Workflow();
218 218 workflow.setId("workflow_threestep:" + supervision.getId());
219   - workflow.setTitle("报工自查-合同编号:" + supervision.getContract());
  219 + workflow.setTitle("报工自查:" + supervision.getName());
220 220 workflow.setReason("报工自查");
221 221 workflow.setStartTime(sdf.format(supervision.getSelfCheckTime()));
222 222 workflow.setEndTime(sdf.format(supervision.getSelfCheckTime()));
... ...
trash-workFlow/src/main/resources/mapper/SupervisionThreestepMapper.xml
... ... @@ -240,8 +240,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
240 240 and self_check_time BETWEEN #{workStartTime} and #{workEndTime}
241 241 ORDER BY self_check_time DESC
242 242 </select>
243   -
244   -
245 243  
246 244  
247 245 <select id="selectSupervisionThreestepById" parameterType="Long"
... ... @@ -399,6 +397,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
399 397 delete from supervision_threestep where id = #{id}
400 398 </delete>
401 399  
  400 +
402 401 <delete id="deleteSupervisionThreestepByIds" parameterType="String">
403 402 delete from supervision_threestep where id in
404 403 <foreach item="id" collection="array" open="(" separator=","
... ...
trash-workFlow/src/main/resources/mapper/TruckActivateMapper.xml
... ... @@ -49,8 +49,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
49 49 </where>
50 50 </select>
51 51  
52   - <select id="getConractByObjectId" parameterType="TruckActivate" resultType="String">
53   - select three.contract_id from(
  52 + <select id="getConractByObjectId" parameterType="TruckActivate" resultType="java.util.HashMap">
  53 + select three.* from(
54 54 select id, company, license_plate, time, construction, status,
55 55 earthsite, object_id, create_by, create_type, activate_time, create_time
56 56 from truck_activate
... ... @@ -59,10 +59,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
59 59 activate_time between #{startTime} and #{endTime}) truck
60 60 LEFT JOIN (select * from supervision_threestep WHERE company_trucks LIKE CONCAT("%",#{objectId},"%")
61 61 and
62   - check_time between #{startTime} and #{endTime}) three
  62 + check_time between #{startTime} and #{endTime}
  63 + ) three
63 64 on
64 65 truck.construction = three.name
65   - and truck.earthsite = three.earthsites_name
66 66 </select>
67 67  
68 68 <select id="selectTodayTruckByObjId" parameterType="String" resultMap="TruckActivateResult">
... ...