|
|
@@ -1860,7 +1860,9 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
|
|
|
//notifyRole = "财务主任审批";
|
|
|
notifyRole = "审批通过";
|
|
|
workActivityProcess.setIsApproval("1");
|
|
|
-
|
|
|
+ if(1 == workInvoice.getIsOmsBilling()){
|
|
|
+ OMS_ENABLED = false;
|
|
|
+ }
|
|
|
if(OMS_ENABLED){
|
|
|
//需要判定,此处 如果开票金额为正数,则表示是开蓝票,如果是负数,则表示是开红票
|
|
|
if(workInvoice.getMoney()>0){
|
|
|
@@ -2661,6 +2663,10 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
|
|
|
notifyRole = "审批通过";
|
|
|
workActivityProcess.setIsApproval("1");
|
|
|
|
|
|
+ if(1 == workInvoice.getIsOmsBilling()){
|
|
|
+ OMS_ENABLED = false;
|
|
|
+ }
|
|
|
+
|
|
|
if(OMS_ENABLED){
|
|
|
//需要判定,此处 如果开票金额为正数,则表示是开蓝票,如果是负数,则表示是开红票
|
|
|
if(workInvoice.getMoney()>0){
|
|
|
@@ -4338,65 +4344,69 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //发起短信通知,用于通知开票人
|
|
|
- AjaxJson j = new AjaxJson();
|
|
|
- //查询开票人员的手机号
|
|
|
- User user = userDao.get(workInvoice.getCreateBy().getId());
|
|
|
- //user.setMobile("18164266544");
|
|
|
- if (StringUtils.isNotBlank(user.getMobile()) && mobilePattern.matcher(user.getMobile().trim()).matches() ) {
|
|
|
- //验证手机号是否已经注册
|
|
|
- if(userDao.validateMobile("mobile") == null){
|
|
|
- HashMap<String,Object> result = null;
|
|
|
- try{
|
|
|
- //调用工具类返回结果
|
|
|
- result = ALiYunSmsUtil.omsWorkInvoiceSms(user.getMobile(), workInvoice.getNumber(), "成功");
|
|
|
- Integer statusCode = (Integer) result.get("statusCode");
|
|
|
- if (200 == statusCode) {
|
|
|
- System.out.println("进入获取密码修改短信通知接口2。获取阿里云短信通知成功");
|
|
|
- j.setSuccess(true);
|
|
|
- j.setErrorCode("-1");
|
|
|
- j.setMsg("短信发送成功!");
|
|
|
-
|
|
|
- }else if(10001 == statusCode){
|
|
|
+ //如果用户需要被短信通知,则此处给短信通知
|
|
|
+ if(null != workInvoice.getIsSmsNotice() && workInvoice.getIsSmsNotice() == 1){
|
|
|
+ //发起短信通知,用于通知开票人
|
|
|
+ AjaxJson j = new AjaxJson();
|
|
|
+ //查询开票人员的手机号
|
|
|
+ User user = userDao.get(workInvoice.getCreateBy().getId());
|
|
|
+ //user.setMobile("18164266544");
|
|
|
+ if (StringUtils.isNotBlank(user.getMobile()) && mobilePattern.matcher(user.getMobile().trim()).matches() ) {
|
|
|
+ //验证手机号是否已经注册
|
|
|
+ if(userDao.validateMobile("mobile") == null){
|
|
|
+ HashMap<String,Object> result = null;
|
|
|
+ try{
|
|
|
+ //调用工具类返回结果
|
|
|
+ result = ALiYunSmsUtil.omsWorkInvoiceSms(user.getMobile(), workInvoice.getNumber(), "成功");
|
|
|
+ Integer statusCode = (Integer) result.get("statusCode");
|
|
|
+ if (200 == statusCode) {
|
|
|
+ System.out.println("进入获取密码修改短信通知接口2。获取阿里云短信通知成功");
|
|
|
+ j.setSuccess(true);
|
|
|
+ j.setErrorCode("-1");
|
|
|
+ j.setMsg("短信发送成功!");
|
|
|
+
|
|
|
+ }else if(10001 == statusCode){
|
|
|
|
|
|
+ j.setSuccess(false);
|
|
|
+ j.setErrorCode("2");
|
|
|
+ String message = (String) result.get("message");
|
|
|
+ //j.setMsg("短信发送失败,错误代码:"+result+",请联系管理员。");
|
|
|
+ j.setMsg(message);
|
|
|
+ j.put("ErrorXml",result);
|
|
|
+ }else if(10002 == statusCode){
|
|
|
+ j.setSuccess(false);
|
|
|
+ j.setErrorCode("2");
|
|
|
+ j.put("message","账户短信量余额不足,请联系管理员进行充值!");
|
|
|
+ j.put("ErrorXml",result);
|
|
|
+ }else if(10003 == statusCode){
|
|
|
+ j.setSuccess(false);
|
|
|
+ j.setErrorCode("2");
|
|
|
+ j.put("message","手机号获取验证码次数已达每日上限!");
|
|
|
+ j.put("ErrorXml",result);
|
|
|
+ }else{
|
|
|
+ j.setSuccess(false);
|
|
|
+ j.setErrorCode("2");
|
|
|
+ j.put("message","短信发送失败,错误代码:101,请联系管理员!");
|
|
|
+ j.put("ErrorXml",result);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ System.out.println("阿里云发送短信失败。失败原因为:" + e.getMessage());
|
|
|
+ logger.error("调用短信接口发生错误", e); // 记录详细日志
|
|
|
+ e.printStackTrace();
|
|
|
+ logger.info("5");
|
|
|
j.setSuccess(false);
|
|
|
- j.setErrorCode("2");
|
|
|
- String message = (String) result.get("message");
|
|
|
- //j.setMsg("短信发送失败,错误代码:"+result+",请联系管理员。");
|
|
|
- j.setMsg(message);
|
|
|
- j.put("ErrorXml",result);
|
|
|
- }else if(10002 == statusCode){
|
|
|
- j.setSuccess(false);
|
|
|
- j.setErrorCode("2");
|
|
|
- j.put("message","账户短信量余额不足,请联系管理员进行充值!");
|
|
|
- j.put("ErrorXml",result);
|
|
|
- }else if(10003 == statusCode){
|
|
|
- j.setSuccess(false);
|
|
|
- j.setErrorCode("2");
|
|
|
- j.put("message","手机号获取验证码次数已达每日上限!");
|
|
|
- j.put("ErrorXml",result);
|
|
|
- }else{
|
|
|
- j.setSuccess(false);
|
|
|
- j.setErrorCode("2");
|
|
|
- j.put("message","短信发送失败,错误代码:101,请联系管理员!");
|
|
|
- j.put("ErrorXml",result);
|
|
|
+ j.setErrorCode("101");
|
|
|
+ j.setMsg("短信发送失败!");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- System.out.println("阿里云发送短信失败。失败原因为:" + e.getMessage());
|
|
|
- logger.error("调用短信接口发生错误", e); // 记录详细日志
|
|
|
- e.printStackTrace();
|
|
|
- logger.info("5");
|
|
|
- j.setSuccess(false);
|
|
|
- j.setErrorCode("101");
|
|
|
- j.setMsg("短信发送失败!");
|
|
|
- }
|
|
|
- finally {
|
|
|
+ finally {
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
isSuccess = true;
|
|
|
|
|
|
|