Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
8dc9c6b6
Commit
8dc9c6b6
authored
Sep 14, 2024
by
位宇华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--代码提交
parent
c445eda2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
6 deletions
+120
-6
ruoyi-wages/src/main/java/com/ruoyi/system/constant/SalaryConstant.java
...c/main/java/com/ruoyi/system/constant/SalaryConstant.java
+1
-1
ruoyi-wages/src/main/java/com/ruoyi/system/mapper/SalaryMapper.java
...s/src/main/java/com/ruoyi/system/mapper/SalaryMapper.java
+5
-0
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/SalaryCurrentRuleServiceImpl.java
...oyi/system/service/impl/SalaryCurrentRuleServiceImpl.java
+27
-2
ruoyi-wages/src/main/java/com/ruoyi/system/support/CurrentRuleSalarySupport.java
...va/com/ruoyi/system/support/CurrentRuleSalarySupport.java
+3
-3
ruoyi-wages/src/main/resources/mapper/system/SalaryMapper.xml
...i-wages/src/main/resources/mapper/system/SalaryMapper.xml
+84
-0
No files found.
ruoyi-wages/src/main/java/com/ruoyi/system/constant/SalaryConstant.java
View file @
8dc9c6b6
...
...
@@ -20,7 +20,7 @@ public class SalaryConstant {
/**
* 应付工资
*/
public
final
static
Set
<
String
>
SALARY_SET
=
Stream
.
of
(
"应付工资"
).
collect
(
Collectors
.
toSet
());
//
public final static Set<String> SALARY_SET = Stream.of("应付工资").collect(Collectors.toSet());
/**
* 应付工资合计
*/
...
...
ruoyi-wages/src/main/java/com/ruoyi/system/mapper/SalaryMapper.java
View file @
8dc9c6b6
...
...
@@ -26,4 +26,9 @@ public interface SalaryMapper {
List
<
SalaryExpenseSourceModel
>
getSources
(
@Param
(
"mineCode"
)
String
mineCode
);
int
exist
(
@Param
(
"mineCode"
)
String
mineCode
,
@Param
(
"salaryDate"
)
String
salaryDate
);
List
<
String
>
selectByDateAndMineCode
(
@Param
(
"salaryDate"
)
String
salaryDate
,
@Param
(
"mineCode"
)
String
mineCode
);
void
updateByDateAndProject
(
SalaryExcelModel
salaryExcelModel
);
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/SalaryCurrentRuleServiceImpl.java
View file @
8dc9c6b6
package
com.ruoyi.system.service.impl
;
import
com.alibaba.fastjson.JSON
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
...
@@ -11,15 +12,21 @@ import com.ruoyi.system.model.salary.SalaryExpenseSourceModel;
import
com.ruoyi.system.service.SalaryCurrentRuleService
;
import
com.ruoyi.system.support.CurrentRuleSalarySupport
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Service
public
class
SalaryCurrentRuleServiceImpl
implements
SalaryCurrentRuleService
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SalaryCurrentRuleServiceImpl
.
class
);
private
final
SalaryMapper
salaryMapper
;
public
SalaryCurrentRuleServiceImpl
(
SalaryMapper
salaryMapper
)
{
...
...
@@ -28,6 +35,7 @@ public class SalaryCurrentRuleServiceImpl implements SalaryCurrentRuleService {
@Override
public
AjaxResult
getCurrentRuleSalary
(
List
<
NewRuleRequestModel
>
newRuleSalaryRequestModelList
)
{
logger
.
info
(
"接口开始执行===================="
);
Optional
<
List
<
NewRuleRequestModel
>>
optional
=
Optional
.
ofNullable
(
newRuleSalaryRequestModelList
);
optional
.
ifPresent
(
v
->
{
String
mineCode
=
newRuleSalaryRequestModelList
.
get
(
0
).
getMineid
();
...
...
@@ -40,11 +48,28 @@ public class SalaryCurrentRuleServiceImpl implements SalaryCurrentRuleService {
salary
.
setSourceExpenses
(
source
.
getExpenseSource
());
}
}));
// System.err.println(JSON.toJSONString(salaryExcelModels));
int
count
=
salaryMapper
.
exist
(
mineCode
,
salaryDate
);
if
(
count
>
0
)
{
salaryMapper
.
delete
(
salaryDate
,
mineCode
);
//salaryMapper.delete(salaryDate, mineCode);
List
<
String
>
stringList
=
salaryMapper
.
selectByDateAndMineCode
(
salaryDate
,
mineCode
);
if
(!
CollectionUtils
.
isEmpty
(
stringList
))
{
List
<
SalaryExcelModel
>
includeCollect
=
salaryExcelModels
.
stream
().
filter
(
value
->
stringList
.
contains
(
value
.
getOrg
())).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
includeCollect
))
{
System
.
err
.
println
(
JSON
.
toJSONString
(
includeCollect
));
includeCollect
.
forEach
(
salaryMapper:
:
updateByDateAndProject
);
}
List
<
SalaryExcelModel
>
noIncludeCollect
=
salaryExcelModels
.
stream
().
filter
(
value
->
!
stringList
.
contains
(
value
.
getOrg
())).
collect
(
Collectors
.
toList
());
System
.
err
.
println
(
JSON
.
toJSONString
(
noIncludeCollect
));
if
(!
CollectionUtils
.
isEmpty
(
noIncludeCollect
))
{
salaryMapper
.
save
(
noIncludeCollect
);
}
}
}
else
{
System
.
err
.
println
(
JSON
.
toJSONString
(
salaryExcelModels
));
salaryMapper
.
save
(
salaryExcelModels
);
}
});
return
AjaxResult
.
success
();
}
...
...
ruoyi-wages/src/main/java/com/ruoyi/system/support/CurrentRuleSalarySupport.java
View file @
8dc9c6b6
...
...
@@ -136,9 +136,9 @@ public class CurrentRuleSalarySupport {
if
(
SalaryConstant
.
BIRTH_INSURANCE_SET
.
contains
(
col
))
{
salaryExcelModel
.
setBirthInsurance
(
newRuleSalaryRequestModel
.
getValue
());
}
if
(
SalaryConstant
.
SALARY_SET
.
contains
(
col
))
{
salaryExcelModel
.
setSalary
(
newRuleSalaryRequestModel
.
getValue
());
}
//
if (SalaryConstant.SALARY_SET.contains(col)) {
//
salaryExcelModel.setSalary(newRuleSalaryRequestModel.getValue());
//
}
if
(
SalaryConstant
.
COMPANY_HOUSE_FUND_SET
.
contains
(
col
))
{
salaryExcelModel
.
setCompanyHouseFund
(
newRuleSalaryRequestModel
.
getValue
());
}
...
...
ruoyi-wages/src/main/resources/mapper/system/SalaryMapper.xml
View file @
8dc9c6b6
...
...
@@ -99,4 +99,88 @@
where s.belong_to_coal = #{mineCode}
and s.salary_date = #{salaryDate}
</select>
<select
id=
"selectByDateAndMineCode"
resultType=
"java.lang.String"
>
select org
from ty_ryvue.salary
where belong_to_coal = #{mineCode}
and salary_date = #{salaryDate}
</select>
<update
id=
"updateByDateAndProject"
>
update ty_ryvue.salary
<trim
prefix=
"set"
suffixOverrides=
","
>
<if
test=
"org!=null and org!=''"
>
org=#{org},
</if>
<if
test=
"personCount!=null and personCount!=''"
>
person_count =#{personCount},
</if>
<if
test=
"medicalSubsidy!=null and medicalSubsidy!=''"
>
medical_subsidy=#{medicalSubsidy},
</if>
<if
test=
"sumSalary!=null and sumSalary!=''"
>
sum_salary=#{sumSalary},
</if>
<if
test=
"oldInsurance!=null and oldInsurance!=''"
>
old_insurance=#{oldInsurance},
</if>
<if
test=
"annuity!=null and annuity!=''"
>
annuity=#{annuity},
</if>
<if
test=
"singleSupplyMedicalInsurance!=null and singleSupplyMedicalInsurance!=''"
>
single_supply_medical_insurance =#{singleSupplyMedicalInsurance},
</if>
<if
test=
"medicalInsurance!=null and medicalInsurance!=''"
>
medical_insurance =#{medicalInsurance},
</if>
<if
test=
"supplyMedicalInsurance!=null and supplyMedicalInsurance!=''"
>
supply_medical_insurance=#{supplyMedicalInsurance},
</if>
<if
test=
"birthInsurance!=null and birthInsurance!=''"
>
birth_insurance=#{birthInsurance},
</if>
<if
test=
"sourceExpenses!=null and sourceExpenses!=''"
>
source_expenses=#{sourceExpenses},
</if>
<if
test=
"unemploymentInsurance!=null and unemploymentInsurance!=''"
>
unemployment_insurance=#{unemploymentInsurance},
</if>
<if
test=
"injuryInsurance!=null and injuryInsurance!=''"
>
injury_insurance=#{injuryInsurance},
</if>
<if
test=
"companyHouseFund!=null and companyHouseFund!=''"
>
company_house_fund=#{companyHouseFund},
</if>
<if
test=
"houseFund!=null and houseFund!=''"
>
house_fund=#{houseFund},
</if>
<if
test=
"laborUnionDues!=null and laborUnionDues!=''"
>
labor_union_dues=#{laborUnionDues},
</if>
<if
test=
"edufFees!=null and edufFees!=''"
>
edu_fees=#{edufFees},
</if>
<if
test=
"oneChild!=null and oneChild!=''"
>
one_child=#{oneChild},
</if>
<if
test=
"longAccountInsurance!=null and longAccountInsurance!=''"
>
long_account_insurance=#{longAccountInsurance},
</if>
<if
test=
"lunch!=null and lunch!=''"
>
lunch=#{lunch},
</if>
<if
test=
"honorMoney!=null and honorMoney!=''"
>
honor_money=#{honorMoney},
</if>
<if
test=
"warmSubsidy!=null and warmSubsidy!=''"
>
warm_subsidy=#{warmSubsidy},
</if>
<if
test=
"heatPreventSubsidy!=null and heatPreventSubsidy!=''"
>
heat_prevent_subsidy=#{heatPreventSubsidy},
</if>
</trim>
where
org=#{org}
and belong_to_coal = #{belongToCoal}
and salary_date = #{salaryDate}
</update>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment