-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
1,759 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ jobs: | |
run: mvn -B package --file pom.xml | ||
deploy: | ||
name: 部署 | ||
if: github.ref == 'refs/heads/develop' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 拉取代码 | ||
|
@@ -36,15 +37,17 @@ jobs: | |
uses: easingthemes/[email protected] | ||
env: | ||
ARGS: "-rltgoDzvO" | ||
SOURCE: "target/" | ||
REMOTE_HOST: ${{ secrets.HOST }} | ||
SOURCE: "target/oerp-*.jar" | ||
REMOTE_HOST: ${{ secrets.SERVER_HOST }} | ||
REMOTE_USER: ${{ secrets.USER }} | ||
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} | ||
TARGET: ${{ secrets.REMOTE_TARGET }} | ||
- name: 启动程序 | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.USER }} | ||
key: ${{ secrets.SERVER_SSH_KEY }} | ||
script: sh /www/wwwroot/oerp.juzibiji.top/springboot/restart.sh | ||
script: | | ||
cd ${{ secrets.REMOTE_TARGET }} | ||
sh restart.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
target/ | ||
assets/ | ||
#代码生成文件夹 | ||
ge/ | ||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/com/juzi/oerp/common/aop/ControllerResponseAOP.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.juzi.oerp.common.aop; | ||
|
||
import com.juzi.oerp.configuration.properties.CodeMessageProperties; | ||
import com.juzi.oerp.model.vo.response.MessageResponseVO; | ||
import org.aspectj.lang.annotation.AfterReturning; | ||
import org.aspectj.lang.annotation.Aspect; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.util.StringUtils; | ||
|
||
/** | ||
* @author Juzi | ||
* @date 2020/7/20 14:11 | ||
*/ | ||
@Aspect | ||
@Component | ||
public class ControllerResponseAOP { | ||
@Autowired | ||
private CodeMessageProperties codeMessageProperties; | ||
|
||
@AfterReturning(returning = "messageResponseVO", pointcut = "execution(public * com.juzi.oerp.controller..*.*(..))") | ||
public void doAfterReturning(MessageResponseVO messageResponseVO) { | ||
if(messageResponseVO==null){ | ||
return; | ||
} | ||
|
||
int code = messageResponseVO.getCode(); | ||
String oldMessage = messageResponseVO.getMessage(); | ||
String newMessage = codeMessageProperties.getCodeMessage().get(code); | ||
|
||
if (StringUtils.isEmpty(oldMessage)) { | ||
messageResponseVO.setMessage(newMessage); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/com/juzi/oerp/common/jackson/CreateExamParamDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.juzi.oerp.common.jackson; | ||
|
||
import com.fasterxml.jackson.core.JsonParser; | ||
import com.fasterxml.jackson.core.TreeNode; | ||
import com.fasterxml.jackson.databind.DeserializationContext; | ||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.juzi.oerp.model.dto.param.CreateExamPlaceParamDTO; | ||
import com.juzi.oerp.model.dto.param.UpdateExamParamDTO; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.io.IOException; | ||
import java.math.BigDecimal; | ||
import java.time.LocalDateTime; | ||
import java.time.ZoneOffset; | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author Juzi | ||
* @date 2020/7/25 21:10 | ||
*/ | ||
@Component | ||
public class CreateExamParamDeserializer extends JsonDeserializer<UpdateExamParamDTO> { | ||
@Override | ||
public Class<?> handledType() { | ||
return UpdateExamParamDTO.class; | ||
} | ||
|
||
@Override | ||
public UpdateExamParamDTO deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { | ||
TreeNode treeNode = p.readValueAsTree(); | ||
String title = treeNode.get("title").toString().replaceAll("\"", ""); | ||
String description = treeNode.get("description").toString().replaceAll("\"", ""); | ||
BigDecimal price = new BigDecimal(treeNode.get("price").toString()); | ||
long beginTime = Long.parseLong(treeNode.get("beginTime").toString()) / 1000; | ||
ZoneOffset zone = ZoneOffset.ofHours(8); | ||
LocalDateTime beginTimeLocalDateTime = LocalDateTime.ofEpochSecond(beginTime, 0, zone); | ||
|
||
long endTime = Long.parseLong(treeNode.get("endTime").toString()) / 1000; | ||
LocalDateTime endTimeLocalDateTime = LocalDateTime.ofEpochSecond(endTime, 0, zone); | ||
|
||
Map<LocalDateTime, List<CreateExamPlaceParamDTO>> timePlace = new HashMap<>(); | ||
TreeNode timePlaceTreeNode = treeNode.get("timePlace"); | ||
timePlaceTreeNode.fieldNames().forEachRemaining(time -> { | ||
LocalDateTime examTime = LocalDateTime.ofEpochSecond(Long.parseLong(time) / 1000, 0, zone); | ||
TreeNode timePlaceTressNodeArray = timePlaceTreeNode.get(time); | ||
List<CreateExamPlaceParamDTO> createExamPlaceParamDTOList = new ArrayList<>(); | ||
for (int i = 0; i < timePlaceTressNodeArray.size(); i++) { | ||
// 考试地点 | ||
String examPlace = timePlaceTressNodeArray.get(i).get("examPlace").toString().replaceAll("\"", ""); | ||
// 考试人数 | ||
int peopleNumber = Integer.parseInt(timePlaceTressNodeArray.get(i).get("peopleNumber").toString()); | ||
CreateExamPlaceParamDTO createExamPlaceParamDTO = new CreateExamPlaceParamDTO(); | ||
createExamPlaceParamDTO | ||
.setExamPlace(examPlace) | ||
.setPeopleNumber(peopleNumber); | ||
createExamPlaceParamDTOList.add(createExamPlaceParamDTO); | ||
} | ||
timePlace.put(examTime, createExamPlaceParamDTOList); | ||
}); | ||
|
||
UpdateExamParamDTO updateExamParamDTO = new UpdateExamParamDTO(); | ||
updateExamParamDTO | ||
.setTitle(title) | ||
.setDescription(description) | ||
.setPrice(price) | ||
.setBeginTime(beginTimeLocalDateTime) | ||
.setEndTime(endTimeLocalDateTime) | ||
.setTimePlace(timePlace); | ||
return updateExamParamDTO; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.