关键方法增加同步锁

master
erzhongxmu 2022-04-02 17:42:24 +08:00
parent 946d5384ef
commit 3fdd871b86
8 changed files with 13 additions and 12 deletions

View File

@ -2817,7 +2817,7 @@ public class WmImNoticeHController extends BaseController {
*/
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request,
public AjaxJson importExcel(HttpServletRequest request,
HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
@ -2921,6 +2921,7 @@ public class WmImNoticeHController extends BaseController {
wmImNoticeH.setSupName(mdsup.getZhongWenQch());
}
wmImNoticeH.setImCusCode(pageheader.getImCusCode());
wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIListnew);
}
j.setMsg("文件导入成功!");

View File

@ -18,7 +18,7 @@ public interface WmOmNoticeHServiceI extends CommonService{
*
*
*/
public void addMain(WmOmNoticeHEntity wmOmNoticeH,
public void addMain(WmOmNoticeHEntity wmOmNoticeH,
List<WmOmNoticeIEntity> wmOmNoticeIList) ;
public void addMaintms(WmTmsNoticeHEntity wmOmNoticeH,
List<WmTmsNoticeIEntity> wmOmNoticeIList) ;

View File

@ -39,7 +39,7 @@ public class WmImNoticeHServiceImpl extends CommonServiceImpl implements WmImNot
}
@Override
public void addMain(WmImNoticeHEntity wmImNoticeH,
public synchronized void addMain(WmImNoticeHEntity wmImNoticeH,
List<WmImNoticeIEntity> wmImNoticeIList){
//保存主信息
if(StringUtil.isEmpty(wmImNoticeH.getOrderTypeCode())){

View File

@ -26,7 +26,7 @@ public class WmInQmIServiceImpl extends CommonServiceImpl implements WmInQmIServ
}
@Override
public Serializable save(WmInQmIEntity entity) throws Exception{
public synchronized Serializable save(WmInQmIEntity entity) throws Exception{
Serializable t = super.save(entity);
//执行新增操作增强业务
this.doAddBus(entity);

View File

@ -38,7 +38,7 @@ public class WmOmNoticeHServiceImpl extends CommonServiceImpl implements WmOmNot
}
@Override
public void addMain(WmOmNoticeHEntity wmOmNoticeH,
public synchronized void addMain(WmOmNoticeHEntity wmOmNoticeH,
List<WmOmNoticeIEntity> wmOmNoticeIList){
//保存主信息
this.save(wmOmNoticeH);

View File

@ -26,7 +26,7 @@ public class WmToDownGoodsServiceImpl extends CommonServiceImpl implements WmToD
}
@Override
public Serializable save(WmToDownGoodsEntity entity) throws Exception{
public synchronized Serializable save(WmToDownGoodsEntity entity) throws Exception{
Serializable t = super.save(entity);
//执行新增操作增强业务
this.doAddBus(entity);

View File

@ -46,7 +46,7 @@ public class WmToUpGoodsServiceImpl extends CommonServiceImpl implements WmToUpG
}
@Override
public Serializable save(WmToUpGoodsEntity entity) throws Exception{
public synchronized Serializable save(WmToUpGoodsEntity entity) throws Exception{
Serializable t = super.save(entity);
//执行新增操作增强业务
this.doAddBus(entity);

View File

@ -43,7 +43,7 @@ public class wmUtil {
return list;
}
public static void genrp(String datafrom,String datato,String username){
public synchronized static void genrp(String datafrom,String datato,String username){
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
String tsql = "call update_rp_period_in_out("+"'"+datafrom+"',"+"'"+datato+"',"+"'"+username+"'"+")";
@ -54,7 +54,7 @@ public class wmUtil {
}
}
public static void genrp2(String datafrom, String datato, String username){
public synchronized static void genrp2(String datafrom, String datato, String username){
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
String tsql = "i";
@ -65,7 +65,7 @@ public class wmUtil {
}
}
public static String getNextNoticeid(String orderType){
public synchronized static String getNextNoticeid(String orderType){
String noticeid=null;
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
@ -124,7 +124,7 @@ public class wmUtil {
return noticeid;
}
public static String getNextomNoticeIdtms(String orderType){
public synchronized static String getNextomNoticeIdtms(String orderType){
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
Map<String, Object> countMap = systemService
.findOneForJdbc("SELECT cast(right(ifnull((om_notice_id),0),4)+1 as SIGNED) as count FROM tms_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW()) order by create_date desc limit 1");
@ -162,7 +162,7 @@ public class wmUtil {
}
return noticeid;
}
public static String getNextomNoticeId(String orderType){
public synchronized static String getNextomNoticeId(String orderType){
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
Map<String, Object> countMap = systemService
.findOneForJdbc("SELECT cast(right(ifnull((om_notice_id),0),4)+1 as SIGNED) as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW()) order by create_date desc limit 1");