Commit 32d0df77 authored by Mccoy Z Xia's avatar Mccoy Z Xia

calendar action 相关页面和接口

parent 2ac54545
...@@ -933,4 +933,42 @@ public class DateUtils { ...@@ -933,4 +933,42 @@ public class DateUtils {
// } // }
// //System.out.println("sss"); // //System.out.println("sss");
// } // }
/**
* 清零 时分秒
* 用于时间查询
* @param date
* @return
*/
public static Date clearTimeShort(Date date) {
return clearTimeShortAndAdd1Day(date, false);
}
/**
* 清零 时分秒 并加一天
* 用于时间查询
* @param date
* @return
*/
public static Date clearTimeShortAndAdd1Day(Date date) {
return clearTimeShortAndAdd1Day(date, true);
}
private static Date clearTimeShortAndAdd1Day(Date date, boolean addOneDay) {
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
// 将时分秒,毫秒域清零
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
//把日期往后增加一天
if (addOneDay) {
calendar.add(Calendar.DATE, 1);
}
return calendar.getTime();
}
} }
package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.calendar.dto.CalendarActionDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.ICalendarActionService;
/**
* <p> @Description </p>
*
* @Author: Mccoy Z Xia (Xia zhixin)
* @Date: 2019-07-21 20:15
* @Version: 1.0
**/
@RestController
@RequestMapping("api/v1/calendarAction/")
public class CalendarActionController {
@Autowired
private ICalendarActionService actionServiceImpl;
@PostMapping("saveCalendarAction")
public OperationResultDto saveCalendarAction(@RequestBody CalendarActionDto dto){
return actionServiceImpl.saveCalendarAction(dto);
}
@GetMapping("getCalendarActionList")
public OperationResultDto getCalendarActionList(){
return actionServiceImpl.getCalendarActionList();
}
@PostMapping("deleteCalendarAction")
public OperationResultDto getCalendarDataForDisplay(@RequestBody CalendarActionDto dto){
return actionServiceImpl.deleteCalendarAction(dto);
}
}
package pwc.taxtech.atms.service; package pwc.taxtech.atms.service;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.calendar.dto.CalendarActionDto;
import pwc.taxtech.atms.calendar.entity.CalendarAction; import pwc.taxtech.atms.calendar.entity.CalendarAction;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
public interface ICalendarActionService { public interface ICalendarActionService {
OperationResultDto saveEvent(CalendarAction record); OperationResultDto saveCalendarAction(CalendarActionDto dto);
OperationResultDto deleteEvent(Long id); OperationResultDto deleteCalendarAction(CalendarActionDto dto);
OperationResultDto getCalendarActionList();
} }
...@@ -2,10 +2,12 @@ package pwc.taxtech.atms.service; ...@@ -2,10 +2,12 @@ package pwc.taxtech.atms.service;
import pwc.taxtech.atms.calendar.entity.CalendarEvent; import pwc.taxtech.atms.calendar.entity.CalendarEvent;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.calendar.CalendarDisplayQueryParamDto;
public interface ICalendarEventService { public interface ICalendarEventService {
OperationResultDto addEvent(CalendarEvent event); OperationResultDto addEvent(CalendarEvent event);
OperationResultDto updateEvent(CalendarEvent event); OperationResultDto updateEvent(CalendarEvent event);
OperationResultDto deleteEvent(Long id); OperationResultDto deleteEvent(Long id);
} }
...@@ -2,15 +2,25 @@ package pwc.taxtech.atms.service.impl; ...@@ -2,15 +2,25 @@ package pwc.taxtech.atms.service.impl;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.calendar.dao.CalendarActionJurisdictionRelationshipMapper; import pwc.taxtech.atms.calendar.dao.CalendarActionJurisdictionRelationshipMapper;
import pwc.taxtech.atms.calendar.dao.CalendarActionMapper; import pwc.taxtech.atms.calendar.dao.CalendarActionMapper;
import pwc.taxtech.atms.calendar.dao.CalendarJurisdictionMapper; import pwc.taxtech.atms.calendar.dao.CalendarJurisdictionMapper;
import pwc.taxtech.atms.calendar.entity.CalendarAction; import pwc.taxtech.atms.calendar.dao.ext.CalendarActionTMapper;
import pwc.taxtech.atms.calendar.dao.ext.CalendarExtMapper;
import pwc.taxtech.atms.calendar.dao.ext.CalendarJurisdictionTMapper;
import pwc.taxtech.atms.calendar.dto.CalendarActionDto;
import pwc.taxtech.atms.calendar.dto.CalendarJurisdictionDto;
import pwc.taxtech.atms.calendar.entity.*;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.ICalendarActionService; import pwc.taxtech.atms.service.ICalendarActionService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* <p> @Description </p> * <p> @Description </p>
...@@ -19,6 +29,7 @@ import java.util.Date; ...@@ -19,6 +29,7 @@ import java.util.Date;
* @Date: 2019-07-10 16:19 * @Date: 2019-07-10 16:19
* @Version: 1.0 * @Version: 1.0
**/ **/
@Service
public class CalendarActionServiceImpl extends BaseService implements ICalendarActionService { public class CalendarActionServiceImpl extends BaseService implements ICalendarActionService {
private static final Logger log = LoggerFactory.getLogger(CalendarActionServiceImpl.class); private static final Logger log = LoggerFactory.getLogger(CalendarActionServiceImpl.class);
...@@ -26,45 +37,126 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA ...@@ -26,45 +37,126 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
@Resource @Resource
private CalendarActionMapper calendarActionMapper; private CalendarActionMapper calendarActionMapper;
@Resource
private CalendarExtMapper calendarExtMapper;
@Resource @Resource
private CalendarJurisdictionMapper calendarJurisdictionMapper; private CalendarJurisdictionMapper calendarJurisdictionMapper;
@Resource @Resource
private CalendarActionJurisdictionRelationshipMapper calendarActionJurisdictionRelationshipMapper; private CalendarActionJurisdictionRelationshipMapper calendarActionJurisdictionRelationshipMapper;
@Autowired
private CalendarActionTMapper actionTMapper;
@Autowired
private CalendarJurisdictionTMapper jurisdictionTMapper;
@Override @Override
public OperationResultDto saveEvent(CalendarAction record) { public OperationResultDto saveCalendarAction(CalendarActionDto dto) {
int count = 0;
try { boolean result;
record.setUpdateTime(new Date());
// 无ID则新建,有ID则更新 if (dto.getId() == null) {
if (record.getId() != null){ result = insertAction(dto);
count = calendarActionMapper.updateByPrimaryKeySelective(record);
} else { } else {
record.setId(idService.nextId()); result =updateAction(dto);
record.setCreateTime(record.getUpdateTime());
count = calendarActionMapper.insert(record);
} }
return new OperationResultDto(result);
}
private boolean insertAction(CalendarActionDto dto) {
Date createTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setId(idService.nextId());
action.setCreateTime(createTime);
action.setUpdateTime(createTime);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
List<CalendarActionJurisdictionRelationship> relationshipList = new ArrayList<>();
list.forEach(l -> {
CalendarJurisdiction jurisdiction = jurisdictionTMapper.toCalendarAction(l);
jurisdiction.setId(idService.nextId());
jurisdiction.setCreateTime(createTime);
jurisdiction.setUpdateTime(createTime);
jurisdictionList.add(jurisdiction);
CalendarActionJurisdictionRelationship relationship = new CalendarActionJurisdictionRelationship();
relationship.setId(idService.nextId());
relationship.setActionId(action.getId());
relationship.setJurisdictionId(jurisdiction.getId());
});
try {
calendarExtMapper.batchInsertActionJurisdiction(jurisdictionList);
calendarExtMapper.batchInsertActionJurisdictionRelation(relationshipList);
calendarActionMapper.insert(action);
} catch (Exception e) { } catch (Exception e) {
log.error("save error", e); log.error("insertAction error", e);
return false;
} }
boolean result = count > 0;
String msg = result ? "1" : "0"; return true;
return new OperationResultDto(result, msg); }
private boolean updateAction(CalendarActionDto dto) {
Date updateTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setUpdateTime(updateTime);
action.setStatus((byte) 1);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
try {
list.forEach(p -> {
CalendarJurisdiction jurisdiction = jurisdictionTMapper.toCalendarAction(p);
jurisdiction.setId(idService.nextId());
jurisdiction.setUpdateTime(updateTime);
jurisdictionList.add(jurisdiction);
});
jurisdictionList.forEach(p -> calendarJurisdictionMapper.updateByPrimaryKeySelective(p));
calendarActionMapper.updateByPrimaryKeySelective(action);
} catch (Exception e) {
log.error("updateAction error", e);
}
return true;
} }
@Override @Override
public OperationResultDto deleteEvent(Long id) { public OperationResultDto deleteCalendarAction(CalendarActionDto dto) {
int count = 0; int count = 0;
CalendarAction action = new CalendarAction();
action.setId(dto.getId());
action.setStatus(Byte.parseByte("0"));
action.setUpdateTime(new Date());
try { try {
count = calendarActionMapper.deleteByPrimaryKey(id); count = calendarActionMapper.updateByPrimaryKeySelective(action);
} catch (Exception e) { } catch (Exception e) {
log.error("deleteAction error", e); log.error("deleteAction error", e);
} }
boolean result = count > 0; return new OperationResultDto(count > 0);
String msg = result ? "删除成功" : "删除失败"; }
return new OperationResultDto(result, msg);
@Override
public OperationResultDto getCalendarActionList() {
CalendarActionExample actionExample = new CalendarActionExample();
actionExample.createCriteria().andStatusEqualTo((byte) 1);
List<CalendarAction> actionList = calendarActionMapper.selectByExample(null);
List<CalendarActionDto> actionDtoList = new ArrayList<>();
actionList.forEach(p -> {
List<CalendarJurisdictionDto> jurisdictionDtoList = calendarExtMapper.getJurisdictionListByActionId(p.getId());
CalendarActionDto dto = actionTMapper.toCalendarActionDto(p);
dto.setJurisdictionDtoList(jurisdictionDtoList);
actionDtoList.add(dto);
});
return OperationResultDto.success(actionDtoList);
} }
} }
...@@ -6,12 +6,17 @@ import org.slf4j.LoggerFactory; ...@@ -6,12 +6,17 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.calendar.dao.*; import pwc.taxtech.atms.calendar.dao.*;
import pwc.taxtech.atms.calendar.dao.ext.CalendarExtMapper; import pwc.taxtech.atms.calendar.dao.ext.CalendarExtMapper;
import pwc.taxtech.atms.calendar.dto.CalendarEventDto;
import pwc.taxtech.atms.calendar.entity.CalendarEvent; import pwc.taxtech.atms.calendar.entity.CalendarEvent;
import pwc.taxtech.atms.calendar.entity.CalendarEventExample;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.calendar.CalendarDisplayQueryParamDto;
import pwc.taxtech.atms.service.ICalendarEventService; import pwc.taxtech.atms.service.ICalendarEventService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* <p> @Description </p> * <p> @Description </p>
...@@ -27,6 +32,8 @@ public class CalendarEventServiceImpl extends BaseService implements ICalendarEv ...@@ -27,6 +32,8 @@ public class CalendarEventServiceImpl extends BaseService implements ICalendarEv
@Resource @Resource
private CalendarEventMapper calendarEventMapper; private CalendarEventMapper calendarEventMapper;
@Resource
private CalendarExtMapper calendarExtMapper;
@Override @Override
public OperationResultDto addEvent(CalendarEvent event) { public OperationResultDto addEvent(CalendarEvent event) {
...@@ -45,7 +52,7 @@ public class CalendarEventServiceImpl extends BaseService implements ICalendarEv ...@@ -45,7 +52,7 @@ public class CalendarEventServiceImpl extends BaseService implements ICalendarEv
} }
boolean result = count > 0; boolean result = count > 0;
String msg = result ? "1" : "-1"; String msg = result ? "1" : "-1";
return new OperationResultDto(result, msg); return new OperationResultDto(result, msg, event.getId().toString());
} }
@Override @Override
...@@ -75,4 +82,5 @@ public class CalendarEventServiceImpl extends BaseService implements ICalendarEv ...@@ -75,4 +82,5 @@ public class CalendarEventServiceImpl extends BaseService implements ICalendarEv
String msg = result ? "1" : "-1"; String msg = result ? "1" : "-1";
return new OperationResultDto(result, msg); return new OperationResultDto(result, msg);
} }
} }
...@@ -361,8 +361,8 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService ...@@ -361,8 +361,8 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService
} }
public List<CalendarEventDto> getCalendarEventData(CalendarDisplayQueryParamDto queryParamDto) { public List<CalendarEventDto> getCalendarEventData(CalendarDisplayQueryParamDto queryParamDto) {
Date start = formatQueryDateTime(queryParamDto.getQueryStartTime(), false); Date start = pwc.taxtech.atms.common.util.DateUtils.clearTimeShort(queryParamDto.getQueryStartTime());
Date end = formatQueryDateTime(queryParamDto.getQueryEndTime(), true); Date end = pwc.taxtech.atms.common.util.DateUtils.clearTimeShortAndAdd1Day(queryParamDto.getQueryEndTime());
String startYearStr = String.format("%tY", start); String startYearStr = String.format("%tY", start);
String endYearStr = String.format("%tY", end); String endYearStr = String.format("%tY", end);
...@@ -485,7 +485,7 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService ...@@ -485,7 +485,7 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService
boolean isEffective = dueDate != null boolean isEffective = dueDate != null
&& dueDate.compareTo(start) >= 0 && dueDate.compareTo(start) >= 0
&& dueDate.compareTo(p.getValidDateStart()) >= 0 && dueDate.compareTo(p.getValidDateStart()) >= 0
&& dueDate.compareTo(formatQueryDateTime(p.getValidDateEnd(), true)) < 0 && dueDate.compareTo(pwc.taxtech.atms.common.util.DateUtils.clearTimeShortAndAdd1Day(p.getValidDateEnd())) < 0
&& dueDate.compareTo(end) < 0; && dueDate.compareTo(end) < 0;
// //
...@@ -494,7 +494,7 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService ...@@ -494,7 +494,7 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService
isEffective = dueDate != null isEffective = dueDate != null
&& dueDate.compareTo(start) >= 0 && dueDate.compareTo(start) >= 0
&& dueDate.compareTo(p.getValidDateStart()) >= 0 && dueDate.compareTo(p.getValidDateStart()) >= 0
&& dueDate.compareTo(formatQueryDateTime(p.getValidDateEnd(), true)) < 0 && dueDate.compareTo(pwc.taxtech.atms.common.util.DateUtils.clearTimeShortAndAdd1Day(p.getValidDateEnd())) < 0
&& dueDate.compareTo(end) < 0; && dueDate.compareTo(end) < 0;
} }
...@@ -541,22 +541,4 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService ...@@ -541,22 +541,4 @@ public class CalendarServiceImpl extends BaseService implements ICalendarService
return str2Date; return str2Date;
} }
private Date formatQueryDateTime(Date date, boolean addOneDay) {
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
// 将时分秒,毫秒域清零
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
//把日期往后增加一天
if (addOneDay) {
calendar.add(Calendar.DATE, 1);
}
return calendar.getTime();
}
} }
package pwc.taxtech.atms.calendar.dao.ext;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import pwc.taxtech.atms.calendar.dto.CalendarActionDto;
import pwc.taxtech.atms.calendar.entity.CalendarAction;
@Mapper(componentModel = "spring")
public interface CalendarActionTMapper {
CalendarActionTMapper CALENDAR_ACTION_T_MAPPERT_Mapper = Mappers.getMapper(CalendarActionTMapper.class);
@Mapping(source = "id", target = "id")
CalendarActionDto toCalendarActionDto(CalendarAction calendarAction);
@Mapping(source = "id", target = "id")
CalendarAction toCalendarAction(CalendarActionDto calendarActionDto);
}
package pwc.taxtech.atms.calendar.dao.ext; package pwc.taxtech.atms.calendar.dao.ext;
import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import pwc.taxtech.atms.MyMapper; import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.calendar.dto.CalendarJurisdictionDto;
import pwc.taxtech.atms.calendar.dto.CalendarTaskTypeDto; import pwc.taxtech.atms.calendar.dto.CalendarTaskTypeDto;
import pwc.taxtech.atms.calendar.dto.EntityDto; import pwc.taxtech.atms.calendar.dto.EntityDto;
import pwc.taxtech.atms.calendar.entity.CalendarActionJurisdictionRelationship;
import pwc.taxtech.atms.calendar.entity.CalendarJurisdiction;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -57,4 +57,46 @@ public interface CalendarExtMapper extends MyMapper { ...@@ -57,4 +57,46 @@ public interface CalendarExtMapper extends MyMapper {
@Select("SELECT order_Index FROM calendar_configuration ORDER BY id DESC LIMIT 1") @Select("SELECT order_Index FROM calendar_configuration ORDER BY id DESC LIMIT 1")
Integer getMaxConfigOrder(); Integer getMaxConfigOrder();
@Insert("<script>\n" +
"INSERT INTO CalendarActionJurisdictionRelationship\n" +
" ( id, area, description, logic_num, logic_unit, status, create_time, update_time)\n" +
"VALUES\n" +
"<foreach collection='list' item='item' index='index' separator=','>\n" +
" (\n" +
" #{item.id},\n" +
" #{item.area},\n" +
" #{item.description},\n" +
" #{item.logicNum},\n" +
" #{item.logicUnit},\n" +
" #{item.status},\n" +
" #{item.createTime},\n" +
" #{item.updateTime}\n" +
" )\n" +
"</foreach>\n" +
"</script>")
int batchInsertActionJurisdiction(List<CalendarJurisdiction> jurisdictionList);
@Insert("<script>" +
"INSERT INTO CalendarActionJurisdictionRelationship\n" +
"( id, action_id, jurisdiction_id)\n" +
"VALUES\n" +
" <foreach collection='list' item='item' index='index' separator=','>\n" +
" (\n" +
" #{item.id},\n" +
" #{item.actionId},\n" +
" #{item.jurisdictionId}\n" +
" )\n" +
" </foreach> " +
"</script>")
int batchInsertActionJurisdictionRelation(List<CalendarActionJurisdictionRelationship> relationshipList);
@Select("SELECT\n" +
"\tt.id, area, description, logic_num, logic_unit, status\n" +
"FROM\n" +
"\tcalendar_jurisdiction t\n" +
"LEFT JOIN calendar_action_jurisdiction_relationship ON t.id = jurisdiction_id\n" +
"AND action_id = #{actionId}\n" +
"ORDER BY area")
List<CalendarJurisdictionDto> getJurisdictionListByActionId(Long actionId);
} }
package pwc.taxtech.atms.calendar.dao.ext;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import pwc.taxtech.atms.calendar.dto.CalendarActionDto;
import pwc.taxtech.atms.calendar.dto.CalendarJurisdictionDto;
import pwc.taxtech.atms.calendar.entity.CalendarAction;
import pwc.taxtech.atms.calendar.entity.CalendarJurisdiction;
@Mapper(componentModel = "spring")
public interface CalendarJurisdictionTMapper {
CalendarJurisdictionTMapper CALENDAR_JURISDICTION_T_MAPPER = Mappers.getMapper(CalendarJurisdictionTMapper.class);
@Mapping(source = "id", target = "id")
CalendarJurisdictionDto toCalendarActionDto(CalendarJurisdiction calendarJurisdiction);
@Mapping(source = "id", target = "id")
CalendarJurisdiction toCalendarAction(CalendarJurisdictionDto calendarJurisdictionDto);
}
package pwc.taxtech.atms.calendar.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
/**
* <p> @Description </p>
*
* @Author: Mccoy Z Xia (Xia zhixin)
* @Date: 2019-07-21 20:22
* @Version: 1.0
**/
@Getter
@Setter
@ToString
@NoArgsConstructor
public class CalendarActionDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String name;
@JsonSerialize(using = ToStringSerializer.class)
private Long triggerId;
@JsonSerialize(using = ToStringSerializer.class)
private Long taskTypeId;
private Byte status;
private List<CalendarJurisdictionDto> jurisdictionDtoList;
}
package pwc.taxtech.atms.calendar.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* <p> @Description </p>
*
* @Author: Mccoy Z Xia (Xia zhixin)
* @Date: 2019-07-21 20:28
* @Version: 1.0
**/
@Getter
@Setter
@ToString
@NoArgsConstructor
public class CalendarJurisdictionDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private Byte area;
private String description;
private Integer logicNum;
private String logicUnit;
private Byte status;
}
<div id="calendar-action">
<div class="calendar-action-Head">{{'CalendarActionHead'|translate}}</div>
<div ng-click="refreshAll()">Refresh</div>
<div class="calendar-action-container">
<div id="data-grid-action">
<div>
<table id="data-table">
<thead id="table-head">
<tr>
<th rowspan="3">Action Item Name</th>
<th rowspan="3">Trigger</th>
<th rowspan="3">
Type of Tasks
<div id="editTaskType" ng-click="editTaskTypeList();">Edit</div>
</th>
<th colspan="9">Jurisdiction of Formation</th>
<th rowspan="3">Operation</th>
</tr>
<tr>
<th colspan="3">Hong Kong</th>
<th colspan="3">BVI</th>
<th colspan="3">Cayman Islands</th>
</tr>
<tr>
<th>Valid</th>
<th>Description</th>
<th>Logic</th>
<th>valid</th>
<th>Description</th>
<th>Logic</th>
<th>valid</th>
<th>Description</th>
<th>Logic</th>
</tr>
</thead>
<tbody id="table-body">
<tr ng-repeat="action in actionList">
<td>{{action.name}}</td>
<td>{{action.triggerId}}</td>
<td>{{action.taskTypeId}}</td>
<td>{{action.status}}</td>
<td>{{action.description}}</td>
<td>
<span>{{action.logicNum}}</span>
<span>{{action.logicUnitId}}</span>
</td>
<td>{{action.status}}</td>
<td>{{action.description}}</td>
<td>
<span>{{action.logicNum}}</span>
<span>{{action.logicUnitId}}</span>
</td>
<td>{{action.status}}</td>
<td>{{action.description}}</td>
<td>
<span>{{action.logicNum}}</span>
<span>{{action.logicUnitId}}</span>
</td>
<td>
<span ng-click="editAction(action, 'Show')">Detail</span>
<span ng-click="editAction(action, 'Edit')">Edit</span>
<span ng-click="deleteAction(action)">Delete</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="edit-task-type-pop"></div>
<script type="text/ng-template" class="content" id="edit-task-type-pop.html">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditTaskTypeListPanel()">&times;</span>
<h4 class="modal-title">
<i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i>
&nbsp;{{'EditTaxProject' | translate}}
</h4>
</div>
<div class="modal-body">
<div class="row pop-grid-container">
<div class="col-md-12">
<div dx-data-grid="taskTypeGridOptions"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="hideEditTaskTypeListPanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}</button>
<button ng-click="editTaskType();" class="btn btn-default btn-red">{{'NewTaxCalendar' | translate}}</button>
</div>
</script>
<div id="edit-task-type"></div>
<script type="text/ng-template" class="content" id="edit-task-type.html">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditTaskTypePanel()">&times;</span>
<h4 class="modal-title">
<i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i>
&nbsp;{{editTaskTypeTitle}}
</h4>
</div>
<div class="modal-body" id="editTaskTypeForm" dx-validation-group="{}">
<div class="row">
<div class="col-lg-3">
<span class="form-title">
{{'TaxEvent' | translate}}
</span>
</div>
<div class="col-lg-9">
<div class="box-font" dx-text-box="{}" dx-validator="validateOption.taskTypeText" ng-model="editTaskTypeEntity.name"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="hideEditTaskTypePanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}</button>
<button ng-click="confirmSubmitTaskType();" class="btn btn-default btn-red">{{'Confirm' | translate}}</button>
</div>
</script>
<edit-calendar-action-modal is-show="showEditModal" parent-page=".calendar-action-container" operate-type="orgOperateType" is-update="isOrgUpdate" selected-organization="selectedOrg"></edit-calendar-action-modal>
<div id="edit-action-pop"></div>
<script type="text/ng-template" class="content" id="edit-action-pop.html">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditActionPanel()">&times;</span>
<div class="long-title"><h3>Action Details</h3></div>
</div>
<div class="modal-body">
<div id="myTabContent" class="tab-content">
<div id="form-container">
<div id="editActionForm" dx-form="formOptions"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="hideEditActionPanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}</button>
<button ng-click="saveAction();" class="btn btn-default btn-red">{{'NewTaxCalendar' | translate}}</button>
</div>
</script>
</div>
systemConfigurationModule.directive('calendarAction', ['$log',
function ($log) {
'use strict';
$log.debug('calendarAction.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/admin/systemConfiguration/calendarAction/calendar-action.html' + '?_=' + Math.random(),
replace: true,
scope: {},
controller: 'CalendarActionController',
link: function (scope, element) {
}
};
}
]);
\ No newline at end of file
#calendar-action {
.calendar-action-Head {
line-height: 60px;
vertical-align: middle;
padding-left: 20px;
display: inline-block;
border: 1px solid #dfdfdf;
width: 100%;
font-weight: bold;
}
table {
border-collapse: collapse;
}
#data-table th, tr {
border: 1px solid #DDD;
padding: 5px;
height: 40px;
text-align: center;
}
#data-table {
margin: 2% 1%;
width: 98%;
}
#table-head {
background-color: #f1f1f1;
text-align: center;
font-size: larger;
}
#table-body {
background-color: #ffffff;
}
#table-body td {
border: 1px solid #DDD;
padding: 5px;
height: 40px;
text-align: center;
}
#editTaskType {
color: red;
font-size: smaller;
margin-top: 5%;
outline: none;
}
#edit-task-type-pop, #edit-task-type, #edit-action-type-pop {
.form-title {
display: inline-block;
vertical-align: middle;
line-height: 36px;
}
.modal-footer {
display: inline-block;
margin-top: 10px;
padding-top: 20px;
width: 100%;
.btn {
float: right;
vertical-align: middle;
height: 30px;
line-height: 28px;
margin-right: 25px;
border: 0;
}
.btn-red {
background-color: #df532a;
color: #fff;
}
.btn-gray {
color: #555;
background-color: #eee;
}
}
}
#edit-action-type-pop {
#form-container {
margin: 10px;
}
.long-title h3 {
font-family: 'Segoe UI Light', 'Helvetica Neue Light', 'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana;
font-weight: 200;
font-size: 28px;
text-align: center;
margin-bottom: 20px;
}
.modal-footer {
display: inline-block;
margin-top: 10px;
padding-top: 20px;
width: 100%;
.btn {
float: right;
vertical-align: middle;
height: 30px;
line-height: 28px;
margin-right: 25px;
border: 0;
}
.btn-red {
background-color: #df532a;
color: #fff;
}
.btn-gray {
color: #555;
background-color: #eee;
}
}
}
}
\ No newline at end of file
...@@ -644,6 +644,22 @@ var infrastructureModule = angular.module('app.infrastructure', ["isteven-multi- ...@@ -644,6 +644,22 @@ var infrastructureModule = angular.module('app.infrastructure', ["isteven-multi-
sticky: true sticky: true
}); });
$stateProvider.state({
name: 'calendarAction',
url: '/calendarAction',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.systemConfiguration]);
}],
template: '<calendar-action></calendar-action>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.systemConfiguration),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({ $stateProvider.state({
name: 'taxCalendarConfiguration', name: 'taxCalendarConfiguration',
......
...@@ -344,6 +344,11 @@ ...@@ -344,6 +344,11 @@
//} //}
taxCalendarEventService.add(model).success(function (data) { taxCalendarEventService.add(model).success(function (data) {
if (data.result) { if (data.result) {
if (data.data){
model.id = data.data;
}
if (_.isFunction($scope.onClosed)) { if (_.isFunction($scope.onClosed)) {
$scope.onClosed({ param: { data: model, type: paramResultType }}); $scope.onClosed({ param: { data: model, type: paramResultType }});
......
...@@ -1718,9 +1718,41 @@ constant.organizationHK = { ...@@ -1718,9 +1718,41 @@ constant.organizationHK = {
{id: 2, name: "CFO"}, {id: 2, name: "CFO"},
{id: 3, name: "NA"} {id: 3, name: "NA"}
], ],
executiveType:[ executiveType: [
{id: 1, name: "Y"}, {id: 1, name: "Y"},
{id: 2, name: "N"} {id: 2, name: "N"}
] ]
}; };
constant.trigger = {
triggerType: [
{
id: 1,
name: "change in named/resident secretary"
}, {
id: 2,
name: "change in registered agent"
}, {
id: 3,
name: "change in local registered office"
}
],
logicUnit: [
{
id: 1,
name: "Calendar Day"
}, {
id: 2,
name: "Week Day"
}, {
id: 3,
name: "Month"
}, {
id: 3,
name: "Year"
}
]
};
/************************************************cit constant end*************************************************/ /************************************************cit constant end*************************************************/
\ No newline at end of file
webservices.factory('calendarActionService', ['$http', 'apiConfig', function ($http, apiConfig) {
'use strict';
return {
getCalendarActionList: function () {
return $http.get('/calendarAction/getCalendarActionList', apiConfig.create());
},
saveCalendarAction: function (data) {
return $http.post('/calendarAction/saveCalendarAction', data, apiConfig.create());
},
deleteCalendarAction: function (id) {
return $http.get('/calendarAction/deleteCalendarAction/' + id, apiConfig.create());
}
};
}]);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment