Commit 64ec7088 authored by eddie.woo's avatar eddie.woo

modify

parent 81d221b7
......@@ -12,7 +12,9 @@ import pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto;
public class CommonUtils {
public static final int BATCH_NUM = 500;
public static final int BATCH_NUM_1000 = 1000;
public static final int BATCH_NUM_2000 = 2000;
public static String getUUID() {
return UUID.randomUUID().toString().toUpperCase();
}
......
......@@ -128,4 +128,5 @@ public final class Constant {
public static String DECIMAL_FORMAT = "#,##0.00";
public static String ZERO_STR = "0";
public static final String DEFAULT_END_DATE = "9999-12";
}
\ No newline at end of file
......@@ -43,4 +43,10 @@ public class RevenueConfController extends BaseController {
revenueConfService.updateConfig(config);
return ApiResultDto.success();
}
@PostMapping("del")
public ApiResultDto delConf(@RequestBody List<Long> idList) {
revenueConfService.delConfig(idList);
return ApiResultDto.success();
}
}
package pwc.taxtech.atms.controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.revenuconf.RevTypeAddDto;
import pwc.taxtech.atms.dto.revenuconf.RevenueConfParam;
import pwc.taxtech.atms.dto.revenuconf.RevenueTypeResult;
import pwc.taxtech.atms.service.impl.RevenueTypeMappingService;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping(value = "api/v1/revenueConfMapping")
public class RevenueConfMappingController extends BaseController {
@Resource
private RevenueTypeMappingService mappingService;
@PostMapping("queryPage")
public CamelPagingResultDto<RevenueTypeResult> queryPage(@RequestBody RevenueConfParam param) {
return new CamelPagingResultDto<>(mappingService.queryPage(param));
}
@PostMapping("add")
public ApiResultDto addConf(@RequestBody RevTypeAddDto addDto) {
mappingService.addConfig(addDto);
return ApiResultDto.success();
}
@PostMapping("update")
public ApiResultDto updateConf(@RequestBody RevenueTypeMapping mapping) {
mappingService.updateConfig(mapping);
return ApiResultDto.success();
}
@PostMapping("del")
public ApiResultDto delConf(@RequestBody List<Long> idList) {
mappingService.delConfig(idList);
return ApiResultDto.success();
}
@PostMapping("upload")
public ApiResultDto upload(@RequestParam MultipartFile file, @RequestParam Integer type) throws Exception {
mappingService.upload(file, type);
return ApiResultDto.success();
}
}
package pwc.taxtech.atms.dto.revenuconf;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
import java.util.List;
public class RevTypeAddDto extends RevenueTypeMapping {
private List<String> orgList;
public List<String> getOrgList() {
return this.orgList;
}
public void setOrgList(List<String> orgList) {
this.orgList = orgList;
}
}
......@@ -23,4 +23,8 @@ public class RevenueConfResult extends RevenueConfig {
public String getStatusStr() {
return RevenueConfEnum.Status.MAPPING.get(this.getStatus());
}
public String getIdStr() {
return this.getId().toString();
}
}
package pwc.taxtech.atms.dto.revenuconf;
import pwc.taxtech.atms.constant.enums.RevenueConfEnum;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
public class RevenueTypeResult extends RevenueTypeMapping {
public String getStatusStr() {
return RevenueConfEnum.Status.MAPPING.get(this.getStatus());
}
}
......@@ -3229,4 +3229,14 @@ public class OrganizationServiceImpl extends BaseService{
return organizationMapper.getMyOrgSelectList(uid);
}
}
public List<OrgCodeIdDto> getMyOrgCodeList() {
String uid = authUserHelper.getCurrentUserId();
User user = userMapper.selectByPrimaryKey(uid);
if (user.getIsSuperAdmin()) {
return organizationMapper.getAllOrgCodeList();
} else {
return organizationMapper.getMyOrgCodeList(uid);
}
}
}
......@@ -51,8 +51,9 @@ public class RevenueConfService extends BaseService {
RevenueConfigExample example = new RevenueConfigExample();
example.createCriteria().andOrgIdEqualTo(param.getOrgId()).andStartDateLessThanOrEqualTo(param.getStartDate()).andEndDateGreaterThanOrEqualTo(param.getEndDate());
return revenueConfigMapper.selectByExample(example).stream()
.map( o -> beanUtil.copyProperties(o, new RevenueConfResult())).collect(Collectors.toList());
.map(o -> beanUtil.copyProperties(o, new RevenueConfResult())).collect(Collectors.toList());
}
/**
* 新增配置
*
......@@ -89,6 +90,12 @@ public class RevenueConfService extends BaseService {
revenueConfigMapper.updateByPrimaryKeySelective(parseEntity(config));
}
public void delConfig(List<Long> idList) {
if (!CollectionUtils.isEmpty(idList)) {
idList.forEach(id -> revenueConfigMapper.deleteByPrimaryKey(id));
}
}
private RevenueConfig parseEntity(RevenueConfig config) {
if (config.getAccountType() != RevenueConfEnum.AccountType.Account.getCode().intValue()) {
config.setTbSegment3(StringUtils.EMPTY);
......
package pwc.taxtech.atms.service.impl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dpo.OrgCodeIdDto;
import pwc.taxtech.atms.dpo.OrgSelectDto;
import pwc.taxtech.atms.dto.revenuconf.RevTypeAddDto;
import pwc.taxtech.atms.dto.revenuconf.RevenueConfParam;
import pwc.taxtech.atms.dto.revenuconf.RevenueTypeResult;
import pwc.taxtech.atms.vat.dao.RevenueTypeMappingMapper;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
import pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample;
import javax.annotation.Resource;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import static pwc.taxtech.atms.constant.Constant.DEFAULT_END_DATE;
@Service
public class RevenueTypeMappingService extends BaseService {
@Resource
private RevenueTypeMappingMapper typeMappingMapper;
@Resource
private OrganizationServiceImpl organizationService;
/**
* 分页查询可查看的配置信息
*
* @param param RevenueConfParam
* @return PageInfo
*/
public PageInfo<RevenueTypeResult> queryPage(RevenueConfParam param) {
List<OrgSelectDto> orgDtoList = organizationService.getMyOrgList();
if (CollectionUtils.isEmpty(orgDtoList)) {
return new PageInfo<>();
}
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
RevenueTypeMappingExample example = new RevenueTypeMappingExample();
example.createCriteria().andOrgIdIn(orgDtoList.stream().map(OrgSelectDto::getId).collect(Collectors.toList()));
PageInfo<RevenueTypeResult> pageInfo = new PageInfo<>(typeMappingMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new RevenueTypeResult())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal());
return pageInfo;
}
/**
* 新增配置
*
* @param mapping RevenueTypeMapping
*/
public void addConfig(RevenueTypeMapping mapping) {
//todo 重复校验
mapping.setId(idService.nextId());
typeMappingMapper.insertSelective(mapping);
}
/**
* 前台批量新增
*
* @param addDto RevTypeAddDto
*/
public void addConfig(RevTypeAddDto addDto) {
if (!CollectionUtils.isEmpty(addDto.getOrgList())) {
addDto.getOrgList().forEach(id -> {
addDto.setId(idService.nextId());
addDto.setOrgId(id);
typeMappingMapper.insertSelective(addDto);
});
}
}
/**
* 更新配置
*
* @param mapping RevenueConfig
*/
public void updateConfig(RevenueTypeMapping mapping) {
//todo 重复校验
typeMappingMapper.updateByPrimaryKeySelective(mapping);
}
public void delConfig(List<Long> idList) {
if (!CollectionUtils.isEmpty(idList)) {
idList.forEach(id -> typeMappingMapper.deleteByPrimaryKey(id));
}
}
public void upload(MultipartFile file, Integer type) throws Exception {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
Sheet sheet = workbook.getSheetAt(0);
List<RevenueTypeMapping> list = new ArrayList<>();
List<OrgCodeIdDto> orgDtoList = organizationService.getMyOrgCodeList();
for (int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r);
String orgCode = row.getCell(0).getStringCellValue();
Optional<OrgCodeIdDto> optional = orgDtoList.stream().filter(o -> StringUtils.equals(o.getCode(), orgCode)).findFirst();
if (!optional.isPresent()) {
continue;
}
RevenueTypeMapping mapping = new RevenueTypeMapping();
mapping.setId(idService.nextId());
mapping.setOrgId(optional.get().getId());
mapping.setOuName(StringUtils.defaultString(row.getCell(1).getStringCellValue()));
mapping.setContent(StringUtils.defaultString(row.getCell(2).getStringCellValue()));
mapping.setTaxRate(new BigDecimal(row.getCell(3).getNumericCellValue()));
mapping.setRevenueTypeName(StringUtils.defaultString(row.getCell(4).getStringCellValue()));
mapping.setStartDate(StringUtils.defaultString(row.getCell(5).getStringCellValue()));
mapping.setEndDate(StringUtils.defaultString(row.getCell(6).getStringCellValue(), DEFAULT_END_DATE));
list.add(mapping);
}
if (1 == type) {
//todo 覆盖导入 具体覆盖哪些
}
if (!CollectionUtils.isEmpty(list)) {
List<List<RevenueTypeMapping>> batchList = CommonUtils.subListWithLen(list, CommonUtils.BATCH_NUM_2000);
batchList.forEach(l -> typeMappingMapper.batchInsert(l));
}
}
}
......@@ -44,6 +44,7 @@
<table tableName="revenue_type_mapping" domainObjectName="RevenueTypeMapping">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="status" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<!-- <table tableName="trial_balance_final" domainObjectName="TrialBalanceFinal">
......
......@@ -138,4 +138,11 @@ public interface OrganizationMapper extends MyMapper {
@Select("select id, name from organization;")
List<OrgSelectDto> getAllOrgSelectList();
@Select("select tb.id,tb.code from user_organization ta left join organization tb on ta.organization_id = tb.id " +
"where ta.user_id = #{uid}")
List<OrgCodeIdDto> getMyOrgCodeList(String uid);
@Select("select id, code from organization;")
List<OrgCodeIdDto> getAllOrgCodeList();
}
\ No newline at end of file
package pwc.taxtech.atms.dpo;
public class OrgCodeIdDto {
private String id;
private String code;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
}
......@@ -105,4 +105,6 @@ public interface RevenueTypeMappingMapper extends MyVatMapper {
* @mbg.generated
*/
int updateByPrimaryKey(RevenueTypeMapping record);
int batchInsert(List<RevenueTypeMapping> list);
}
\ No newline at end of file
......@@ -99,6 +99,17 @@ public class RevenueTypeMapping extends BaseEntity implements Serializable {
*/
private String endDate;
/**
* Database Column Remarks:
* 状态 0:启用 1:停用
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column revenue_type_mapping.status
*
* @mbg.generated
*/
private Integer status;
/**
*
* This field was generated by MyBatis Generator.
......@@ -335,6 +346,30 @@ public class RevenueTypeMapping extends BaseEntity implements Serializable {
this.endDate = endDate == null ? null : endDate.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column revenue_type_mapping.status
*
* @return the value of revenue_type_mapping.status
*
* @mbg.generated
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column revenue_type_mapping.status
*
* @param status the value for revenue_type_mapping.status
*
* @mbg.generated
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column revenue_type_mapping.create_by
......@@ -451,6 +486,7 @@ public class RevenueTypeMapping extends BaseEntity implements Serializable {
sb.append(", revenueTypeName=").append(revenueTypeName);
sb.append(", startDate=").append(startDate);
sb.append(", endDate=").append(endDate);
sb.append(", status=").append(status);
sb.append(", createBy=").append(createBy);
sb.append(", updateBy=").append(updateBy);
sb.append(", createTime=").append(createTime);
......
......@@ -736,6 +736,66 @@ public class RevenueTypeMappingExample {
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
......
......@@ -14,6 +14,7 @@
<result column="revenue_type_name" jdbcType="VARCHAR" property="revenueTypeName" />
<result column="start_date" jdbcType="VARCHAR" property="startDate" />
<result column="end_date" jdbcType="VARCHAR" property="endDate" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -91,7 +92,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, org_id, ou_name, content, tax_rate, revenue_type_name, start_date, end_date,
create_by, update_by, create_time, update_time
`status`, create_by, update_by, create_time, update_time
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample" resultMap="BaseResultMap">
<!--
......@@ -146,14 +147,14 @@
-->
insert into revenue_type_mapping (id, org_id, ou_name,
content, tax_rate, revenue_type_name,
start_date, end_date, create_by,
update_by, create_time, update_time
)
start_date, end_date, `status`,
create_by, update_by, create_time,
update_time)
values (#{id,jdbcType=BIGINT}, #{orgId,jdbcType=VARCHAR}, #{ouName,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{taxRate,jdbcType=DECIMAL}, #{revenueTypeName,jdbcType=VARCHAR},
#{startDate,jdbcType=VARCHAR}, #{endDate,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
#{startDate,jdbcType=VARCHAR}, #{endDate,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
#{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.RevenueTypeMapping">
<!--
......@@ -186,6 +187,9 @@
<if test="endDate != null">
end_date,
</if>
<if test="status != null">
`status`,
</if>
<if test="createBy != null">
create_by,
</if>
......@@ -224,6 +228,9 @@
<if test="endDate != null">
#{endDate,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
......@@ -279,6 +286,9 @@
<if test="record.endDate != null">
end_date = #{record.endDate,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=TINYINT},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
......@@ -310,6 +320,7 @@
revenue_type_name = #{record.revenueTypeName,jdbcType=VARCHAR},
start_date = #{record.startDate,jdbcType=VARCHAR},
end_date = #{record.endDate,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=TINYINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
update_by = #{record.updateBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
......@@ -346,6 +357,9 @@
<if test="endDate != null">
end_date = #{endDate,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
......@@ -374,6 +388,7 @@
revenue_type_name = #{revenueTypeName,jdbcType=VARCHAR},
start_date = #{startDate,jdbcType=VARCHAR},
end_date = #{endDate,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -398,4 +413,40 @@
order by ${orderByClause}
</if>
</select>
<insert id="batchInsert" parameterType="pwc.taxtech.atms.vat.entity.RevenueTypeMapping">
insert into revenue_type_mapping (id, org_id, ou_name,
content, tax_rate, revenue_type_name,
start_date, end_date, `status`
<if test="createBy != null">
,create_by
</if>
<if test="updateBy != null">
,update_by
</if>
<if test="createTime != null">
,create_time
</if>
<if test="updateTime != null">
,update_time
</if>) values
<foreach collection="list" item="item" index="index" separator=",">
(#{id,jdbcType=BIGINT}, #{orgId,jdbcType=VARCHAR}, #{ouName,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{taxRate,jdbcType=DECIMAL}, #{revenueTypeName,jdbcType=VARCHAR},
#{startDate,jdbcType=VARCHAR}, #{endDate,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}
<if test="createBy != null">
,create_by = #{createBy,jdbcType=VARCHAR}
</if>
<if test="updateBy != null">
,update_by = #{updateBy,jdbcType=VARCHAR}
</if>
<if test="createTime != null">
,create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="updateTime != null">
,update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>)
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -1324,6 +1324,24 @@ var dataImpModule = angular.module('app.dataImp', ['ui.grid', 'ui.router','ui.gr
sticky: true
});
$stateProvider.state({
name: 'dataImportConfigRevenueTypeMapping',
url: "/dataImportConfig/revenueTypeMapping",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<vat-revenue-conf-mapping></vat-revenue-conf-mapping>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.dataImp),
sticky: true
});
$stateProvider.state({
name: 'recordImportLog',
url: "/dataImportLog/dataImport",
......
......@@ -2106,6 +2106,7 @@
"RevenueNoOrgData": "没有机构权限",
"RevenueGetOrgError": "获取机构信息失败",
"RevenueAddSuccess": "添加成功",
"RevenueDelSuccess": "删除成功",
"RevenueUpdateSuccess": "更新成功",
"dataValidate" : "数据校验",
"RevDetail": "收入明细",
......@@ -2133,5 +2134,9 @@
"RevDetailType": "收入类型",
"RevDetailCategory": "收入类别",
"RevDetailTaxOn": "计税方法",
"RevCMTitle": "开票记录与收入类型映射配置",
"RevCMApplyBU": "申请部门",
"RevCMInvoiceCTX": "开票内容",
"~MustBeEndOneApp": "我必须是最后一个!"
}
\ No newline at end of file
<div class="vat-revenue-conf-mapping">
<!--标题-->
<div class="nav-wrapper">
<div class="nav-header" translate="RevCMTitle"></div>
</div>
<div id="tab_total">
<form class="form-inline">
<div class="form-group">
<button type="button" class="btn btn-secondary" ng-click="addConfig()">{{'RevenueAddBtn' | translate }}</button>&nbsp;&nbsp;&nbsp;
<button type="button" class="btn btn-third" ng-click="delConfig()">{{'RevenueDelBtn' | translate }}</button>&nbsp;&nbsp;&nbsp;
<label class="control-label">文件:</label>
<input class="form-control" type="text" name="fileName" ng-model="uploadFile.file.name" readonly placeholder=""/>
<button type="button" type="file" ngf-select ng-model="uploadFile.file" accept=".xls,.xlsx" class="btn btn-secondary browse">{{'SelectFile' | translate }}</button>
<button type="button" class="btn btn-secondary" translate="CoverImportBtn" ng-click="upload()"></button>
<button type="button" class="btn btn-secondary" translate="AddImportBtn" ng-click="upload()"></button>
<button type="button" class="btn btn-in-grid inline-div" ng-click="downEntepriseAccountTemplate()"><i
class="fa fa-download" aria-hidden="true"></i>下载模板
</button>
</div>
</form>
<div class="dt-init-wrapper">
<div class="dx-viewport grid-container">
<div id="revenueGridContainer" dx-data-grid="revenueGridOptions"
style="margin-top: 0px;">
<div data-options="dxTemplate:{ name:'editCellTemplate' }">
</div>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshConfigGrid()"></ack-pagination>
</div>
</div>
</div>
<div class="modal fade" id="revenueTypeAddDiv" tabindex="-1" role="dialog">
<div class="modal-dialog" style="width: 1200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="modal-title">
<span translate="RevCMTitle"></span>
</h3>
</div>
<div class="modal-body" id="modal-body">
<form class="form-horizontal" id="configForm">
<div class="form-group">
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevenueColOrg' | translate}}:</label>
<div class="col-sm-4">
<div dx-tag-box="selectOrgOptions"></div>
</div>
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevCMApplyBU' | translate}}:</label>
<div class="col-sm-4">
<input class="form-control" name="name" ng-model="formParam.ouName" maxlength="255">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevCMInvoiceCTX' | translate}}:</label>
<div class="col-sm-4">
<input class="form-control" name="name" ng-model="formParam.content" maxlength="255">
</div>
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevenueColTaxRate' | translate}}:</label>
<div class="col-sm-4">
<div dx-select-box="selectTaxRateOptions"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevDetailType' | translate}}:</label>
<div class="col-sm-4">
<input class="form-control" name="name" ng-model="formParam.revenueTypeName" maxlength="255">
</div>
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevenueColStatus' | translate}}:</label>
<div class="col-sm-4">
<div dx-select-box="selectStatusOptions"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevenueColEnable' | translate}}:</label>
<div class="col-sm-4">
<div dx-date-box="dateBoxStart"></div>
</div>
<label class="col-sm-2 control-label"><span style="color: red">*</span>{{'RevenueColDisable' | translate}}:</label>
<div class="col-sm-4">
<div dx-date-box="dateBoxEnd"></div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="saveConfig()">{{'Confirm' | translate }}</button>
<button type="button" class="btn btn-third" data-dismiss="modal" ng-click="cancelModal()">{{'Cancel' | translate }}</button>
</div>
</div>
</div>
</div>
</div>
citModule.directive('vatRevenueConfMapping', ['$log', 'browserService', '$translate', 'region', '$timeout',
function ($log, browserService, $translate, region, $timeout) {
$log.debug('vatPreviewProfitLoss.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/dataImport/vat-revenue-conf-mapping/vat-revenue-conf-mapping.html' + '?_=' + Math.random(),
scope: {},
controller: 'VatRevenueConfMappingController',
link: function ($scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
}
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
.vat-revenue-conf-mapping {
/*background-color: @color-white;*/
padding-left: 20px;
/*min-height: 800px;*/
height: 96%;
.nav-wrapper {
/*padding-bottom: 5px;
border-bottom: 1px solid #DBD8D3;*/
.nav-header {
height: 54px;
line-height: 54px;
font-family: "Microsoft YaHei Bold", "Microsoft YaHei Regular", "Microsoft YaHei";
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #333;
display: inline-block;
}
.nav-tab {
span {
display: inline-block;
height: 34px;
line-height: 34px;
padding: 0 10px;
background-color: #B90808;
color: #FFF;
font-family: "Microsoft YaHei";
font-weight: 400;
font-style: normal;
font-size: 14px;
cursor: pointer;
}
.active {
background-color: #F91000;
}
}
.alert-warning {
background-color: #FDE2DE;
cursor: pointer;
}
.alert {
color: #CF2D1B;
font-weight: bold;
display: inline-block;
padding: 5px;
margin-left: 60px;
margin-bottom: 0px;
i {
font-size: 20px;
vertical-align: middle;
margin-right: 5px;
}
}
.operation-wrapper {
margin: 15px 25px 10px 10px;
span {
cursor: pointer;
}
}
}
.dropdown-common() {
display: inline-block;
.select-button {
background-color: #F5F5F5;
padding: 6px 0;
width: 100px;
}
.caret {
margin-top: 8px;
}
.dropdown-menu {
min-width: 100px;
li {
text-align: center;
min-height: 0px;
height: 30px;
line-height: 30px;
color: #000;
font-weight: normal;
&:hover {
background-color: #F91000;
color: #FFF;
}
}
}
}
#tab_total {
display: block;
height: calc(~'100% - 40px');
position: relative;
.import-wrapper {
span {
margin-left: 10px;
color: #333;
font-family: "Microsoft YaHei";
font-style: normal;
font-size: 14px;
font-weight: bold;
}
.period-picker {
width: 150px;
border: 1px solid #c7c5c0;
display: inline-block;
line-height: 20px;
margin-top: 7px;
}
.imp-subheader {
display: inline-block;
font-size: 15px;
height: 30px;
line-height: 30px;
vertical-align: middle;
border: none;
select {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
background: transparent;
}
}
.dropdown {
.dropdown-common();
}
input {
width: 50px;
outline: none;
border-radius: 3px;
border: 1px solid #3c3a36;
padding: 2px;
text-align: center;
}
> button:last-child {
float: right;
margin-right: 20px;
}
.btn-wrapper {
border-radius: 5px;
background-color: #e0301e;
color: #FFF;
display: inline-block;
float: right;
margin-right: 10px;
.btn-vat-primary {
min-width: 80px;
}
}
}
.dt-init-wrapper {
margin: 30px 0;
max-width: 99%;
height: calc(~'100% - 25px');
position: relative;
.dropdown {
.dropdown-common();
i {
color: #F85550;
}
}
.importPLStatusGridContainer {
height: calc(~'100% - 30px');
overflow: hidden;
position: absolute;
top: 0;
bottom: 136px; /* 130 + 6 */
left: 0;
right: 0;
background-color: #FFF;
}
}
.error-info-wrapper {
position: absolute;
height: 150px;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
background-color: #FFF;
margin-left: -40px;
}
#content-resizer {
width: 110%;
position: absolute;
height: 4px;
bottom: 150px;
left: 0;
right: 0;
background-color: red;
cursor: n-resize;
margin-left: -40px;
#topIcon {
cursor: pointer;
margin-top: -19px;
width: 38px;
margin-left: 46%;
z-index: 999;
bottom: -381px;
text-align: center;
display: block !important;
}
}
.dt-import-wrapper {
margin: 60px 0;
max-width: 99%;
overflow: auto;
height: calc(~"100% - 35px");
.dropdown {
.dropdown-common();
i {
color: #F85550;
}
}
}
}
.error-list-modal {
.modal-title {
color: #FF0000;
}
.modal-body {
max-height: 300px;
overflow-y: auto;
table {
border: 1px solid #CCC;
thead tr th {
height: 30px;
border: 1px solid #CCC;
}
tbody tr td {
height: 25px;
border: 1px solid #CCC;
}
}
}
.modal-footer {
text-align: center;
}
}
#tab_detail {
display: none;
}
/*覆写ack-pagination.less中:.page-size, .pagination 中的margin演示 */
.page-form-group{
float:right;
.page-size{
margin:0;
}
.pagination {
margin:0;
}
}
}
.tb-model-period-dropdow-popup {
width: 400px;
height: 500px;
position: fixed;
top: 25%;
left: 40%;
.modal-dialog {
width: 100%;
height: 90%;
margin: 20px auto;
.modal-content {
width: 100%;
.modal-body {
height: 90%;
}
}
}
}
#totalWrapper {
margin: 5px 10px 10px -10px;
width: 100%;
padding-left: 10px;
font-family: Microsoft YaHei;
font-size: 13px;
float:right;
.total_span{
color: #B4122A !important;
background-color:#ddd !important;
font-size: 12px !important;
font-weight:bold !important;
border-radius:10px !important;
padding-left: 8px !important;
padding-right: 8px !important;
}
.total-column{
width:15%;
float:left;
padding-left: 15px;
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
//表格配置
$scope.revenueGridOptions = $.extend(true, {}, dxDataGridService.BASIC_GRID_OPTIONS, {
columns: [
// {dataField: 'serialNo', caption: $translate.instant('RevenueColSerialNo'), fixed: true, allowHeaderFiltering: true},
{dataField: 'idStr', caption: '', visible: false},
{dataField: 'name', caption: $translate.instant('RevenueColName'), fixed: true, allowHeaderFiltering: true, minWidth: '300px'},
{dataField: 'orgId', caption: $translate.instant('RevenueColOrg'), fixed: true, allowHeaderFiltering: true, minWidth: '300px',
calculateCellValue: function(data) {
......@@ -35,7 +35,7 @@
}).appendTo(container);
$('<i class="fa fa-trash" style="cursor: pointer;margin-left: 5px;"></i>')
.on('click', function () {
$scope.editConfig(options.data);
$scope.delConfig([options.data.idStr]);
}).appendTo(container);
}
catch (e) {
......@@ -50,7 +50,11 @@
mode: 'multiple',
showCheckBoxesMode: 'always',
allowSelectAll: true
}
},
onSelectionChanged: function (data) {
$scope.selectedItems = data.selectedRowsData;
$scope.selectedRecourdCount = data.selectedRowsData.length;
},
});
//刷新页面
......@@ -74,8 +78,24 @@
};
//删除配置
$scope.delConfig = function () {
SweetAlert.info('del');
$scope.delConfig = function (idList) {
$http.post('/revenueConf/del',idList, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
SweetAlert.success($translate.instant('RevenueDelSuccess'));
$scope.refreshConfigGrid();
}else {
SweetAlert.error($translate.instant('SystemError'));
}
})
};
$scope.batchDelConfig = function () {
if (!!$scope.selectedRecourdCount) {
$scope.delConfig(_.map($scope.selectedItems, function(item){ return item.idStr; }));
}else {
SweetAlert.warning($translate.instant('PleaseSelectAtLeastOneItem'));
}
};
//添加配置
......
......@@ -7,7 +7,7 @@
<form class="form-inline">
<div class="form-group"><div class="import-wrapper">
<button type="button" class="btn btn-primary" ng-click="addConfig()">{{'RevenueAddBtn' | translate }}</button>&nbsp;&nbsp;&nbsp;
<button type="button" class="btn btn-third" ng-click="delConfig()">{{'RevenueDelBtn' | translate }}</button>
<button type="button" class="btn btn-third" ng-click="batchDelConfig()">{{'RevenueDelBtn' | translate }}</button>
</div></div>
</form>
......
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