Commit 23766b40 authored by zhkwei's avatar zhkwei

CIT固定资产-导入、资产清单补充及优化

parent 905dfd13
package pwc.taxtech.atms.controller;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.AssetDetailGroupDto;
import pwc.taxtech.atms.dto.AssetDetailGroupStringDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.AssetDetailGroup;
import pwc.taxtech.atms.entity.AssetGroup;
import pwc.taxtech.atms.entity.CitAssetGroupResult;
import pwc.taxtech.atms.service.impl.AssetGroupServiceImpl;
import pwc.taxtech.atms.entity.CitAssetsList;
import pwc.taxtech.atms.service.impl.AssetListServiceImpl;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description 资产相关Controller
......@@ -66,13 +56,13 @@ public class AssetListController {
* @return
*/
@RequestMapping(value = "/getAssetResultList", method = RequestMethod.GET)
public @ResponseBody ApiResultDto getAssetResultList(Integer assetType){
public @ResponseBody ApiResultDto getAssetResultList(Integer assetType, @RequestParam String projectId, @RequestParam Integer taxAccountCompare){
logger.info("根据资产类别获取资产清单");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(assetListService.getAssetResultList(assetType));
apiResultDto.setData(assetListService.getAssetResultList(assetType,projectId,taxAccountCompare));
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
......@@ -152,6 +142,16 @@ public class AssetListController {
return null;
}
@RequestMapping(value="updateAssetResultList",method = RequestMethod.POST)
public ApiResultDto updateAssetResultList(@RequestBody List<CitAssetsList> citAssetsLists,
@RequestParam String projectId){
ApiResultDto apiResultDto = new ApiResultDto();
assetListService.updateAssetResultList(citAssetsLists,projectId);
apiResultDto.setCode(1);
apiResultDto.setMessage("资产修改成功");
return apiResultDto;
}
/**
* CIT资产文件导入
* @return
......
......@@ -401,6 +401,28 @@ public class CitAssetsListDto implements Serializable {
*/
private Date updateTime;
/**
* Database Column Remarks:
* 税会折旧大小比较结果;1表示税大,2表示会大
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column assets_list.tax_account_compare
*
* @mbg.generated
*/
private Integer taxAccountCompare;
/**
* Database Column Remarks:
* 税法分类,也是资产二级分类(asset_detail_group表中的detailGroupName)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column assets_list.tax_group_name
*
* @mbg.generated
*/
private String taxGroupName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table assets_list
......@@ -1249,6 +1271,42 @@ public class CitAssetsListDto implements Serializable {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column assets_list.tax_account_compare
*
* @param taxAccountCompare the value for assets_list.tax_account_compare
*
* @mbg.generated
*/
public void setTaxAccountCompare(Integer taxAccountCompare) {
this.taxAccountCompare = taxAccountCompare;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column assets_list.tax_group_name
*
* @return the value of assets_list.tax_group_name
*
* @mbg.generated
*/
public String getTaxGroupName() {
return taxGroupName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column assets_list.tax_group_name
*
* @param taxGroupName the value for assets_list.tax_group_name
*
* @mbg.generated
*/
public void setTaxGroupName(String taxGroupName) {
this.taxGroupName = taxGroupName == null ? null : taxGroupName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table assets_list
......@@ -1296,6 +1354,8 @@ public class CitAssetsListDto implements Serializable {
sb.append(", assetType=").append(assetType);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", taxAccountCompare=").append(taxAccountCompare);
sb.append(", taxGroupName=").append(taxGroupName);
sb.append("]");
return sb.toString();
}
......
......@@ -16,6 +16,7 @@ import pwc.taxtech.atms.dao.CitAssetGroupResultMapper;
import pwc.taxtech.atms.dao.CitAssetsListMapper;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.vat.entity.AssetsList;
import java.io.File;
import java.io.IOException;
......@@ -61,12 +62,16 @@ public class AssetListServiceImpl extends BaseService {
/**
* 根据资产类别(固定资产、长期待摊、无形资产)查询出结果
*/
public List<CitAssetsListDto> getAssetResultList(Integer assetType) throws Exception {
public List<CitAssetsListDto> getAssetResultList(Integer assetType, String projectId,Integer taxAccountCompare) throws Exception {
logger.debug("根据资产类别(固定资产、长期待摊、无形资产)查询出结果");
CitAssetsListExample assetListExample = new CitAssetsListExample();
CitAssetsListExample.Criteria criteria = assetListExample.createCriteria();
criteria.andProjectIdEqualTo(projectId);
criteria.andAssetTypeEqualTo(assetType);
criteria.andStatusEqualTo(1);
if(taxAccountCompare != 2){
criteria.andTaxAccountCompareEqualTo(taxAccountCompare);
}
List<CitAssetsList> citAssetsLists = assetListMapper.selectByExample(assetListExample);
List<CitAssetsListDto> citAssetsListDtos = new ArrayList<>();
for (CitAssetsList citAssetsList:citAssetsLists){
......@@ -283,9 +288,10 @@ public class AssetListServiceImpl extends BaseService {
.filter(groupResult -> groupResult.getAssetName().equals(citAsset.getAssetGroupName())).collect(Collectors.toList());
//通过判断过滤后的集合来确认是否已经对该资产类别进行过分类
if(groupResults != null && groupResults.size()>0){
Integer assetGroupType = selectAssetGroup(groupResults.get(0).getAssetGroupId()).getAssetGroupType();
AssetDetailGroup assetDetailGroup = selectAssetDetailGroup(groupResults.get(0).getAssetDetailGroupId());
// Integer assetGroupType = selectAssetDetailGroup(groupResults.get(0).getAssetDetailGroupId()).getAssetGroupType();
//进行税务的计算
setCitAssetTaxData(citAsset,groupResults.get(0),assetGroupType);
setCitAssetTaxData(citAsset,groupResults.get(0),assetDetailGroup);
}else{
//没有进行过分类,放入Set集合里面
assetNameSet.add(assetName);
......@@ -357,10 +363,11 @@ public class AssetListServiceImpl extends BaseService {
for (CitAssetGroupResult assetGroupResult : assetGroupResults) {
//根据主键修改资产类别有关数据,主要修改的字段为资产一级分类主键、资产二级分类主键
assetGroupResultMapper.updateByPrimaryKeySelective(assetGroupResult);
Integer assetGroupType = selectAssetGroup(assetGroupResult.getAssetGroupId()).getAssetGroupType();
List<CitAssetsList> citAssetsLists = selectAssetsList(projectId, assetGroupResult.getAssetName());
AssetDetailGroup assetDetailGroup = selectAssetDetailGroup(assetGroupResult.getAssetDetailGroupId());
// Integer assetGroupType = selectAssetGroup(assetGroupResult.getAssetGroupId()).getAssetGroupType();
List<CitAssetsList> citAssetsLists = selectAssetsList(projectId, assetGroupResult.getAssetName(),saveGroupType);
citAssetsLists.stream().forEach(citAsset -> {
setCitAssetTaxData(citAsset,assetGroupResult,assetGroupType);
setCitAssetTaxData(citAsset,assetGroupResult,assetDetailGroup);
});
}
......@@ -373,14 +380,18 @@ public class AssetListServiceImpl extends BaseService {
return null;
}
/**
* 设置税务数据
* @param citAsset
* @param assetGroupResult
* @param assetGroupType
* @param assetDetailGroup
*/
public void setCitAssetTaxData(CitAssetsList citAsset,CitAssetGroupResult assetGroupResult,Integer assetGroupType){
public void setCitAssetTaxData(CitAssetsList citAsset,CitAssetGroupResult assetGroupResult,AssetDetailGroup assetDetailGroup){
Calendar cal = Calendar.getInstance();
//设置税法分类
citAsset.setTaxGroupName(assetDetailGroup.getDetailGroupName());
Integer assetGroupType = assetDetailGroup.getAssetGroupType();
//获取税务折旧期限,此值根据分类查数据库带出的值不在此进行操作
citAsset.setTaxDepreciationPeriod(assetGroupResult.getTaxDepreciationPeriod());
//获取截止去年累计折旧期间,此值根据分类查数据库带出的值不在此进行操作
......@@ -413,14 +424,23 @@ public class AssetListServiceImpl extends BaseService {
citAsset.setYearDifferenceAmount(citAsset.getTaxCurrentYearDepreciationAmount().subtract(citAsset.getAccountYearDepreciationAmount()));
//获取保留差异
citAsset.setIsRetain(1);
//获取资产一级分类
//获取资产一级分类的类型
citAsset.setAssetType(assetGroupType);
//设置税会比较值
citAsset.setTaxAccountCompare(citAsset.getTaxCurrentYearDepreciationAmount().compareTo(citAsset.getAccountYearDepreciationAmount())==1?1:0);
//更改资产状态,已进行分类并有效
citAsset.setStatus(1);
//根据主键修改资产清单数据
assetListMapper.updateByPrimaryKeySelective(citAsset);
}
public ApiResultDto updateAssetResultList(List<CitAssetsList> assetsLists, String projectId){
for(CitAssetsList citAsset:assetsLists){
assetListMapper.updateByPrimaryKeySelective(citAsset);
}
return null;
}
/**
* 获取符合条件(projectId、未进行分类)的资产清单数据
* @param projectId
......@@ -440,12 +460,16 @@ public class AssetListServiceImpl extends BaseService {
* @param assetName
* @return
*/
private List<CitAssetsList> selectAssetsList(String projectId, String assetName) {
private List<CitAssetsList> selectAssetsList(String projectId, String assetName, Integer saveGroupType) {
CitAssetsListExample assetListExample = new CitAssetsListExample();
CitAssetsListExample.Criteria criteria = assetListExample.createCriteria();
criteria.andProjectIdEqualTo(projectId);
//0表示未进行分类的数据
//当 saveGroupType为1时证明是初次导入进来时的数据需要进行状态的判断,当为其他或者为2时需要查询全部状态的数据
if(saveGroupType == 1){
criteria.andStatusEqualTo(0);
}
criteria.andAssetGroupNameEqualTo(assetName);
return assetListMapper.selectByExample(assetListExample);
}
......@@ -460,4 +484,8 @@ public class AssetListServiceImpl extends BaseService {
AssetGroupExample.Criteria criteria = assetGroupExample.createCriteria();
return assetGroupMapper.selectByPrimaryKey(id);
}
private AssetDetailGroup selectAssetDetailGroup(Long id) {
return assetDetailGroupMapper.selectByPrimaryKey(id);
}
}
......@@ -105,5 +105,4 @@ public interface CitAssetGroupResultMapper extends MyMapper {
* @mbg.generated
*/
int updateByPrimaryKey(CitAssetGroupResult record);
}
\ No newline at end of file
......@@ -395,6 +395,28 @@ public class CitAssetsList extends BaseEntity implements Serializable {
*/
private Date updateTime;
/**
* Database Column Remarks:
* 税会折旧大小比较结果;1表示税大,2表示会大
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column assets_list.tax_account_compare
*
* @mbg.generated
*/
private Integer taxAccountCompare;
/**
* Database Column Remarks:
* 税法分类,也是资产二级分类(asset_detail_group表中的detailGroupName)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column assets_list.tax_group_name
*
* @mbg.generated
*/
private String taxGroupName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table assets_list
......@@ -1243,6 +1265,54 @@ public class CitAssetsList extends BaseEntity implements Serializable {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column assets_list.tax_account_compare
*
* @return the value of assets_list.tax_account_compare
*
* @mbg.generated
*/
public Integer getTaxAccountCompare() {
return taxAccountCompare;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column assets_list.tax_account_compare
*
* @param taxAccountCompare the value for assets_list.tax_account_compare
*
* @mbg.generated
*/
public void setTaxAccountCompare(Integer taxAccountCompare) {
this.taxAccountCompare = taxAccountCompare;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column assets_list.tax_group_name
*
* @return the value of assets_list.tax_group_name
*
* @mbg.generated
*/
public String getTaxGroupName() {
return taxGroupName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column assets_list.tax_group_name
*
* @param taxGroupName the value for assets_list.tax_group_name
*
* @mbg.generated
*/
public void setTaxGroupName(String taxGroupName) {
this.taxGroupName = taxGroupName == null ? null : taxGroupName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table assets_list
......@@ -1290,6 +1360,8 @@ public class CitAssetsList extends BaseEntity implements Serializable {
sb.append(", assetType=").append(assetType);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", taxAccountCompare=").append(taxAccountCompare);
sb.append(", taxGroupName=").append(taxGroupName);
sb.append("]");
return sb.toString();
}
......
......@@ -2335,6 +2335,136 @@ public class CitAssetsListExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andTaxAccountCompareIsNull() {
addCriterion("tax_account_compare is null");
return (Criteria) this;
}
public Criteria andTaxAccountCompareIsNotNull() {
addCriterion("tax_account_compare is not null");
return (Criteria) this;
}
public Criteria andTaxAccountCompareEqualTo(Integer value) {
addCriterion("tax_account_compare =", value, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareNotEqualTo(Integer value) {
addCriterion("tax_account_compare <>", value, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareGreaterThan(Integer value) {
addCriterion("tax_account_compare >", value, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareGreaterThanOrEqualTo(Integer value) {
addCriterion("tax_account_compare >=", value, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareLessThan(Integer value) {
addCriterion("tax_account_compare <", value, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareLessThanOrEqualTo(Integer value) {
addCriterion("tax_account_compare <=", value, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareIn(List<Integer> values) {
addCriterion("tax_account_compare in", values, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareNotIn(List<Integer> values) {
addCriterion("tax_account_compare not in", values, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareBetween(Integer value1, Integer value2) {
addCriterion("tax_account_compare between", value1, value2, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxAccountCompareNotBetween(Integer value1, Integer value2) {
addCriterion("tax_account_compare not between", value1, value2, "taxAccountCompare");
return (Criteria) this;
}
public Criteria andTaxGroupNameIsNull() {
addCriterion("tax_group_name is null");
return (Criteria) this;
}
public Criteria andTaxGroupNameIsNotNull() {
addCriterion("tax_group_name is not null");
return (Criteria) this;
}
public Criteria andTaxGroupNameEqualTo(String value) {
addCriterion("tax_group_name =", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameNotEqualTo(String value) {
addCriterion("tax_group_name <>", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameGreaterThan(String value) {
addCriterion("tax_group_name >", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameGreaterThanOrEqualTo(String value) {
addCriterion("tax_group_name >=", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameLessThan(String value) {
addCriterion("tax_group_name <", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameLessThanOrEqualTo(String value) {
addCriterion("tax_group_name <=", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameLike(String value) {
addCriterion("tax_group_name like", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameNotLike(String value) {
addCriterion("tax_group_name not like", value, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameIn(List<String> values) {
addCriterion("tax_group_name in", values, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameNotIn(List<String> values) {
addCriterion("tax_group_name not in", values, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameBetween(String value1, String value2) {
addCriterion("tax_group_name between", value1, value2, "taxGroupName");
return (Criteria) this;
}
public Criteria andTaxGroupNameNotBetween(String value1, String value2) {
addCriterion("tax_group_name not between", value1, value2, "taxGroupName");
return (Criteria) this;
}
}
/**
......
......@@ -41,6 +41,8 @@
<result column="asset_type" jdbcType="INTEGER" property="assetType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="tax_account_compare" jdbcType="INTEGER" property="taxAccountCompare" />
<result column="tax_group_name" jdbcType="VARCHAR" property="taxGroupName" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -120,7 +122,8 @@
account_total_depreciation_amount, tax_depreciation_period, tax_to_last_year_depreciation_period,
tax_to_current_year_depreciation_period, tax_year_depreciation_period, tax_month_depreciation_amount,
tax_to_current_year_depreciation_amount, tax_current_year_depreciation_amount, total_difference_amount,
year_difference_amount, is_retain, asset_type, create_time, update_time
year_difference_amount, is_retain, asset_type, create_time, update_time, tax_account_compare,
tax_group_name
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultMap="BaseResultMap">
<!--
......@@ -186,7 +189,8 @@
tax_month_depreciation_amount, tax_to_current_year_depreciation_amount,
tax_current_year_depreciation_amount, total_difference_amount,
year_difference_amount, is_retain, asset_type,
create_time, update_time)
create_time, update_time, tax_account_compare,
tax_group_name)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{assetNumber,jdbcType=VARCHAR}, #{assetGroupName,jdbcType=VARCHAR}, #{assetDetailGroupId,jdbcType=BIGINT},
#{assetDescription,jdbcType=VARCHAR}, #{buyDate,jdbcType=TIMESTAMP}, #{depreciationDate,jdbcType=TIMESTAMP},
......@@ -200,7 +204,8 @@
#{taxMonthDepreciationAmount,jdbcType=DECIMAL}, #{taxToCurrentYearDepreciationAmount,jdbcType=DECIMAL},
#{taxCurrentYearDepreciationAmount,jdbcType=DECIMAL}, #{totalDifferenceAmount,jdbcType=DECIMAL},
#{yearDifferenceAmount,jdbcType=DECIMAL}, #{isRetain,jdbcType=INTEGER}, #{assetType,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{taxAccountCompare,jdbcType=INTEGER},
#{taxGroupName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitAssetsList">
<!--
......@@ -314,6 +319,12 @@
<if test="updateTime != null">
update_time,
</if>
<if test="taxAccountCompare != null">
tax_account_compare,
</if>
<if test="taxGroupName != null">
tax_group_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -421,6 +432,12 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="taxAccountCompare != null">
#{taxAccountCompare,jdbcType=INTEGER},
</if>
<if test="taxGroupName != null">
#{taxGroupName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultType="java.lang.Long">
......@@ -545,6 +562,12 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.taxAccountCompare != null">
tax_account_compare = #{record.taxAccountCompare,jdbcType=INTEGER},
</if>
<if test="record.taxGroupName != null">
tax_group_name = #{record.taxGroupName,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -590,7 +613,9 @@
is_retain = #{record.isRetain,jdbcType=INTEGER},
asset_type = #{record.assetType,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
tax_account_compare = #{record.taxAccountCompare,jdbcType=INTEGER},
tax_group_name = #{record.taxGroupName,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -704,6 +729,12 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="taxAccountCompare != null">
tax_account_compare = #{taxAccountCompare,jdbcType=INTEGER},
</if>
<if test="taxGroupName != null">
tax_group_name = #{taxGroupName,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -746,7 +777,9 @@
is_retain = #{isRetain,jdbcType=INTEGER},
asset_type = #{assetType,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP},
tax_account_compare = #{taxAccountCompare,jdbcType=INTEGER},
tax_group_name = #{taxGroupName,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultMap="BaseResultMap">
......
......@@ -74,5 +74,9 @@
"dateFormat4YearMonthDay": "yyyy-mm-dd",
"noData": "No Data",
"toUpdate": "To be updated",
"~MustBeEndOneApp": "I Must be the End One, please!"
"~MustBeEndOneApp": "I Must be the End One, please!",
"TaxAccountDifference": "税会差异",
"TaxGreaterAccount": "会计折旧&lt;=税务折旧",
"TaxLessAccount": "会计折旧&gt;税务折旧"
}
\ No newline at end of file
......@@ -81,6 +81,9 @@
"TaxGroupType": "税法分类",
"TaxToLastYearDepreciationPeriod": "截止去年累计折旧期间",
"TaxToCurrentYearDepreciationPeriod": "截止本年累计折旧期间",
"TaxAccountDifference": "税会差异",
"TaxGreaterAccount": "会计折旧&lt;=税务折旧",
"TaxLessAccount": "会计折旧&gt;税务折旧",
"BuyDateType": "日期错误",
"AssetNumberType": "资产编号错误",
"AssetGroupNameType": "资产类别错误",
......
......@@ -7,6 +7,7 @@
'use strict';
var projectId = vatSessionService.project.id;
var taxAccountCompare = 2;
var successCount = 0;
var uploadUrl = apiInterceptor.webApiHostUrl + '/asset/assetsImport';
var webHost = loginContext.apiHost;
......@@ -676,7 +677,7 @@
$scope.TotalAccountYearDepreciationAmount = 0;
$scope.TotalTaxCurrentYearDepreciationAmount = 0;
$scope.TotalYearDifferenceAmount = 0
assetListService.getAssetResultList(assetType).success(function (assetListData) {
assetListService.getAssetResultList(assetType,projectId,taxAccountCompare).success(function (assetListData) {
debugger;
var data = assetListData.data;
if (data) {
......@@ -758,7 +759,7 @@
}
}
//初始化编辑dataGrid
//初始化编辑d资产分类(asset_group_result)ataGrid
var InitGrid = function (showAdd) {
$scope.assetsGridOptions = {
bindingOptions: {
......@@ -927,10 +928,6 @@
{
caption: $translate.instant('IsRetain'), alignment: 'center', dataField: "isRetain", dataType: "boolean", width: 120, allowEditing: true
},
{
caption: $translate.instant('IsRetain'), alignment: 'center', dataField: "isRetain", dataType: "boolean", width: 120, allowEditing: true
},
];
$scope.assetsResultGridOptions = {
......@@ -962,6 +959,13 @@
e.cellElement.addClass('herder-center');
e.cellElement.append($compile(inputElement)($scope));
}
if(e.column.caption === $translate.instant('IsRetain'))
{
e.cellElement.empty();
var inputElement = $('<input type="checkbox" ng-model="SelectAll" ng-click="selectAllAsset()">保留差异</input>');
e.cellElement.addClass('herder-center');
e.cellElement.append($compile(inputElement)($scope));
}
}
},
loadPanel: {
......@@ -1001,7 +1005,7 @@
var defaultFun = savebutton.options.onClick;
var saveAsset = function () {
defaultFun();
assetListService.updateAssetResultList(targetArray).success(function (data) {
assetListService.updateAssetResultList(targetArray,projectId).success(function (data) {
if (data) {
getAssetResultList($scope.displayType - 1);
SweetAlert.success($translate.instant('SaveSuccess'));
......@@ -1021,6 +1025,29 @@
}
}
}
//税会差异选项内容
$scope.applyFilterTypes = [{
key: "2",
name: $translate.instant('AllTheItems')
}, {
key: "0",
name: $translate.instant('TaxLessAccount')
}, {
key: "1",
name: $translate.instant('TaxGreaterAccount')
}];
//初始化税会差异选项
$scope.taxAccountDifferenceOptions = {
items: $scope.applyFilterTypes,
value: $scope.applyFilterTypes[0].key,
valueExpr: "key",
displayExpr: "name",
onValueChanged: function(data) {
debugger;
taxAccountCompare = data.value;
getAssetResultList($scope.displayType - 1);
}
};
//获取数据服务
var getGroupList = function () {
......@@ -1231,7 +1258,7 @@
}
};
//弹出分类界面
//弹出分类界面,1、先获取asset_group_result表中的数据,并赋值给数据集assetGroupResultDataSource
$scope.setAssetsGroup = function () {
assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) {
var data = groupResultData.data;
......@@ -1243,7 +1270,9 @@
//orgAssetGroupList = angular.copy(data);
$scope.assetGroupResultDataSource = data;
}
//初始化资产分类Grid
InitGrid(true);
//此值传入后台用来分辨当前是导入文件时的保存资产分类或者是直接点击资产分类按钮保存资产分类
$scope.saveGroupType = 2;
$scope.isDisabled = false;
$scope.modalInstance = $uibModal.open({
......
......@@ -3,7 +3,9 @@
<div class="nav-header">{{'AssetList' | translate}}</div>
<div class="nav-tab">
<span ng-click="switchTab($event,1)">{{'AssetListImport' | translate}}</span>&nbsp;&nbsp;
<span class="active" ng-click="switchTab($event,2)">{{'FixedAssets' | translate}}</span><span ng-click="switchTab($event,3)">{{'LongTermPrepaid' | translate}}</span><span ng-click="switchTab($event,4)">{{'InvisibleAssets' | translate}}</span>
<span class="active" ng-click="switchTab($event,2)">{{'FixedAssets' | translate}}</span><span
ng-click="switchTab($event,3)">{{'LongTermPrepaid' | translate}}</span><span
ng-click="switchTab($event,4)">{{'InvisibleAssets' | translate}}</span>
</div>
</div>
......@@ -46,15 +48,20 @@
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<div class="col-sm-5">
<input class="form-control" type="text" name="fileName" value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required>
<input class="form-control" type="text" name="fileName"
value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required>
</div>
<div class="col-sm-2">
<button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx" class="btn btn-secondary browse">{{'SelectFile' | translate}}</button>
<div class="col-sm-4">
<button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx"
class="btn btn-secondary browse">{{'SelectFile' | translate}}
</button>
</div>
<div class="col-sm-2">
<button class="btn btn-vat-primary" translate="ImportBtn" ng-click="importDataNew()"></button>
<div class="col-sm-3">
<button class="btn btn-vat-primary" style="height: 34px" translate="ImportBtn"
ng-click="importDataNew()"></button>
</div>
</div>
......@@ -99,7 +106,8 @@
</thead>
<tbody style="margin-top:40px;">
<tr ng-repeat="thisrows in invoiceData track by $index" ng-class-even="'row-even'" ng-class-odd="'row-odd'">
<tr ng-repeat="thisrows in invoiceData track by $index" ng-class-even="'row-even'"
ng-class-odd="'row-odd'">
<td style="text-align: center; width: 30px;">{{$index+1}}</td>
<td ng-repeat="cells in thisrows track by $index">
{{ cells }}
......@@ -115,7 +123,8 @@
<div class="total-Wrapper">
<span>{{'TotalNumber' | translate}}<span class="total_span">{{ImportTotalCount}}</span> {{'RecordCount' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountAcquisitionValue' | translate}}<span class="total_span">{{ImportTotalAccountAcquisitionValue}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountYearDepreciationAmount' | translate}}<span class="total_span">{{ImportTotalAccountYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountYearDepreciationAmount' | translate}}<span
class="total_span">{{ImportTotalAccountYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<!--<span style="margin-left:15px;">{{'TotalTaxCurrentYearDepreciationAmount' | translate}}<span class="total_span">{{ImportTotalTaxCurrentYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalYearDifferenceAmount' | translate}}<span class="total_span">{{ImportTotalYearDifferenceAmount}}</span> {{'Yuan' | translate}}</span>-->
</div>
......@@ -135,25 +144,34 @@
resizer-top="#balance-ouput-grid-wrapper"
resizer-bottom="#error-info-wrapper">
<div id="topIcon" ng-click="toggleErrorTab()">
<img src="../../../../app-resources/images/collapse.png" />
<img src="../../../../app-resources/images/collapse.png"/>
</div>
</div>
</div>
</div>
<!--计算结果显示界面-->
<div id="tab_Assets" ng-if="displayType >1">
<div class="total-Wrapper" >
<!--税会差异的选择-->
<div class="option">
<span>{{'TaxAccountDifference' | translate}}</span>
<div id="taxAccountDifferenceButton" dx-select-box="taxAccountDifferenceOptions"></div>
</div>
<!--计算结果-->
<div class="total-Wrapper">
<span>{{'TotalNumber' | translate}}<span class="total_span">{{TotalCount}}</span> {{'RecordCount' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountAcquisitionValue' | translate}}<span class="total_span">{{TotalAccountAcquisitionValue}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountYearDepreciationAmount' | translate}}<span class="total_span">{{TotalAccountYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalTaxCurrentYearDepreciationAmount' | translate}}<span class="total_span">{{TotalTaxCurrentYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalAccountYearDepreciationAmount' | translate}}<span
class="total_span">{{TotalAccountYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalTaxCurrentYearDepreciationAmount' | translate}}<span
class="total_span">{{TotalTaxCurrentYearDepreciationAmount}}</span> {{'Yuan' | translate}}</span>
<span style="margin-left:15px;">{{'TotalYearDifferenceAmount' | translate}}<span class="total_span">{{TotalYearDifferenceAmount}}</span> {{'Yuan' | translate}}</span>
</div>
<!--资产清单结果集-->
<div class="dt-asset-result">
<!--<asset-list-edit-modal asset-type="displayType-1" type="0"></asset-list-edit-modal>-->
<div id="assetsResultGrid" dx-data-grid="assetsResultGridOptions"></div>
</div>
</div>
......@@ -166,17 +184,21 @@
</div>
</div>
<div class="modal-body" style="margin:15px;padding:initial;">
<div style="border: 1px solid #959595;height:450px; border-radius: 3px;width:800px;" dx-data-grid=" gridPeriodOptions"></div>
<div style="border: 1px solid #959595;height:450px; border-radius: 3px;width:800px;"
dx-data-grid=" gridPeriodOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-third" ng-click="cancelValidateAsset()">{{'ButtonCancel' | translate }}</button>
<button type="button" class="btn btn-third" ng-click="cancelValidateAsset()">{{'ButtonCancel' |
translate }}
</button>
</div>
</div>
</script>
<!--前台错误信息界面-->
<div class="error-list-modal">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 720px; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
......@@ -186,13 +208,15 @@
</div>
<div class="modal-body">
{{'ImportErrorPopUpErrorDetail' | translate}}:
<br />
<br/>
<table>
<thead>
<tr>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpNoCol' | translate}}</th>
<th width="20%">{{'ImportErrorPopUpErrorTypeCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' |
translate}}
</th>
<th width="60%">{{'ImportErrorPopUpErrorDescCol' | translate}}</th>
</tr>
</thead>
......@@ -224,13 +248,18 @@
</div>
<div class="modal-body">
<div class="grid-container">
<div id="assetsGroupGrid" dx-data-grid="assetsGridOptions" style="max-width: 760px; margin-top: -40px;">
<div id="assetsGroupGrid" dx-data-grid="assetsGridOptions"
style="max-width: 760px; margin-top: -40px;">
</div>
</div>
</div>
<div class="modal-footer">
<button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()" ng-disabled="!hasEditPermission">{{'Confirm' | translate }}</button>
<button type="button" class="btn btn-third" ng-click="cancelAsset()" ng-if="!isDisabled" ng-disabled="isDisabled">{{'ButtonCancel' | translate }}</button>
<button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()"
ng-disabled="!hasEditPermission">{{'Confirm' | translate }}
</button>
<button type="button" class="btn btn-third" ng-click="cancelAsset()" ng-if="!isDisabled"
ng-disabled="isDisabled">{{'ButtonCancel' | translate }}
</button>
</div>
</div>
</script>
......
......@@ -303,6 +303,19 @@
/*font-size:13px !important;*/
}
}
.option {
margin-top: 10px;
margin-bottom: 10px;
}
.option > span {
margin-right: 10px;
}
.option > .dx-selectbox {
display: inline-block;
vertical-align: middle;
}
}
.error-list-modal {
......
......@@ -44,5 +44,5 @@
</div>
</script>
<div class="vat-import-content" ui-view></div>
<div class="vat-import-content" ui-view style="overflow: auto"></div>
</div>
......@@ -6,9 +6,9 @@ webservices.factory('assetListService', ['$http', 'apiConfig', function ($http,
debugger;
return $http.get('/asset/getAssetListData', apiConfig.create());
},
getAssetResultList: function (assetType) {
getAssetResultList: function (assetType,projectId, taxAccountCompare) {
debugger;
return $http.get('/asset/getAssetResultList?assetType=' + assetType, apiConfig.create());
return $http.get('/asset/getAssetResultList?assetType=' + assetType + '&projectId=' + projectId + '&taxAccountCompare=' + taxAccountCompare, apiConfig.create());
},
getAssetGroupResultData: function (projectId) {
debugger;
......@@ -26,6 +26,10 @@ webservices.factory('assetListService', ['$http', 'apiConfig', function ($http,
debugger;
return $http.post('/asset/saveAssetGroupInfo?saveGroupType=' + saveGroupType + '&projectId=' + projectId,assetGroupResults, apiConfig.create());
},
updateAssetResultList:function (assetsList,projectId) {
debugger;
return $http.post('/asset/updateAssetResultList?projectId=' + projectId,assetsList, apiConfig.create());
},
getAllFixedAssetDetailGroup: function (assetGroupType,pageIndex,pageSize) {
debugger;
return $http.post('/asset/getFixedAssetDetailGroup',{"assetGroupType":assetGroupType,"pageIndex":pageIndex,"pageSize":pageSize}, apiConfig.create());
......
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