|
|
@@ -22,10 +22,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
@@ -77,7 +74,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
|
|
|
}
|
|
|
|
|
|
@PostMapping("/addPro")
|
|
|
- @ApiOperation(value = "新建按钮")
|
|
|
+ @ApiOperation(value = "新建按钮 个微企微用type区分")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Object addPro(@RequestBody FosterwxCashAccountSchedule fosterwxCashAccountSchedule, @AuthUser User user) {
|
|
|
this.onInsert(fosterwxCashAccountSchedule);
|
|
|
@@ -88,20 +85,23 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
|
|
|
|
|
|
// 待创建
|
|
|
fosterwxCashAccountSchedule.setStatus(2);
|
|
|
+
|
|
|
fosterwxCashAccountScheduleService.save(fosterwxCashAccountSchedule);
|
|
|
|
|
|
return AjaxResult.success("新建成功");
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "导入排期按钮")
|
|
|
+ @ApiOperation(value = "导入排期按钮 新加一个type字段 加在url后面传输")
|
|
|
@PostMapping("/importSchedule")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Object importSchedule(@RequestBody MultipartFile file, @AuthUser User user) {
|
|
|
+ public Object importSchedule(@RequestParam(defaultValue = "1") Integer type, @RequestBody MultipartFile file, @AuthUser User user) {
|
|
|
Map<String, Object> map = new HashMap<>(16);
|
|
|
Map<Integer, String> feild = new HashMap<>(5);
|
|
|
feild.put(0, "scheduleDate");
|
|
|
feild.put(1, "groupId");
|
|
|
feild.put(2, "templateId");
|
|
|
+ feild.put(3, "groupNumEveryTime|default");
|
|
|
+ feild.put(4, "messageInterval|default");
|
|
|
List<Map<String, String>> row = new ArrayList<>();
|
|
|
VoltaHandle<ArrayList<Map<String, String>>> voltaRes = Analysis.analysis(file, feild);
|
|
|
if (voltaRes.getErr() != null) {
|
|
|
@@ -111,10 +111,16 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
|
|
|
|
|
|
for (Map<String, String> detail : row) {
|
|
|
FosterwxCashAccountSchedule fosterwxCashAccountSchedule = new FosterwxCashAccountSchedule();
|
|
|
+
|
|
|
fosterwxCashAccountSchedule.setScheduleDate(LocalDate.parse(detail.get("scheduleDate")));
|
|
|
fosterwxCashAccountSchedule.setGroupId(Integer.valueOf(detail.get("groupId")));
|
|
|
fosterwxCashAccountSchedule.setTemplateId(Integer.valueOf(detail.get("templateId")));
|
|
|
fosterwxCashAccountSchedule.setStatus(2);
|
|
|
+ fosterwxCashAccountSchedule.setType(type);
|
|
|
+ if (2 == type) {
|
|
|
+ fosterwxCashAccountSchedule.setGroupNumEveryTime(Integer.valueOf(detail.get("groupNumEveryTime")));
|
|
|
+ fosterwxCashAccountSchedule.setMessageInterval(Integer.valueOf(detail.get("messageInterval")));
|
|
|
+ }
|
|
|
fosterwxCashAccountSchedule.setCreateUid(user.getId());
|
|
|
fosterwxCashAccountSchedule.setCreateUser(user.getName());
|
|
|
fosterwxCashAccountSchedule.setUpdateUid(user.getId());
|